Inversed-Tech / eyelid

Private iris matching
Apache License 2.0
0 stars 0 forks source link

Add a generic `YasheConf` trait and use it instead of an inner config struct #80

Closed teor2345 closed 2 months ago

teor2345 commented 2 months ago

This PR depends on #79.

This PR changes the YasheParams struct into a YasheConf trait. As part of that change, the YasheConf trait is implemented for the existing polynomial config marker structs. There is also a convenience method for converting T to the Coeff type.

YASHE also needs some specific conversions on Coeff, they are added as trait bounds. Unfortunately these bounds need to be repeated on every generic type, impl, and function. (But the compiler will tell you where.)

I fixed a reduction bug in polynomials, where the modular reduction was skipped.

I also changed some clippy lints. I noticed an undocumented unwrap() from a previous PR, this is clearer as an expect().

Close #59.