From 11bf37b17c1c347b5499ec2c07204c77d8d5b3e4 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 13 Sep 2018 15:02:10 +0200 Subject: [PATCH] vendor: update trezor-crypto --- embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h | 2 +- embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h | 2 +- vendor/trezor-crypto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h index a196567afe..ee1cb1c745 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-nist256p1.h @@ -132,7 +132,7 @@ STATIC mp_obj_t mod_trezorcrypto_nist256p1_verify_recover(mp_obj_t signature, mp bool compressed = (recid >= 4); recid &= 3; uint8_t out[65]; - if (0 == ecdsa_verify_digest_recover(&nist256p1, out, (const uint8_t *)sig.buf + 1, (const uint8_t *)dig.buf, recid)) { + if (0 == ecdsa_recover_pub_from_sig(&nist256p1, out, (const uint8_t *)sig.buf + 1, (const uint8_t *)dig.buf, recid)) { if (compressed) { out[0] = 0x02 | (out[64] & 1); return mp_obj_new_bytes(out, 33); diff --git a/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h b/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h index 55286e5a3c..5a1bc6de79 100644 --- a/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h +++ b/embed/extmod/modtrezorcrypto/modtrezorcrypto-secp256k1.h @@ -143,7 +143,7 @@ STATIC mp_obj_t mod_trezorcrypto_secp256k1_verify_recover(mp_obj_t signature, mp bool compressed = (recid >= 4); recid &= 3; uint8_t out[65]; - if (0 == ecdsa_verify_digest_recover(&secp256k1, out, (const uint8_t *)sig.buf + 1, (const uint8_t *)dig.buf, recid)) { + if (0 == ecdsa_recover_pub_from_sig(&secp256k1, out, (const uint8_t *)sig.buf + 1, (const uint8_t *)dig.buf, recid)) { if (compressed) { out[0] = 0x02 | (out[64] & 1); return mp_obj_new_bytes(out, 33); diff --git a/vendor/trezor-crypto b/vendor/trezor-crypto index 9c2cfb0470..f9523f97df 160000 --- a/vendor/trezor-crypto +++ b/vendor/trezor-crypto @@ -1 +1 @@ -Subproject commit 9c2cfb04704b1419e7d1aebbb21b192fbf49644d +Subproject commit f9523f97df2c965835001d551738bbe1b93b53df