zk-token_sdk: define defaults for pod ElGamal/AES ciphertexts (#22532)

This commit is contained in:
samkim-crypto 2022-01-20 17:27:31 -04:00 committed by GitHub
parent a2d251ce1e
commit 41fb98c771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -19,7 +19,7 @@ impl fmt::Debug for ElGamalCiphertext {
}
}
#[derive(Clone, Copy, Pod, Zeroable, PartialEq)]
#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq)]
#[repr(transparent)]
pub struct ElGamalPubkey(pub [u8; 32]);
@ -29,7 +29,7 @@ impl fmt::Debug for ElGamalPubkey {
}
}
#[derive(Clone, Copy, Pod, Zeroable, PartialEq)]
#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq)]
#[repr(transparent)]
pub struct PedersenCommitment(pub [u8; 32]);
@ -39,7 +39,7 @@ impl fmt::Debug for PedersenCommitment {
}
}
#[derive(Clone, Copy, Pod, Zeroable, PartialEq)]
#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq)]
#[repr(transparent)]
pub struct PedersenDecryptHandle(pub [u8; 32]);
@ -114,3 +114,9 @@ impl fmt::Debug for AeCiphertext {
write!(f, "{:?}", self.0)
}
}
impl Default for AeCiphertext {
fn default() -> Self {
Self::zeroed()
}
}