7#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp"
9#include "barretenberg/crypto/hashers/hashers.hpp"
11#include "barretenberg/common/serialize.hpp"
12#include "barretenberg/common/streams.hpp"
13#include "barretenberg/serialize/msgpack.hpp"
17template <
typename Fr,
typename G1>
struct key_pair {
19 typename G1::affine_element public_key;
31 std::array<uint8_t, 32> s;
34 std::array<uint8_t, 32> e;
38template <
typename Hash,
typename Fq,
typename Fr,
typename G1>
39bool verify_signature(
const std::string& message,
const typename G1::affine_element& public_key,
const signature& sig);
41template <
typename Hash,
typename Fq,
typename Fr,
typename G1>
46 return lhs.s == rhs.s && lhs.e == rhs.e;
49inline std::ostream& operator<<(std::ostream& os, signature
const& sig)
51 os <<
"{ " << sig.s <<
", " << sig.e <<
" }";
55template <
typename B>
inline void read(B& it, key_pair<grumpkin::fr, grumpkin::g1>& keypair)
57 read(it, keypair.private_key);
58 read(it, keypair.public_key);
61template <
typename B>
inline void write(B& buf, key_pair<grumpkin::fr, grumpkin::g1>
const& keypair)
63 write(buf, keypair.private_key);
64 write(buf, keypair.public_key);
68#include "./schnorr.tcc"
Definition: schnorr.hpp:17
Definition: schnorr.hpp:25