INNER CODE UNIT · Rust

from_x_y

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

    pub fn from_x_y(x: T, y: T) -> ErrorOr<PublicKey<T>> {
        Ok(HomogeneousPoint::from_x_y((x, y)).map(|value| PublicKey { value })?)
    }
}

impl PublicKey<fp_256::Monty> {
    pub fn to_byte_vectors_32(&self) -> Option<([u8; 32], [u8; 32])> {
        self.value
            .normalize()
            .map(|(x, y)| (x.to_bytes_32(), y.to_bytes_32()))
    }
}

impl PublicKey<fp_480::Monty> {
    pub fn to_byte_vectors_60(&self) -> Option<([u8; 60], [u8; 60])> {
        self.value
            .normalize()
            .map(|(x, y)| (x.to_bytes_60(), y.to_bytes_60()))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…