Adding p256 support and no_std CI (#2)

This commit is contained in:
Kevin Lewi
2021-09-09 02:59:11 -07:00
committed by GitHub
parent bb4b9d0909
commit fe3222d148
6 changed files with 53 additions and 107 deletions
+14 -11
View File
@@ -89,26 +89,29 @@ fn populate_test_vectors(values: &Value) -> VOPRFTestVectorParameters {
}
}
struct Ristretto255Sha512;
impl CipherSuite for Ristretto255Sha512 {
type Group = RistrettoPoint;
type Hash = Sha512;
}
#[test]
fn tests() -> Result<(), InternalError> {
struct Ristretto255Sha512;
impl CipherSuite for Ristretto255Sha512 {
type Group = RistrettoPoint;
type Hash = Sha512;
}
test_blind::<Ristretto255Sha512>(OPRF_RISTRETTO255_SHA512)?;
test_evaluate::<Ristretto255Sha512>(OPRF_RISTRETTO255_SHA512)?;
test_finalize::<Ristretto255Sha512>(OPRF_RISTRETTO255_SHA512)?;
#[cfg(feature = "p256")]
{
use p256_::ProjectivePoint;
use sha2::Sha256;
struct P256Sha256;
impl CipherSuite for P256Sha256 {
type Group = p256_::ProjectivePoint;
type Hash = sha2::Sha256;
}
test_blind::<ProjectivePoint, Sha256>(OPRF_P256_SHA256)?;
test_evaluate::<ProjectivePoint>(OPRF_P256_SHA256)?;
test_finalize::<ProjectivePoint, Sha256>(OPRF_P256_SHA256)?;
test_blind::<P256Sha256>(OPRF_P256_SHA256)?;
test_evaluate::<P256Sha256>(OPRF_P256_SHA256)?;
test_finalize::<P256Sha256>(OPRF_P256_SHA256)?;
}
Ok(())