Skip to content

Commit

Permalink
Add brainpool mechanisms
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Jul 16, 2024
1 parent 0ccdd46 commit 540ad72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ pub enum Kind {
P256,
P384,
P521,
BrainpoolP256R1,
BrainpoolP384R1,
BrainpoolP512R1,
X255,
}

Expand Down Expand Up @@ -215,6 +218,9 @@ impl Kind {
Kind::Rsa4096 => 9,
Kind::P384 => 10,
Kind::P521 => 11,
Kind::BrainpoolP256R1 => 12,
Kind::BrainpoolP384R1 => 13,
Kind::BrainpoolP512R1 => 14,
}
}

Expand All @@ -231,6 +237,9 @@ impl Kind {
9 => Kind::Rsa4096,
10 => Kind::P384,
11 => Kind::P521,
12 => Kind::BrainpoolP256R1,
13 => Kind::BrainpoolP384R1,
14 => Kind::BrainpoolP512R1,
_ => return Err(Error::InvalidSerializedKey),
})
}
Expand Down
6 changes: 6 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,12 @@ pub enum Mechanism {
P384Prehashed,
P521,
P521Prehashed,
BrainpoolP256R1,
BrainpoolP256R1Prehashed,
BrainpoolP384R1,
BrainpoolP384R1Prehashed,
BrainpoolP512R1,
BrainpoolP512R1Prehashed,
// clients can also do hashing by themselves
Sha256,
Tdes,
Expand Down

0 comments on commit 540ad72

Please sign in to comment.