NAME

Crypt::Bear::HMAC - HMAC implementations in BearSSL

VERSION

version 0.002

SYNOPSIS

my $key = Crypt::Bear::HMAC::Key->new('sha256', '0123456789ABCDEF');
my $digester = Crypt::Bear::HMAC->new($key);

while(<>) {
    $digester->update($_);
}
say unpack 'H*', $digester->out;

DESCRIPTION

This represents a streaming implementation of hmac on top of common hash functions.

METHODS

new($key)

Returns a new HMAC based on the $key, which should be a Crypt::Bear::HMAC::Key.

update(data)

This feeds data to the hasher.

out()

This returns the hash based on the current state.

digest()

Return the name of the hash that's being used (e.g. 'sha256')

size()

This returns the size of the output.

AUTHOR

Leon Timmermans <fawaka@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.