circl
circl copied to clipboard
Implement MAYO
We chose to implement the newer version of MAYO proposed by the authors instead of the one submitted to NIST.
The authors proposed the change to the spec here: "Nibbling MAYO: Optimized Implementations for AVX2 and Cortex-M4" by Ward Beullens, Fabio Campos, Sofía Celi, Basil Hess, Matthias J. Kannwischer.
This pure Go code is written based on the tricks described in that paper and in their reference C code, specifically the nibbling-mayo branch.
It also passes the KAT tests.
Closes https://github.com/cloudflare/circl/issues/482
Thank you for this. I will review over the coming days.
This is only a partial review. There is a lot to like in here, but it still needs work to be easier to review: you need to explain how things are encoded, computed, etc.
Also, did you implement this from scratch or did you translate an existing implementation?
Thanks for pointing out things to consider. No, it is not written not from scratch. The code basically follows the thought process of the reference code.
Thanks for pointing out things to consider. No, it is not written not from scratch. The code basically follows the thought process of the reference code.
You should add a comment acknowledging on which code you've based yours, and mention its license (and make sure it's compatible with Circl's license.)
Thanks for pointing out things to consider. No, it is not written not from scratch. The code basically follows the thought process of the reference code.
You should add a comment acknowledging on which code you've based yours, and mention its license (and make sure it's compatible with Circl's license.)
about the licensing, I think it suffices to add a line in the gen.go file something such as:
This implementation is a port from the C implementation of MAYO [link} distributed under <LICENSE>.
and there is no need to include the NOTICE and LICENSE files.
@ilway25 Thank you so much for the quick changes on our preliminary review. I'll be travelling for another week. After that I'll sit down and continue the review. Thanks again.
The code improved a lot. Still it needs better documentation on the actual arithmetic to make review easier.