mirror of
https://github.com/neocturne/libuecc.git
synced 2025-03-04 17:03:31 +01:00
Unify legacy and Ed25519 base point by negating conversion factors
This commit is contained in:
parent
bb4fcb9328
commit
740355d5dd
1 changed files with 16 additions and 16 deletions
|
@ -95,19 +95,19 @@ const ecc_25519_work_t ecc_25519_work_default_base = {
|
||||||
|
|
||||||
|
|
||||||
const ecc_25519_work_t ecc_25519_work_base_ed25519 = {
|
const ecc_25519_work_t ecc_25519_work_base_ed25519 = {
|
||||||
{0x19, 0x94, 0x01, 0x80, 0xc6, 0x05, 0x73, 0xdd,
|
{0xd4, 0x6b, 0xfe, 0x7f, 0x39, 0xfa, 0x8c, 0x22,
|
||||||
0x1e, 0x69, 0xdc, 0x14, 0xd9, 0x48, 0x71, 0x95,
|
0xe1, 0x96, 0x23, 0xeb, 0x26, 0xb7, 0x8e, 0x6a,
|
||||||
0xcb, 0x8b, 0x74, 0x99, 0x29, 0x5c, 0xd9, 0x22,
|
0x34, 0x74, 0x8b, 0x66, 0xd6, 0xa3, 0x26, 0xdd,
|
||||||
0xe6, 0xa1, 0x60, 0xde, 0xaf, 0xbc, 0x83, 0x2b},
|
0x19, 0x5e, 0x9f, 0x21, 0x50, 0x43, 0x7c, 0x54},
|
||||||
{0x58, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
{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,
|
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},
|
{1},
|
||||||
{0xa6, 0xa9, 0x67, 0x66, 0x38, 0x9e, 0xf5, 0x7d,
|
{0x47, 0x56, 0x98, 0x99, 0xc7, 0x61, 0x0a, 0x82,
|
||||||
0xe5, 0x20, 0x7d, 0xdd, 0xe0, 0xd3, 0x8d, 0x77,
|
0x1a, 0xdf, 0x82, 0x22, 0x1f, 0x2c, 0x72, 0x88,
|
||||||
0x3c, 0xd6, 0xf6, 0xad, 0x87, 0x16, 0xe1, 0x1b,
|
0xc3, 0x29, 0x09, 0x52, 0x78, 0xe9, 0x1e, 0xe4,
|
||||||
0xb8, 0xb4, 0xb3, 0x7e, 0x59, 0xfd, 0x02, 0x56},
|
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 */
|
/** Factor to multiply the X coordinate with to convert from the legacy to the Ed25519 curve */
|
||||||
static const uint32_t legacy_to_ed25519[32] = {
|
static const uint32_t legacy_to_ed25519[32] = {
|
||||||
0x06, 0x7e, 0x45, 0xff, 0xaa, 0x04, 0x6e, 0xcc,
|
0xe7, 0x81, 0xba, 0x00, 0x55, 0xfb, 0x91, 0x33,
|
||||||
0x82, 0x1a, 0x7d, 0x4b, 0xd1, 0xd3, 0xa1, 0xc5,
|
0x7d, 0xe5, 0x82, 0xb4, 0x2e, 0x2c, 0x5e, 0x3a,
|
||||||
0x7e, 0x4f, 0xfc, 0x03, 0xdc, 0x08, 0x7b, 0xd2,
|
0x81, 0xb0, 0x03, 0xfc, 0x23, 0xf7, 0x84, 0x2d,
|
||||||
0xbb, 0x06, 0xa0, 0x60, 0xf4, 0xed, 0x26, 0x0f,
|
0x44, 0xf9, 0x5f, 0x9f, 0x0b, 0x12, 0xd9, 0x70,
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Factor to multiply the X coordinate with to convert from the Ed25519 to the legacy curve */
|
/** Factor to multiply the X coordinate with to convert from the Ed25519 to the legacy curve */
|
||||||
static const uint32_t ed25519_to_legacy[32] = {
|
static const uint32_t ed25519_to_legacy[32] = {
|
||||||
0x04, 0x97, 0xbd, 0x24, 0x50, 0xfb, 0x4b, 0xbf,
|
0xe9, 0x68, 0x42, 0xdb, 0xaf, 0x04, 0xb4, 0x40,
|
||||||
0x5e, 0x2a, 0xbc, 0x0d, 0x06, 0xc7, 0xce, 0xd7,
|
0xa1, 0xd5, 0x43, 0xf2, 0xf9, 0x38, 0x31, 0x28,
|
||||||
0xfe, 0xe8, 0xfa, 0x98, 0x64, 0x7e, 0x9e, 0x07,
|
0x01, 0x17, 0x05, 0x67, 0x9b, 0x81, 0x61, 0xf8,
|
||||||
0x56, 0xa4, 0xc1, 0x95, 0xdf, 0x98, 0xb4, 0x5b,
|
0xa9, 0x5b, 0x3e, 0x6a, 0x20, 0x67, 0x4b, 0x24,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue