Implement common traits

This commit is contained in:
daxpedda
2021-06-22 20:46:34 -07:00
committed by Kevin Lewi
parent 48590056ca
commit eb59676a94
9 changed files with 218 additions and 64 deletions
+3 -1
View File
@@ -12,12 +12,14 @@ use generic_array::GenericArray;
use rand::{CryptoRng, RngCore};
/// Used to store the OPRF input and blinding factor
#[derive(Clone)]
pub struct Token<Grp: Group> {
pub(crate) data: Vec<u8>,
pub(crate) blind: Grp::Scalar,
}
impl_clone_for!(struct Token<Grp: Group>, [data, blind]);
impl_debug_eq_hash_for!(struct Token<Grp: Group>, [data, blind], [Grp::Scalar]);
static STR_VOPRF: &[u8] = b"VOPRF06-HashToGroup-";
static STR_VOPRF_FINALIZE: &[u8] = b"VOPRF06-Finalize-";
static MODE_BASE: u8 = 0x00;