HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelibsodium-bindings-0.0.1.1Haskell2010

LibSodium.Bindings.CryptoAuth

  • 5 values

Introduction

0 declarations

Compute an authentication tag for a message and a secret key, and verify that a given tag is valid for a given message and a key.

The function computing the tag is deterministic: the same (message, key) tuple will always produce the same output. However, even if the message is public, knowing the key is required in order to be able to compute a valid tag. Therefore, the key should remain confidential. The tag, however, can be public.

The operations of this module are backed by the HMAC-SHA512-256 algorithm.

Usage

0 declarations

A typical use case is:

  • A prepares a message, adds an authentication tag, sends it to B

  • A doesn't store the message

  • Later on, B sends the message and the authentication tag to A

  • A uses the authentication tag to verify that it created this message.

This operation does not encrypt the message. It only computes and verifies an authentication tag.

Functions

3 declarations

Constants

2 declarations