Skip to content

Commit 2a814ff

Browse files
authored
Add commitToScalars and version bump (#60)
* Add commit to scalars to public API * version bump * changelog update * right version bump * fix typos * revert typo
1 parent 5797082 commit 2a814ff

File tree

7 files changed

+24
-4
lines changed

7 files changed

+24
-4
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"source.fixAll.eslint": "explicit"
44
},
55
"eslint.format.enable": true,
6-
"eslint.workingDirectories": [{ "pattern": "./*" }]
6+
"eslint.workingDirectories": [{ "pattern": "./*" }],
7+
"rust-analyzer.procMacro.enable": true
78
}
89

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
(modification: no type change headlines) and this project adheres to
66
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## 0.4.8 - 2024-09-12
9+
10+
- Expose `commitToScalars` in public API. #[60](https://github.com/ethereumjs/verkle-cryptography-wasm/pull/60)
11+
812
## 0.4.7 - 2024-09-10
913
- Add better API for `createProof`/`verifyProof` and expanded tests #[57](https://github.com/ethereumjs/verkle-cryptography-wasm/pull/57)
1014

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "verkle-cryptography-wasm",
3-
"version": "0.4.7",
3+
"version": "0.4.8",
44
"description": "Verkle Trie Crytography WASM/TypeScript Bindings",
55
"keywords": [
66
"ethereum",

src.ts/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
verifyExecutionWitnessPreState as verifyExecutionWitnessPreStateBase,
88
createProof as createProofBase,
99
verifyProof as verifyProofBase,
10+
commitToScalars as commitToScalarsBase,
1011
type ProverInput as ProverInputBase,
1112
type VerifierInput as VerifierInputBase,
1213
} from './verkleFFIBindings/index.js'
@@ -43,7 +44,9 @@ export const loadVerkleCrypto = async () => {
4344
const createProof = (proverInputs: ProverInput[]) => createProofBase(verkleFFI, proverInputs)
4445
const verifyProof = (proof: Uint8Array, verifierInputs: VerifierInput[]) =>
4546
verifyProofBase(verkleFFI, proof, verifierInputs)
47+
const commitToScalars = (vector: Uint8Array[]) => commitToScalarsBase(verkleFFI, vector)
4648
return {
49+
commitToScalars,
4750
getTreeKey,
4851
getTreeKeyHash,
4952
updateCommitment,

src.ts/verkleFFIBindings/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
} from '../wasm/rust_verkle_wasm.js'
66

77
import {
8+
commitToScalars,
89
getTreeKey,
910
getTreeKeyHash,
1011
updateCommitment,
@@ -15,6 +16,7 @@ import {
1516
} from './verkleFFI.js'
1617

1718
export {
19+
commitToScalars,
1820
initVerkleWasm,
1921
getTreeKey,
2022
getTreeKeyHash,

src.ts/verkleFFIBindings/verkleFFI.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,13 @@ function serializeVerifierInputs(proof: Uint8Array, verifierInputs: VerifierInpu
178178

179179
return concatBytes(...serializedVerifierInputs)
180180
}
181+
182+
/**
183+
*
184+
* @param verkleFFI The interface to the WASM verkle crypto object
185+
* @param vector an array of Uint8Arrays to be committed to (must be 32 bytes each)
186+
* @returns a 64 byte {@link Uint8Array} uncompressed commitment to the {@link vector} of values
187+
*/
188+
export const commitToScalars = (verkleFFI: VerkleFFI, vector: Uint8Array[]) => {
189+
return verkleFFI.commitToScalars(vector)
190+
}

0 commit comments

Comments
 (0)