template <size_t Depth>
cardano::SumKesPrivateKey class

KES private key based on the sum composition.

Template parameters
Depth The key depth. Max evolutions are 1^Depth - 1.

Public static variables

static size_t size constexpr
Size of the secret key in bytes.

Public static functions

static auto generate() →  std::pair< SumKesPrivateKey< Depth >, KesPublicKey > -> auto
static auto keygen(std::span<uint8_t, SumKesPrivateKey<Depth>::size+4> key_buffer, std::span<uint8_t, KesSeed::size> seed) →  std::pair< SumKesPrivateKey< Depth >, KesPublicKey > -> auto
Key generation.

Constructors, destructors, conversion operators

SumKesPrivateKey(std::span<uint8_t> bytes) explicit
Construct a KES key object from a span of key bytes.

Public functions

auto bytes() const →  const SecureByteArray< SumKesPrivateKey< Depth >::size+4 > & -> auto constexpr
Return a constant reference to the private key bytes. The encoding returns the following array of size Self::SIZE + 4: ( sk_{-1} || seed || self.lhs_pk || self.rhs_pk || period ) where sk_{-1} is the secret secret key of lower depth. Note that the period is only included in the last layer.
void drop()
Zero out the private key.
auto period() →  size_t
Return the current period of the secret key.
auto publicKey() const →  KesPublicKey
Derive the public key paired with this private key.
auto sign(std::span<const uint8_t> msg) const →  SumKesSignature<Depth>
Generate a message signature from the private key.
auto sign(std::string_view msg) const →  SumKesSignature<Depth>
Sign the message with the private key.
auto signCompact(std::span<const uint8_t> msg) const →  SumKesCompactSignature<Depth>
Sign the message with the private key and produce a compact signature.
auto signCompact(std::string_view msg) const →  SumKesCompactSignature<Depth>
Sign the message with the private key and produce a compact signature.
void update()
Update the key to the next period.

Function documentation

template <size_t Depth>
static auto cardano::SumKesPrivateKey::generate() →  std::pair< SumKesPrivateKey< Depth >, KesPublicKey >

Returns A pair of the private key and the public key.

Factory method to create a new set of KES keys from a cryptographically secure random number generator.

template <size_t Depth>
static auto cardano::SumKesPrivateKey::keygen(std::span<uint8_t, SumKesPrivateKey<Depth>::size+4> key_buffer, std::span<uint8_t, KesSeed::size> seed) →  std::pair< SumKesPrivateKey< Depth >, KesPublicKey >

Key generation.

Parameters
key_buffer A buffer of size SumKesPrivateKey<Depth>::size plus four bytes to store period as a 32 bit integer .
seed A buffer of size KesSeed::size containing the seed.
Returns A pair of SumKesPrivateKey<Depth> and KesPublicKey.

template <size_t Depth>
cardano::SumKesPrivateKey::SumKesPrivateKey(std::span<uint8_t> bytes) explicit

Construct a KES key object from a span of key bytes.

Parameters
bytes A span of bytes that will be moved into the object.

template <size_t Depth>
SumKesSignature<Depth> cardano::SumKesPrivateKey::sign(std::span<const uint8_t> msg) const

Generate a message signature from the private key.

Parameters
msg A span of bytes (uint8_t) representing the message to sign.
Returns The KES signature object.

template <size_t Depth>
SumKesSignature<Depth> cardano::SumKesPrivateKey::sign(std::string_view msg) const

Sign the message with the private key.

Parameters
msg A string type (string_view) message to sign.
Returns The KES signature object.

template <size_t Depth>
SumKesCompactSignature<Depth> cardano::SumKesPrivateKey::signCompact(std::span<const uint8_t> msg) const

Sign the message with the private key and produce a compact signature.

Parameters
msg A span of bytes (uint8_t) representing the message to sign.
Returns The KES compact signature object.

template <size_t Depth>
SumKesCompactSignature<Depth> cardano::SumKesPrivateKey::signCompact(std::string_view msg) const

Sign the message with the private key and produce a compact signature.

Parameters
msg A string type (string_view) message to sign.
Returns The KES compact signature object.

template <size_t Depth>
void cardano::SumKesPrivateKey::update()

Update the key to the next period.