template <size_t Depth>
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
Public static functions
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 ) wheresk_{-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::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:: 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:: 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. |