UltrafastSecp256k1 3.50.0
Ultra high-performance secp256k1 elliptic curve cryptography library
Loading...
Searching...
No Matches
secp256k1::hash Namespace Reference

Namespaces

namespace  scalar
 

Enumerations

enum class  HashTier : int {
  SCALAR = 0 , ARM_SHA2 = 1 , SHA_NI = 2 , AVX2 = 3 ,
  AVX512 = 4
}
 

Functions

HashTier detect_hash_tier () noexcept
 Detect best available hashing tier at runtime.
 
const char * hash_tier_name (HashTier tier) noexcept
 Human-readable tier name.
 
bool sha_ni_available () noexcept
 Check individual features.
 
bool avx2_available () noexcept
 
bool avx512_available () noexcept
 
std::array< std::uint8_t, 32 > sha256 (const void *data, std::size_t len) noexcept
 SHA-256 of arbitrary data (auto-selects best implementation).
 
void sha256_33 (const std::uint8_t *pubkey33, std::uint8_t *out32) noexcept
 
void sha256_32 (const std::uint8_t *in32, std::uint8_t *out32) noexcept
 SHA-256 of exactly 32 bytes (e.g. second hash in double-SHA256)
 
std::array< std::uint8_t, 32 > sha256d (const void *data, std::size_t len) noexcept
 Double-SHA256: SHA256(SHA256(data)) for arbitrary data.
 
std::array< std::uint8_t, 20 > ripemd160 (const void *data, std::size_t len) noexcept
 RIPEMD-160 of arbitrary data (auto-selects best implementation).
 
void ripemd160_32 (const std::uint8_t *in32, std::uint8_t *out20) noexcept
 
std::array< std::uint8_t, 20 > hash160 (const void *data, std::size_t len) noexcept
 Hash160 of arbitrary data.
 
void hash160_33 (const std::uint8_t *pubkey33, std::uint8_t *out20) noexcept
 
void sha256_33_batch (const std::uint8_t *pubkeys, std::uint8_t *out32s, std::size_t count) noexcept
 
void ripemd160_32_batch (const std::uint8_t *in32s, std::uint8_t *out20s, std::size_t count) noexcept
 
void hash160_33_batch (const std::uint8_t *pubkeys, std::uint8_t *out20s, std::size_t count) noexcept
 

Enumeration Type Documentation

◆ HashTier

enum class secp256k1::hash::HashTier : int
strong
Enumerator
SCALAR 
ARM_SHA2 
SHA_NI 
AVX2 
AVX512 

Definition at line 50 of file hash_accel.hpp.

Function Documentation

◆ avx2_available()

bool secp256k1::hash::avx2_available ( )
noexcept

◆ avx512_available()

bool secp256k1::hash::avx512_available ( )
noexcept

◆ detect_hash_tier()

HashTier secp256k1::hash::detect_hash_tier ( )
noexcept

Detect best available hashing tier at runtime.

◆ hash160()

std::array< std::uint8_t, 20 > secp256k1::hash::hash160 ( const void *  data,
std::size_t  len 
)
noexcept

Hash160 of arbitrary data.

◆ hash160_33()

void secp256k1::hash::hash160_33 ( const std::uint8_t *  pubkey33,
std::uint8_t *  out20 
)
noexcept

Hash160 of exactly 33 bytes (compressed pubkey). Fused SHA256(33) + RIPEMD160(32) with minimal intermediary overhead.

◆ hash160_33_batch()

void secp256k1::hash::hash160_33_batch ( const std::uint8_t *  pubkeys,
std::uint8_t *  out20s,
std::size_t  count 
)
noexcept

Batch Hash160 of Nx33-byte compressed pubkeys. Fused pipeline: strides of 4/8 messages through SHA256->RIPEMD160. out20s: caller-allocated, at least countx20 bytes.

◆ hash_tier_name()

const char * secp256k1::hash::hash_tier_name ( HashTier  tier)
noexcept

Human-readable tier name.

◆ ripemd160()

std::array< std::uint8_t, 20 > secp256k1::hash::ripemd160 ( const void *  data,
std::size_t  len 
)
noexcept

RIPEMD-160 of arbitrary data (auto-selects best implementation).

◆ ripemd160_32()

void secp256k1::hash::ripemd160_32 ( const std::uint8_t *  in32,
std::uint8_t *  out20 
)
noexcept

RIPEMD-160 of exactly 32 bytes (SHA-256 output -> Hash160 hot path). Precomputed padding – no branches, no buffer management.

◆ ripemd160_32_batch()

void secp256k1::hash::ripemd160_32_batch ( const std::uint8_t *  in32s,
std::uint8_t *  out20s,
std::size_t  count 
)
noexcept

Batch RIPEMD-160 of Nx32-byte SHA-256 digests. out20s: caller-allocated, at least countx20 bytes.

◆ sha256()

std::array< std::uint8_t, 32 > secp256k1::hash::sha256 ( const void *  data,
std::size_t  len 
)
noexcept

SHA-256 of arbitrary data (auto-selects best implementation).

◆ sha256_32()

void secp256k1::hash::sha256_32 ( const std::uint8_t *  in32,
std::uint8_t *  out32 
)
noexcept

SHA-256 of exactly 32 bytes (e.g. second hash in double-SHA256)

◆ sha256_33()

void secp256k1::hash::sha256_33 ( const std::uint8_t *  pubkey33,
std::uint8_t *  out32 
)
noexcept

SHA-256 of exactly 33 bytes (compressed pubkey hot path). Precomputed padding – no branches, no buffer management.

◆ sha256_33_batch()

void secp256k1::hash::sha256_33_batch ( const std::uint8_t *  pubkeys,
std::uint8_t *  out32s,
std::size_t  count 
)
noexcept

Batch SHA-256 of Nx33-byte compressed pubkeys. out32s: caller-allocated, at least countx32 bytes.

◆ sha256d()

std::array< std::uint8_t, 32 > secp256k1::hash::sha256d ( const void *  data,
std::size_t  len 
)
noexcept

Double-SHA256: SHA256(SHA256(data)) for arbitrary data.

◆ sha_ni_available()

bool secp256k1::hash::sha_ni_available ( )
noexcept

Check individual features.