pub struct Sm2Ciphertext {
pub x: U256,
pub y: U256,
pub hash: [u8; 32],
pub ciphertext: Vec<u8>,
}Expand description
Parsed SM2 ciphertext components.
x and y are the affine coordinates of C1 = kG; hash is C3,
the SM3 digest computed during encryption; ciphertext is C2, the
KDF-XOR’d plaintext.
Fields§
§x: U256C1.x.
y: U256C1.y.
hash: [u8; 32]C3 = SM3(x2 || M || y2). Always 32 bytes.
ciphertext: Vec<u8>C2 = M XOR KDF(x2 || y2, |M|). Length matches plaintext length.
Trait Implementations§
Source§impl Clone for Sm2Ciphertext
impl Clone for Sm2Ciphertext
Source§fn clone(&self) -> Sm2Ciphertext
fn clone(&self) -> Sm2Ciphertext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Sm2Ciphertext
impl RefUnwindSafe for Sm2Ciphertext
impl Send for Sm2Ciphertext
impl Sync for Sm2Ciphertext
impl Unpin for Sm2Ciphertext
impl UnsafeUnpin for Sm2Ciphertext
impl UnwindSafe for Sm2Ciphertext
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