INNER CODE UNIT · Rust
from
IronCoreLabs/recrypt-rs · src/internal/mod.rs:123
fn from(api_pk: &'a api::PrivateKey) -> Self {
PrivateKey {
value: Fp256::from(api_pk.to_bytes_32()).to_monty(),
}
}
}
impl PrivateKey<fp_256::Monty> {
pub fn from_fp256(fp256: fp_256::Monty) -> PrivateKey<fp_256::Monty> {
PrivateKey { value: fp256 }
}
}
impl From<api_480::PrivateKey> for PrivateKey<fp_480::Monty> {
fn from(api_pk: api_480::PrivateKey) -> Self {
PrivateKey {
value: Fp480::from(api_pk.to_bytes_60()).to_monty(),
}