1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +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:
Jan Pochyla 2016-10-14 15:46:09 +02:00
parent a44e16a9ca
commit 2ff937b707
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;