hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
crypto_provider.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CRYPTOPROVIDER_HPP
7 #define IROHA_CRYPTOPROVIDER_HPP
8 
10 #include "cryptography/seed.hpp"
12 
13 namespace shared_model {
14  namespace crypto {
19  public:
26  static std::string sign(const Blob &blob, const Keypair &keypair);
27 
35  static bool verify(
36  shared_model::interface::types::SignatureByteRangeView signature,
37  const Blob &orig,
38  shared_model::interface::types::PublicKeyByteRangeView public_key);
43  static Seed generateSeed();
44 
50  static Seed generateSeed(const std::string &passphrase);
51 
56  static Keypair generateKeypair();
57 
63  static Keypair generateKeypair(const Seed &seed);
64 
65  static constexpr size_t kHashLength = 256 / 8;
66  static constexpr size_t kPublicKeyLength = 256 / 8;
67  static constexpr size_t kPrivateKeyLength = 256 / 8;
68  static constexpr size_t kSignatureLength = 512 / 8;
69  static constexpr size_t kSeedLength = 256 / 8;
70  };
71  } // namespace crypto
72 } // namespace shared_model
73 
74 #endif // IROHA_CRYPTOPROVIDER_HPP
static Keypair generateKeypair()
Definition: crypto_provider.cpp:37
Definition: blob.hpp:27
Definition: keypair.hpp:19
static constexpr size_t kSignatureLength
Definition: crypto_provider.hpp:68
static constexpr size_t kPrivateKeyLength
Definition: crypto_provider.hpp:67
static constexpr size_t kSeedLength
Definition: crypto_provider.hpp:69
static constexpr size_t kHashLength
Definition: crypto_provider.hpp:65
Definition: seed.hpp:16
static Seed generateSeed()
Definition: crypto_provider.cpp:28
static std::string sign(const Blob &blob, const Keypair &keypair)
Definition: crypto_provider.cpp:17
static bool verify(shared_model::interface::types::SignatureByteRangeView signature, const Blob &orig, shared_model::interface::types::PublicKeyByteRangeView public_key)
Definition: crypto_provider.cpp:22
Definition: crypto_provider.hpp:18
Definition: command_executor.hpp:12
static constexpr size_t kPublicKeyLength
Definition: crypto_provider.hpp:66