Use crypto-bigint's reduction in ed448

Achieves feasible performance in the ed448 which makes it potentially viable
for real world usage.

Accordingly prepares a new release, updating the README.
This commit is contained in:
Luke Parker
2023-04-19 02:25:19 -04:00
parent 21026136bd
commit 334873b6a5
6 changed files with 33 additions and 11 deletions

View File

@@ -6,6 +6,13 @@ use crypto_bigint::{U512, U1024};
#[derive(Clone, Copy, PartialEq, Eq, Default, Debug, Zeroize)]
pub struct FieldElement(pub(crate) U512);
const MODULUS_PADDED_STR: &str = concat!(
"00000000000000",
"00",
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffe",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
);
const MODULUS_STR: &str = concat!(
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffe",
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
@@ -33,6 +40,7 @@ pub(crate) const Q_4: FieldElement =
field!(
FieldElement,
MODULUS_PADDED_STR,
MODULUS_STR,
MODULUS,
WIDE_MODULUS,