Kagome
Polkadot Runtime Engine in C++17
kagome::host_api::CryptoExtension Class Reference

#include <crypto_extension.hpp>

Collaboration diagram for kagome::host_api::CryptoExtension:

Public Member Functions

 CryptoExtension (std::shared_ptr< const runtime::MemoryProvider > memory_provider, std::shared_ptr< const crypto::Sr25519Provider > sr25519_provider, std::shared_ptr< const crypto::EcdsaProvider > ecdsa_provider, std::shared_ptr< const crypto::Ed25519Provider > ed25519_provider, std::shared_ptr< const crypto::Secp256k1Provider > secp256k1_provider, std::shared_ptr< const crypto::Hasher > hasher, std::shared_ptr< crypto::CryptoStore > crypto_store, std::shared_ptr< const crypto::Bip39Provider > bip39_provider)
 
runtime::WasmPointer ext_hashing_keccak_256_version_1 (runtime::WasmSpan data)
 
runtime::WasmPointer ext_hashing_sha2_256_version_1 (runtime::WasmSpan data)
 
runtime::WasmPointer ext_hashing_blake2_128_version_1 (runtime::WasmSpan data)
 
runtime::WasmPointer ext_hashing_blake2_256_version_1 (runtime::WasmSpan data)
 
runtime::WasmPointer ext_hashing_twox_64_version_1 (runtime::WasmSpan data)
 
runtime::WasmPointer ext_hashing_twox_128_version_1 (runtime::WasmSpan data)
 
runtime::WasmPointer ext_hashing_twox_256_version_1 (runtime::WasmSpan data)
 
void ext_crypto_start_batch_verify_version_1 ()
 
runtime::WasmSize ext_crypto_finish_batch_verify_version_1 ()
 
runtime::WasmSpan ext_crypto_ed25519_public_keys_version_1 (runtime::WasmSize key_type)
 
runtime::WasmPointer ext_crypto_ed25519_generate_version_1 (runtime::WasmSize key_type, runtime::WasmSpan seed)
 
runtime::WasmSpan ext_crypto_ed25519_sign_version_1 (runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
 
runtime::WasmSize ext_crypto_ed25519_verify_version_1 (runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data)
 
runtime::WasmSpan ext_crypto_sr25519_public_keys_version_1 (runtime::WasmSize key_type)
 
runtime::WasmPointer ext_crypto_sr25519_generate_version_1 (runtime::WasmSize key_type, runtime::WasmSpan seed)
 
runtime::WasmSpan ext_crypto_sr25519_sign_version_1 (runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
 
int32_t ext_crypto_sr25519_verify_version_1 (runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data)
 
int32_t ext_crypto_sr25519_verify_version_2 (runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer pubkey_data)
 
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_version_1 (runtime::WasmPointer sig, runtime::WasmPointer msg)
 
runtime::WasmSpan ext_crypto_secp256k1_ecdsa_recover_compressed_version_1 (runtime::WasmPointer sig, runtime::WasmPointer msg)
 
runtime::WasmSpan ext_crypto_ecdsa_public_keys_version_1 (runtime::WasmSize key_type)
 
runtime::WasmSpan ext_crypto_ecdsa_sign_version_1 (runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
 
runtime::WasmSpan ext_crypto_ecdsa_sign_prehashed_version_1 (runtime::WasmSize key_type, runtime::WasmPointer key, runtime::WasmSpan msg)
 
runtime::WasmPointer ext_crypto_ecdsa_generate_version_1 (runtime::WasmSize key_type_id, runtime::WasmSpan seed) const
 
int32_t ext_crypto_ecdsa_verify_version_1 (runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer key) const
 
int32_t ext_crypto_ecdsa_verify_prehashed_version_1 (runtime::WasmPointer sig, runtime::WasmSpan msg, runtime::WasmPointer key) const
 

Static Public Attributes

static constexpr uint32_t kVerifyBatchSuccess = 1
 
static constexpr uint32_t kVerifyBatchFail = 0
 
static constexpr uint32_t kVerifySuccess = 1
 
static constexpr uint32_t kVerifyFail = 0
 

Private Member Functions

common::Blob< 32 > deriveSeed (std::string_view content)
 
runtime::MemorygetMemory () const
 

Private Attributes

std::shared_ptr< const runtime::MemoryProvidermemory_provider_
 
std::shared_ptr< const crypto::Sr25519Providersr25519_provider_
 
std::shared_ptr< const crypto::EcdsaProviderecdsa_provider_
 
std::shared_ptr< const crypto::Ed25519Providered25519_provider_
 
std::shared_ptr< const crypto::Secp256k1Providersecp256k1_provider_
 
std::shared_ptr< const crypto::Hasherhasher_
 
std::shared_ptr< crypto::CryptoStorecrypto_store_
 
std::shared_ptr< const crypto::Bip39Providerbip39_provider_
 
log::Logger logger_
 

Detailed Description

Implements extension functions related to cryptography

Definition at line 33 of file crypto_extension.hpp.

Constructor & Destructor Documentation

kagome::host_api::CryptoExtension::CryptoExtension ( std::shared_ptr< const runtime::MemoryProvider memory_provider,
std::shared_ptr< const crypto::Sr25519Provider sr25519_provider,
std::shared_ptr< const crypto::EcdsaProvider ecdsa_provider,
std::shared_ptr< const crypto::Ed25519Provider ed25519_provider,
std::shared_ptr< const crypto::Secp256k1Provider secp256k1_provider,
std::shared_ptr< const crypto::Hasher hasher,
std::shared_ptr< crypto::CryptoStore crypto_store,
std::shared_ptr< const crypto::Bip39Provider bip39_provider 
)

Definition at line 63 of file crypto_extension.cpp.

Member Function Documentation

common::Blob< 32 > kagome::host_api::CryptoExtension::deriveSeed ( std::string_view  content)
private

Definition at line 196 of file crypto_extension.cpp.

runtime::WasmPointer kagome::host_api::CryptoExtension::ext_crypto_ecdsa_generate_version_1 ( runtime::WasmSize  key_type_id,
runtime::WasmSpan  seed 
) const
See also
HostApi::ext_crypto_ecdsa_generate

Definition at line 668 of file crypto_extension.cpp.

runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_ecdsa_public_keys_version_1 ( runtime::WasmSize  key_type)
runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_ecdsa_sign_prehashed_version_1 ( runtime::WasmSize  key_type,
runtime::WasmPointer  key,
runtime::WasmSpan  msg 
)
runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_ecdsa_sign_version_1 ( runtime::WasmSize  key_type,
runtime::WasmPointer  key,
runtime::WasmSpan  msg 
)
int32_t kagome::host_api::CryptoExtension::ext_crypto_ecdsa_verify_prehashed_version_1 ( runtime::WasmPointer  sig,
runtime::WasmSpan  msg,
runtime::WasmPointer  key 
) const
int32_t kagome::host_api::CryptoExtension::ext_crypto_ecdsa_verify_version_1 ( runtime::WasmPointer  sig,
runtime::WasmSpan  msg,
runtime::WasmPointer  key 
) const
See also
HostApi::ext_crypto_ecdsa_verify

Definition at line 704 of file crypto_extension.cpp.

runtime::WasmPointer kagome::host_api::CryptoExtension::ext_crypto_ed25519_generate_version_1 ( runtime::WasmSize  key_type,
runtime::WasmSpan  seed 
)
See also
HostApi::ext_crypto_ed25519_generate

Definition at line 235 of file crypto_extension.cpp.

runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_ed25519_public_keys_version_1 ( runtime::WasmSize  key_type)
See also
HostApi::ext_crypto_ed25519_public_keys

Definition at line 175 of file crypto_extension.cpp.

runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_ed25519_sign_version_1 ( runtime::WasmSize  key_type,
runtime::WasmPointer  key,
runtime::WasmSpan  msg 
)
See also
HostApi::ext_crypto_ed25519_sign

Definition at line 267 of file crypto_extension.cpp.

runtime::WasmSize kagome::host_api::CryptoExtension::ext_crypto_ed25519_verify_version_1 ( runtime::WasmPointer  sig,
runtime::WasmSpan  msg,
runtime::WasmPointer  pubkey_data 
)
See also
HostApi::ext_crypto_ed25519_verify

Definition at line 304 of file crypto_extension.cpp.

runtime::WasmSize kagome::host_api::CryptoExtension::ext_crypto_finish_batch_verify_version_1 ( )

Definition at line 170 of file crypto_extension.cpp.

runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_secp256k1_ecdsa_recover_compressed_version_1 ( runtime::WasmPointer  sig,
runtime::WasmPointer  msg 
)
runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_secp256k1_ecdsa_recover_version_1 ( runtime::WasmPointer  sig,
runtime::WasmPointer  msg 
)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_crypto_sr25519_generate_version_1 ( runtime::WasmSize  key_type,
runtime::WasmSpan  seed 
)
See also
HostApi::ext_crypto_sr25519_generate

Definition at line 358 of file crypto_extension.cpp.

runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_sr25519_public_keys_version_1 ( runtime::WasmSize  key_type)
See also
HostApi::ext_crypto_sr25519_public_keys

Definition at line 336 of file crypto_extension.cpp.

runtime::WasmSpan kagome::host_api::CryptoExtension::ext_crypto_sr25519_sign_version_1 ( runtime::WasmSize  key_type,
runtime::WasmPointer  key,
runtime::WasmSpan  msg 
)
See also
HostApi::ext_crypto_sr25519_sign

Definition at line 394 of file crypto_extension.cpp.

int32_t kagome::host_api::CryptoExtension::ext_crypto_sr25519_verify_version_1 ( runtime::WasmPointer  sig,
runtime::WasmSpan  msg,
runtime::WasmPointer  pubkey_data 
)
See also
HostApi::ext_crypto_sr25519_verify

Definition at line 434 of file crypto_extension.cpp.

int32_t kagome::host_api::CryptoExtension::ext_crypto_sr25519_verify_version_2 ( runtime::WasmPointer  sig,
runtime::WasmSpan  msg,
runtime::WasmPointer  pubkey_data 
)

Definition at line 466 of file crypto_extension.cpp.

void kagome::host_api::CryptoExtension::ext_crypto_start_batch_verify_version_1 ( )

Definition at line 165 of file crypto_extension.cpp.

runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_blake2_128_version_1 ( runtime::WasmSpan  data)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_blake2_256_version_1 ( runtime::WasmSpan  data)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_keccak_256_version_1 ( runtime::WasmSpan  data)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_sha2_256_version_1 ( runtime::WasmSpan  data)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_twox_128_version_1 ( runtime::WasmSpan  data)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_twox_256_version_1 ( runtime::WasmSpan  data)
runtime::WasmPointer kagome::host_api::CryptoExtension::ext_hashing_twox_64_version_1 ( runtime::WasmSpan  data)
runtime::Memory& kagome::host_api::CryptoExtension::getMemory ( ) const
inlineprivate

Definition at line 215 of file crypto_extension.hpp.

Member Data Documentation

std::shared_ptr<const crypto::Bip39Provider> kagome::host_api::CryptoExtension::bip39_provider_
private

Definition at line 226 of file crypto_extension.hpp.

std::shared_ptr<crypto::CryptoStore> kagome::host_api::CryptoExtension::crypto_store_
private

Definition at line 225 of file crypto_extension.hpp.

std::shared_ptr<const crypto::EcdsaProvider> kagome::host_api::CryptoExtension::ecdsa_provider_
private

Definition at line 221 of file crypto_extension.hpp.

std::shared_ptr<const crypto::Ed25519Provider> kagome::host_api::CryptoExtension::ed25519_provider_
private

Definition at line 222 of file crypto_extension.hpp.

std::shared_ptr<const crypto::Hasher> kagome::host_api::CryptoExtension::hasher_
private

Definition at line 224 of file crypto_extension.hpp.

constexpr uint32_t kagome::host_api::CryptoExtension::kVerifyBatchFail = 0
static

Definition at line 36 of file crypto_extension.hpp.

constexpr uint32_t kagome::host_api::CryptoExtension::kVerifyBatchSuccess = 1
static

Definition at line 35 of file crypto_extension.hpp.

constexpr uint32_t kagome::host_api::CryptoExtension::kVerifyFail = 0
static

Definition at line 38 of file crypto_extension.hpp.

constexpr uint32_t kagome::host_api::CryptoExtension::kVerifySuccess = 1
static

Definition at line 37 of file crypto_extension.hpp.

log::Logger kagome::host_api::CryptoExtension::logger_
private

Definition at line 227 of file crypto_extension.hpp.

std::shared_ptr<const runtime::MemoryProvider> kagome::host_api::CryptoExtension::memory_provider_
private

Definition at line 219 of file crypto_extension.hpp.

std::shared_ptr<const crypto::Secp256k1Provider> kagome::host_api::CryptoExtension::secp256k1_provider_
private

Definition at line 223 of file crypto_extension.hpp.

std::shared_ptr<const crypto::Sr25519Provider> kagome::host_api::CryptoExtension::sr25519_provider_
private

Definition at line 220 of file crypto_extension.hpp.


The documentation for this class was generated from the following files: