crate-crypto / Ed448-Goldilocks

24 stars 12 forks source link

Implement Saturated limb arithmetic #17

Closed kevaundray closed 4 years ago

kevaundray commented 4 years ago

When squaring the following:

let mut bytes = [ 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, ];

~The result is 4, which is clearly incorrect~. Following: https://eprint.iacr.org/2019/1304.pdf , I think it would be sensible to use those formulas and double back onto radix-28 when we have the time. This also will close #15 .

I think we will still need to implement the fully saturated limbs!