Skip to content

HMAC-based Extract-and-Expand Key Derivation Function (HKDF) in pure V Language

License

Notifications You must be signed in to change notification settings

blackshirt/hkdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hkdf

HMAC-based Extract-and-Expand Key Derivation Function (HKDF) in pure V Language. See RFC 5869 for more detail.

Contents

new

fn new(h crypto.Hash) &Hkdf

[Return to contents]

Hkdf

hasher

fn (k Hkdf) hasher() crypto.Hash

[Return to contents]

sum

fn (k Hkdf) sum(data []u8) ![]u8

sum return sum of the data for Hkdf hash

[Return to contents]

size

fn (k Hkdf) size() !int

size return size of the checksum underlying hash

[Return to contents]

hmac

fn (k Hkdf) hmac(key []u8, data []u8) ![]u8

hmac create new hmac

[Return to contents]

extract

fn (k Hkdf) extract(salt []u8, ikm []u8) ![]u8

extract create pseudorandom key (prk) from input given.
its output is hmac based hash with length (size) of Hashing checksum size

[Return to contents]

expand

fn (k Hkdf) expand(prk []u8, info []u8, length int) ![]u8

// expand expand pseudorandom key to build output keying materi.
where length is the length of output keying material in octets (<= 255*HashLen) where HashLen denotes the length of the hash function output in octets

[Return to contents]

About

HMAC-based Extract-and-Expand Key Derivation Function (HKDF) in pure V Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages