Skip to content

Commit 1500b64

Browse files
committed
KBKDF: Use FIPS/OpenSSL compatible params
Signed-off-by: Jakub Jelen <[email protected]>
1 parent c5e6cac commit 1500b64

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

cryptoki/tests/basic.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,9 +2293,9 @@ fn kbkdf_counter_mode() -> TestResult {
22932293
// Some variables we will use throughout
22942294
let counter_format = KbkdfCounterFormat::new(Endianness::Big, NonZeroUsize::new(16).unwrap());
22952295
let dkm_length_format = KbkdfDkmLengthFormat::new(
2296-
KbkdfDkmLengthMethod::SumOfKeys,
2296+
KbkdfDkmLengthMethod::SumOfSegments,
22972297
Endianness::Big,
2298-
NonZeroUsize::new(16).unwrap(),
2298+
NonZeroUsize::new(32).unwrap(),
22992299
);
23002300

23012301
// Instantiate KBKDF in counter-mode without additional keys
@@ -2388,7 +2388,7 @@ fn kbkdf_feedback_mode() -> TestResult {
23882388
let dkm_length_format = KbkdfDkmLengthFormat::new(
23892389
KbkdfDkmLengthMethod::SumOfKeys,
23902390
Endianness::Big,
2391-
NonZeroUsize::new(16).unwrap(),
2391+
NonZeroUsize::new(32).unwrap(),
23922392
);
23932393

23942394
/* FEEDBACK-MODE - no IV */
@@ -2502,9 +2502,9 @@ fn kbkdf_double_pipeline_mode() -> TestResult {
25022502

25032503
// Some variables we will use throughout
25042504
let dkm_length_format = KbkdfDkmLengthFormat::new(
2505-
KbkdfDkmLengthMethod::SumOfKeys,
2505+
KbkdfDkmLengthMethod::SumOfSegments,
25062506
Endianness::Big,
2507-
NonZeroUsize::new(16).unwrap(),
2507+
NonZeroUsize::new(32).unwrap(),
25082508
);
25092509

25102510
// Instantiate KBKDF in feedback-mode without additional keys
@@ -2611,9 +2611,9 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
26112611
// Some variables we will use throughout
26122612
let counter_format = KbkdfCounterFormat::new(Endianness::Big, NonZeroUsize::new(16).unwrap());
26132613
let dkm_length_format = KbkdfDkmLengthFormat::new(
2614-
KbkdfDkmLengthMethod::SumOfKeys,
2614+
KbkdfDkmLengthMethod::SumOfSegments,
26152615
Endianness::Big,
2616-
NonZeroUsize::new(16).unwrap(),
2616+
NonZeroUsize::new(32).unwrap(),
26172617
);
26182618

26192619
// Instantiate KBKDF in counter-mode without additional keys
@@ -2769,7 +2769,7 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
27692769
let dkm_length_format = KbkdfDkmLengthFormat::new(
27702770
KbkdfDkmLengthMethod::SumOfKeys,
27712771
Endianness::Big,
2772-
NonZeroUsize::new(16).unwrap(),
2772+
NonZeroUsize::new(32).unwrap(),
27732773
);
27742774

27752775
let mut derived_keys = vec![];
@@ -2951,9 +2951,9 @@ fn kbkdf_additional_keys_double_pipeline_mode() -> TestResult {
29512951

29522952
// Some variables we will use throughout
29532953
let dkm_length_format = KbkdfDkmLengthFormat::new(
2954-
KbkdfDkmLengthMethod::SumOfKeys,
2954+
KbkdfDkmLengthMethod::SumOfSegments,
29552955
Endianness::Big,
2956-
NonZeroUsize::new(16).unwrap(),
2956+
NonZeroUsize::new(32).unwrap(),
29572957
);
29582958

29592959
// Instantiate KBKDF in feedback-mode without additional keys
@@ -3085,9 +3085,9 @@ fn kbkdf_invalid_data_params_counter_mode() -> TestResult {
30853085
// Some variables we will use throughout
30863086
let counter_format = KbkdfCounterFormat::new(Endianness::Big, NonZeroUsize::new(16).unwrap());
30873087
let dkm_length_format = KbkdfDkmLengthFormat::new(
3088-
KbkdfDkmLengthMethod::SumOfKeys,
3088+
KbkdfDkmLengthMethod::SumOfSegments,
30893089
Endianness::Big,
3090-
NonZeroUsize::new(16).unwrap(),
3090+
NonZeroUsize::new(32).unwrap(),
30913091
);
30923092

30933093
/* MISSING ITERATION VARIABLE */
@@ -3234,9 +3234,9 @@ fn kbkdf_invalid_data_params_feedback_mode() -> TestResult {
32343234
// Some variables we will use throughout
32353235
let counter_format = KbkdfCounterFormat::new(Endianness::Big, NonZeroUsize::new(16).unwrap());
32363236
let dkm_length_format = KbkdfDkmLengthFormat::new(
3237-
KbkdfDkmLengthMethod::SumOfKeys,
3237+
KbkdfDkmLengthMethod::SumOfSegments,
32383238
Endianness::Big,
3239-
NonZeroUsize::new(16).unwrap(),
3239+
NonZeroUsize::new(32).unwrap(),
32403240
);
32413241

32423242
/* MISSING ITERATION VARIABLE */
@@ -3357,9 +3357,9 @@ fn kbkdf_invalid_data_params_double_pipeline_mode() -> TestResult {
33573357
// Some variables we will use throughout
33583358
let counter_format = KbkdfCounterFormat::new(Endianness::Big, NonZeroUsize::new(16).unwrap());
33593359
let dkm_length_format = KbkdfDkmLengthFormat::new(
3360-
KbkdfDkmLengthMethod::SumOfKeys,
3360+
KbkdfDkmLengthMethod::SumOfSegments,
33613361
Endianness::Big,
3362-
NonZeroUsize::new(16).unwrap(),
3362+
NonZeroUsize::new(32).unwrap(),
33633363
);
33643364

33653365
/* MISSING ITERATION VARIABLE */

0 commit comments

Comments
 (0)