Skip to content

Commit

Permalink
starting some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJepsen committed Oct 22, 2024
1 parent 080887b commit e80a4e7
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ node_modules/*

# circomkit tests
circuits/test/**/*.circom
circuits/test/*.circom
circuits/test/*.circom
ir_log/*
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dotenvy = "0.15"

[dev-dependencies]
rstest ="0.18" # testing convenience proc-macros
proofs= { git = "https://github.com/pluto/web-prover.git", package="proofs" }
5 changes: 5 additions & 0 deletions circuits/entry.circom
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 added src/entry.bin
Binary file not shown.
Binary file added src/entry.r1cs
Binary file not shown.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ mod utils;
use error::MyError;
use log::info;



fn main() -> Result<(), MyError> {
utils::setup()?;



Ok(())
}
39 changes: 39 additions & 0 deletions src/tests.rs
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)),
]),
};

}

0 comments on commit e80a4e7

Please sign in to comment.