INNER CODE UNIT · Rust

to_bytes

IronCoreLabs/recrypt-rs · src/internal/mod.rs:104

    fn to_bytes(&self) -> ByteVector {
        self.value.to_bytes()
    }
}

#[derive(Copy, Clone, Debug, Default)]
#[cfg_attr(test, derive(PartialEq))]
pub struct PrivateKey<T> {
    pub value: T,
}
impl From<api::PrivateKey> for PrivateKey<fp_256::Monty> {
    fn from(api_pk: api::PrivateKey) -> Self {
        PrivateKey {
            value: Fp256::from(api_pk.to_bytes_32()).to_monty(),
        }
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…