Skip to content

Commit

Permalink
Move Ed25519 private key into Box
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Oct 25, 2023
1 parent 3c838e1 commit e523567
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aws-lc-rs/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl VerificationAlgorithm for EdDSAParameters {
/// An Ed25519 key pair, for signing.
#[allow(clippy::module_name_repetitions)]
pub struct Ed25519KeyPair {
private_key: [u8; ED25519_PRIVATE_KEY_LEN],
private_key: Box<[u8; ED25519_PRIVATE_KEY_LEN]>,
public_key: PublicKey,
}

Expand Down Expand Up @@ -287,7 +287,7 @@ impl Ed25519KeyPair {
.map_err(|_| KeyRejected::inconsistent_components())?;

Ok(Self {
private_key,
private_key: Box::new(private_key),
public_key: PublicKey(derived_public_key),
})
}
Expand Down Expand Up @@ -352,7 +352,7 @@ impl Ed25519KeyPair {
private_key[ED25519_PRIVATE_KEY_SEED_LEN..].copy_from_slice(&public_key);

let key_pair = Self {
private_key,
private_key: Box::new(private_key),
public_key: PublicKey(public_key),
};

Expand Down

0 comments on commit e523567

Please sign in to comment.