|
Kagome
Polkadot Runtime Engine in C++17
|
Namespaces | |
| bip39 | |
| constants | |
| secp256k1 | |
Classes | |
| class | Bip39Provider |
| class | Bip39ProviderImpl |
| struct | blake2b_ctx |
| struct | blake2s_ctx |
| struct | blake2s_ctx_full |
| class | CryptoStore |
| class | CryptoStoreImpl |
| struct | CryptoSuite |
| class | DevMnemonicPhrase |
| struct | EcdsaKeypair |
| struct | EcdsaKeypairAndSeed |
| class | EcdsaProvider |
| class | EcdsaProviderImpl |
| class | EcdsaSuite |
| struct | Ed25519Keypair |
| struct | Ed25519KeypairAndSeed |
| class | Ed25519Provider |
| class | Ed25519ProviderImpl |
| class | Ed25519Suite |
| class | Hasher |
| class | HasherImpl |
| class | KeyCache |
| class | KeyFileStorage |
| class | Pbkdf2Provider |
| class | Pbkdf2ProviderImpl |
| class | Secp256k1Provider |
| class | Secp256k1ProviderImpl |
| class | SessionKeys |
| struct | Sr25519Keypair |
| struct | Sr25519KeypairAndSeed |
| class | Sr25519Provider |
| class | Sr25519ProviderImpl |
| class | Sr25519Suite |
| struct | VRFOutput |
| class | VRFProvider |
| class | VRFProviderImpl |
| struct | VRFVerifyOutput |
Typedefs | |
| using | KeyTypeId = uint32_t |
| Key type identifier. More... | |
| using | EcdsaSignature = std::vector< uint8_t > |
| using | EcdsaSeed = common::Blob< constants::ecdsa::SEED_SIZE > |
| using | EcdsaPrehashedMessage = libp2p::crypto::ecdsa::PrehashedMessage |
| using | BoostRandomGenerator = libp2p::crypto::random::BoostRandomGenerator |
| using | CSPRNG = libp2p::crypto::random::CSPRNG |
| using | RandomGenerator = libp2p::crypto::random::RandomGenerator |
| using | VRFPreOutput = std::array< uint8_t, constants::sr25519::vrf::OUTPUT_SIZE > |
| using | VRFThreshold = boost::multiprecision::uint128_t |
| using | VRFProof = std::array< uint8_t, constants::sr25519::vrf::PROOF_SIZE > |
Functions | |
| static void | blake2b_compress (blake2b_ctx *ctx, int last) |
| int | blake2b_init (blake2b_ctx *ctx, size_t outlen, const void *key, size_t keylen) |
| void | blake2b_update (blake2b_ctx *ctx, const void *in, size_t inlen) |
| void | blake2b_final (blake2b_ctx *ctx, void *out) |
| int | blake2b (void *out, size_t outlen, const void *key, size_t keylen, const void *in, size_t inlen) |
| static void | blake2s_compress (blake2s_ctx_full *ctx, int last) |
| void | blake2s_update (blake2s_ctx *ctx, const void *in, size_t inlen) |
| Update context with incoming bytes. More... | |
| void | blake2s_final (blake2s_ctx *ctx, void *out) |
| Finalize hash calculation. More... | |
| int | blake2s_init (blake2s_ctx *ctx, size_t outlen, const void *key, size_t keylen) |
| Generic blake2s init function. More... | |
| int | blake2s (void *out, size_t outlen, const void *key, size_t keylen, const void *in, size_t inlen) |
| All in one blake2s hashing function. More... | |
| void | blake2s_256_init (blake2s_ctx *ctx) |
| Initialize hash context. More... | |
| void | blake2s_256 (void *out, const void *in, size_t inlen) |
| One-shot convenience function to calculate blake2s_256 hash. More... | |
| libp2p::crypto::KeyPair | ed25519KeyToLibp2pKeypair (const Ed25519Keypair &kp) |
| bool | isSupportedKeyType (KeyTypeId k) |
| checks whether key type value is supported More... | |
| std::string | encodeKeyTypeIdToStr (KeyTypeId key_type_id) |
| makes string representation of KeyTypeId More... | |
| KeyTypeId | decodeKeyTypeIdFromStr (std::string_view str) |
| restores KeyTypeId from its string representation More... | |
| outcome::result< int > | validateRecoveryId (int v) |
| common::Hash256 | sha256 (std::string_view input) |
| common::Hash256 | sha256 (gsl::span< const uint8_t > input) |
| void | make_twox64 (const uint8_t *in, uint32_t len, uint8_t *out) |
| common::Hash64 | make_twox64 (gsl::span< const uint8_t > buf) |
| void | make_twox128 (const uint8_t *in, uint32_t len, uint8_t *out) |
| common::Hash128 | make_twox128 (gsl::span< const uint8_t > buf) |
| void | make_twox256 (const uint8_t *in, uint32_t len, uint8_t *out) |
| common::Hash256 | make_twox256 (gsl::span< const uint8_t > buf) |
Variables | |
| static const uint64_t | blake2b_iv [8] |
| static const uint32_t | blake2s_iv [8] |
| constexpr KnownKeyTypeId | polkadot_key_order [6] |
Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
| struct kagome::crypto::blake2b_ctx |
| struct kagome::crypto::blake2s_ctx |
| struct kagome::crypto::blake2s_ctx_full |
Definition at line 29 of file blake2s.cpp.
| Class Members | ||
|---|---|---|
| uint8_t | b[64] | |
| size_t | c | |
| uint32_t | h[8] | |
| size_t | outlen | |
| uint32_t | t[2] | |
| struct kagome::crypto::VRFVerifyOutput |
Output of a verifiable random function verification.
Definition at line 67 of file sr25519_types.hpp.
| Class Members | ||
|---|---|---|
| bool | is_less | |
| bool | is_valid | |
| using kagome::crypto::BoostRandomGenerator = typedef libp2p::crypto::random::BoostRandomGenerator |
Definition at line 13 of file boost_generator.hpp.
| typedef libp2p::crypto::random::CSPRNG kagome::crypto::CSPRNG |
Definition at line 14 of file boost_generator.hpp.
| using kagome::crypto::EcdsaPrehashedMessage = typedef libp2p::crypto::ecdsa::PrehashedMessage |
Definition at line 45 of file ecdsa_types.hpp.
| using kagome::crypto::EcdsaSeed = typedef common::Blob<constants::ecdsa::SEED_SIZE> |
Definition at line 44 of file ecdsa_types.hpp.
| using kagome::crypto::EcdsaSignature = typedef std::vector<uint8_t> |
Definition at line 43 of file ecdsa_types.hpp.
| using kagome::crypto::KeyTypeId = typedef uint32_t |
Key type identifier.
Definition at line 21 of file key_type.hpp.
| using kagome::crypto::RandomGenerator = typedef libp2p::crypto::random::RandomGenerator |
Definition at line 12 of file random_generator.hpp.
| using kagome::crypto::VRFPreOutput = typedef std::array<uint8_t, constants::sr25519::vrf::OUTPUT_SIZE> |
Definition at line 45 of file sr25519_types.hpp.
| using kagome::crypto::VRFProof = typedef std::array<uint8_t, constants::sr25519::vrf::PROOF_SIZE> |
Definition at line 47 of file sr25519_types.hpp.
| using kagome::crypto::VRFThreshold = typedef boost::multiprecision::uint128_t |
Definition at line 46 of file sr25519_types.hpp.
|
strong |
| Enumerator | |
|---|---|
| UNSUPPORTED_KEY_TYPE | |
| UNSUPPORTED_CRYPTO_TYPE | |
| WRONG_SEED_SIZE | |
| KEY_NOT_FOUND | |
| BABE_ALREADY_EXIST | |
| GRAN_ALREADY_EXIST | |
| AUDI_ALREADY_EXIST | |
| WRONG_PUBLIC_KEY | |
Definition at line 26 of file crypto_store_impl.hpp.
|
strong |
| Enumerator | |
|---|---|
| UNSUPPORTED_KEY_TYPE | |
| UNSUPPORTED_KEY_TYPE_ID | |
Definition at line 13 of file key_type.hpp.
Types are 32bit integers, which represent encoded 4-char strings Little-endian byte order is used
| Enumerator | |
|---|---|
| KEY_TYPE_BABE | |
| KEY_TYPE_GRAN | |
| KEY_TYPE_ACCO | |
| KEY_TYPE_IMON | |
| KEY_TYPE_AUDI | |
| KEY_TYPE_LP2P | |
| KEY_TYPE_ASGN | |
| KEY_TYPE_PARA | |
Definition at line 27 of file key_type.hpp.
|
strong |
| Enumerator | |
|---|---|
| KEY_DERIVATION_FAILED | |
Definition at line 15 of file pbkdf2_provider.hpp.
|
strong |
| Enumerator | |
|---|---|
| INVALID_ARGUMENT | |
| INVALID_V_VALUE | |
| INVALID_R_OR_S_VALUE | |
| INVALID_SIGNATURE | |
| RECOVERY_FAILED | |
Definition at line 15 of file secp256k1_provider_impl.hpp.
|
strong |
sr25519 provider error codes
| Enumerator | |
|---|---|
| SIGN_UNKNOWN_ERROR | |
| VERIFY_UNKNOWN_ERROR | |
Definition at line 18 of file sr25519_provider.hpp.
| int kagome::crypto::blake2b | ( | void * | out, |
| size_t | outlen, | ||
| const void * | key, | ||
| size_t | keylen, | ||
| const void * | in, | ||
| size_t | inlen | ||
| ) |
Definition at line 190 of file blake2b.cpp.
|
static |
Definition at line 60 of file blake2b.cpp.
| void kagome::crypto::blake2b_final | ( | blake2b_ctx * | ctx, |
| void * | out | ||
| ) |
Definition at line 169 of file blake2b.cpp.
| int kagome::crypto::blake2b_init | ( | blake2b_ctx * | ctx, |
| size_t | outlen, | ||
| const void * | key, | ||
| size_t | keylen | ||
| ) |
Definition at line 113 of file blake2b.cpp.
| void kagome::crypto::blake2b_update | ( | blake2b_ctx * | ctx, |
| const void * | in, | ||
| size_t | inlen | ||
| ) |
Definition at line 147 of file blake2b.cpp.
| int kagome::crypto::blake2s | ( | void * | out, |
| size_t | outlen, | ||
| const void * | key, | ||
| size_t | keylen, | ||
| const void * | in, | ||
| size_t | inlen | ||
| ) |
All in one blake2s hashing function.
| out | output buffer |
| outlen | size of { |
| out} | |
| key | optional key |
| keylen | size of { |
| key}. | Pass 0 to indicate that key is not provided. |
| in | data to be hashed |
| inlen | size of { |
| in} |
Definition at line 194 of file blake2s.cpp.
| void kagome::crypto::blake2s_256 | ( | void * | out, |
| const void * | in, | ||
| size_t | inlen | ||
| ) |
One-shot convenience function to calculate blake2s_256 hash.
| out | 32-byte buffer |
| in | { |
| inlen} | bytes input buffer |
| inlen | size of the input buffer |
Definition at line 216 of file blake2s.cpp.
| void kagome::crypto::blake2s_256_init | ( | blake2s_ctx * | ctx | ) |
|
static |
Definition at line 69 of file blake2s.cpp.
| void kagome::crypto::blake2s_final | ( | blake2s_ctx * | ctx, |
| void * | out | ||
| ) |
Finalize hash calculation.
| ctx | context |
| out | 32-byte output |
Definition at line 138 of file blake2s.cpp.
| int kagome::crypto::blake2s_init | ( | blake2s_ctx * | ctx, |
| size_t | outlen, | ||
| const void * | key, | ||
| size_t | keylen | ||
| ) |
Generic blake2s init function.
| ctx | context |
| outlen | 1..32 bytes of output buffer size |
| key | optional key |
| keylen | length of { |
| key} | in bytes. Pass 0 to indicate that key is not provided. |
Definition at line 159 of file blake2s.cpp.
| void kagome::crypto::blake2s_update | ( | blake2s_ctx * | ctx, |
| const void * | in, | ||
| size_t | inlen | ||
| ) |
Update context with incoming bytes.
| ctx | context |
| in | { |
| inlen} | byte array |
| inlen | size of { |
| in} |
Definition at line 117 of file blake2s.cpp.
| KeyTypeId kagome::crypto::decodeKeyTypeIdFromStr | ( | std::string_view | str | ) |
restores KeyTypeId from its string representation
| param | string representation of key type |
Definition at line 35 of file key_type.cpp.
| libp2p::crypto::KeyPair kagome::crypto::ed25519KeyToLibp2pKeypair | ( | const Ed25519Keypair & | kp | ) |
Definition at line 243 of file crypto_store_impl.cpp.
| std::string kagome::crypto::encodeKeyTypeIdToStr | ( | KeyTypeId | key_type_id | ) |
makes string representation of KeyTypeId
| key_type_id | KeyTypeId |
Definition at line 29 of file key_type.cpp.
| bool kagome::crypto::isSupportedKeyType | ( | KeyTypeId | k | ) |
checks whether key type value is supported
| k | key type value |
Definition at line 14 of file key_type.cpp.
| void kagome::crypto::make_twox128 | ( | const uint8_t * | in, |
| uint32_t | len, | ||
| uint8_t * | out | ||
| ) |
| common::Hash128 kagome::crypto::make_twox128 | ( | gsl::span< const uint8_t > | buf | ) |
| void kagome::crypto::make_twox256 | ( | const uint8_t * | in, |
| uint32_t | len, | ||
| uint8_t * | out | ||
| ) |
| common::Hash256 kagome::crypto::make_twox256 | ( | gsl::span< const uint8_t > | buf | ) |
| void kagome::crypto::make_twox64 | ( | const uint8_t * | in, |
| uint32_t | len, | ||
| uint8_t * | out | ||
| ) |
| common::Hash64 kagome::crypto::make_twox64 | ( | gsl::span< const uint8_t > | buf | ) |
| common::Hash256 kagome::crypto::sha256 | ( | std::string_view | input | ) |
Take a SHA-256 hash from string
| input | to be hashed |
Definition at line 11 of file sha256.cpp.
| common::Hash256 kagome::crypto::sha256 | ( | gsl::span< const uint8_t > | input | ) |
Take a SHA-256 hash from bytes
| input | to be hashed |
Definition at line 17 of file sha256.cpp.
| outcome::result<int> kagome::crypto::validateRecoveryId | ( | int | v | ) |
Definition at line 57 of file secp256k1_provider_impl.cpp.
|
static |
Definition at line 49 of file blake2b.cpp.
|
static |
Definition at line 58 of file blake2s.cpp.
| constexpr KnownKeyTypeId kagome::crypto::polkadot_key_order[6] |
Definition at line 23 of file session_keys.hpp.