This commit is contained in:
Michele Balistreri 2024-02-07 21:26:54 +01:00
parent fd5302c471
commit 35862e4b9e
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
1 changed files with 2 additions and 2 deletions

View File

@ -108,14 +108,14 @@ int ecdsa_recover_pub_from_sig(const ecdsa_curve *curve, uint8_t *pub_key, const
}
int ecdh_multiply(const ecdsa_curve *curve, const uint8_t *priv_key, const uint8_t *pub_key, uint8_t *session_key) {
uint8_t buf[ECC256_ELEMENT_SIZE * 2];
uint8_t buf[ECC256_POINT_SIZE];
pub_key = ec_uncompress_key(curve, pub_key, buf);
if (pub_key == NULL) {
return 1;
}
if (hal_ec_point_multiply(curve, priv_key, &pub_key[1], &session_key[1]) != HAL_SUCCESS) {
if (hal_ec_point_multiply(curve, priv_key, pub_key, &session_key[1]) != HAL_SUCCESS) {
return 1;
}