mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
Add GRS curve
This commit is contained in:
parent
5cb15e3420
commit
e7281cf9f5
3
bip32.c
3
bip32.c
@ -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;
|
||||
}
|
||||
|
1
curves.c
1
curves.c
@ -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";
|
||||
|
1
curves.h
1
curves.h
@ -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[];
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user