diff --git a/bindings/nim/README.md b/bindings/nim/README.md index 32e13b415..4b7cb94d1 100644 --- a/bindings/nim/README.md +++ b/bindings/nim/README.md @@ -4,7 +4,7 @@ This directory contains Nim bindings for the c-kzg-4844 library. ## Requirements -This bindings support Nim compiler version 1.2, 1.4, 1.6, and devel. +These bindings support Nim compiler version 1.2, 1.4, 1.6, and devel. You also need to install dependencies: @@ -14,7 +14,7 @@ nimble install stew ## Tests -Currently reference tests only support Nim compiler version 1.4, and 1.6 because of yaml library limitations. +Currently, reference tests only support Nim compiler version 1.4, and 1.6 because of yaml library limitations. But other tests that are not using yaml can be run by Nim 1.2 - devel. Dependencies: @@ -36,7 +36,7 @@ Or from c-kzg-4844 root folder: nimble test ``` -## How to use this bindings in your project +## How to use these bindings in your project Install via nimble: diff --git a/bindings/nim/kzg.nim b/bindings/nim/kzg.nim index 856af2785..41709d9f6 100644 --- a/bindings/nim/kzg.nim +++ b/bindings/nim/kzg.nim @@ -97,7 +97,7 @@ proc loadTrustedSetupFromString*(input: string): Result[KzgCtx, string] = try: let fieldElems = s.readLine().parseInt() if fieldElems != FIELD_ELEMENTS_PER_BLOB: - return err("invalid field elemments per blob, expect $1, got $2" % [ + return err("invalid field elements per blob, expect $1, got $2" % [ $FIELD_ELEMENTS_PER_BLOB, $fieldElems ]) let numG2 = s.readLine().parseInt() diff --git a/bindings/node.js/CONTRIBUTING.md b/bindings/node.js/CONTRIBUTING.md index 6168edacb..f346e8762 100644 --- a/bindings/node.js/CONTRIBUTING.md +++ b/bindings/node.js/CONTRIBUTING.md @@ -40,6 +40,6 @@ exported by `node.js`. There is also a header-only `C++` implementation of the There is mixed usage of the two in this library. The addon was built to be -[context-aware](https://nodejs.github.io/node-addon-examples/special-topics/context-awareness/) +[context-aware](https://nodejs.github.io/node-addon-examples/special-topics/context-awareness/), so it will be safe to run on a worker thread. Be sure not to use any static/global variables as those are not thread safe. diff --git a/bindings/node.js/Makefile b/bindings/node.js/Makefile index 17850ecc6..6ec056106 100644 --- a/bindings/node.js/Makefile +++ b/bindings/node.js/Makefile @@ -66,7 +66,7 @@ publish: build bundle @cd dist @npm publish -# Run ref-tests in linux environment for cross-compatability check +# Run ref-tests in linux environment for cross-compatibility check .PHONY: linux-test linux-test: bundle @# Docker cannot copy from outside this dir diff --git a/bindings/node.js/lib/kzg.d.ts b/bindings/node.js/lib/kzg.d.ts index 9d7557d3b..be05a1d1d 100644 --- a/bindings/node.js/lib/kzg.d.ts +++ b/bindings/node.js/lib/kzg.d.ts @@ -26,8 +26,6 @@ export const FIELD_ELEMENTS_PER_BLOB: number; * * @param {string} filePath * - * @return {KzgBindings} - * * @throws {TypeError} - Non-String input * @throws {Error} - For all other errors. See error message for more info */ @@ -82,7 +80,12 @@ export function computeBlobKzgProof(blob: Blob, commitmentBytes: Bytes48): KZGPr * * @throws {TypeError} - For invalid arguments or failure of the native library */ -export function verifyKzgProof(commitment: Bytes48, zBytes: Bytes32, yBytes: Bytes32, proof: Bytes48): boolean; +export function verifyKzgProof( + commitmentBytes: Bytes48, + zBytes: Bytes32, + yBytes: Bytes32, + proofBytes: Bytes48 +): boolean; /** * Given a blob and its proof, verify that it corresponds to the provided @@ -96,20 +99,20 @@ export function verifyKzgProof(commitment: Bytes48, zBytes: Bytes32, yBytes: Byt * * @throws {TypeError} - For invalid arguments or failure of the native library */ -export function verifyBlobKzgProof(blob: Blob, commitment: Bytes48, proof: Bytes48): boolean; +export function verifyBlobKzgProof(blob: Blob, commitmentBytes: Bytes48, proofBytes: Bytes48): boolean; /** - * Given an array of blobs and their proofs, verify that they corresponds to their + * Given an array of blobs and their proofs, verify that they correspond to their * provided commitment. * * Note: blobs[0] relates to commitmentBytes[0] and proofBytes[0] * * @param {Blob} blobs - An array of serialized blobs to verify - * @param {Bytes48} commitmentBytes - An array of serialized commitments to verify - * @param {Bytes48} proofBytes - An array of serialized KZG proofs for verification + * @param {Bytes48} commitmentsBytes - An array of serialized commitments to verify + * @param {Bytes48} proofsBytes - An array of serialized KZG proofs for verification * * @return {boolean} - true/false depending on batch validity * * @throws {TypeError} - For invalid arguments or failure of the native library */ -export function verifyBlobKzgProofBatch(blobs: Blob[], commitments: Bytes48[], proofs: Bytes48[]): boolean; +export function verifyBlobKzgProofBatch(blobs: Blob[], commitmentsBytes: Bytes48[], proofsBytes: Bytes48[]): boolean; diff --git a/bindings/node.js/lib/kzg.js b/bindings/node.js/lib/kzg.js index 4e8b7c2e2..4d0f9909d 100644 --- a/bindings/node.js/lib/kzg.js +++ b/bindings/node.js/lib/kzg.js @@ -8,7 +8,7 @@ const bindings = require("bindings")("kzg"); /** * Converts JSON formatted trusted setup into the native format that - * the native library requires. Returns the absolute file path to the + * the native library requires. Returns the absolute file path to * the formatted file. The path will be the same as the origin * file but with a ".txt" extension. * diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs index f121dd803..e90eea412 100644 --- a/bindings/rust/build.rs +++ b/bindings/rust/build.rs @@ -132,7 +132,7 @@ fn make_bindings(header_path: &str, blst_headers_dir: &str, bindings_out_path: & // if/when bindgen fixes this or allows us to choose our own representation // for types. Using repr(C) is equivalent to repr(u*) for fieldless enums, // so this should be safe to do. The alternative was to modify C_KZG_RET in -// C and we decided this was the lesser of two evils. There should be only +// C, and we decided this was the lesser of two evils. There should be only // one instance where repr(C) isn't used: C_KZG_RET. // See: https://github.com/rust-lang/rust-bindgen/issues/1907 #[cfg(feature = "generate-bindings")]