Make traits public to allow PCC to use formatting traits
This commit is contained in:
@@ -48,7 +48,7 @@ pub mod proofs;
|
||||
pub mod scheme;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
mod traits;
|
||||
pub mod traits;
|
||||
mod utils;
|
||||
|
||||
pub type Attribute = Scalar;
|
||||
|
||||
@@ -29,7 +29,7 @@ use crate::error::{CoconutError, Result};
|
||||
use crate::scheme::setup::Parameters;
|
||||
use crate::scheme::VerificationKey;
|
||||
use crate::utils::{hash_g1, try_deserialize_scalar, try_deserialize_scalar_vec};
|
||||
use crate::{elgamal, Attribute, Bytable, ElGamalKeyPair};
|
||||
use crate::{elgamal, Attribute, ElGamalKeyPair};
|
||||
|
||||
// as per the reference python implementation
|
||||
type ChallengeDigest = Sha256;
|
||||
|
||||
@@ -73,6 +73,14 @@ impl ThetaCovid {
|
||||
bytes
|
||||
}
|
||||
|
||||
pub fn to_bytes_tuple(&self) -> ([u8; 96], [u8; 96], Vec<u8>) {
|
||||
let blinded_message_bytes = self.blinded_message.to_affine().to_compressed();
|
||||
let credential_bytes = self.credential.to_bytes();
|
||||
let proof_bytes = self.pi_v.to_bytes();
|
||||
|
||||
(blinded_message_bytes, credential_bytes, proof_bytes)
|
||||
}
|
||||
|
||||
pub fn from_bytes(bytes: &[u8]) -> Result<ThetaCovid> {
|
||||
if bytes.len() < 192 {
|
||||
return Err(
|
||||
|
||||
Reference in New Issue
Block a user