diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-05-12 14:14:31 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-05-22 12:00:10 +0200 |
commit | 3e84692aa4cbf047ca8fb16ca424deed8d9c3769 (patch) | |
tree | a757a823b9fc1ea184ed48dc270c7c457017ee0e /openpgp/src/crypto/backend/nettle | |
parent | 2245b12bb056a390a5bb3541ce72ef66835297e6 (diff) |
openpgp: Deduplicate Key::import_secret_ed25519.
Diffstat (limited to 'openpgp/src/crypto/backend/nettle')
-rw-r--r-- | openpgp/src/crypto/backend/nettle/asymmetric.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/openpgp/src/crypto/backend/nettle/asymmetric.rs b/openpgp/src/crypto/backend/nettle/asymmetric.rs index a83c5c1f..debb8a5b 100644 --- a/openpgp/src/crypto/backend/nettle/asymmetric.rs +++ b/openpgp/src/crypto/backend/nettle/asymmetric.rs @@ -393,30 +393,6 @@ use crate::types::PublicKeyAlgorithm; impl<R> Key4<SecretParts, R> where R: key::KeyRole, { - /// Creates a new OpenPGP secret key packet for an existing Ed25519 key. - /// - /// The ECDH key will use hash algorithm `hash` and symmetric - /// algorithm `sym`. If one or both are `None` secure defaults - /// will be used. The key will have it's creation date set to - /// `ctime` or the current time if `None` is given. - pub fn import_secret_ed25519<T>(private_key: &[u8], ctime: T) - -> Result<Self> where T: Into<Option<SystemTime>> - { - let mut public_key = [0; ed25519::ED25519_KEY_SIZE]; - ed25519::public_key(&mut public_key, private_key).unwrap(); - - Self::with_secret( - ctime.into().unwrap_or_else(crate::now), - PublicKeyAlgorithm::EdDSA, - mpi::PublicKey::EdDSA { - curve: Curve::Ed25519, - q: MPI::new_compressed_point(&public_key), - }, - mpi::SecretKeyMaterial::EdDSA { - scalar: private_key.into(), - }.into()) - } - /// Creates a new OpenPGP public key packet for an existing RSA key. /// /// The RSA key will use public exponent `e` and modulo `n`. The key will |