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 
70  static Keypair generateKeypair(const PrivateKey &key);
71 
72  static constexpr size_t kHashLength = 256 / 8;
73  static constexpr size_t kPublicKeyLength = 256 / 8;
74  static constexpr size_t kPrivateKeyLength = 256 / 8;
75  static constexpr size_t kSignatureLength = 512 / 8;
76  static constexpr size_t kSeedLength = 256 / 8;
77  };
78  } // namespace crypto
79 } // namespace shared_model
80 
81 #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:75
Definition: private_key.hpp:16
static constexpr size_t kPrivateKeyLength
Definition: crypto_provider.hpp:74
static constexpr size_t kSeedLength
Definition: crypto_provider.hpp:76
static constexpr size_t kHashLength
Definition: crypto_provider.hpp:72
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:13
static constexpr size_t kPublicKeyLength
Definition: crypto_provider.hpp:73