class
Crypto::Poly1305::Native
- Crypto::Poly1305::Native
- Crypto::Poly1305::MAC
- Reference
- Object
Overview
Poly1305 message authentication code (pure Crystal BigInt implementation).
Defined in:
crypto/poly1305/native.crConstructors
-
.chacha20(key : Bytes, nonce : Bytes) : self
Generating the Poly1305 Key Using ChaCha20
-
.chacha20(cipher : ChaCha20::Cipher) : self
Generating the Poly1305 Key Using ChaCha20
-
.new(key : Bytes)
Initializes the Poly1305 context with a given 32-byte key.
-
.new(key : String)
Initializes the Poly1305 context with a given 32-byte hex-encoded key.
Class Method Summary
-
.auth(key : Bytes, message : Bytes) : Bytes
A convenience method to compute a Poly1305 MAC for a single message.
Instance Method Summary
-
#final : Bytes
Finalizes the MAC computation and returns the 16-byte authenticator.
- #key : Bytes
-
#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
Instance methods inherited from class Crypto::Poly1305::MAC
final : Bytes
final,
key : Bytes
key,
update(msg : Bytes)
update
Constructor Detail
Generating the Poly1305 Key Using ChaCha20
Initializes the Poly1305 context with a given 32-byte key. The key should be used only once per message and then discarded.
Initializes the Poly1305 context with a given 32-byte hex-encoded key. The key should be used only once per message and then discarded.
Class Method Detail
A convenience method to compute a Poly1305 MAC for a single message.
Instance Method Detail
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