- Switch ordering of domain separator
- When copying the polynomial into the bytes array, use the `j` value to position the pointer
This commit is contained in:
kevaundray 2022-11-18 00:16:10 +00:00 committed by GitHub
parent cf327db6e7
commit deb29eb59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1089,12 +1089,12 @@ static C_KZG_RET hash_to_bytes(uint8_t out[32],
if (bytes == NULL) return C_KZG_MALLOC; if (bytes == NULL) return C_KZG_MALLOC;
memcpy(bytes, FIAT_SHAMIR_PROTOCOL_DOMAIN, 16); memcpy(bytes, FIAT_SHAMIR_PROTOCOL_DOMAIN, 16);
bytes_of_uint64(&bytes[16], n); bytes_of_uint64(&bytes[16], FIELD_ELEMENTS_PER_BLOB);
bytes_of_uint64(&bytes[16 + 8], FIELD_ELEMENTS_PER_BLOB); bytes_of_uint64(&bytes[16 + 8], n);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
for (j = 0; j < FIELD_ELEMENTS_PER_BLOB; j++) for (j = 0; j < FIELD_ELEMENTS_PER_BLOB; j++)
bytes_from_bls_field(&bytes[ni + i * BYTES_PER_FIELD_ELEMENT], &polys[i][j]); bytes_from_bls_field(&bytes[ni + BYTES_PER_FIELD_ELEMENT * (i * FIELD_ELEMENTS_PER_BLOB + j)], &polys[i][j]);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
bytes_from_g1(&bytes[np + i * 48], &comms[i]); bytes_from_g1(&bytes[np + i * 48], &comms[i]);