pub struct MAC<G: AffineRepr> {
pub A: G,
pub e: G::ScalarField,
pub s: G::ScalarField,
}Expand description
MAC of list of messages
Fields§
§A: G§e: G::ScalarFieldCalled r in the paper
s: G::ScalarFieldImplementations§
Source§impl<G: AffineRepr> MAC<G>
impl<G: AffineRepr> MAC<G>
pub fn new<R: RngCore>( rng: &mut R, messages: &[G::ScalarField], secret_key: &SecretKey<G::ScalarField>, params: impl AsRef<MACParams<G>>, ) -> Result<Self, KVACError>
Sourcepub fn new_with_committed_messages<R: RngCore>(
rng: &mut R,
commitment: &G,
uncommitted_messages: BTreeMap<usize, &G::ScalarField>,
sk: &SecretKey<G::ScalarField>,
params: impl AsRef<MACParams<G>>,
) -> Result<Self, KVACError>
pub fn new_with_committed_messages<R: RngCore>( rng: &mut R, commitment: &G, uncommitted_messages: BTreeMap<usize, &G::ScalarField>, sk: &SecretKey<G::ScalarField>, params: impl AsRef<MACParams<G>>, ) -> Result<Self, KVACError>
Issuer creates a MAC on some blinded attributes.
This is for “Blind Issuance” mentioned in section 4.2 of the paper with a modification, the issuer does not
contribute any randomness that goes towards s
pub fn verify( &self, messages: &[G::ScalarField], sk: impl AsRef<G::ScalarField>, params: impl AsRef<MACParams<G>>, ) -> Result<(), KVACError>
Sourcepub fn unblind(self, blinding: &G::ScalarField) -> Self
pub fn unblind(self, blinding: &G::ScalarField) -> Self
Used to unblind a blinded MAC from signer
Trait Implementations§
Source§impl<G: AffineRepr> CanonicalDeserialize for MAC<G>
impl<G: AffineRepr> CanonicalDeserialize for MAC<G>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
The general deserialize method that takes in customization flags.
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<G: AffineRepr> CanonicalSerialize for MAC<G>
impl<G: AffineRepr> CanonicalSerialize for MAC<G>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
The general serialize method that takes in customization flags.
fn serialized_size(&self, compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<G: Clone + AffineRepr> Clone for MAC<G>where
G::ScalarField: Clone,
impl<G: Clone + AffineRepr> Clone for MAC<G>where
G::ScalarField: Clone,
Source§impl<G: Debug + AffineRepr> Debug for MAC<G>where
G::ScalarField: Debug,
impl<G: Debug + AffineRepr> Debug for MAC<G>where
G::ScalarField: Debug,
Source§impl<'de, G: AffineRepr> Deserialize<'de> for MAC<G>
impl<'de, G: AffineRepr> Deserialize<'de> for MAC<G>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<G: AffineRepr> Drop for MAC<G>
impl<G: AffineRepr> Drop for MAC<G>
impl<G: Eq + AffineRepr> Eq for MAC<G>where
G::ScalarField: Eq,
Source§impl<G: PartialEq + AffineRepr> PartialEq for MAC<G>where
G::ScalarField: PartialEq,
impl<G: PartialEq + AffineRepr> PartialEq for MAC<G>where
G::ScalarField: PartialEq,
Source§impl<G: AffineRepr> Serialize for MAC<G>
impl<G: AffineRepr> Serialize for MAC<G>
impl<G: AffineRepr> StructuralPartialEq for MAC<G>
Source§impl<G: AffineRepr> Valid for MAC<G>
impl<G: AffineRepr> Valid for MAC<G>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
Auto Trait Implementations§
impl<G> Freeze for MAC<G>
impl<G> RefUnwindSafe for MAC<G>
impl<G> Send for MAC<G>
impl<G> Sync for MAC<G>
impl<G> Unpin for MAC<G>
impl<G> UnsafeUnpin for MAC<G>
impl<G> UnwindSafe for MAC<G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more