auth 0.0.1
Authenticated computation with C++26 modules
Loading...
Searching...
No Matches
hash.ccm File Reference
module auth.hash

SHA-256 digests for serialized byte sequences. More...

#include <array>
#include <cstdint>
#include <span>
#include <openssl/sha.h>
import auth.error;
Include dependency graph for hash.ccm:

Go to the source code of this file.

Typedefs

using auth::digest = std::array<std::uint8_t, 32>
 The 32 bytes of a SHA-256 digest in hash output order.

Functions

digest auth::sha256 (std::span< const std::uint8_t > data)
 Hashes exactly the supplied bytes with OpenSSL's SHA-256 implementation.

Detailed Description

SHA-256 digests for serialized byte sequences.

Definition in file hash.ccm.

Function Documentation

◆ sha256()

digest auth::sha256 ( std::span< const std::uint8_t > data)
inlineexport

Hashes exactly the supplied bytes with OpenSSL's SHA-256 implementation.

Parameters
dataInput bytes; an empty span is valid.
Returns
The SHA-256 digest.
Exceptions
auth_errorIf OpenSSL reports failure.

Definition at line 27 of file hash.ccm.