summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-03-18 15:03:46 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-03-18 15:03:46 +0100
commit740355d5ddb4e003e386951b9e74d8a4d49f609e (patch)
tree8814d9c143dc0a3026007043c96ac8e9bec73044
parentbb4fcb93282ca2c3440294683c88e8d54a1278e0 (diff)
downloadlibuecc-740355d5ddb4e003e386951b9e74d8a4d49f609e.zip
libuecc-740355d5ddb4e003e386951b9e74d8a4d49f609e.tar
Unify legacy and Ed25519 base point by negating conversion factors
-rw-r--r--src/ec25519.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/ec25519.c b/src/ec25519.c
index 1b0ac73..0354f35 100644
--- a/src/ec25519.c
+++ b/src/ec25519.c
@@ -95,19 +95,19 @@ const ecc_25519_work_t ecc_25519_work_default_base = {
const ecc_25519_work_t ecc_25519_work_base_ed25519 = {
- {0x19, 0x94, 0x01, 0x80, 0xc6, 0x05, 0x73, 0xdd,
- 0x1e, 0x69, 0xdc, 0x14, 0xd9, 0x48, 0x71, 0x95,
- 0xcb, 0x8b, 0x74, 0x99, 0x29, 0x5c, 0xd9, 0x22,
- 0xe6, 0xa1, 0x60, 0xde, 0xaf, 0xbc, 0x83, 0x2b},
+ {0xd4, 0x6b, 0xfe, 0x7f, 0x39, 0xfa, 0x8c, 0x22,
+ 0xe1, 0x96, 0x23, 0xeb, 0x26, 0xb7, 0x8e, 0x6a,
+ 0x34, 0x74, 0x8b, 0x66, 0xd6, 0xa3, 0x26, 0xdd,
+ 0x19, 0x5e, 0x9f, 0x21, 0x50, 0x43, 0x7c, 0x54},
{0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66},
{1},
- {0xa6, 0xa9, 0x67, 0x66, 0x38, 0x9e, 0xf5, 0x7d,
- 0xe5, 0x20, 0x7d, 0xdd, 0xe0, 0xd3, 0x8d, 0x77,
- 0x3c, 0xd6, 0xf6, 0xad, 0x87, 0x16, 0xe1, 0x1b,
- 0xb8, 0xb4, 0xb3, 0x7e, 0x59, 0xfd, 0x02, 0x56},
+ {0x47, 0x56, 0x98, 0x99, 0xc7, 0x61, 0x0a, 0x82,
+ 0x1a, 0xdf, 0x82, 0x22, 0x1f, 0x2c, 0x72, 0x88,
+ 0xc3, 0x29, 0x09, 0x52, 0x78, 0xe9, 0x1e, 0xe4,
+ 0x47, 0x4b, 0x4c, 0x81, 0xa6, 0x02, 0xfd, 0x29}
};
@@ -117,18 +117,18 @@ static const uint32_t one[32] = {1};
/** Factor to multiply the X coordinate with to convert from the legacy to the Ed25519 curve */
static const uint32_t legacy_to_ed25519[32] = {
- 0x06, 0x7e, 0x45, 0xff, 0xaa, 0x04, 0x6e, 0xcc,
- 0x82, 0x1a, 0x7d, 0x4b, 0xd1, 0xd3, 0xa1, 0xc5,
- 0x7e, 0x4f, 0xfc, 0x03, 0xdc, 0x08, 0x7b, 0xd2,
- 0xbb, 0x06, 0xa0, 0x60, 0xf4, 0xed, 0x26, 0x0f,
+ 0xe7, 0x81, 0xba, 0x00, 0x55, 0xfb, 0x91, 0x33,
+ 0x7d, 0xe5, 0x82, 0xb4, 0x2e, 0x2c, 0x5e, 0x3a,
+ 0x81, 0xb0, 0x03, 0xfc, 0x23, 0xf7, 0x84, 0x2d,
+ 0x44, 0xf9, 0x5f, 0x9f, 0x0b, 0x12, 0xd9, 0x70,
};
/** Factor to multiply the X coordinate with to convert from the Ed25519 to the legacy curve */
static const uint32_t ed25519_to_legacy[32] = {
- 0x04, 0x97, 0xbd, 0x24, 0x50, 0xfb, 0x4b, 0xbf,
- 0x5e, 0x2a, 0xbc, 0x0d, 0x06, 0xc7, 0xce, 0xd7,
- 0xfe, 0xe8, 0xfa, 0x98, 0x64, 0x7e, 0x9e, 0x07,
- 0x56, 0xa4, 0xc1, 0x95, 0xdf, 0x98, 0xb4, 0x5b,
+ 0xe9, 0x68, 0x42, 0xdb, 0xaf, 0x04, 0xb4, 0x40,
+ 0xa1, 0xd5, 0x43, 0xf2, 0xf9, 0x38, 0x31, 0x28,
+ 0x01, 0x17, 0x05, 0x67, 0x9b, 0x81, 0x61, 0xf8,
+ 0xa9, 0x5b, 0x3e, 0x6a, 0x20, 0x67, 0x4b, 0x24,
};