Skip to content

Commit

Permalink
Add commitToScalars and version bump (#60)
Browse files Browse the repository at this point in the history
* Add commit to scalars to public API

* version bump

* changelog update

* right version bump

* fix typos

* revert typo
  • Loading branch information
acolytec3 authored Sep 13, 2024
1 parent 5797082 commit 2a814ff
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"source.fixAll.eslint": "explicit"
},
"eslint.format.enable": true,
"eslint.workingDirectories": [{ "pattern": "./*" }]
"eslint.workingDirectories": [{ "pattern": "./*" }],
"rust-analyzer.procMacro.enable": true
}

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

## 0.4.8 - 2024-09-12

- Expose `commitToScalars` in public API. #[60](https://github.com/ethereumjs/verkle-cryptography-wasm/pull/60)

## 0.4.7 - 2024-09-10
- Add better API for `createProof`/`verifyProof` and expanded tests #[57](https://github.com/ethereumjs/verkle-cryptography-wasm/pull/57)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "verkle-cryptography-wasm",
"version": "0.4.7",
"version": "0.4.8",
"description": "Verkle Trie Crytography WASM/TypeScript Bindings",
"keywords": [
"ethereum",
Expand Down
3 changes: 3 additions & 0 deletions src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
verifyExecutionWitnessPreState as verifyExecutionWitnessPreStateBase,
createProof as createProofBase,
verifyProof as verifyProofBase,
commitToScalars as commitToScalarsBase,
type ProverInput as ProverInputBase,
type VerifierInput as VerifierInputBase,
} from './verkleFFIBindings/index.js'
Expand Down Expand Up @@ -43,7 +44,9 @@ export const loadVerkleCrypto = async () => {
const createProof = (proverInputs: ProverInput[]) => createProofBase(verkleFFI, proverInputs)
const verifyProof = (proof: Uint8Array, verifierInputs: VerifierInput[]) =>
verifyProofBase(verkleFFI, proof, verifierInputs)
const commitToScalars = (vector: Uint8Array[]) => commitToScalarsBase(verkleFFI, vector)
return {
commitToScalars,
getTreeKey,
getTreeKeyHash,
updateCommitment,
Expand Down
2 changes: 2 additions & 0 deletions src.ts/verkleFFIBindings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from '../wasm/rust_verkle_wasm.js'

import {
commitToScalars,
getTreeKey,
getTreeKeyHash,
updateCommitment,
Expand All @@ -15,6 +16,7 @@ import {
} from './verkleFFI.js'

export {
commitToScalars,
initVerkleWasm,
getTreeKey,
getTreeKeyHash,
Expand Down
10 changes: 10 additions & 0 deletions src.ts/verkleFFIBindings/verkleFFI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,13 @@ function serializeVerifierInputs(proof: Uint8Array, verifierInputs: VerifierInpu

return concatBytes(...serializedVerifierInputs)
}

/**
*
* @param verkleFFI The interface to the WASM verkle crypto object
* @param vector an array of Uint8Arrays to be committed to (must be 32 bytes each)
* @returns a 64 byte {@link Uint8Array} uncompressed commitment to the {@link vector} of values
*/
export const commitToScalars = (verkleFFI: VerkleFFI, vector: Uint8Array[]) => {
return verkleFFI.commitToScalars(vector)
}

0 comments on commit 2a814ff

Please sign in to comment.