Merge branch 'development' into eddsa

This commit is contained in:
Pol Henarejos
2023-08-18 13:07:13 +02:00
2 changed files with 12 additions and 2 deletions

View File

@@ -274,6 +274,9 @@ int derive_key(const uint8_t *app_id,
if (cinfo == NULL) {
return 1;
}
if (cinfo->bit_size % 8 != 0) {
outk[0] >>= 8 - (cinfo->bit_size % 8);
}
r = mbedtls_ecp_read_key(curve, key, outk, ceil((float) cinfo->bit_size / 8));
mbedtls_platform_zeroize(outk, sizeof(outk));
if (r != 0) {