Skip to content

sgns::crypto

Namespaces

Name
sgns::crypto::constants
sgns::crypto::secp256k1

Classes

Name
class sgns::crypto::ED25519ProviderImpl
class sgns::crypto::ED25519Provider
struct sgns::crypto::ED25519Keypair
class sgns::crypto::Hasher
class sgns::crypto::HasherImpl
class sgns::crypto::Pbkdf2ProviderImpl
class sgns::crypto::Pbkdf2Provider
Interface for PBKDF2 key derivation.
class sgns::crypto::Secp256k1ProviderImpl
class sgns::crypto::Secp256k1Provider
Interface for secp256k1 public key recovery.

Types

Name
enum class ED25519ProviderError
enum class Pbkdf2ProviderError
enum class Secp256k1ProviderError
using base::Blob< constants::ed25519::PRIVKEY_SIZE > ED25519PrivateKey
using base::Blob< constants::ed25519::PUBKEY_SIZE > ED25519PublicKey
using base::Blob< constants::ed25519::SIGNATURE_SIZE > ED25519Signature
using base::Blob< constants::ed25519::SEED_SIZE > ED25519Seed
using Blob< 16 > Hash128
using Blob< 32 > Hash256
using Blob< 8 > Hash64

Functions

Name
outcome::result< int > validateRecoveryId(int v)
base::Hash256 sha256(std::string_view input)
base::Hash256 sha256(gsl::span< const uint8_t > input)
std::vector< uint8_t > sha256(const void * data, size_t dataSize)
void make_twox64(const uint8_t * in, uint32_t len, uint8_t * out)
base::Hash64 make_twox64(gsl::span< const uint8_t > buf)
void make_twox128(const uint8_t * in, uint32_t len, uint8_t * out)
base::Hash128 make_twox128(gsl::span< const uint8_t > buf)
void make_twox256(const uint8_t * in, uint32_t len, uint8_t * out)
base::Hash256 make_twox256(gsl::span< const uint8_t > buf)

Types Documentation

enum ED25519ProviderError

Enumerator Value Description
FAILED_GENERATE_KEYPAIR 1
SIGN_UNKNOWN_ERROR
VERIFY_UNKNOWN_ERROR

enum Pbkdf2ProviderError

Enumerator Value Description
KEY_DERIVATION_FAILED 1

enum Secp256k1ProviderError

Enumerator Value Description
INVALID_ARGUMENT 1
INVALID_V_VALUE
INVALID_R_OR_S_VALUE
INVALID_SIGNATURE
RECOVERY_FAILED

using ED25519PrivateKey

using sgns::crypto::ED25519PrivateKey = base::Blob<constants::ed25519::PRIVKEY_SIZE>;

using ED25519PublicKey

using sgns::crypto::ED25519PublicKey = base::Blob<constants::ed25519::PUBKEY_SIZE>;

using ED25519Signature

using sgns::crypto::ED25519Signature = base::Blob<constants::ed25519::SIGNATURE_SIZE>;

using ED25519Seed

using sgns::crypto::ED25519Seed = base::Blob<constants::ed25519::SEED_SIZE>;

using Hash128

using sgns::base::Hash128 = Blob<16>;

using Hash256

using sgns::base::Hash256 = Blob<32>;

using Hash64

using sgns::base::Hash64 = Blob<8>;

Functions Documentation

function validateRecoveryId

outcome::result< int > validateRecoveryId(
    int v
)

function sha256

base::Hash256 sha256(
    std::string_view input
)

Parameters:

  • input to be hashed

Return: hashed bytes

Take a SHA-256 hash from string

function sha256

base::Hash256 sha256(
    gsl::span< const uint8_t > input
)

Parameters:

  • input to be hashed

Return: hashed bytes

Take a SHA-256 hash from bytes

function sha256

std::vector< uint8_t > sha256(
    const void * data,
    size_t dataSize
)

function make_twox64

void make_twox64(
    const uint8_t * in,
    uint32_t len,
    uint8_t * out
)

function make_twox64

base::Hash64 make_twox64(
    gsl::span< const uint8_t > buf
)

function make_twox128

void make_twox128(
    const uint8_t * in,
    uint32_t len,
    uint8_t * out
)

function make_twox128

base::Hash128 make_twox128(
    gsl::span< const uint8_t > buf
)

function make_twox256

void make_twox256(
    const uint8_t * in,
    uint32_t len,
    uint8_t * out
)

function make_twox256

base::Hash256 make_twox256(
    gsl::span< const uint8_t > buf
)

Updated on 2026-04-15 at 11:00:39 -0700