Skip to content

Commit

Permalink
Derive public key from private key
Browse files Browse the repository at this point in the history
  • Loading branch information
devonh committed Sep 4, 2024
1 parent 4900fee commit 723c1b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pk_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ impl TryFrom<PkDecryptionPickle> for PkDecryption {
type Error = crate::LibolmPickleError;

fn try_from(pickle: PkDecryptionPickle) -> Result<Self, Self::Error> {
Ok(Self {
key: Curve25519SecretKey::from_slice(&pickle.private_curve25519_key),
public_key: Curve25519PublicKey::from_slice(&pickle.public_curve25519_key)?,
})
let key = Curve25519SecretKey::from_slice(&pickle.private_curve25519_key);
let public_key = Curve25519PublicKey::from(&key);

Ok(Self { key, public_key })
}
}

Expand Down

0 comments on commit 723c1b2

Please sign in to comment.