class Crypto::Poly1305

Overview

Poly1305 message authentication code.

Defined in:

crypto/poly1305.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.chacha20(key : Bytes, nonce : Bytes) : Poly1305 #

Generating the Poly1305 Key Using ChaCha20


[View source]
def self.chacha20(cipher : ChaCha20) : Poly1305 #

Generating the Poly1305 Key Using ChaCha20


[View source]
def self.new(key : Bytes) #

Initializes the Poly1305 context with a given 32-byte key. The key should be used only once per message and then discarded.


[View source]
def self.new(key : String) #

Initializes the Poly1305 context with a given 32-byte hex-encoded key. The key should be used only once per message and then discarded.


[View source]

Class Method Detail

def self.auth(key : Bytes, message : Bytes) : Bytes #

A convenience method to compute a Poly1305 MAC for a single message.


[View source]

Instance Method Detail

def final : Bytes #

Finalizes the MAC computation and returns the 16-byte authenticator.


[View source]
def key : Bytes #

[View source]
def update(msg : Bytes) #

Processes a message fragment, msg bytes should be 16 bytes alligned if different size is used the final block is assumed, further calculations would be incorrect


[View source]