Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
schnorr.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8#include "../../primitives/bool/bool.hpp"
9#include "../../primitives/byte_array/byte_array.hpp"
10#include "../../primitives/field/field.hpp"
11#include "../../primitives/group/cycle_group.hpp"
12#include "../../primitives/witness/witness.hpp"
14
15namespace bb::stdlib {
16
17template <typename C> struct schnorr_signature_bits {
20};
21
22template <typename C>
24
25template <typename C>
27 const cycle_group<C>& pub_key,
28 const schnorr_signature_bits<C>& sig);
29
30template <typename C>
31void schnorr_verify_signature(const byte_array<C>& message,
32 const cycle_group<C>& pub_key,
33 const schnorr_signature_bits<C>& sig);
34
35template <typename C>
37 const cycle_group<C>& pub_key,
38 const schnorr_signature_bits<C>& sig);
39
40} // namespace bb::stdlib
Implements boolean logic in-circuit.
Definition bool.hpp:59
Represents a dynamic array of bytes in-circuit.
cycle_group represents a group Element of the proving system's embedded curve i.e....
cycle_scalar represents a member of the cycle curve SCALAR FIELD. This is NOT the native circuit fiel...
StrictMock< MockContext > context
schnorr_signature_bits< C > schnorr_convert_signature(C *context, const crypto::schnorr_signature &signature)
Instantiate a witness containing the signature (s, e) as a quadruple of field_t elements (s_lo,...
Definition schnorr.cpp:22
std::array< field_t< C >, 2 > schnorr_verify_signature_internal(const byte_array< C > &message, const cycle_group< C > &pub_key, const schnorr_signature_bits< C > &sig)
Make the computations needed to verify a signature (s, e), i.e., compute e' = hash(([s]g + [e]pub)....
Definition schnorr.cpp:46
bool_t< C > schnorr_signature_verification_result(const byte_array< C > &message, const cycle_group< C > &pub_key, const schnorr_signature_bits< C > &sig)
Attempt to verify a signature (s, e) and return the result, i.e., compute e' = hash(([s]g + [e]pub)....
Definition schnorr.cpp:90
void schnorr_verify_signature(const byte_array< C > &message, const cycle_group< C > &pub_key, const schnorr_signature_bits< C > &sig)
Verify that a signature (s, e) is valid, i.e., compute e' = hash(([s]g + [e]pub).x | message) and che...
Definition schnorr.cpp:75
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
cycle_group< C >::cycle_scalar s
Definition schnorr.hpp:18
cycle_group< C >::cycle_scalar e
Definition schnorr.hpp:19