mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-17 04:27:08 +00:00
Statically allocate hash_output
This commit is contained in:
parent
ad31161515
commit
73d5d2fb0b
@ -1112,8 +1112,7 @@ static C_KZG_RET compute_challenges(BLSFieldElement *out, BLSFieldElement r_powe
|
||||
for (i = 0; i < n; i++)
|
||||
bytes_from_g1(&bytes[np + i * 48], &comms[i]);
|
||||
|
||||
uint8_t* hash_output = calloc(32, sizeof(uint8_t));
|
||||
if (hash_output == NULL) { free(bytes); return C_KZG_MALLOC; }
|
||||
uint8_t hash_output[32] = {0};
|
||||
hash(hash_output, bytes, nb);
|
||||
memcpy(bytes, hash_output, 32);
|
||||
bytes[32] = 0x0;
|
||||
@ -1128,7 +1127,6 @@ static C_KZG_RET compute_challenges(BLSFieldElement *out, BLSFieldElement r_powe
|
||||
hash(hash_output, bytes, 33);
|
||||
bytes_to_bls_field(out, hash_output);
|
||||
|
||||
free(hash_output);
|
||||
free(bytes);
|
||||
return C_KZG_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user