Skip to content

sgns::crypto::bip39::EntropyAccumulator

Accumulates entropy tokens and exposes entropy + checksum. More...

#include <entropy_accumulator.hpp>

Public Functions

Name
outcome::result< EntropyAccumulator > create(size_t words_count)
create class instance
outcome::result< void > append(const EntropyToken & value)
append a new entropy token
outcome::result< std::vector< uint8_t > > getEntropy() const
outcome::result< uint8_t > getChecksum() const
checksum is a part of last byte
outcome::result< uint8_t > calculateChecksum() const
calculates checksum of significant bits

Detailed Description

class sgns::crypto::bip39::EntropyAccumulator;

Accumulates entropy tokens and exposes entropy + checksum.

Used to assemble mnemonic-derived entropy and validate its checksum.

Public Functions Documentation

function create

static outcome::result< EntropyAccumulator > create(
    size_t words_count
)

create class instance

Parameters:

  • words_count number of words in mnemonic phrase

function append

outcome::result< void > append(
    const EntropyToken & value
)

append a new entropy token

Parameters:

  • value token

Return: success or error if storage is full

function getEntropy

outcome::result< std::vector< uint8_t > > getEntropy() const

Return: entropy as byte array

function getChecksum

outcome::result< uint8_t > getChecksum() const

checksum is a part of last byte

Return: checksum

function calculateChecksum

outcome::result< uint8_t > calculateChecksum() const

calculates checksum of significant bits

Return: checksum value


Updated on 2026-03-04 at 13:10:43 -0800