Use ed25519-compact crate instead of ed25519-dalek

ed25519-dalek does not implement Clone and Eq for secret keys, and
relevant PR in its repository wait for merge from long time ago, leading
to potential problems with maintainability
This commit is contained in:
Egor Duda
2022-05-16 21:48:43 +03:00
parent 0ef0bb23f4
commit 55056b721c
3 changed files with 18 additions and 45 deletions

View File

@@ -844,10 +844,10 @@ impl From<ecdsa::PubKey> for CoseKey {
}
#[cfg(feature = "ed25519")]
impl From<ed25519_dalek::PublicKey> for CoseKey {
fn from(pk: ed25519_dalek::PublicKey) -> Self {
impl From<ed25519_compact::PublicKey> for CoseKey {
fn from(pk: ed25519_compact::PublicKey) -> Self {
CoseKey {
x_bytes: pk.to_bytes(),
x_bytes: *pk,
y_bytes: [0u8; 32],
key_type: CoseKey::OKP_KEY_TYPE,
curve: CoseKey::ED25519_CURVE,