1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

invert pby when normalizing S during signing

This commit is contained in:
Pavol Rusnak 2014-12-23 18:13:33 +01:00
parent 89a7d7797b
commit 795579cbac

View File

@ -364,6 +364,9 @@ int ecdsa_sign_digest(const uint8_t *priv_key, const uint8_t *digest, uint8_t *s
// if S > order/2 => S = -S
if (bn_is_less(&order256k1_half, &k)) {
bn_substract_noprime(&order256k1, &k, &k);
if (pby) {
*pby = !*pby;
}
}
// we are done, R.x and k is the result signature