Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bbapi_ecdsa.hpp
Go to the documentation of this file.
1#pragma once
15#include <array>
16#include <cstdint>
17#include <string>
18#include <vector>
19
20namespace bb::bbapi {
21
27 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1ComputePublicKey";
28
29 struct Response {
30 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1ComputePublicKeyResponse";
33 bool operator==(const Response&) const = default;
34 };
35
37 Response execute(BBApiRequest& request) &&;
39 bool operator==(const EcdsaSecp256k1ComputePublicKey&) const = default;
40};
41
47 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1ComputePublicKey";
48
49 struct Response {
50 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1ComputePublicKeyResponse";
53 bool operator==(const Response&) const = default;
54 };
55
57 Response execute(BBApiRequest& request) &&;
59 bool operator==(const EcdsaSecp256r1ComputePublicKey&) const = default;
60};
61
67 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1ConstructSignature";
68
69 struct Response {
70 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1ConstructSignatureResponse";
71 std::array<uint8_t, 32> r;
72 std::array<uint8_t, 32> s;
73 uint8_t v;
75 bool operator==(const Response&) const = default;
76 };
77
78 std::vector<uint8_t> message;
80 Response execute(BBApiRequest& request) &&;
82 bool operator==(const EcdsaSecp256k1ConstructSignature&) const = default;
83};
84
90 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1ConstructSignature";
91
92 struct Response {
93 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1ConstructSignatureResponse";
94 std::array<uint8_t, 32> r;
95 std::array<uint8_t, 32> s;
96 uint8_t v;
98 bool operator==(const Response&) const = default;
99 };
100
101 std::vector<uint8_t> message;
103 Response execute(BBApiRequest& request) &&;
105 bool operator==(const EcdsaSecp256r1ConstructSignature&) const = default;
106};
107
113 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1RecoverPublicKey";
114
115 struct Response {
116 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1RecoverPublicKeyResponse";
119 bool operator==(const Response&) const = default;
120 };
121
122 std::vector<uint8_t> message;
123 std::array<uint8_t, 32> r;
124 std::array<uint8_t, 32> s;
125 uint8_t v;
126 Response execute(BBApiRequest& request) &&;
128 bool operator==(const EcdsaSecp256k1RecoverPublicKey&) const = default;
129};
130
136 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1RecoverPublicKey";
137
138 struct Response {
139 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1RecoverPublicKeyResponse";
142 bool operator==(const Response&) const = default;
143 };
144
145 std::vector<uint8_t> message;
146 std::array<uint8_t, 32> r;
147 std::array<uint8_t, 32> s;
148 uint8_t v;
149 Response execute(BBApiRequest& request) &&;
151 bool operator==(const EcdsaSecp256r1RecoverPublicKey&) const = default;
152};
153
159 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1VerifySignature";
160
161 struct Response {
162 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256k1VerifySignatureResponse";
165 bool operator==(const Response&) const = default;
166 };
167
168 std::vector<uint8_t> message;
170 std::array<uint8_t, 32> r;
171 std::array<uint8_t, 32> s;
172 uint8_t v;
173 Response execute(BBApiRequest& request) &&;
175 bool operator==(const EcdsaSecp256k1VerifySignature&) const = default;
176};
177
183 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1VerifySignature";
184
185 struct Response {
186 static constexpr const char MSGPACK_SCHEMA_NAME[] = "EcdsaSecp256r1VerifySignatureResponse";
189 bool operator==(const Response&) const = default;
190 };
191
192 std::vector<uint8_t> message;
194 std::array<uint8_t, 32> r;
195 std::array<uint8_t, 32> s;
196 uint8_t v;
197 Response execute(BBApiRequest& request) &&;
199 bool operator==(const EcdsaSecp256r1VerifySignature&) const = default;
200};
201
202} // namespace bb::bbapi
Shared type definitions for the Barretenberg RPC API.
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const Response &) const =default
Compute ECDSA public key from private key for secp256k1.
Response execute(BBApiRequest &request) &&
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const EcdsaSecp256k1ComputePublicKey &) const =default
bool operator==(const Response &) const =default
Construct an ECDSA signature for secp256k1.
Response execute(BBApiRequest &request) &&
bool operator==(const EcdsaSecp256k1ConstructSignature &) const =default
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const Response &) const =default
Recover public key from ECDSA signature for secp256k1.
Response execute(BBApiRequest &request) &&
bool operator==(const EcdsaSecp256k1RecoverPublicKey &) const =default
static constexpr const char MSGPACK_SCHEMA_NAME[]
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const Response &) const =default
Verify an ECDSA signature for secp256k1.
secp256k1::g1::affine_element public_key
Response execute(BBApiRequest &request) &&
MSGPACK_FIELDS(message, public_key, r, s, v)
bool operator==(const EcdsaSecp256k1VerifySignature &) const =default
static constexpr const char MSGPACK_SCHEMA_NAME[]
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const Response &) const =default
Compute ECDSA public key from private key for secp256r1.
bool operator==(const EcdsaSecp256r1ComputePublicKey &) const =default
Response execute(BBApiRequest &request) &&
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const Response &) const =default
Construct an ECDSA signature for secp256r1.
static constexpr const char MSGPACK_SCHEMA_NAME[]
Response execute(BBApiRequest &request) &&
bool operator==(const EcdsaSecp256r1ConstructSignature &) const =default
bool operator==(const Response &) const =default
Recover public key from ECDSA signature for secp256r1.
Response execute(BBApiRequest &request) &&
bool operator==(const EcdsaSecp256r1RecoverPublicKey &) const =default
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const Response &) const =default
static constexpr const char MSGPACK_SCHEMA_NAME[]
Verify an ECDSA signature for secp256r1.
secp256r1::g1::affine_element public_key
static constexpr const char MSGPACK_SCHEMA_NAME[]
bool operator==(const EcdsaSecp256r1VerifySignature &) const =default
MSGPACK_FIELDS(message, public_key, r, s, v)
Response execute(BBApiRequest &request) &&