@@ -455,7 +455,7 @@ fn encrypt_decrypt_multipart() -> TestResult {
455
455
let template = vec ! [
456
456
Attribute :: Token ( true ) ,
457
457
Attribute :: Private ( false ) ,
458
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
458
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
459
459
Attribute :: Encrypt ( true ) ,
460
460
Attribute :: Decrypt ( true ) ,
461
461
] ;
@@ -566,7 +566,7 @@ fn encrypt_decrypt_multipart_already_initialized() -> TestResult {
566
566
let template = vec ! [
567
567
Attribute :: Token ( true ) ,
568
568
Attribute :: Private ( false ) ,
569
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
569
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
570
570
Attribute :: Encrypt ( true ) ,
571
571
Attribute :: Decrypt ( true ) ,
572
572
] ;
@@ -775,7 +775,7 @@ fn session_find_objects() -> testresult::TestResult {
775
775
Attribute :: Token ( true ) ,
776
776
Attribute :: Encrypt ( true ) ,
777
777
Attribute :: Label ( format!( "key_{}" , i) . as_bytes( ) . to_vec( ) ) ,
778
- Attribute :: ValueLen ( 32 . into ( ) ) ,
778
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) . unwrap ( ) ) ,
779
779
Attribute :: Id ( "12345678" . as_bytes( ) . to_vec( ) ) , // reusing the same CKA_ID
780
780
] ;
781
781
@@ -825,7 +825,7 @@ fn session_objecthandle_iterator() -> testresult::TestResult {
825
825
let key_template = vec ! [
826
826
Attribute :: Token ( true ) ,
827
827
Attribute :: Encrypt ( true ) ,
828
- Attribute :: ValueLen ( 32 . into ( ) ) ,
828
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
829
829
Attribute :: Label ( format!( "key_{}" , i) . as_bytes( ) . to_vec( ) ) ,
830
830
Attribute :: Id ( "12345678" . as_bytes( ) . to_vec( ) ) , // reusing the same CKA_ID
831
831
] ;
@@ -915,7 +915,7 @@ fn wrap_and_unwrap_key() {
915
915
916
916
let key_to_be_wrapped_template = vec ! [
917
917
Attribute :: Token ( true ) ,
918
- Attribute :: ValueLen ( 32 . into ( ) ) ,
918
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) . unwrap ( ) ) ,
919
919
// the key needs to be extractable to be suitable for being wrapped
920
920
Attribute :: Extractable ( true ) ,
921
921
Attribute :: Encrypt ( true ) ,
@@ -1197,7 +1197,7 @@ fn get_attribute_info_test() -> TestResult {
1197
1197
session. generate_key_pair ( & mechanism, & pub_key_template, & priv_key_template) ?;
1198
1198
1199
1199
let pub_attribs = vec ! [ AttributeType :: PublicExponent , AttributeType :: Modulus ] ;
1200
- let mut priv_attribs = [
1200
+ let priv_attribs = [
1201
1201
AttributeType :: PublicExponent ,
1202
1202
AttributeType :: Modulus ,
1203
1203
AttributeType :: PrivateExponent ,
@@ -1369,7 +1369,7 @@ fn aes_key_attributes_test() -> TestResult {
1369
1369
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
1370
1370
Attribute :: Token ( true ) ,
1371
1371
Attribute :: Sensitive ( true ) ,
1372
- Attribute :: ValueLen ( 16 . into ( ) ) ,
1372
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
1373
1373
Attribute :: KeyType ( KeyType :: AES ) ,
1374
1374
Attribute :: Label ( b"testAES" . to_vec( ) ) ,
1375
1375
Attribute :: Private ( true ) ,
@@ -1465,7 +1465,7 @@ fn session_copy_object() -> TestResult {
1465
1465
Attribute :: Private ( true ) ,
1466
1466
Attribute :: Sensitive ( true ) ,
1467
1467
Attribute :: Extractable ( false ) ,
1468
- Attribute :: ValueLen ( 16 . into ( ) ) ,
1468
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
1469
1469
Attribute :: Label ( "original" . as_bytes ( ) . to_vec ( ) ) ,
1470
1470
] ;
1471
1471
@@ -1678,7 +1678,7 @@ fn sha256_digest_multipart_with_key() -> TestResult {
1678
1678
let key_template = vec ! [
1679
1679
Attribute :: Token ( true ) ,
1680
1680
Attribute :: Private ( false ) ,
1681
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
1681
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
1682
1682
// Key must be non-sensitive and extractable to get its bytes and digest them directly, for comparison
1683
1683
Attribute :: Sensitive ( false ) ,
1684
1684
Attribute :: Extractable ( true ) ,
@@ -2119,7 +2119,7 @@ fn ekdf_aes_cbc_encrypt_data() -> TestResult {
2119
2119
Attribute :: Token ( true ) ,
2120
2120
Attribute :: Sensitive ( true ) ,
2121
2121
Attribute :: Private ( true ) ,
2122
- Attribute :: ValueLen ( 32 . into ( ) ) ,
2122
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2123
2123
Attribute :: Derive ( true ) ,
2124
2124
] ;
2125
2125
@@ -2179,7 +2179,7 @@ fn kbkdf_counter_mode() -> TestResult {
2179
2179
let base_template = [
2180
2180
Attribute :: Token ( true ) ,
2181
2181
Attribute :: Private ( false ) ,
2182
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2182
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2183
2183
Attribute :: Derive ( true ) ,
2184
2184
] ;
2185
2185
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2190,7 +2190,7 @@ fn kbkdf_counter_mode() -> TestResult {
2190
2190
Attribute :: Private ( false ) ,
2191
2191
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2192
2192
Attribute :: KeyType ( KeyType :: AES ) ,
2193
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2193
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2194
2194
Attribute :: Encrypt ( true ) ,
2195
2195
Attribute :: Decrypt ( true ) ,
2196
2196
] ;
@@ -2234,7 +2234,7 @@ fn kbkdf_counter_mode() -> TestResult {
2234
2234
let wanted_attributes = [
2235
2235
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2236
2236
Attribute :: KeyType ( KeyType :: AES ) ,
2237
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2237
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2238
2238
Attribute :: Encrypt ( true ) ,
2239
2239
Attribute :: Decrypt ( true ) ,
2240
2240
Attribute :: Sign ( false ) ,
@@ -2272,7 +2272,7 @@ fn kbkdf_feedback_mode() -> TestResult {
2272
2272
let base_template = [
2273
2273
Attribute :: Token ( true ) ,
2274
2274
Attribute :: Private ( false ) ,
2275
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2275
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2276
2276
Attribute :: Derive ( true ) ,
2277
2277
] ;
2278
2278
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2283,7 +2283,7 @@ fn kbkdf_feedback_mode() -> TestResult {
2283
2283
Attribute :: Private ( false ) ,
2284
2284
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2285
2285
Attribute :: KeyType ( KeyType :: AES ) ,
2286
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2286
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2287
2287
Attribute :: Encrypt ( true ) ,
2288
2288
Attribute :: Decrypt ( true ) ,
2289
2289
] ;
@@ -2350,7 +2350,7 @@ fn kbkdf_feedback_mode() -> TestResult {
2350
2350
let wanted_attributes = [
2351
2351
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2352
2352
Attribute :: KeyType ( KeyType :: AES ) ,
2353
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2353
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2354
2354
Attribute :: Encrypt ( true ) ,
2355
2355
Attribute :: Decrypt ( true ) ,
2356
2356
Attribute :: Sign ( false ) ,
@@ -2389,7 +2389,7 @@ fn kbkdf_double_pipeline_mode() -> TestResult {
2389
2389
let base_template = [
2390
2390
Attribute :: Token ( true ) ,
2391
2391
Attribute :: Private ( false ) ,
2392
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2392
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2393
2393
Attribute :: Derive ( true ) ,
2394
2394
] ;
2395
2395
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2400,7 +2400,7 @@ fn kbkdf_double_pipeline_mode() -> TestResult {
2400
2400
Attribute :: Private ( false ) ,
2401
2401
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2402
2402
Attribute :: KeyType ( KeyType :: AES ) ,
2403
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2403
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2404
2404
Attribute :: Encrypt ( true ) ,
2405
2405
Attribute :: Decrypt ( true ) ,
2406
2406
] ;
@@ -2440,7 +2440,7 @@ fn kbkdf_double_pipeline_mode() -> TestResult {
2440
2440
let wanted_attributes = [
2441
2441
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2442
2442
Attribute :: KeyType ( KeyType :: AES ) ,
2443
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2443
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2444
2444
Attribute :: Encrypt ( true ) ,
2445
2445
Attribute :: Decrypt ( true ) ,
2446
2446
Attribute :: Sign ( false ) ,
@@ -2478,7 +2478,7 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2478
2478
let base_template = [
2479
2479
Attribute :: Token ( true ) ,
2480
2480
Attribute :: Private ( false ) ,
2481
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2481
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2482
2482
Attribute :: Derive ( true ) ,
2483
2483
] ;
2484
2484
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2490,7 +2490,7 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2490
2490
Attribute :: Private ( false ) ,
2491
2491
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2492
2492
Attribute :: KeyType ( KeyType :: AES ) ,
2493
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2493
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2494
2494
Attribute :: Encrypt ( true ) ,
2495
2495
Attribute :: Decrypt ( true ) ,
2496
2496
] ,
@@ -2499,7 +2499,7 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2499
2499
Attribute :: Private ( false ) ,
2500
2500
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2501
2501
Attribute :: KeyType ( KeyType :: AES ) ,
2502
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
2502
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
2503
2503
Attribute :: Sign ( true ) ,
2504
2504
Attribute :: Verify ( true ) ,
2505
2505
] ,
@@ -2570,7 +2570,7 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2570
2570
vec ! [
2571
2571
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2572
2572
Attribute :: KeyType ( KeyType :: AES ) ,
2573
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2573
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2574
2574
Attribute :: Encrypt ( true ) ,
2575
2575
Attribute :: Decrypt ( true ) ,
2576
2576
Attribute :: Sign ( false ) ,
@@ -2580,7 +2580,7 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2580
2580
vec ! [
2581
2581
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2582
2582
Attribute :: KeyType ( KeyType :: AES ) ,
2583
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
2583
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
2584
2584
Attribute :: Encrypt ( false ) ,
2585
2585
Attribute :: Decrypt ( false ) ,
2586
2586
Attribute :: Sign ( true ) ,
@@ -2634,7 +2634,7 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2634
2634
let base_template = [
2635
2635
Attribute :: Token ( true ) ,
2636
2636
Attribute :: Private ( false ) ,
2637
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2637
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2638
2638
Attribute :: Derive ( true ) ,
2639
2639
] ;
2640
2640
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2646,7 +2646,7 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2646
2646
Attribute :: Private ( false ) ,
2647
2647
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2648
2648
Attribute :: KeyType ( KeyType :: AES ) ,
2649
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2649
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2650
2650
Attribute :: Encrypt ( true ) ,
2651
2651
Attribute :: Decrypt ( true ) ,
2652
2652
] ,
@@ -2655,7 +2655,7 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2655
2655
Attribute :: Private ( false ) ,
2656
2656
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2657
2657
Attribute :: KeyType ( KeyType :: AES ) ,
2658
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
2658
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
2659
2659
Attribute :: Sign ( true ) ,
2660
2660
Attribute :: Verify ( true ) ,
2661
2661
] ,
@@ -2759,7 +2759,7 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2759
2759
vec ! [
2760
2760
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2761
2761
Attribute :: KeyType ( KeyType :: AES ) ,
2762
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2762
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2763
2763
Attribute :: Encrypt ( true ) ,
2764
2764
Attribute :: Decrypt ( true ) ,
2765
2765
Attribute :: Sign ( false ) ,
@@ -2769,7 +2769,7 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2769
2769
vec ! [
2770
2770
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2771
2771
Attribute :: KeyType ( KeyType :: AES ) ,
2772
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
2772
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
2773
2773
Attribute :: Encrypt ( false ) ,
2774
2774
Attribute :: Decrypt ( false ) ,
2775
2775
Attribute :: Sign ( true ) ,
@@ -2819,7 +2819,7 @@ fn kbkdf_additional_keys_double_pipeline_mode() -> TestResult {
2819
2819
let base_template = [
2820
2820
Attribute :: Token ( true ) ,
2821
2821
Attribute :: Private ( false ) ,
2822
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2822
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2823
2823
Attribute :: Derive ( true ) ,
2824
2824
] ;
2825
2825
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2831,7 +2831,7 @@ fn kbkdf_additional_keys_double_pipeline_mode() -> TestResult {
2831
2831
Attribute :: Private ( false ) ,
2832
2832
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2833
2833
Attribute :: KeyType ( KeyType :: AES ) ,
2834
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2834
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2835
2835
Attribute :: Encrypt ( true ) ,
2836
2836
Attribute :: Decrypt ( true ) ,
2837
2837
] ,
@@ -2840,7 +2840,7 @@ fn kbkdf_additional_keys_double_pipeline_mode() -> TestResult {
2840
2840
Attribute :: Private ( false ) ,
2841
2841
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2842
2842
Attribute :: KeyType ( KeyType :: AES ) ,
2843
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
2843
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
2844
2844
Attribute :: Sign ( true ) ,
2845
2845
Attribute :: Verify ( true ) ,
2846
2846
] ,
@@ -2907,7 +2907,7 @@ fn kbkdf_additional_keys_double_pipeline_mode() -> TestResult {
2907
2907
vec ! [
2908
2908
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2909
2909
Attribute :: KeyType ( KeyType :: AES ) ,
2910
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2910
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2911
2911
Attribute :: Encrypt ( true ) ,
2912
2912
Attribute :: Decrypt ( true ) ,
2913
2913
Attribute :: Sign ( false ) ,
@@ -2917,7 +2917,7 @@ fn kbkdf_additional_keys_double_pipeline_mode() -> TestResult {
2917
2917
vec ! [
2918
2918
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2919
2919
Attribute :: KeyType ( KeyType :: AES ) ,
2920
- Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into ( ) ) ,
2920
+ Attribute :: ValueLen ( AES128_BLOCK_SIZE . try_into ( ) ? ) ,
2921
2921
Attribute :: Encrypt ( false ) ,
2922
2922
Attribute :: Decrypt ( false ) ,
2923
2923
Attribute :: Sign ( true ) ,
@@ -2971,7 +2971,7 @@ fn kbkdf_invalid_data_params_counter_mode() -> TestResult {
2971
2971
let base_template = [
2972
2972
Attribute :: Token ( true ) ,
2973
2973
Attribute :: Private ( false ) ,
2974
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2974
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2975
2975
Attribute :: Derive ( true ) ,
2976
2976
] ;
2977
2977
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -2982,7 +2982,7 @@ fn kbkdf_invalid_data_params_counter_mode() -> TestResult {
2982
2982
Attribute :: Private ( false ) ,
2983
2983
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
2984
2984
Attribute :: KeyType ( KeyType :: AES ) ,
2985
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
2985
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
2986
2986
Attribute :: Encrypt ( true ) ,
2987
2987
Attribute :: Decrypt ( true ) ,
2988
2988
] ;
@@ -3120,7 +3120,7 @@ fn kbkdf_invalid_data_params_feedback_mode() -> TestResult {
3120
3120
let base_template = [
3121
3121
Attribute :: Token ( true ) ,
3122
3122
Attribute :: Private ( false ) ,
3123
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
3123
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
3124
3124
Attribute :: Derive ( true ) ,
3125
3125
] ;
3126
3126
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -3131,7 +3131,7 @@ fn kbkdf_invalid_data_params_feedback_mode() -> TestResult {
3131
3131
Attribute :: Private ( false ) ,
3132
3132
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
3133
3133
Attribute :: KeyType ( KeyType :: AES ) ,
3134
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
3134
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
3135
3135
Attribute :: Encrypt ( true ) ,
3136
3136
Attribute :: Decrypt ( true ) ,
3137
3137
] ;
@@ -3243,7 +3243,7 @@ fn kbkdf_invalid_data_params_double_pipeline_mode() -> TestResult {
3243
3243
let base_template = [
3244
3244
Attribute :: Token ( true ) ,
3245
3245
Attribute :: Private ( false ) ,
3246
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
3246
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
3247
3247
Attribute :: Derive ( true ) ,
3248
3248
] ;
3249
3249
let base_key = session. generate_key ( & Mechanism :: AesKeyGen , & base_template) ?;
@@ -3254,7 +3254,7 @@ fn kbkdf_invalid_data_params_double_pipeline_mode() -> TestResult {
3254
3254
Attribute :: Private ( false ) ,
3255
3255
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
3256
3256
Attribute :: KeyType ( KeyType :: AES ) ,
3257
- Attribute :: ValueLen ( ( AES256_BLOCK_SIZE as u64 ) . into ( ) ) ,
3257
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
3258
3258
Attribute :: Encrypt ( true ) ,
3259
3259
Attribute :: Decrypt ( true ) ,
3260
3260
] ;
@@ -3707,7 +3707,7 @@ fn unique_id() -> TestResult {
3707
3707
3708
3708
let generate_template = vec ! [
3709
3709
Attribute :: Token ( true ) ,
3710
- Attribute :: ValueLen ( 32 . into ( ) ) ,
3710
+ Attribute :: ValueLen ( AES256_BLOCK_SIZE . try_into ( ) ? ) ,
3711
3711
Attribute :: Encrypt ( true ) ,
3712
3712
] ;
3713
3713
0 commit comments