NAME

Crypt::Bear::GCM - GCM implementation for BearSSL

VERSION

version 0.002

SYNOPSIS

my $aead = Crypt::Bear::GCM->new(Crypt::Bear::AES_CTR->new($key));

$aead->reset($iv);
$aead->aad_inject($aad);
$aead->flip;
my $ciphertext = $aead->run($plaintext, 1);
my $tag = $aead->get_tag;

$aead->reset($iv);
$aead->aad_inject($aad);
$aead->flip;
my $decoded = $aead->run($ciphertext, 0);
$aead->check_tag($tag)

DESCRIPTION

This is a subclass of Crypt::Bear::AEAD that implements GCM mode. It needs a Crypt::Bear::CTR such as Crypt::Bear::AES_CTR for this.

METHODS

new($ctr)

Creates a new GCM mode object with the given CTR object.

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.