-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Synthesizer is restored based on Ale-75, Playground is deleted from t…
…his repository. Find Playground from the repo 'tokamak-zk-evm-playground'
- Loading branch information
1 parent
a19616c
commit 05a9fd6
Showing
138 changed files
with
4,014 additions
and
13,433 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
use icicle_core::vec_ops::{VecOps, VecOpsConfig}; | ||
use icicle_bls12_381::curve::{ScalarCfg, ScalarField}; | ||
use icicle_core::traits::{Arithmetic, FieldConfig, FieldImpl, GenerateRandom}; | ||
use icicle_runtime::memory::{HostOrDeviceSlice, HostSlice, DeviceSlice, DeviceVec}; | ||
|
||
pub fn point_mul_two_vecs(lhs: &Box<[ScalarField]>, rhs: &Box<[ScalarField]>, res: &mut Box<[ScalarField]>){ | ||
if lhs.len() != rhs.len() || lhs.len() != res.len() { | ||
panic!("Mismatch of sizes of vectors to be pointwise-multiplied"); | ||
} | ||
let vec_ops_cfg = VecOpsConfig::default(); | ||
let lhs_buff = HostSlice::from_slice(lhs); | ||
let rhs_buff = HostSlice::from_slice(rhs); | ||
let res_buff = HostSlice::from_mut_slice(res); | ||
ScalarCfg::mul(lhs_buff, rhs_buff, res_buff, &vec_ops_cfg).unwrap(); | ||
} | ||
|
||
pub fn outer_product_two_vecs(col_vec: &Box<[ScalarField]>, row_vec: &Box<[ScalarField]>, res: &mut Box<[ScalarField]>){ | ||
if col_vec.len() * row_vec.len() != res.len() { | ||
panic!("Mismatch of sizes of vectors to be outer-producted"); | ||
} | ||
|
||
let col_len = col_vec.len(); | ||
let row_len = row_vec.len(); | ||
|
||
let vec_ops_cfg = VecOpsConfig::default(); | ||
let min_len = std::cmp::min(row_len, col_len); | ||
let max_len = std::cmp::max(row_len, col_len); | ||
let max_dir = if max_len == row_len {true } else {false}; | ||
|
||
let base_vec = if max_dir { row_vec } else { col_vec }; | ||
|
||
let mut res_untransposed = vec![ScalarField::zero(); res.len()].into_boxed_slice(); | ||
for ind in 0 .. min_len { | ||
let scaler = if max_dir {col_vec[ind]} else {row_vec[ind]}; | ||
let scaler_vec = vec![scaler; max_len].into_boxed_slice(); | ||
let mut res_vec = vec![ScalarField::zero(); max_len].into_boxed_slice(); | ||
ScalarCfg::mul( | ||
HostSlice::from_slice(&scaler_vec), | ||
HostSlice::from_slice(&base_vec), | ||
HostSlice::from_mut_slice(&mut res_vec), | ||
&vec_ops_cfg | ||
).unwrap(); | ||
res_untransposed[ind * max_len .. (ind + 1) * max_len].copy_from_slice(&res_vec); | ||
} | ||
|
||
if !max_dir { | ||
let res_untranposed_buf = HostSlice::from_slice(&res_untransposed); | ||
let res_buf = HostSlice::from_mut_slice(res); | ||
ScalarCfg::transpose( | ||
res_untranposed_buf, | ||
min_len as u32, | ||
max_len as u32, | ||
res_buf, | ||
&vec_ops_cfg).unwrap(); | ||
} else { | ||
res.clone_from(&res_untransposed); | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/frontend/qap-compiler/subcircuits/library/globalWireList.ts
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified
BIN
+28.7 KB
(170%)
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit0.r1cs
Binary file not shown.
Binary file modified
BIN
-15.7 KB
(82%)
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit1.r1cs
Binary file not shown.
Binary file added
BIN
+239 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit10.r1cs
Binary file not shown.
Binary file added
BIN
+371 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit11.r1cs
Binary file not shown.
Binary file added
BIN
+1.08 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit12.r1cs
Binary file not shown.
Binary file added
BIN
+832 Bytes
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit13.r1cs
Binary file not shown.
Binary file added
BIN
+57.7 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit14.r1cs
Binary file not shown.
Binary file added
BIN
+57.6 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit15.r1cs
Binary file not shown.
Binary file added
BIN
+43 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit16.r1cs
Binary file not shown.
Binary file added
BIN
+43 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit17.r1cs
Binary file not shown.
Binary file added
BIN
+82.3 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit18.r1cs
Binary file not shown.
Binary file added
BIN
+53.3 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit19.r1cs
Binary file not shown.
Binary file modified
BIN
+28.4 KB
(170%)
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit2.r1cs
Binary file not shown.
Binary file added
BIN
+189 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit20.r1cs
Binary file not shown.
Binary file added
BIN
+479 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit21.r1cs
Binary file not shown.
Binary file added
BIN
+85.2 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit22.r1cs
Binary file not shown.
Binary file added
BIN
+85.2 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit23.r1cs
Binary file not shown.
Binary file added
BIN
+123 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit24.r1cs
Binary file not shown.
Binary file added
BIN
+141 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit25.r1cs
Binary file not shown.
Binary file added
BIN
+141 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit26.r1cs
Binary file not shown.
Binary file added
BIN
+55.2 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit27.r1cs
Binary file not shown.
Binary file added
BIN
+175 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit28.r1cs
Binary file not shown.
Binary file added
BIN
+42.4 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit3.r1cs
Binary file not shown.
Binary file added
BIN
+86.8 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit4.r1cs
Binary file not shown.
Binary file added
BIN
+42.7 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit5.r1cs
Binary file not shown.
Binary file added
BIN
+174 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit6.r1cs
Binary file not shown.
Binary file added
BIN
+688 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit7.r1cs
Binary file not shown.
Binary file added
BIN
+174 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit8.r1cs
Binary file not shown.
Binary file added
BIN
+688 KB
packages/frontend/qap-compiler/subcircuits/library/r1cs/subcircuit9.r1cs
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/frontend/qap-compiler/subcircuits/library/subcircuitInfo.ts
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+978 Bytes
(100%)
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit0.wasm
Binary file not shown.
Binary file modified
BIN
-3.04 KB
(93%)
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit1.wasm
Binary file not shown.
Binary file added
BIN
+62.8 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit10.wasm
Binary file not shown.
Binary file added
BIN
+119 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit11.wasm
Binary file not shown.
Binary file added
BIN
+35.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit12.wasm
Binary file not shown.
Binary file added
BIN
+34.5 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit13.wasm
Binary file not shown.
Binary file added
BIN
+48.7 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit14.wasm
Binary file not shown.
Binary file added
BIN
+48.7 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit15.wasm
Binary file not shown.
Binary file added
BIN
+38.9 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit16.wasm
Binary file not shown.
Binary file added
BIN
+39.8 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit17.wasm
Binary file not shown.
Binary file added
BIN
+38.8 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit18.wasm
Binary file not shown.
Binary file added
BIN
+50.3 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit19.wasm
Binary file not shown.
Binary file modified
BIN
+897 Bytes
(100%)
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit2.wasm
Binary file not shown.
Binary file added
BIN
+60.7 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit20.wasm
Binary file not shown.
Binary file added
BIN
+70.3 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit21.wasm
Binary file not shown.
Binary file added
BIN
+44.5 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit22.wasm
Binary file not shown.
Binary file added
BIN
+45.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit23.wasm
Binary file not shown.
Binary file added
BIN
+40.3 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit24.wasm
Binary file not shown.
Binary file added
BIN
+40.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit25.wasm
Binary file not shown.
Binary file added
BIN
+40.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit26.wasm
Binary file not shown.
Binary file added
BIN
+37.2 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit27.wasm
Binary file not shown.
Binary file added
BIN
+48.1 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit28.wasm
Binary file not shown.
Binary file added
BIN
+38.5 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit3.wasm
Binary file not shown.
Binary file added
BIN
+42.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit4.wasm
Binary file not shown.
Binary file added
BIN
+38.5 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit5.wasm
Binary file not shown.
Binary file added
BIN
+59.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit6.wasm
Binary file not shown.
Binary file added
BIN
+80.5 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit7.wasm
Binary file not shown.
Binary file added
BIN
+59.4 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit8.wasm
Binary file not shown.
Binary file added
BIN
+80.5 KB
packages/frontend/qap-compiler/subcircuits/library/wasm/subcircuit9.wasm
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.