purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::TaggedHash Class Reference

Reusable BIP340-style tagged SHA-256 helper. More...

#include <curve.hpp>

Public Member Functions

 TaggedHash (std::string_view tag)
 
std::array< unsigned char, 32 > digest (std::span< const unsigned char > data) const
 
template<std::size_t Segments>
std::array< unsigned char, 32 > digest_many (const std::array< std::span< const unsigned char >, Segments > &segments) const
 

Detailed Description

The digest is computed as SHA256(SHA256(tag) || SHA256(tag) || data...).

Definition at line 111 of file curve.hpp.

Constructor & Destructor Documentation

◆ TaggedHash()

purify::TaggedHash::TaggedHash ( std::string_view  tag)
inlineexplicit

Definition at line 113 of file curve.hpp.

References purify_sha256().

Member Function Documentation

◆ digest()

std::array< unsigned char, 32 > purify::TaggedHash::digest ( std::span< const unsigned char >  data) const
inline

◆ digest_many()

template<std::size_t Segments>
std::array< unsigned char, 32 > purify::TaggedHash::digest_many ( const std::array< std::span< const unsigned char >, Segments > &  segments) const
inline

Definition at line 123 of file curve.hpp.

References purify_sha256_many().


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