LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::BLAKE3 Class Reference

A class that wraps the BLAKE3 algorithm. More...

#include "llvm/Support/BLAKE3.h"

Inheritance diagram for llvm::BLAKE3:
Inheritance graph
[legend]

Public Member Functions

 BLAKE3 ()
 
void init ()
 Reinitialize the internal state.
 
void update (ArrayRef< uint8_t > Data)
 Digest more data.
 
void update (StringRef Str)
 Digest more data.
 
template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
void final (BLAKE3Result< NumBytes > &Result)
 Finalize the hasher and put the result in Result.
 
template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
BLAKE3Result< NumBytes > final ()
 Finalize the hasher and return an output of any length, given in bytes.
 
template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
BLAKE3Result< NumBytes > result ()
 Return the current output for the digested data since the last call to init().
 

Static Public Member Functions

template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
static BLAKE3Result< NumBytes > hash (ArrayRef< uint8_t > Data)
 Returns a BLAKE3 hash for the given data.
 

Detailed Description

A class that wraps the BLAKE3 algorithm.

Definition at line 38 of file BLAKE3.h.

Constructor & Destructor Documentation

◆ BLAKE3()

llvm::BLAKE3::BLAKE3 ( )
inline

Definition at line 40 of file BLAKE3.h.

References init().

Member Function Documentation

◆ final() [1/2]

template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
BLAKE3Result< NumBytes > llvm::BLAKE3::final ( )
inline

Finalize the hasher and return an output of any length, given in bytes.

This doesn't modify the hasher itself, and it's possible to finalize again after adding more input.

Definition at line 67 of file BLAKE3.h.

References llvm_blake3_hasher_finalize().

Referenced by llvm::TruncatedBLAKE3< NumBytes >::final().

◆ final() [2/2]

template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
void llvm::BLAKE3::final ( BLAKE3Result< NumBytes > &  Result)
inline

Finalize the hasher and put the result in Result.

This doesn't modify the hasher itself, and it's possible to finalize again after adding more input.

Definition at line 59 of file BLAKE3.h.

References llvm_blake3_hasher_finalize().

Referenced by hash().

◆ hash()

template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
static BLAKE3Result< NumBytes > llvm::BLAKE3::hash ( ArrayRef< uint8_t Data)
inlinestatic

Returns a BLAKE3 hash for the given data.

Definition at line 86 of file BLAKE3.h.

References llvm::Data, final(), and update().

◆ init()

void llvm::BLAKE3::init ( )
inline

Reinitialize the internal state.

Definition at line 43 of file BLAKE3.h.

References llvm_blake3_hasher_init().

Referenced by BLAKE3(), and llvm::codeview::GloballyHashedType::hashType().

◆ result()

template<size_t NumBytes = LLVM_BLAKE3_OUT_LEN>
BLAKE3Result< NumBytes > llvm::BLAKE3::result ( )
inline

Return the current output for the digested data since the last call to init().

Other hash functions distinguish between result() and final(), with result() allowing more calls into update(), but there's no

Definition at line 80 of file BLAKE3.h.

◆ update() [1/2]

void llvm::BLAKE3::update ( ArrayRef< uint8_t Data)
inline

Digest more data.

Definition at line 46 of file BLAKE3.h.

References llvm::Data, and llvm_blake3_hasher_update().

Referenced by hash(), and llvm::codeview::GloballyHashedType::hashType().

◆ update() [2/2]

void llvm::BLAKE3::update ( StringRef  Str)
inline

Digest more data.

Definition at line 51 of file BLAKE3.h.

References llvm_blake3_hasher_update().


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