1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

Merge branch 'master' of git://github.com/romanz/trezor-mcu into romanz-master

Conflicts:
	firmware/crypto.c
This commit is contained in:
Pavol Rusnak 2015-06-28 21:26:15 +02:00
commit d488366e36

View File

@ -103,9 +103,11 @@ int cryptoMessageSign(const uint8_t *message, size_t message_len, const uint8_t
sha256_Final(hash, &ctx); sha256_Final(hash, &ctx);
sha256_Raw(hash, 32, hash); sha256_Raw(hash, 32, hash);
uint8_t pby; uint8_t pby;
ecdsa_sign_digest(&secp256k1, privkey, hash, signature + 1, &pby); int result = ecdsa_sign_digest(&secp256k1, privkey, hash, signature + 1, &pby);
if (result == 0) {
signature[0] = 27 + pby + 4; signature[0] = 27 + pby + 4;
return 0; }
return result;
} }
int cryptoMessageVerify(const uint8_t *message, size_t message_len, const uint8_t *address_raw, const uint8_t *signature) int cryptoMessageVerify(const uint8_t *message, size_t message_len, const uint8_t *address_raw, const uint8_t *signature)