1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

Add GRS curve

This commit is contained in:
Yura Pakhuchiy 2018-04-04 19:39:56 +07:00 committed by Pavol Rusnak
parent 5cb15e3420
commit e7281cf9f5
5 changed files with 15 additions and 0 deletions

View File

@ -687,6 +687,9 @@ const curve_info *get_curve_by_name(const char *curve_name) {
if (strcmp(curve_name, SECP256K1_DECRED_NAME) == 0) {
return &secp256k1_decred_info;
}
if (strcmp(curve_name, SECP256K1_GROESTL_NAME) == 0) {
return &secp256k1_groestl_info;
}
if (strcmp(curve_name, NIST256P1_NAME) == 0) {
return &nist256p1_info;
}

View File

@ -24,6 +24,7 @@
const char SECP256K1_NAME[] = "secp256k1";
const char SECP256K1_DECRED_NAME[] = "secp256k1-decred";
const char SECP256K1_GROESTL_NAME[] = "secp256k1-groestl";
const char NIST256P1_NAME[] = "nist256p1";
const char ED25519_NAME[] = "ed25519";
const char ED25519_SHA3_NAME[] = "ed25519-sha3";

View File

@ -27,6 +27,7 @@
extern const char SECP256K1_NAME[];
extern const char SECP256K1_DECRED_NAME[];
extern const char SECP256K1_GROESTL_NAME[];
extern const char NIST256P1_NAME[];
extern const char ED25519_NAME[];
extern const char ED25519_SHA3_NAME[];

View File

@ -72,3 +72,12 @@ const curve_info secp256k1_decred_info = {
.hasher_sign = HASHER_BLAKE,
.hasher_pubkey = HASHER_BLAKE,
};
const curve_info secp256k1_groestl_info = {
.bip32_name = "Bitcoin seed",
.params = &secp256k1,
.hasher_bip32 = HASHER_SHA2,
.hasher_base58 = HASHER_GROESTLD_TRUNC,
.hasher_sign = HASHER_SHA2,
.hasher_pubkey = HASHER_SHA2,
};

View File

@ -32,5 +32,6 @@
extern const ecdsa_curve secp256k1;
extern const curve_info secp256k1_info;
extern const curve_info secp256k1_decred_info;
extern const curve_info secp256k1_groestl_info;
#endif