Remove CipherSuite (#20)

* Remove `Hash`

* Remove `CipherSuite`

* Remove single field `struct`s
This commit is contained in:
daxpedda
2021-10-05 15:53:18 -07:00
committed by GitHub
parent 2d8780476a
commit 6fb4cad59c
13 changed files with 519 additions and 569 deletions
+7 -3
View File
@@ -14,8 +14,8 @@ pub(crate) mod p256;
mod ristretto;
use crate::errors::InternalError;
use crate::hash::Hash;
use core::ops::{Add, Mul, Sub};
use digest::{BlockInput, Digest};
use generic_array::{ArrayLength, GenericArray};
use rand::{CryptoRng, RngCore};
use zeroize::Zeroize;
@@ -33,10 +33,14 @@ pub trait Group:
const SUITE_ID: usize;
/// transforms a password and domain separation tag (DST) into a curve point
fn hash_to_curve<H: Hash>(msg: &[u8], dst: &[u8]) -> Result<Self, InternalError>;
fn hash_to_curve<H: BlockInput + Digest>(msg: &[u8], dst: &[u8])
-> Result<Self, InternalError>;
/// Hashes a slice of pseudo-random bytes to a scalar
fn hash_to_scalar<H: Hash>(input: &[u8], dst: &[u8]) -> Result<Self::Scalar, InternalError>;
fn hash_to_scalar<H: BlockInput + Digest>(
input: &[u8],
dst: &[u8],
) -> Result<Self::Scalar, InternalError>;
/// The type of base field scalars
type Scalar: Zeroize