-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
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,5 @@ | ||
pragma circom 2.1.9; | ||
|
||
include "gmul.circom"; | ||
|
||
component main = GhashMul(); |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,12 @@ mod utils; | |
use error::MyError; | ||
use log::info; | ||
|
||
|
||
|
||
fn main() -> Result<(), MyError> { | ||
utils::setup()?; | ||
|
||
|
||
|
||
Ok(()) | ||
} |
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 |
---|---|---|
@@ -1 +1,40 @@ | ||
use std::collections::HashMap; | ||
|
||
use log::debug; | ||
use proofs::program::{self, data::{CircuitData, InstructionConfig, R1CSType, SetupData, WitnessGeneratorType}}; | ||
|
||
const ENTRY_EXTERNAL_R1CS: &[u8] = include_bytes!("entry.r1cs"); | ||
const ENTRY_WITNESS_GENERATOR: &[u8] = include_bytes!("entry.bin"); | ||
const JSON_MAX_ROM_LENGTH: usize = 35; | ||
|
||
|
||
#[test] | ||
fn test_setup() { | ||
let setup_data = SetupData { | ||
r1cs_types: vec![ | ||
R1CSType::Raw(ENTRY_EXTERNAL_R1CS.to_vec()), | ||
], | ||
witness_generator_types: vec![ | ||
WitnessGeneratorType::Raw(ENTRY_WITNESS_GENERATOR.to_vec()), | ||
], | ||
max_rom_length: JSON_MAX_ROM_LENGTH, | ||
}; | ||
|
||
debug!("Setting up `Memory`..."); | ||
let public_params = program::setup(&setup_data); | ||
|
||
debug!("Creating ROM"); | ||
let rom_data = HashMap::from([ | ||
(String::from("entry"), CircuitData { opcode: 0 }), | ||
]); | ||
|
||
let aes_rom_opcode_config = InstructionConfig { | ||
name: String::from("AES_GCM_1"), | ||
private_input: HashMap::from([ | ||
(String::from(AES_KEY.0), json!(AES_KEY.1)), | ||
(String::from(AES_IV.0), json!(AES_IV.1)), | ||
(String::from(AES_AAD.0), json!(AES_AAD.1)), | ||
]), | ||
}; | ||
|
||
} |