You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kbkdf/src/lib.rs
+29-4Lines changed: 29 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
)]
7
7
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
8
8
#![forbid(unsafe_code)]
9
+
#![warn(missing_docs)]
9
10
10
11
use core::{fmt, marker::PhantomData, ops::Mul};
11
12
use digest::{
@@ -18,8 +19,10 @@ use digest::{
18
19
19
20
pubmod sealed;
20
21
22
+
/// KBKDF error type.
21
23
#[derive(Debug,PartialEq)]
22
24
pubenumError{
25
+
/// Indicates that the requested length of the derived key is too large for the value of R specified.
23
26
InvalidRequestSize,
24
27
}
25
28
@@ -36,13 +39,28 @@ impl fmt::Display for Error {
36
39
37
40
impl core::error::ErrorforError{}
38
41
39
-
/// Parameters used for KBKDF
42
+
/// Parameters used for KBKDF.
43
+
///
44
+
/// For more details, read the official specification: [NIST SP 800-108r1](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-108r1.pdf).
40
45
pubstructParams<'k,'l,'c>{
46
+
/// Key-derivation key.
47
+
///
48
+
/// key that is used as an input to a key-derivation function (along with other input data) to derive keying material.
41
49
pubkin:&'k[u8],
50
+
/// A string that identifies the purpose for the derived keying material, which is encoded as a bit string.
51
+
///
52
+
/// The encoding method for the Label is defined in a larger context, for example, in the protocol that uses a KDF.
42
53
publabel:&'l[u8],
54
+
/// A bit string containing the information related to the derived keying material.
55
+
///
56
+
/// It may include the identities of the parties who are deriving and/or using the derived keying material and,
57
+
/// optionally, a nonce known by the parties who derive the keys.
43
58
pubcontext:&'c[u8],
59
+
/// A flag indicating whether to update the Prf with the requested key length.
44
60
pubuse_l:bool,
61
+
/// A flag indicating whether to separate the label from the context with a NULL byte.
45
62
pubuse_separator:bool,
63
+
/// A flag indicating whether to update the Prf with the iteration counter.
0 commit comments