Pigweed
 
Loading...
Searching...
No Matches
pw::crypto::sha256::Sha256 Class Reference

#include <sha256.h>

Public Member Functions

Sha256Update (ConstByteSpan data)
 
Status Final (ByteSpan out_digest)
 

Detailed Description

Computes the SHA256 digest of potentially long, non-contiguous input messages.

Usage:

if (!Sha256().Update(message).Update(more_message).Final(out_digest).ok()) {
// Error handling.
}
Definition: sha256.h:63
Status Final(ByteSpan out_digest)
Definition: sha256.h:100
Sha256 & Update(ConstByteSpan data)
Definition: sha256.h:77

Member Function Documentation

◆ Final()

Status pw::crypto::sha256::Sha256::Final ( ByteSpan  out_digest)
inline

Finishes the hashing session and outputs the final digest in the first kDigestSizeBytes of out_digest. out_digest must be at least kDigestSizeBytes long.

Final() locks down the Sha256 instance from any additional use.

Any error, including those occurring inside the constructor or Update() will be reflected in the return value of Final().

◆ Update()

Sha256 & pw::crypto::sha256::Sha256::Update ( ConstByteSpan  data)
inline

Feeds data to the running hasher. The feeding can involve zero or more Update() calls and the order matters.


The documentation for this class was generated from the following file: