Shift from_bytes into the Point impl.

Looks like we were also computing our test cases in a slightly sketchy
way, and just testing that we failed in exactly the same way. We do, but
now we generate better test data.
This commit is contained in:
2019-05-18 17:38:55 -07:00
parent 44618c2e2f
commit b42902e6ab
4 changed files with 3137 additions and 2121 deletions

View File

@@ -5,7 +5,6 @@ mod point;
use digest::Digest;
use rand::Rng;
use sha2::Sha512;
use self::fe::*;
use self::point::*;
#[cfg(test)]
use testing::run_test;
@@ -134,8 +133,7 @@ impl ED25519Public {
return false;
}
let mut a = Point::new();
x25519_ge_frombytes_vartime(&mut a, &self.public);
let mut a = Point::from_bytes(&self.public).unwrap(); // FIXME!!
a.invert();
let h_digest = eddsa_digest(signature_r, &self.public, msg);
let h = digest_scalar(&h_digest);