Hkdf<D> functionv0.1.0
pub func Hkdf<D: Digest>(
prototype: D,
salt: char8[..],
material: char8[..],
info: char8[..],
into: var char8[..]
) -> bool
Returns false for an output longer than 255 digests, exactly as HkdfExpand does.
Type parameters
| Name | Description |
|---|---|
D: Digest | the digest type |
Parameters
| Name | Type | Description |
|---|---|---|
prototype | D | any value of the digest type, read only to select it |
salt | char8[..] | the salt, which may be empty |
material | char8[..] | the input keying material |
info | char8[..] | the context and application-specific information |
into | var char8[..] | receives the output |
Returns: whether into was a length this construction can produce
Related
HkdfMaximumBlocks
pub const HkdfMaximumBlocks: uint = 255;
The most blocks Expand can produce, since its counter is one byte.
HkdfExtract<D>
pub func HkdfExtract<D: Digest>(
prototype: D,
salt: char8[..],
material: char8[..],
into: var char8[..]
)
Extracts a pseudorandom key from material, salted with salt.
into must be exactly the digest's length. An empty salt is legal and means a string of that many zeros,
which is what the specification says — so an absent salt is not the same as no salt at all.
Type parameters
| Name | Description |
|---|---|
D: Digest | the digest type |
Parameters
| Name | Type | Description |
|---|---|---|
prototype | D | any value of the digest type, read only to select it |
salt | char8[..] | the salt, which may be empty |
material | char8[..] | the input keying material |
into | var char8[..] | receives the output |
HkdfExpand<D>
pub func HkdfExpand<D: Digest>(
prototype: D,
key: char8[..],
info: char8[..],
into: var char8[..]
) -> bool
Expands key into into, separated by info.
Returns false when into is longer than 255 digests, which is the most the one-byte counter can address;
nothing is written in that case. info names what the derived key is for, and two expansions of one key
under different info strings are unrelated.
Type parameters
| Name | Description |
|---|---|
D: Digest | the digest type |
Parameters
| Name | Type | Description |
|---|---|---|
prototype | D | any value of the digest type, read only to select it |
key | char8[..] | the key |
info | char8[..] | the context and application-specific information |
into | var char8[..] | receives the output |
Returns: whether into was a length this construction can produce