ZenGo-X / class

Rust library for building IQC: cryptography based on class groups of imaginary quadratic orders
GNU General Public License v3.0
63 stars 31 forks source link

refactor(VDF): set up a_b_delta before eval() and verify() #40

Closed HAOYUatHZ closed 3 years ago

HAOYUatHZ commented 3 years ago

to benchmark VDF's eval() and verify() more accurately, we need to separate "g <- H_G(x)", that is, h_g should not count for the measurement. Especially when we are comparing class_group vs RSA_group: h_g in class_group and h_g in RSA_group are different. This PR attempts to refactor class_group Wesolowski VDF, by moving "g <- H_G(x)" outside eval() and verify().

environment

how to test it

cargo test vdf -- --test-threads 1

test result

running 2 tests
test primitives::vdf::tests::test_vdf_valid_proof ... ok
test primitives::vdf::tests::test_vdf_wrong_proof ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 26 filtered out