Skip to content

Commit

Permalink
chore: update kzg params
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalakkal committed Jan 1, 2024
1 parent a1a5b07 commit b4a98a7
Show file tree
Hide file tree
Showing 21 changed files with 39 additions and 86 deletions.
6 changes: 3 additions & 3 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axiom-crypto/halo2-wasm-cli",
"version": "0.1.5",
"version": "0.1.6-rc.0",
"description": "Halo2 Javascript library",
"main": "index.js",
"scripts": {
Expand All @@ -18,8 +18,8 @@
"author": "Intrinsic Technologies",
"license": "ISC",
"dependencies": {
"@axiom-crypto/halo2-lib-js": "0.2.13-alpha.1",
"@axiom-crypto/halo2-wasm": "0.2.10",
"@axiom-crypto/halo2-lib-js": "0.2.14-rc.0",
"@axiom-crypto/halo2-wasm": "0.2.11-rc.1",
"commander": "^11.1.0",
"typescript": "^5.2.2"
},
Expand Down
18 changes: 9 additions & 9 deletions cli/pnpm-lock.yaml

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

10 changes: 5 additions & 5 deletions cli/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ halo2-wasm mock -c src/examples/run.ts src/examples/circuit.ts
halo2-wasm mock src/examples/circuit.ts
```

Note: to use the default circuit runner, `@axiom-crypto/halo2-lib-js` must be installed globally using `npm`.
Note: to use the default circuit runner, `halo2-lib-js` must be installed globally using `npm`.
```
npm install -g @axiom-crypto/halo2-lib-js
npm install -g halo2-lib-js
```

## Installation

To use the `halo2-wasm` command, the `@axiom-crypto/halo2-wasm-cli` package must be installed globally. To do that run:
To use the `halo2-wasm` command, the `halo2-wasm-cli` package must be installed globally. To do that run:
```
npm install -g @axiom-crypto/halo2-wasm-cli
npm install -g halo2-wasm-cli
```

Note: global npm installations may require sudo access. If you'd like to install `@axiom-crypto/halo2-lib-js` or `@axiom-crypto/halo2-wasm-cli` without sudo access, see this guide: [GitHub](https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md).
Note: global npm installations may require sudo access. If you'd like to install `halo2-lib-js` or `halo2-wasm-cli` without sudo access, see this guide: [GitHub](https://github.com/sindresorhus/guides/blob/main/npm-global-without-sudo.md).

## Usage

Expand Down
4 changes: 2 additions & 2 deletions halo2-lib-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axiom-crypto/halo2-lib-js",
"version": "0.2.13",
"version": "0.2.14-rc.0",
"description": "Halo2 Javascript library",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -32,7 +32,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@axiom-crypto/halo2-wasm": "0.2.10",
"@axiom-crypto/halo2-wasm": "0.2.11-rc.1",
"ethers": "^6.8.0",
"prettier": "1.18.2"
},
Expand Down
8 changes: 4 additions & 4 deletions halo2-lib-js/pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions halo2-repl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@axiom-crypto/halo2-lib-js": "0.2.13",
"@axiom-crypto/halo2-wasm": "0.2.10",
"@axiom-crypto/halo2-lib-js": "0.2.14-rc.0",
"@axiom-crypto/halo2-wasm": "0.2.11-rc.1",
"@devbookhq/splitter": "^1.4.2",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
Expand Down
18 changes: 9 additions & 9 deletions halo2-repl/pnpm-lock.yaml

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

Binary file removed halo2-repl/public/kzg_bn254_14.srs
Binary file not shown.
2 changes: 1 addition & 1 deletion halo2-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "halo2-wasm"
version = "0.2.10"
version = "0.2.11-rc.1"
edition = "2021"

[lib]
Expand Down
1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_10_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_11_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_12_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_13_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_14_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_6_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_7_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_8_b64.ts

This file was deleted.

1 change: 0 additions & 1 deletion halo2-wasm/js/kzg/bin/kzg_bn254_9_b64.ts

This file was deleted.

44 changes: 3 additions & 41 deletions halo2-wasm/js/kzg/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
import { srs as kzg_bn254_14 } from './bin/kzg_bn254_14_b64';
import { srs as kzg_bn254_13 } from './bin/kzg_bn254_13_b64';
import { srs as kzg_bn254_12 } from './bin/kzg_bn254_12_b64';
import { srs as kzg_bn254_11 } from './bin/kzg_bn254_11_b64';
import { srs as kzg_bn254_10 } from './bin/kzg_bn254_10_b64';
import { srs as kzg_bn254_9 } from './bin/kzg_bn254_9_b64';
import { srs as kzg_bn254_8 } from './bin/kzg_bn254_8_b64';
import { srs as kzg_bn254_7 } from './bin/kzg_bn254_7_b64';
import { srs as kzg_bn254_6 } from './bin/kzg_bn254_6_b64';

function fetchAndConvertToUint8Array(url: string): Promise<Uint8Array> {
return new Promise((resolve, reject) => {
// Check if running in Node.js environment
Expand Down Expand Up @@ -47,36 +37,8 @@ const convertBase64ToUint8Arr = (b64str: string) => {
}

export const getKzgParams = async (k: number): Promise<Uint8Array> => {
switch(k){
case 19:
return fetchAndConvertToUint8Array("https://axiom-crypto.s3.amazonaws.com/challenge_0078/kzg_bn254_19.srs");
case 18:
return fetchAndConvertToUint8Array("https://axiom-crypto.s3.amazonaws.com/challenge_0078/kzg_bn254_18.srs");
case 17:
return fetchAndConvertToUint8Array("https://axiom-crypto.s3.amazonaws.com/challenge_0078/kzg_bn254_17.srs");
case 16:
return fetchAndConvertToUint8Array("https://axiom-crypto.s3.amazonaws.com/challenge_0078/kzg_bn254_16.srs");
case 15:
return fetchAndConvertToUint8Array("https://axiom-crypto.s3.amazonaws.com/challenge_0078/kzg_bn254_15.srs");
case 14:
return convertBase64ToUint8Arr(kzg_bn254_14);
case 13:
return convertBase64ToUint8Arr(kzg_bn254_13);
case 12:
return convertBase64ToUint8Arr(kzg_bn254_12);
case 11:
return convertBase64ToUint8Arr(kzg_bn254_11);
case 10:
return convertBase64ToUint8Arr(kzg_bn254_10);
case 9:
return convertBase64ToUint8Arr(kzg_bn254_9);
case 8:
return convertBase64ToUint8Arr(kzg_bn254_8);
case 7:
return convertBase64ToUint8Arr(kzg_bn254_7);
case 6:
return convertBase64ToUint8Arr(kzg_bn254_6);
default:
throw new Error(`k=${k} is not supported`);
if (k < 6 || k > 19) {
throw new Error(`k=${k} is not supported`);
}
return fetchAndConvertToUint8Array(`https://axiom-crypto.s3.amazonaws.com/challenge_0085/kzg_bn254_${k}.srs`);
};
2 changes: 1 addition & 1 deletion halo2-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@axiom-crypto/halo2-wasm",
"description": "Halo2 wasm bindings",
"version": "0.2.10",
"version": "0.2.11-rc.1",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
Expand Down
Binary file modified halo2-wasm/params/kzg_bn254_10.srs
Binary file not shown.

0 comments on commit b4a98a7

Please sign in to comment.