Skip to content

Commit 5b2a843

Browse files
Made formatting fixes
Signed-off-by: Jacob Prud'homme <[email protected]>
1 parent 13f40fa commit 5b2a843

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

cryptoki/src/mechanism/kbkdf.rs

+10-12
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,11 @@ impl<'a> KbkdfParams<'a> {
257257
prf_data_params: &'a [PrfDataParam<'a>],
258258
additional_derived_keys: Option<&'a mut [DerivedKey]>,
259259
) -> Self {
260-
let mut additional_derived_keys = additional_derived_keys
261-
.map(|keys| {
262-
keys.iter_mut()
263-
.map(Into::into)
264-
.collect::<Box<[CK_DERIVED_KEY]>>()
265-
});
260+
let mut additional_derived_keys = additional_derived_keys.map(|keys| {
261+
keys.iter_mut()
262+
.map(Into::into)
263+
.collect::<Box<[CK_DERIVED_KEY]>>()
264+
});
266265

267266
let inner = CK_SP800_108_KDF_PARAMS {
268267
prfType: prf_mechanism.into(),
@@ -329,12 +328,11 @@ impl<'a> KbkdfFeedbackParams<'a> {
329328
iv: Option<&'a [u8]>,
330329
additional_derived_keys: Option<&'a mut [DerivedKey]>,
331330
) -> Self {
332-
let mut additional_derived_keys = additional_derived_keys
333-
.map(|keys| {
334-
keys.iter_mut()
335-
.map(Into::into)
336-
.collect::<Box<[CK_DERIVED_KEY]>>()
337-
});
331+
let mut additional_derived_keys = additional_derived_keys.map(|keys| {
332+
keys.iter_mut()
333+
.map(Into::into)
334+
.collect::<Box<[CK_DERIVED_KEY]>>()
335+
});
338336

339337
let inner = CK_SP800_108_FEEDBACK_KDF_PARAMS {
340338
prfType: prf_mechanism.into(),

cryptoki/src/mechanism/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,8 @@ impl From<&Mechanism<'_>> for CK_MECHANISM {
12521252
fn make_mechanism<T>(mechanism: CK_MECHANISM_TYPE, param: &T) -> CK_MECHANISM {
12531253
CK_MECHANISM {
12541254
mechanism,
1255-
/* SAFETY: Parameters that expect to have some part of themselves
1255+
/*
1256+
* SAFETY: Parameters that expect to have some part of themselves
12561257
* mutated should indicate this to the end user by marking both the
12571258
* relevant constructor parameters and the type's PhantomData as mut.
12581259
* Otherwise, we should generally not expect the backend to mutate the
@@ -1262,7 +1263,7 @@ fn make_mechanism<T>(mechanism: CK_MECHANISM_TYPE, param: &T) -> CK_MECHANISM {
12621263
* - aead::GcmMessageParams
12631264
* - kbkdf::KbkdfParams
12641265
* - kbkdf::KbkdfFeedbackParams
1265-
**/
1266+
*/
12661267
pParameter: param as *const T as *mut c_void,
12671268
ulParameterLen: size_of::<T>()
12681269
.try_into()

0 commit comments

Comments
 (0)