mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
modtrezorcrypto: fix ecsda_sign calls
TODO: allow the caller to provide the is_canonical parameter: trezor/trezor-crypto@133c068f37
This commit is contained in:
parent
a44e16a9ca
commit
2ff937b707
@ -61,7 +61,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Nist256p1_sign(mp_obj_t self, mp_obj_t secret_k
|
||||
vstr_t vstr;
|
||||
vstr_init_len(&vstr, 65);
|
||||
uint8_t pby;
|
||||
if (0 != ecdsa_sign(&nist256p1, (const uint8_t *)sk.buf, (const uint8_t *)msg.buf, msg.len, (uint8_t *)vstr.buf, &pby)) {
|
||||
if (0 != ecdsa_sign(&nist256p1, (const uint8_t *)sk.buf, (const uint8_t *)msg.buf, msg.len, (uint8_t *)vstr.buf, &pby, NULL)) { // TODO: is_canonical
|
||||
mp_raise_ValueError("Signing failed");
|
||||
}
|
||||
(void)pby;
|
||||
|
@ -61,7 +61,7 @@ STATIC mp_obj_t mod_TrezorCrypto_Secp256k1_sign(mp_obj_t self, mp_obj_t secret_k
|
||||
vstr_t vstr;
|
||||
vstr_init_len(&vstr, 65);
|
||||
uint8_t pby;
|
||||
if (0 != ecdsa_sign(&secp256k1, (const uint8_t *)sk.buf, (const uint8_t *)msg.buf, msg.len, (uint8_t *)vstr.buf, &pby)) {
|
||||
if (0 != ecdsa_sign(&secp256k1, (const uint8_t *)sk.buf, (const uint8_t *)msg.buf, msg.len, (uint8_t *)vstr.buf, &pby, NULL)) { // TODO: is_canonical
|
||||
mp_raise_ValueError("Signing failed");
|
||||
}
|
||||
(void)pby;
|
||||
|
Loading…
Reference in New Issue
Block a user