change AESCiphertext to AesCiphertext
This commit is contained in:
@ -106,6 +106,15 @@ impl AesCiphertext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for AesCiphertext {
|
||||||
|
fn default() -> Self {
|
||||||
|
AesCiphertext {
|
||||||
|
nonce: [0_u8; 12],
|
||||||
|
ciphertext: [0_u8; 24],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
@ -70,12 +70,17 @@ pub struct RangeProof128(pub [u8; 736]);
|
|||||||
unsafe impl Zeroable for RangeProof128 {}
|
unsafe impl Zeroable for RangeProof128 {}
|
||||||
unsafe impl Pod for RangeProof128 {}
|
unsafe impl Pod for RangeProof128 {}
|
||||||
|
|
||||||
/// Serialization for AESCiphertext
|
/// Serialization for AesCiphertext
|
||||||
#[derive(Clone, Copy, Pod, Zeroable, PartialEq)]
|
#[derive(Clone, Copy, PartialEq)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
pub struct AESCiphertext(pub [u8; 16]);
|
pub struct AesCiphertext(pub [u8; 36]);
|
||||||
|
|
||||||
impl fmt::Debug for AESCiphertext {
|
// `AesCiphertext` is a Pod and Zeroable.
|
||||||
|
// Add the marker traits manually because `bytemuck` only adds them for some `u8` arrays
|
||||||
|
unsafe impl Zeroable for AesCiphertext {}
|
||||||
|
unsafe impl Pod for AesCiphertext {}
|
||||||
|
|
||||||
|
impl fmt::Debug for AesCiphertext {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{:?}", self.0)
|
write!(f, "{:?}", self.0)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user