Skip to content

Commit a2aceb7

Browse files
committed
cleanup(rustcrypto): remove vestiges of disabled algorithms
Remove all vestiges of the disabled SLHDSASHAKE192f and SLHDSASHAKE256s algorithms from the rustcrypto adapter. This remove all the related module files. No associated code remains for these parameter sets within the rustcrypto adapter, which, effectively, only supports SLH-DSA-SHAKE-128f. Signed-off-by: Nicola Tuveri <nic.tuv@gmail.com> Change-Id: I6a6a6964d33b7e7a359f09aa46dc03ab4c45c273
1 parent 9953880 commit a2aceb7

File tree

9 files changed

+6
-5231
lines changed

9 files changed

+6
-5231
lines changed

src/adapters/rustcrypto.rs

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ const PROPERTY_DEFINITION: &CStr = c"x.author='QUBIP',x.qubip.adapter='rustcrypt
1919

2020
#[allow(non_snake_case)]
2121
pub(crate) mod SLHDSASHAKE128f;
22-
#[cfg(any())] // module disabled
23-
#[allow(non_snake_case)]
24-
pub(crate) mod SLHDSASHAKE192f;
25-
#[cfg(any())] // module disabled
26-
#[allow(non_snake_case)]
27-
pub(crate) mod SLHDSASHAKE256s;
2822

2923
#[derive(Debug)]
3024
struct RustCryptoAdapter;
@@ -34,19 +28,13 @@ impl AdapterContextTrait for RustCryptoAdapter {
3428
fn register_algorithms(&self, handle: &mut super::AdaptersHandle) -> Result<(), aurora::Error> {
3529
trace!(target: log_target!(), "{}", "Called!");
3630

37-
let signature_algorithms = Box::new([
38-
algorithm_to_register!(SLHDSASHAKE128f, SIG_FUNCTIONS),
39-
//algorithm_to_register!(SLHDSASHAKE192f, SIG_FUNCTIONS),
40-
//algorithm_to_register!(SLHDSASHAKE256s, SIG_FUNCTIONS),
41-
]);
31+
let signature_algorithms =
32+
Box::new([algorithm_to_register!(SLHDSASHAKE128f, SIG_FUNCTIONS)]);
4233
// ownership transfers to the iterator which is transferred to the handle
4334
handle.register_algorithms(OSSL_OP_SIGNATURE, signature_algorithms.into_iter())?;
4435

45-
let keymgmt_algorithms = Box::new([
46-
algorithm_to_register!(SLHDSASHAKE128f, KMGMT_FUNCTIONS),
47-
//algorithm_to_register!(SLHDSASHAKE192f, KMGMT_FUNCTIONS),
48-
//algorithm_to_register!(SLHDSASHAKE256s, KMGMT_FUNCTIONS),
49-
]);
36+
let keymgmt_algorithms =
37+
Box::new([algorithm_to_register!(SLHDSASHAKE128f, KMGMT_FUNCTIONS)]);
5038
// ownership transfers to the iterator which is transferred to the handle
5139
handle.register_algorithms(OSSL_OP_KEYMGMT, keymgmt_algorithms.into_iter())?;
5240

@@ -55,12 +43,6 @@ impl AdapterContextTrait for RustCryptoAdapter {
5543
// SLHDSASHAKE128f
5644
decoder_to_register!(SLHDSASHAKE128f, DECODER_DER2SubjectPublicKeyInfo),
5745
decoder_to_register!(SLHDSASHAKE128f, DECODER_DER2PrivateKeyInfo),
58-
// // SLHDSASHAKE192f
59-
// decoder_to_register!(SLHDSASHAKE192f, DECODER_DER2SubjectPublicKeyInfo),
60-
// decoder_to_register!(SLHDSASHAKE192f, DECODER_DER2PrivateKeyInfo),
61-
// // SLHDSASHAKE256s
62-
// decoder_to_register!(SLHDSASHAKE256s, DECODER_DER2SubjectPublicKeyInfo),
63-
// decoder_to_register!(SLHDSASHAKE256s, DECODER_DER2PrivateKeyInfo),
6446
]);
6547

6648
handle.register_algorithms(OSSL_OP_DECODER, decoder_algorithms.into_iter())?;
@@ -71,16 +53,6 @@ impl AdapterContextTrait for RustCryptoAdapter {
7153
encoder_to_register!(SLHDSASHAKE128f, ENCODER_PrivateKeyInfo2PEM),
7254
encoder_to_register!(SLHDSASHAKE128f, ENCODER_SubjectPublicKeyInfo2DER),
7355
encoder_to_register!(SLHDSASHAKE128f, ENCODER_SubjectPublicKeyInfo2PEM),
74-
// // SLHDSASHAKE192f
75-
// encoder_to_register!(SLHDSASHAKE192f, ENCODER_PrivateKeyInfo2DER),
76-
// encoder_to_register!(SLHDSASHAKE192f, ENCODER_PrivateKeyInfo2PEM),
77-
// encoder_to_register!(SLHDSASHAKE192f, ENCODER_SubjectPublicKeyInfo2DER),
78-
// encoder_to_register!(SLHDSASHAKE192f, ENCODER_SubjectPublicKeyInfo2PEM),
79-
// // SLHDSASHAKE256s
80-
// encoder_to_register!(SLHDSASHAKE256s, ENCODER_PrivateKeyInfo2DER),
81-
// encoder_to_register!(SLHDSASHAKE256s, ENCODER_PrivateKeyInfo2PEM),
82-
// encoder_to_register!(SLHDSASHAKE256s, ENCODER_SubjectPublicKeyInfo2DER),
83-
// encoder_to_register!(SLHDSASHAKE256s, ENCODER_SubjectPublicKeyInfo2PEM),
8456
]);
8557

8658
handle.register_algorithms(OSSL_OP_ENCODER, encoder_algorithms.into_iter())?;
@@ -95,11 +67,7 @@ impl AdapterContextTrait for RustCryptoAdapter {
9567
) -> Result<(), aurora::Error> {
9668
trace!(target: log_target!(), "{}", "Called!");
9769

98-
let tls_sigalgs = [
99-
SLHDSASHAKE128f::capabilities::tls_sigalg::OSSL_PARAM_ARRAY,
100-
// SLHDSASHAKE192f::capabilities::tls_sigalg::OSSL_PARAM_ARRAY,
101-
// SLHDSASHAKE256s::capabilities::tls_sigalg::OSSL_PARAM_ARRAY,
102-
];
70+
let tls_sigalgs = [SLHDSASHAKE128f::capabilities::tls_sigalg::OSSL_PARAM_ARRAY];
10371
for a in tls_sigalgs {
10472
let first: &bindings::OSSL_PARAM = a.first().unwrap_or(&CONST_OSSL_PARAM::END);
10573
let ptr: *const bindings::OSSL_PARAM = std::ptr::from_ref(first);
@@ -112,11 +80,7 @@ impl AdapterContextTrait for RustCryptoAdapter {
11280
fn register_obj_sigids(&self, handle: &mut super::AdaptersHandle) -> Result<(), aurora::Error> {
11381
trace!(target: log_target!(), "{}", "Called!");
11482

115-
let obj_sigids = vec![
116-
SLHDSASHAKE128f::OBJ_SIGID,
117-
//SLHDSASHAKE192f::OBJ_SIGID,
118-
//SLHDSASHAKE256s::OBJ_SIGID
119-
];
83+
let obj_sigids = vec![SLHDSASHAKE128f::OBJ_SIGID];
12084

12185
for obj_sigid in obj_sigids {
12286
handle.register_obj_sigid(obj_sigid)?;

0 commit comments

Comments
 (0)