hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
ed25519_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CRYPTO_HPP
7 #define IROHA_CRYPTO_HPP
8 
9 #include <string>
10 #include <string_view>
11 
12 #include "common/blob.hpp"
13 #include "crypto/keypair.hpp"
15 
16 namespace iroha {
17 
26  sig_t sign(const uint8_t *msg,
27  size_t msgsize,
28  const pubkey_t &pub,
29  const privkey_t &priv);
30 
31  sig_t sign(std::string_view msg, const pubkey_t &pub, const privkey_t &priv);
32 
41  bool verify(const uint8_t *msg,
42  size_t msgsize,
43  shared_model::interface::types::PublicKeyByteRangeView public_key,
44  shared_model::interface::types::SignatureByteRangeView signature);
45 
46  bool verify(std::string_view msg,
47  shared_model::interface::types::PublicKeyByteRangeView public_key,
48  shared_model::interface::types::SignatureByteRangeView signature);
49 
53  blob_t<32> create_seed();
54 
60  blob_t<32> create_seed(std::string passphrase);
61 
67  keypair_t create_keypair(blob_t<32> seed);
68 
73  keypair_t create_keypair();
74 
75 } // namespace iroha
76 #endif // IROHA_CRYPTO_HPP
bool verify(const uint8_t *msg, size_t msgsize, PublicKeyByteRangeView public_key, SignatureByteRangeView signature)
Definition: ed25519_impl.cpp:40
blob_t< 32 > create_seed()
Definition: ed25519_impl.cpp:68
blob_t< 32 > pubkey_t
Definition: keypair.hpp:14
sig_t sign(const uint8_t *msg, size_t msgsize, const pubkey_t &pub, const privkey_t &priv)
Definition: ed25519_impl.cpp:19
blob_t< 64 > sig_t
Definition: keypair.hpp:13
Definition: block_query.hpp:15
blob_t< 32 > privkey_t
Definition: keypair.hpp:15
keypair_t create_keypair(blob_t< 32 > seed)
Definition: ed25519_impl.cpp:86