ethereum / research

MIT License
1.81k stars 591 forks source link

moved to blst lib #134

Closed lCardosoSantos closed 1 year ago

lCardosoSantos commented 1 year ago

fk20 changed from py_ecc.optimized_bls12_381 to supranational/blst. Static lib is not included in this commit, instructions are on README.md. Type hints were also added.

Improvement of speed is as follow, tested using a simple timer, on a i7-10875H CPU @ 2.30GHz, using the previous tests in the main functions.

This Commit:

fk20_multi.py
    func generate_setup exec in 0.133120s
    func data_availabilty_using_fk20_multi exec in 0.329644s
    func check_proof_multi exec in 0.004176s

fk20_single.py
    func generate_setup exec in 0.003918s
    func commit_to_poly exec in 0.000145s
    func eval_poly_at exec in 0.000013s
    func check_proof_single exec in 0.001314s

kzg_proofs.py
    func generate_setup exec in 0.004300s
    func commit_to_poly exec in 0.000181s
    func eval_poly_at exec in 0.000005s
    func check_proof_single exec in 0.001022s
    func eval_poly_at exec in 0.000006s
    func compute_proof_multi exec in 0.000119s
    func check_proof_multi exec in 0.002404s

Previous version:

fk20_multi.py
    func generate_setup exec in 22.170851s
    func data_availabilty_using_fk20_multi exec in 25.432907s
    func check_proof_multi exec in 0.363934s

fk20_single.py
    func generate_setup exec in 0.685386s
    func commit_to_poly exec in 0.001058s
    func eval_poly_at exec in 0.000012s
    func check_proof_single exec in 0.322271s

kzg_proofs.py
    func generate_setup exec in 0.647586s
    func commit_to_poly exec in 0.001214s
    func eval_poly_at exec in 0.000011s
    func check_proof_single exec in 0.306913s
    func eval_poly_at exec in 0.000006s
    func compute_proof_multi exec in 0.001027s
    func check_proof_multi exec in 0.267182s