Add n=0 special case for compute_aggregate_kzg_proof

This commit is contained in:
Ramana Kumar 2022-11-08 23:11:19 +00:00
parent c8fab42ac0
commit 084fd2209e
No known key found for this signature in database
GPG Key ID: ED471C788B900433

View File

@ -1146,6 +1146,11 @@ C_KZG_RET compute_aggregate_kzg_proof(KZGProof *out,
const Blob blobs[], const Blob blobs[],
size_t n, size_t n,
const KZGSettings *s) { const KZGSettings *s) {
if (n == 0) {
*out = g1_identity;
return C_KZG_OK;
}
KZGCommitment* commitments = calloc(n, sizeof(KZGCommitment)); KZGCommitment* commitments = calloc(n, sizeof(KZGCommitment));
if (commitments == NULL) return C_KZG_MALLOC; if (commitments == NULL) return C_KZG_MALLOC;