Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Fix warnings in bip32.c
Browse files Browse the repository at this point in the history
  • Loading branch information
matsjj committed Oct 27, 2020
1 parent 9acdbb4 commit 0f2e47f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions trezor-crypto/src/bip32.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,11 +632,11 @@ int hdnode_sign(HDNode *node, const uint8_t *msg, uint32_t msg_len, HasherType h
} else if (node->curve == &ed25519_keccak_info) {
ed25519_sign_keccak(msg, msg_len, node->private_key, node->public_key + 1, sig);
} else if (node->curve == &curve25519_info) {
uint8_t ed25519_public_key[32];
memset(ed25519_public_key, 0, 32);
curve25519_pk_to_ed25519(ed25519_public_key, node->public_key + 1);
ed25519_sign(msg, msg_len, node->private_key, ed25519_public_key, sig);
const uint8_t sign_bit = ed25519_public_key[31] & 0x80;
uint8_t public_key[32];
memset(public_key, 0, 32);
curve25519_pk_to_ed25519(public_key, node->public_key + 1);
ed25519_sign(msg, msg_len, node->private_key, public_key, sig);
const uint8_t sign_bit = public_key[31] & 0x80;
sig[63] = sig[63] & 127;
sig[63] |= sign_bit;
}
Expand Down

0 comments on commit 0f2e47f

Please sign in to comment.