Closed greenhat closed 2 years ago
Starting this one!
@greenhat Rust allows us to define operators like + and * for custom types. Would you like to have such syntactic sugar for the gf2_192
types?
@greenhat Rust allows us to define operators like + and * for custom types. Would you like to have such syntactic sugar for the
gf2_192
types?
Sounds nice! Yes, please.
The bounty is sent. Thank you!
Implementation details
Extract https://github.com/ergoplatform/sigma-rust/blob/develop/ergotree-interpreter/src/sigma_protocol/gf2_192.rs and https://github.com/ergoplatform/sigma-rust/blob/develop/ergotree-interpreter/src/sigma_protocol/gf2_192poly.rs into a separate crate
gf2_192
and implement according to existing implementation in Scala https://github.com/ScorexFoundation/sigmastate-interpreter/blob/prepare-v5.0-evaluator/sigmastate/src/main/java/gf2t/GF2_192.java , https://github.com/ScorexFoundation/sigmastate-interpreter/blob/prepare-v5.0-evaluator/sigmastate/src/main/java/gf2t/GF2_192_Poly.javaTesting
Implement tests according to the tests in Scala version in https://github.com/ScorexFoundation/sigmastate-interpreter/blob/prepare-v5.0-evaluator/sigmastate/src/test/java/gf2t/GF2_192Test.java
References
https://github.com/reyzin/GF2t
Existing Rust implementation for Galois fields GF(2^256): https://github.com/djsweet/galois_2p8 https://github.com/geky/gf256