Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: sha256 #48

Merged
merged 163 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
9d9e5f4
u32 init
tamirhemo Jul 25, 2023
2d7027c
Merge branch 'main' into tamir/sha
tamirhemo Jul 25, 2023
36e0f19
some structure
tamirhemo Jul 26, 2023
c7f6e92
and
tamirhemo Jul 26, 2023
7077936
fmt
tamirhemo Jul 26, 2023
13195fe
affine_point_constant
kevjue Jul 26, 2023
3613777
shared memory in builder
tamirhemo Jul 26, 2023
3e45ce5
sha stuff
tamirhemo Jul 26, 2023
480e551
fix: adding the generator to the list
tamirhemo Jul 27, 2023
46e0a58
fmt
tamirhemo Jul 27, 2023
1fe9b26
Merge remote-tracking branch 'origin/kevjue/set_affine_point_constant…
tamirhemo Jul 27, 2023
a4d9f63
timing messages for assigning input
tamirhemo Jul 27, 2023
dd7e59a
return to random test case and public inputs
tamirhemo Jul 27, 2023
e37cba7
comments
tamirhemo Jul 27, 2023
4504839
remove comments
tamirhemo Jul 27, 2023
e3a2739
merge bug fix
tamirhemo Jul 27, 2023
668d0da
remove permutation module
tamirhemo Jul 27, 2023
df68dd6
accumulator layout
tamirhemo Jul 27, 2023
76992a4
commit
tamirhemo Jul 27, 2023
111733b
Merge branch 'main' into tamir/sha
tamirhemo Jul 27, 2023
ba5da23
Merge branch 'main' into tamir/sha
tamirhemo Jul 27, 2023
559cf7b
cubic element instead of extension element
tamirhemo Jul 27, 2023
aa542c1
clean code remarks
tamirhemo Jul 27, 2023
495e1fe
clippy
tamirhemo Jul 27, 2023
36a889b
change public to global name
tamirhemo Jul 27, 2023
6f5c8b8
challenges in TraceWriter
tamirhemo Jul 27, 2023
e998602
bus channel template
tamirhemo Jul 28, 2023
43f262e
trace module organization
tamirhemo Jul 28, 2023
7074404
new read method
tamirhemo Jul 28, 2023
3b52c1a
bus channel 0.1
tamirhemo Jul 28, 2023
04ad8ac
added public and global vars support
tamirhemo Jul 29, 2023
6c817dd
bus complete
tamirhemo Jul 29, 2023
8b3f334
sort global/public inputs
tamirhemo Jul 31, 2023
a0d94b5
bus
tamirhemo Jul 31, 2023
729574e
clippy
tamirhemo Jul 31, 2023
e0f1acc
clippy
tamirhemo Jul 31, 2023
5e181bf
change inputs to vec
tamirhemo Jul 31, 2023
e51665f
doc
tamirhemo Jul 31, 2023
bac75de
u32 ops template
tamirhemo Jul 31, 2023
12352d2
first bitop test
tamirhemo Aug 1, 2023
c0a5931
test with dfferent rows
tamirhemo Aug 1, 2023
9aa52f7
xor
tamirhemo Aug 1, 2023
467b1ba
fix bus
tamirhemo Aug 1, 2023
69f52b1
fix u32 test
tamirhemo Aug 1, 2023
75c3923
bytes layout
tamirhemo Aug 1, 2023
97624f4
layout for byte lookup
tamirhemo Aug 1, 2023
84e45dd
changes to lookup layout
tamirhemo Aug 1, 2023
8ce0fb2
new lookup changes
tamirhemo Aug 1, 2023
0e3fdc4
lookup
tamirhemo Aug 1, 2023
4aa2ed0
add table method
tamirhemo Aug 1, 2023
4fb5981
byte decode
tamirhemo Aug 1, 2023
f369bc7
bit not
tamirhemo Aug 1, 2023
24fdd34
shr
tamirhemo Aug 1, 2023
4a74ddc
shr full test
tamirhemo Aug 1, 2023
517f1cf
byte lookup assignment
tamirhemo Aug 2, 2023
bafc1de
multiplicities to round 0
tamirhemo Aug 2, 2023
eacc5cf
multiplicites in table data
tamirhemo Aug 2, 2023
e601aa5
lock
tamirhemo Aug 2, 2023
ec3d8bc
refactor table_log
tamirhemo Aug 2, 2023
2de4459
fmt
tamirhemo Aug 2, 2023
ee69a0e
log table constraint
tamirhemo Aug 2, 2023
1231040
acc table constraint
tamirhemo Aug 2, 2023
d6db42d
lookup table-only done
tamirhemo Aug 2, 2023
d6b7566
lookup digest constr
tamirhemo Aug 2, 2023
7c9de61
lookup cleanup
tamirhemo Aug 2, 2023
131671e
logder before refactoring
tamirhemo Aug 2, 2023
ee43b39
logder refactor
tamirhemo Aug 2, 2023
dd7f830
fmt
tamirhemo Aug 2, 2023
9203dcf
lookup test
tamirhemo Aug 2, 2023
9835010
row accumulation improved
tamirhemo Aug 2, 2023
c0dcd13
change constants in lookup
tamirhemo Aug 2, 2023
bdbdeae
cargo update and get ride of collect_vec
tamirhemo Aug 3, 2023
c4e629f
lookup functionality
tamirhemo Aug 3, 2023
28d61c1
generate trace for each row independently
tamirhemo Aug 3, 2023
fd51136
doc cleanup
tamirhemo Aug 3, 2023
18c35ce
using instruction-write method in some functions
tamirhemo Aug 3, 2023
10de765
auto row writing
tamirhemo Aug 3, 2023
40c62dc
fmt
tamirhemo Aug 3, 2023
ab45386
byte lookup refactor
tamirhemo Aug 3, 2023
b3d13b6
operations template
tamirhemo Aug 3, 2023
4ae714d
change shr to flexible one
tamirhemo Aug 3, 2023
282d960
table creation
tamirhemo Aug 3, 2023
6d51ae9
shr
tamirhemo Aug 4, 2023
5efc290
selector method
tamirhemo Aug 4, 2023
25e946c
array slice method
tamirhemo Aug 4, 2023
72fd565
subarray
tamirhemo Aug 4, 2023
96bfc81
new shr
tamirhemo Aug 4, 2023
52fff3d
and
tamirhemo Aug 4, 2023
c8e52e1
shl
tamirhemo Aug 4, 2023
3da3c4a
shift
tamirhemo Aug 4, 2023
ace8a01
shift and rotate
tamirhemo Aug 4, 2023
29426ec
shift and rotate ops
tamirhemo Aug 4, 2023
9911109
bit_ops
tamirhemo Aug 4, 2023
691c5af
bitops
tamirhemo Aug 4, 2023
9b4970d
figure filtered instruction
tamirhemo Aug 4, 2023
dd9fb70
filtered instruction
tamirhemo Aug 4, 2023
69466d9
reorg
tamirhemo Aug 4, 2023
d896c3f
byte operations instruction
tamirhemo Aug 4, 2023
700ee90
register byte lookup
tamirhemo Aug 5, 2023
e660c04
register insgtruction with filter
tamirhemo Aug 7, 2023
8717dd9
filtered instruction
tamirhemo Aug 7, 2023
6189eee
test more bit ops
tamirhemo Aug 7, 2023
6f12fd5
byte lookup
tamirhemo Aug 7, 2023
c682784
clock cycle and hash template
tamirhemo Aug 7, 2023
6c6c29c
byte lookup table
tamirhemo Aug 7, 2023
e233833
clippy
tamirhemo Aug 7, 2023
83e4334
util fn idiomatic
tamirhemo Aug 7, 2023
fc29120
add shrconst and rotconst
tamirhemo Aug 7, 2023
3ee07c0
uint and, xor, not
tamirhemo Aug 7, 2023
9b05b70
assert zero methods
tamirhemo Aug 7, 2023
139d66d
add shr with carry
tamirhemo Aug 7, 2023
8b73cb9
shr with shift < 8
tamirhemo Aug 8, 2023
c6afa88
u32 shr
tamirhemo Aug 8, 2023
650ee2f
cleanup
tamirhemo Aug 8, 2023
eb0e54e
shr and rotate
tamirhemo Aug 8, 2023
b1e93a4
shr and rotate
tamirhemo Aug 8, 2023
3bad0b3
u32 operations
tamirhemo Aug 8, 2023
75fcfad
clippy
tamirhemo Aug 8, 2023
896a2fe
refactor values writing
tamirhemo Aug 8, 2023
2d98c00
simplify lookup constraints
tamirhemo Aug 8, 2023
afbcae4
lookup for public inputs
tamirhemo Aug 8, 2023
0f93941
gadget init and remove comment
tamirhemo Aug 8, 2023
92d5dae
accumulation for public inputs
tamirhemo Aug 8, 2023
bedd13d
public operations byte lookup
tamirhemo Aug 8, 2023
f29b6c6
add public and global ops lookup
tamirhemo Aug 8, 2023
4652cf4
some cleanup, attempted public byte ops
tamirhemo Aug 8, 2023
f2b9deb
clean some comments
tamirhemo Aug 8, 2023
be046ac
fix public bytes action test
tamirhemo Aug 9, 2023
eef996e
changes
tamirhemo Aug 9, 2023
05381e8
change bytes() to to_le_bytes()
tamirhemo Aug 9, 2023
37880d8
refactor arithmetic
tamirhemo Aug 9, 2023
f4d5dab
write to public slice
tamirhemo Aug 9, 2023
fb206ed
change sender to syncsender
tamirhemo Aug 10, 2023
0a338ff
try
tamirhemo Aug 10, 2023
6a70421
byte operations generator
tamirhemo Aug 11, 2023
a78a825
remove blocking send
tamirhemo Aug 11, 2023
c22357d
sha first attempt
tamirhemo Aug 11, 2023
1ebd552
sha round
tamirhemo Aug 14, 2023
2a0802b
change multiplicity values to a lock
tamirhemo Aug 14, 2023
9be13fb
hash step
tamirhemo Aug 14, 2023
8fa6171
padding test
tamirhemo Aug 14, 2023
9684fc3
sha without buts
tamirhemo Aug 14, 2023
d5fe893
global bus values
tamirhemo Aug 15, 2023
a216d2d
bus global out
tamirhemo Aug 15, 2023
7bd951a
fix cubic import
tamirhemo Aug 15, 2023
11310cf
refactor rair
tamirhemo Aug 15, 2023
50f4dd8
sha with bus
tamirhemo Aug 15, 2023
1ae4701
global instructions
tamirhemo Aug 15, 2023
6d3ad6f
separate constraint and trace writing data
tamirhemo Aug 15, 2023
8afca33
fix byte gadget
tamirhemo Aug 15, 2023
30f15e3
sha cleanup
tamirhemo Aug 15, 2023
03bcad1
sha256 gadget cleanup
tamirhemo Aug 15, 2023
73ae87f
sha cleanup
tamirhemo Aug 15, 2023
083cac4
change multiplicities to atomic usize
tamirhemo Aug 15, 2023
b6bc6e0
ec cleanup
tamirhemo Aug 15, 2023
79c9f6d
sha 256
tamirhemo Aug 16, 2023
3581e2f
fmt
tamirhemo Aug 16, 2023
8b8b5fe
clippy
tamirhemo Aug 16, 2023
3b7ee94
clippy
tamirhemo Aug 16, 2023
64f155e
sha number of columns
tamirhemo Aug 16, 2023
0786937
gadget 1
tamirhemo Aug 17, 2023
a9a47f1
sha256 with example
tamirhemo Aug 17, 2023
f0c6593
change sha_256 to sha256
tamirhemo Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 51 additions & 31 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions curta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ plonky2 = { git = "https://github.com/mir-protocol/plonky2.git", default-feature
num = { version = "0.4", default-features = false }
rand = "0.8.4"
serde = { version = "1.0", features = ["derive"] }
hex = "0.4.3"
subtle-encoding = "0.5.1"

[dev-dependencies]
env_logger = { version = "0.9.0", default-features = false }
Expand Down
12 changes: 8 additions & 4 deletions curta/examples/ed_scalar_mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ use plonky2::iop::witness::{PartialWitness, WitnessWrite};
use plonky2::plonk::circuit_builder::CircuitBuilder;
use plonky2::plonk::circuit_data::CircuitConfig;
use plonky2::plonk::config::PoseidonGoldilocksConfig;
use plonky2::plonk::prover::prove;
use plonky2::timed;
use plonky2::util::timing::TimingTree;
use rand::thread_rng;

fn main() {
// Devlarying some type aliases for convenience
// Define some type aliases for convenience
type F = GoldilocksField;
type E = GoldilocksCubicParameters;
type C = PoseidonGoldilocksConfig;
Expand Down Expand Up @@ -150,12 +151,15 @@ fn main() {
}
);

let recursive_proof = timed!(
// Generate the proof
let proof = timed!(
timing,
"Generate proof",
plonky2::plonk::prover::prove(&data.prover_only, &data.common, pw, &mut timing)
prove(&data.prover_only, &data.common, pw, &mut timing)
)
.unwrap();
timing.print();
data.verify(recursive_proof).unwrap();

// Verify the proof
data.verify(proof).unwrap();
}
Loading
Loading