Skip to content

Commit

Permalink
Merge pull request #45 from trussed-dev/main
Browse files Browse the repository at this point in the history
Add secp256k1 to mechanism enum
  • Loading branch information
sosthene-nitrokey authored Oct 28, 2024
2 parents 92dd7f0 + ccbbe3b commit a39c670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ pub enum Kind {
BrainpoolP384R1,
BrainpoolP512R1,
X255,
Secp256k1,
}

bitflags::bitflags! {
Expand Down Expand Up @@ -221,6 +222,7 @@ impl Kind {
Kind::BrainpoolP256R1 => 12,
Kind::BrainpoolP384R1 => 13,
Kind::BrainpoolP512R1 => 14,
Kind::Secp256k1 => 15,
}
}

Expand All @@ -240,6 +242,7 @@ impl Kind {
12 => Kind::BrainpoolP256R1,
13 => Kind::BrainpoolP384R1,
14 => Kind::BrainpoolP512R1,
15 => Kind::Secp256k1,
_ => return Err(Error::InvalidSerializedKey),
})
}
Expand Down
2 changes: 2 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ pub enum Mechanism {
BrainpoolP384R1Prehashed,
BrainpoolP512R1,
BrainpoolP512R1Prehashed,
Secp256k1,
Secp256k1Prehashed,
// clients can also do hashing by themselves
Sha256,
Tdes,
Expand Down

0 comments on commit a39c670

Please sign in to comment.