Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions bindings/node.js/src/kzg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ inline uint8_t *get_bytes(
return array.Data();
}
inline Blob *get_blob(const Napi::Env &env, const Napi::Value &val) {
return reinterpret_cast<Blob *>(get_bytes(env, val, BYTES_PER_BLOB, "blob")
return reinterpret_cast<Blob *>(
get_bytes(env, val, BYTES_PER_BLOB, "blob")
);
}
inline Bytes32 *get_bytes32(
Expand All @@ -161,7 +162,8 @@ inline Bytes48 *get_bytes48(
);
}
inline Cell *get_cell(const Napi::Env &env, const Napi::Value &val) {
return reinterpret_cast<Cell *>(get_bytes(env, val, BYTES_PER_CELL, "cell")
return reinterpret_cast<Cell *>(
get_bytes(env, val, BYTES_PER_CELL, "cell")
);
}
inline uint64_t get_cell_index(const Napi::Env &env, const Napi::Value &val) {
Expand Down Expand Up @@ -886,15 +888,17 @@ Napi::Value VerifyCellKzgProofBatch(const Napi::CallbackInfo &info) {
goto out;
}

commitments = (Bytes48 *
)calloc(commitments_param.Length(), sizeof(Bytes48));
commitments = (Bytes48 *)calloc(
commitments_param.Length(), sizeof(Bytes48)
);
if (commitments == nullptr) {
Napi::Error::New(env, "Error while allocating memory for commitments")
.ThrowAsJavaScriptException();
goto out;
}
cell_indices = (uint64_t *
)calloc(cell_indices_param.Length(), sizeof(uint64_t));
cell_indices = (uint64_t *)calloc(
cell_indices_param.Length(), sizeof(uint64_t)
);
if (cell_indices == nullptr) {
Napi::Error::New(env, "Error while allocating memory for cell_indices")
.ThrowAsJavaScriptException();
Expand Down
4 changes: 2 additions & 2 deletions src/eip4844/eip4844.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ static C_KZG_RET compute_r_powers_for_verify_kzg_proof_batch(
fr_t r;

size_t input_size = DOMAIN_STR_LENGTH + sizeof(uint64_t) + sizeof(uint64_t) +
(n * (BYTES_PER_COMMITMENT + 2 * BYTES_PER_FIELD_ELEMENT + BYTES_PER_PROOF)
);
(n *
(BYTES_PER_COMMITMENT + 2 * BYTES_PER_FIELD_ELEMENT + BYTES_PER_PROOF));
ret = c_kzg_malloc((void **)&bytes, input_size);
if (ret != C_KZG_OK) goto out;

Expand Down
Loading