Add support for secp224k1
This commit is contained in:
parent
9bcff3905b
commit
18e3ec9b4d
3 changed files with 43 additions and 1 deletions
|
@ -260,7 +260,7 @@
|
||||||
#define POLARSSL_ECP_DP_SECP384R1_ENABLED
|
#define POLARSSL_ECP_DP_SECP384R1_ENABLED
|
||||||
#define POLARSSL_ECP_DP_SECP521R1_ENABLED
|
#define POLARSSL_ECP_DP_SECP521R1_ENABLED
|
||||||
//#define POLARSSL_ECP_DP_SECP192K1_ENABLED // Not implemented yet!
|
//#define POLARSSL_ECP_DP_SECP192K1_ENABLED // Not implemented yet!
|
||||||
//#define POLARSSL_ECP_DP_SECP224K1_ENABLED // Not implemented yet!
|
#define POLARSSL_ECP_DP_SECP224K1_ENABLED
|
||||||
#define POLARSSL_ECP_DP_SECP256K1_ENABLED
|
#define POLARSSL_ECP_DP_SECP256K1_ENABLED
|
||||||
#define POLARSSL_ECP_DP_BP256R1_ENABLED
|
#define POLARSSL_ECP_DP_BP256R1_ENABLED
|
||||||
#define POLARSSL_ECP_DP_BP384R1_ENABLED
|
#define POLARSSL_ECP_DP_BP384R1_ENABLED
|
||||||
|
|
|
@ -318,6 +318,39 @@ static t_uint secp521r1_n[] = {
|
||||||
};
|
};
|
||||||
#endif /* POLARSSL_ECP_DP_SECP521R1_ENABLED */
|
#endif /* POLARSSL_ECP_DP_SECP521R1_ENABLED */
|
||||||
|
|
||||||
|
#if defined(POLARSSL_ECP_DP_SECP224K1_ENABLED)
|
||||||
|
static t_uint secp224k1_p[] = {
|
||||||
|
BYTES_TO_T_UINT_8( 0x6D, 0xE5, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF ),
|
||||||
|
BYTES_TO_T_UINT_8( 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ),
|
||||||
|
BYTES_TO_T_UINT_8( 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ),
|
||||||
|
BYTES_TO_T_UINT_4( 0xFF, 0xFF, 0xFF, 0xFF ),
|
||||||
|
};
|
||||||
|
static t_uint secp224k1_a[] = {
|
||||||
|
BYTES_TO_T_UINT_2( 0x00, 0x00 ),
|
||||||
|
};
|
||||||
|
static t_uint secp224k1_b[] = {
|
||||||
|
BYTES_TO_T_UINT_2( 0x05, 0x00 ),
|
||||||
|
};
|
||||||
|
static t_uint secp224k1_gx[] = {
|
||||||
|
BYTES_TO_T_UINT_8( 0x5C, 0xA4, 0xB7, 0xB6, 0x0E, 0x65, 0x7E, 0x0F ),
|
||||||
|
BYTES_TO_T_UINT_8( 0xA9, 0x75, 0x70, 0xE4, 0xE9, 0x67, 0xA4, 0x69 ),
|
||||||
|
BYTES_TO_T_UINT_8( 0xA1, 0x28, 0xFC, 0x30, 0xDF, 0x99, 0xF0, 0x4D ),
|
||||||
|
BYTES_TO_T_UINT_4( 0x33, 0x5B, 0x45, 0xA1 ),
|
||||||
|
};
|
||||||
|
static t_uint secp224k1_gy[] = {
|
||||||
|
BYTES_TO_T_UINT_8( 0xA5, 0x61, 0x6D, 0x55, 0xDB, 0x4B, 0xCA, 0xE2 ),
|
||||||
|
BYTES_TO_T_UINT_8( 0x59, 0xBD, 0xB0, 0xC0, 0xF7, 0x19, 0xE3, 0xF7 ),
|
||||||
|
BYTES_TO_T_UINT_8( 0xD6, 0xFB, 0xCA, 0x82, 0x42, 0x34, 0xBA, 0x7F ),
|
||||||
|
BYTES_TO_T_UINT_4( 0xED, 0x9F, 0x08, 0x7E ),
|
||||||
|
};
|
||||||
|
static t_uint secp224k1_n[] = {
|
||||||
|
BYTES_TO_T_UINT_8( 0xF7, 0xB1, 0x9F, 0x76, 0x71, 0xA9, 0xF0, 0xCA ),
|
||||||
|
BYTES_TO_T_UINT_8( 0x84, 0x61, 0xEC, 0xD2, 0xE8, 0xDC, 0x01, 0x00 ),
|
||||||
|
BYTES_TO_T_UINT_8( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ),
|
||||||
|
BYTES_TO_T_UINT_8( 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 ),
|
||||||
|
};
|
||||||
|
#endif /* POLARSSL_ECP_DP_SECP224K1_ENABLED */
|
||||||
|
|
||||||
#if defined(POLARSSL_ECP_DP_SECP256K1_ENABLED)
|
#if defined(POLARSSL_ECP_DP_SECP256K1_ENABLED)
|
||||||
static t_uint secp256k1_p[] = {
|
static t_uint secp256k1_p[] = {
|
||||||
BYTES_TO_T_UINT_8( 0x2F, 0xFC, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF ),
|
BYTES_TO_T_UINT_8( 0x2F, 0xFC, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF ),
|
||||||
|
@ -681,6 +714,11 @@ int ecp_use_known_dp( ecp_group *grp, ecp_group_id id )
|
||||||
return( LOAD_GROUP( secp521r1 ) );
|
return( LOAD_GROUP( secp521r1 ) );
|
||||||
#endif /* POLARSSL_ECP_DP_SECP521R1_ENABLED */
|
#endif /* POLARSSL_ECP_DP_SECP521R1_ENABLED */
|
||||||
|
|
||||||
|
#if defined(POLARSSL_ECP_DP_SECP224K1_ENABLED)
|
||||||
|
case POLARSSL_ECP_DP_SECP224K1:
|
||||||
|
return( LOAD_GROUP_A( secp224k1 ) );
|
||||||
|
#endif /* POLARSSL_ECP_DP_SECP224K1_ENABLED */
|
||||||
|
|
||||||
#if defined(POLARSSL_ECP_DP_SECP256K1_ENABLED)
|
#if defined(POLARSSL_ECP_DP_SECP256K1_ENABLED)
|
||||||
case POLARSSL_ECP_DP_SECP256K1:
|
case POLARSSL_ECP_DP_SECP256K1:
|
||||||
return( LOAD_GROUP_A( secp256k1 ) );
|
return( LOAD_GROUP_A( secp256k1 ) );
|
||||||
|
|
|
@ -423,6 +423,10 @@ ECP test vectors M255 aka Curve25519
|
||||||
depends_on:POLARSSL_ECP_DP_M255_ENABLED
|
depends_on:POLARSSL_ECP_DP_M255_ENABLED
|
||||||
ecp_test_vec_x:POLARSSL_ECP_DP_M255:"5AC99F33632E5A768DE7E81BF854C27C46E3FBF2ABBACD29EC4AFF517369C660":"057E23EA9F1CBE8A27168F6E696A791DE61DD3AF7ACD4EEACC6E7BA514FDA863":"47DC3D214174820E1154B49BC6CDB2ABD45EE95817055D255AA35831B70D3260":"6EB89DA91989AE37C7EAC7618D9E5C4951DBA1D73C285AE1CD26A855020EEF04":"61450CD98E36016B58776A897A9F0AEF738B99F09468B8D6B8511184D53494AB"
|
ecp_test_vec_x:POLARSSL_ECP_DP_M255:"5AC99F33632E5A768DE7E81BF854C27C46E3FBF2ABBACD29EC4AFF517369C660":"057E23EA9F1CBE8A27168F6E696A791DE61DD3AF7ACD4EEACC6E7BA514FDA863":"47DC3D214174820E1154B49BC6CDB2ABD45EE95817055D255AA35831B70D3260":"6EB89DA91989AE37C7EAC7618D9E5C4951DBA1D73C285AE1CD26A855020EEF04":"61450CD98E36016B58776A897A9F0AEF738B99F09468B8D6B8511184D53494AB"
|
||||||
|
|
||||||
|
ECP test vectors secp224k1
|
||||||
|
depends_on:POLARSSL_ECP_DP_SECP224K1_ENABLED
|
||||||
|
ecp_test_vect:POLARSSL_ECP_DP_SECP224K1:"8EAD9B2819A3C2746B3EDC1E0D30F23271CDAC048C0615C961B1A9D3":"DEE0A75EF26CF8F501DB80807A3A0908E5CF01852709C1D35B31428B":"276D2B817918F7CD1DA5CCA081EC4B62CD255E0ACDC9F85FA8C52CAC":"AB7E70AEDA68A174ECC1F3800561B2D4FABE97C5D2A1A94D081E3FAC":"D2E94B00FD30201C40EDF73B137427916687AEA1935B277A5960DD1C":"DE728A614B17D91EB3CB2C17DA195562B6281585986332B3E12DA0ED":"B66B673D29038A3487A2D9C10CDCE67646F7C39C984EBE9E8795AD3C":"928C6147AF5EE4B54FA6ECF77B70CA3FEE5F4182DB057878F129DF":
|
||||||
|
|
||||||
ECP test vectors secp256k1
|
ECP test vectors secp256k1
|
||||||
depends_on:POLARSSL_ECP_DP_SECP256K1_ENABLED
|
depends_on:POLARSSL_ECP_DP_SECP256K1_ENABLED
|
||||||
ecp_test_vect:POLARSSL_ECP_DP_SECP256K1:"923C6D4756CD940CD1E13A359F6E0F0698791938E6D60246030AE4B0D8D4E9DE":"20A865B295E93C5B090F324B84D7AC7526AA1CFE86DD80E792CECCD16B657D55":"38AC87141A4854A8DFD87333E107B61692323721FE2EAD6E52206FE471A4771B":"4F5036A8ED5809AB7E70AEDA68A174ECC1F3800561B2D4FABE97C5D2A1A94D08":"029F5D2CC5A2C7E538FBA321439B4EC8DD79B7FEB9C0A8A5114EEA39856E22E8":"165171AFC3411A427F24FDDE1192A551C90983EB421BC982AB4CF4E21F18F04B":"E4B5B537D3ACEA7624F2E9C185BFFD80BC7035E515F33E0D4CFAE747FD20038E":"2BC685B7DCDBC694F5E036C4EAE9BFB489D7BF8940C4681F734B71D68501514C"
|
ecp_test_vect:POLARSSL_ECP_DP_SECP256K1:"923C6D4756CD940CD1E13A359F6E0F0698791938E6D60246030AE4B0D8D4E9DE":"20A865B295E93C5B090F324B84D7AC7526AA1CFE86DD80E792CECCD16B657D55":"38AC87141A4854A8DFD87333E107B61692323721FE2EAD6E52206FE471A4771B":"4F5036A8ED5809AB7E70AEDA68A174ECC1F3800561B2D4FABE97C5D2A1A94D08":"029F5D2CC5A2C7E538FBA321439B4EC8DD79B7FEB9C0A8A5114EEA39856E22E8":"165171AFC3411A427F24FDDE1192A551C90983EB421BC982AB4CF4E21F18F04B":"E4B5B537D3ACEA7624F2E9C185BFFD80BC7035E515F33E0D4CFAE747FD20038E":"2BC685B7DCDBC694F5E036C4EAE9BFB489D7BF8940C4681F734B71D68501514C"
|
||||||
|
|
Loading…
Reference in a new issue