Skip to content

Commit

Permalink
Add NID constants for Brainpool curves
Browse files Browse the repository at this point in the history
Brainpool curves are used by European government organizations that are
suspicious of the NIST curves. Brainpool curves are very similar to NIST
curves with one critical difference: the parameters to Brainpool are
nothing-up-my-sleeve numbers [0].

The actual values of the NID constants have been taken from the OpenSSL
source code [1].

[0]: https://github.com/veorq/numsgen#seeds

[1]: https://github.com/openssl/openssl/blob/4e6647506331fc3b3ef5b23e5dbe188279ddd575/include/openssl/obj_mac.h#L4759
  • Loading branch information
wiktor-k committed Oct 27, 2022
1 parent bbdcaf7 commit 123f9d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openssl-sys/src/obj_mac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ pub const NID_sect409k1: c_int = 731;
pub const NID_sect409r1: c_int = 732;
pub const NID_sect571k1: c_int = 733;
pub const NID_sect571r1: c_int = 734;
pub const NID_brainpoolP256r1: c_int = 927;
pub const NID_brainpoolP384r1: c_int = 931;
pub const NID_brainpoolP512r1: c_int = 933;
pub const NID_wap_wsg_idm_ecid_wtls1: c_int = 735;
pub const NID_wap_wsg_idm_ecid_wtls3: c_int = 736;
pub const NID_wap_wsg_idm_ecid_wtls4: c_int = 737;
Expand Down
3 changes: 3 additions & 0 deletions openssl/src/nid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ impl Nid {
pub const SECT409R1: Nid = Nid(ffi::NID_sect409r1);
pub const SECT571K1: Nid = Nid(ffi::NID_sect571k1);
pub const SECT571R1: Nid = Nid(ffi::NID_sect571r1);
pub const BRAINPOOL_P256R1: Nid = Nid(ffi::NID_brainpoolP256r1);
pub const BRAINPOOL_P384R1: Nid = Nid(ffi::NID_brainpoolP384r1);
pub const BRAINPOOL_P512R1: Nid = Nid(ffi::NID_brainpoolP512r1);
pub const WAP_WSG_IDM_ECID_WTLS1: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls1);
pub const WAP_WSG_IDM_ECID_WTLS3: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls3);
pub const WAP_WSG_IDM_ECID_WTLS4: Nid = Nid(ffi::NID_wap_wsg_idm_ecid_wtls4);
Expand Down

0 comments on commit 123f9d6

Please sign in to comment.