INNER CODE UNIT · Rust

new

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

    pub fn new(point: HomogeneousPoint<T>) -> PublicKey<T> {
        PublicKey { value: point }
    }

    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> {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…