Skip to content

Commit

Permalink
feat(dsl): Add ECDSA secp256r1 verification (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 authored Jul 10, 2023
1 parent c9bc87d commit adc4c7b
Show file tree
Hide file tree
Showing 15 changed files with 549 additions and 36 deletions.
2 changes: 1 addition & 1 deletion cpp/bin-test/target/main.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"backend":"dummy-backend-bb.js","abi":{"parameters":[{"name":"verification_key","type":{"kind":"array","length":114,"type":{"kind":"field"}},"visibility":"private"},{"name":"proof","type":{"kind":"array","length":94,"type":{"kind":"field"}},"visibility":"private"},{"name":"public_inputs","type":{"kind":"array","length":1,"type":{"kind":"field"}},"visibility":"private"},{"name":"key_hash","type":{"kind":"field"},"visibility":"private"},{"name":"input_aggregation_object","type":{"kind":"array","length":16,"type":{"kind":"field"}},"visibility":"private"},{"name":"proof_b","type":{"kind":"array","length":94,"type":{"kind":"field"}},"visibility":"private"}],"param_witnesses":{"input_aggregation_object":[211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226],"key_hash":[210],"proof":[115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208],"proof_b":[227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320],"public_inputs":[209],"verification_key":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114]},"return_type":{"kind":"array","length":16,"type":{"kind":"field"}},"return_witnesses":[337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352]},"bytecode":"H4sIAAAAAAAA/+3WQ7PcWQDG4fOObTNj287YMxl7JmPbtm3Htm1bXyG2zefWzSaLLFK3KotUTtXT1auurnp//9NdSh4ppexWSm7hVm7jdu7gTu7ibu7hXu7jfh7gQR6iZtmwswWvkLXvt2QrtmYbtmU7tmcHdmQndmYXdq38zmV39mBP9mJv9mFf9mN/DuBADuJgDuFQqnEYh3MER3IUR3MMx3Icx3MCJ3ISJ3MKp3Iap3MGZ3IWZ3MO53Ie53MBF3IRF3MJ1bmUy7icK7iSq7iaa7iW67ieG7iRm7iZGtis2KzYrNis2KzYrNis2KzYrNis2KzYrNis2KzYrNTkYSr2f5THeJwneJKneJpneJbneJ4XeJGXeHntjhWf+Sqv8Tpv8CZv8Tbv8C7v8T4f8CEf8TGf8Cmf8Tlf8CVf8TXf8C3f8T0/8CM/8TO/8Cu/8Tt/8Cd/8Tf/8C//8T+1qE0d6lKP+jSgIY1oTBOa0ozmtKAlrWhNG9rSjvZ0oCOd6EwXutKN7vSgJ73oTR/60o/+DGAggxjMEIYyjOGMYCSjGM2YUvkMjWVcqfKJHqPH6DF6jB6jx+gxeoweo8foMXqMHqPH6DE1StXP5jth07oTxjOBiUxiMlOYyjSmM4OZzGI2c5jLPOazgIUsYjFLWMoylrOClaxidWU+8RINRUPRUDQUDUVD0VA0FA1FQ9FQNBQNRUOp+C3UUDQUDUVD0VA0FA1FQ9FQNBQNRUPRUDQUDaUaGoqGoqFoKBqKhqKhaCgaioaioWgoGoqGoqFoKBqKhqKhaCgaioaioWgoGoqGoqFoKBqKhqKhVC/r3AlVfaY36v+C9Z41mprLcKgIAAA=","proving_key":[],"verification_key":[],"gates":505501}
{"backend":"acvm-backend-barretenberg","abi":{"parameters":[{"name":"verification_key","type":{"kind":"array","length":114,"type":{"kind":"field"}},"visibility":"private"},{"name":"proof","type":{"kind":"array","length":94,"type":{"kind":"field"}},"visibility":"private"},{"name":"public_inputs","type":{"kind":"array","length":1,"type":{"kind":"field"}},"visibility":"private"},{"name":"key_hash","type":{"kind":"field"},"visibility":"private"},{"name":"input_aggregation_object","type":{"kind":"array","length":16,"type":{"kind":"field"}},"visibility":"private"},{"name":"proof_b","type":{"kind":"array","length":94,"type":{"kind":"field"}},"visibility":"private"}],"param_witnesses":{"input_aggregation_object":[211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226],"key_hash":[210],"proof":[115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208],"proof_b":[227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320],"public_inputs":[209],"verification_key":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114]},"return_type":{"kind":"array","length":16,"type":{"kind":"field"}},"return_witnesses":[337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352]},"bytecode":"H4sIAAAAAAAA/+3WU6/dWQDG4fWObbNj2+7YMx17pmPbtm3Xtm1bX6G2zefk9KZJb5qT9KLpSp6dfbWzk/f3X3uXkkdKKbuVklu4ldu4nTu4k7u4m3u4l/u4nwd4kIeoWTb8bMErZO37LdmKrdmGbdmO7dmBHdmJndmFXSu/d9mdPdiTvdibfdiX/difAziQgziYQziUahzG4RzBkRzF0RzDsRzH8ZzAiZzEyZzCqZzG6ZzBmZzF2ZzDuZzH+VzAhVzExVxCdS7lMi7nCq7kKq7mGq7lOq7nBm7kJm6mBnYrdit2K3Yrdit2K3Yrdit2K3Yrdit2K3Yrdit2KzV5mIoGHuUxHucJnuQpnuYZnuU5nucFXuQlXl67Y8VnvsprvM4bvMlbvM07vMt7vM8HfMhHfMwnfMpnfM4XfMlXfM03fMt3fM8P/MhP/Mwv/Mpv/M4f/Mlf/M0//Mt//E8talOHutSjPg1oSCMa04SmNKM5LWhJK1rThra0oz0d6EgnOtOFrnSjOz3oSS9604e+9KM/AxjIIAYzhKEMYzgjGMkoRjOmVD5DYxlXqnyix+gxeoweo8foMXqMHqPH6DF6jB6jx+gxekyNUvWz+U7YtO6E8UxgIpOYzBSmMo3pzGAms5jNHOYyj/ksYCGLWMwSlrKM5axgJatYXZlPvERD0VA0FA1FQ9FQNBQNRUPRUDQUDUVD0VAqfg81FA1FQ9FQNBQNRUPRUDQUDUVD0VA0FA1FQ6mGhqKhaCgaioaioWgoGoqGoqFoKBqKhqKhaCgaioaioWgoGoqGoqFoKBqKhqKhaCgaioaioWgo1cs6d0JVn+mN/t9gvWcN6fQg96wIAAA=","proving_key":[],"verification_key":[]}
15 changes: 15 additions & 0 deletions cpp/src/barretenberg/crypto/ecdsa/ecdsa.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#pragma once
#include "../hashers/hashers.hpp"
#include "barretenberg/ecc/curves/secp256k1/secp256k1.hpp"

#include "barretenberg/ecc/curves/secp256r1/secp256r1.hpp"

#include "barretenberg/serialize/msgpack.hpp"
#include <array>
#include <string>
Expand Down Expand Up @@ -70,6 +73,18 @@ template <typename B> inline void write(B& buf, key_pair<secp256k1::fr, secp256k
write(buf, keypair.public_key);
}

template <typename B> inline void read(B& it, key_pair<secp256r1::fr, secp256r1::g1>& keypair)
{
read(it, keypair.private_key);
read(it, keypair.public_key);
}

template <typename B> inline void write(B& buf, key_pair<secp256r1::fr, secp256r1::g1> const& keypair)
{
write(buf, keypair.private_key);
write(buf, keypair.public_key);
}

} // namespace ecdsa
} // namespace crypto

Expand Down
22 changes: 16 additions & 6 deletions cpp/src/barretenberg/dsl/acir_format/acir_format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ void create_circuit(Builder& builder, acir_format const& constraint_system)
create_schnorr_verify_constraints(builder, constraint);
}

// Add ECDSA constraints
for (const auto& constraint : constraint_system.ecdsa_constraints) {
create_ecdsa_verify_constraints(builder, constraint, false);
// Add ECDSA K1 constraints
for (const auto& constraint : constraint_system.ecdsa_k1_constraints) {
create_ecdsa_k1_verify_constraints(builder, constraint, false);
}

// Add ECDSA R1 constraints
for (const auto& constraint : constraint_system.ecdsa_r1_constraints) {
create_ecdsa_r1_verify_constraints(builder, constraint, false);
}

// Add blake2s constraints
Expand Down Expand Up @@ -171,9 +176,14 @@ void create_circuit_with_witness(Builder& builder, acir_format const& constraint
create_schnorr_verify_constraints(builder, constraint);
}

// Add ECDSA constraints
for (const auto& constraint : constraint_system.ecdsa_constraints) {
create_ecdsa_verify_constraints(builder, constraint);
// Add ECDSA k1 constraints
for (const auto& constraint : constraint_system.ecdsa_k1_constraints) {
create_ecdsa_k1_verify_constraints(builder, constraint);
}

// Add ECDSA r1 constraints
for (const auto& constraint : constraint_system.ecdsa_r1_constraints) {
create_ecdsa_r1_verify_constraints(builder, constraint);
}

// Add blake2s constraints
Expand Down
10 changes: 7 additions & 3 deletions cpp/src/barretenberg/dsl/acir_format/acir_format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "blake2s_constraint.hpp"
#include "block_constraint.hpp"
#include "ecdsa_secp256k1.hpp"
#include "ecdsa_secp256r1.hpp"
#include "fixed_base_scalar_mul.hpp"
#include "hash_to_field.hpp"
#include "keccak_constraint.hpp"
Expand All @@ -26,7 +27,8 @@ struct acir_format {
std::vector<LogicConstraint> logic_constraints;
std::vector<RangeConstraint> range_constraints;
std::vector<SchnorrConstraint> schnorr_constraints;
std::vector<EcdsaSecp256k1Constraint> ecdsa_constraints;
std::vector<EcdsaSecp256k1Constraint> ecdsa_k1_constraints;
std::vector<EcdsaSecp256r1Constraint> ecdsa_r1_constraints;
std::vector<Sha256Constraint> sha256_constraints;
std::vector<Blake2sConstraint> blake2s_constraints;
std::vector<KeccakConstraint> keccak_constraints;
Expand Down Expand Up @@ -67,7 +69,8 @@ template <typename B> inline void read(B& buf, acir_format& data)
read(buf, data.range_constraints);
read(buf, data.sha256_constraints);
read(buf, data.schnorr_constraints);
read(buf, data.ecdsa_constraints);
read(buf, data.ecdsa_k1_constraints);
read(buf, data.ecdsa_r1_constraints);
read(buf, data.blake2s_constraints);
read(buf, data.keccak_constraints);
read(buf, data.keccak_var_constraints);
Expand All @@ -88,7 +91,8 @@ template <typename B> inline void write(B& buf, acir_format const& data)
write(buf, data.range_constraints);
write(buf, data.sha256_constraints);
write(buf, data.schnorr_constraints);
write(buf, data.ecdsa_constraints);
write(buf, data.ecdsa_k1_constraints);
write(buf, data.ecdsa_r1_constraints);
write(buf, data.blake2s_constraints);
write(buf, data.keccak_constraints);
write(buf, data.keccak_var_constraints);
Expand Down
12 changes: 8 additions & 4 deletions cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ TEST(acir_format, test_a_single_constraint_no_pub_inputs)
.logic_constraints = {},
.range_constraints = {},
.schnorr_constraints = {},
.ecdsa_constraints = {},
.ecdsa_k1_constraints = {},
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand Down Expand Up @@ -135,7 +136,8 @@ TEST(acir_format, test_logic_gate_from_noir_circuit)
.logic_constraints = { logic_constraint },
.range_constraints = { range_a, range_b },
.schnorr_constraints = {},
.ecdsa_constraints = {},
.ecdsa_k1_constraints = {},
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand Down Expand Up @@ -201,7 +203,8 @@ TEST(acir_format, test_schnorr_verify_pass)
.logic_constraints = {},
.range_constraints = range_constraints,
.schnorr_constraints = { schnorr_constraint },
.ecdsa_constraints = {},
.ecdsa_k1_constraints = {},
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand Down Expand Up @@ -274,7 +277,8 @@ TEST(acir_format, test_schnorr_verify_small_range)
.logic_constraints = {},
.range_constraints = range_constraints,
.schnorr_constraints = { schnorr_constraint },
.ecdsa_constraints = {},
.ecdsa_k1_constraints = {},
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ TEST(up_ram, TestBlockConstraint)
.logic_constraints = {},
.range_constraints = {},
.schnorr_constraints = {},
.ecdsa_constraints = {},
.ecdsa_k1_constraints = {},
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand Down
13 changes: 9 additions & 4 deletions cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "ecdsa_secp256k1.hpp"
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp"

namespace acir_format {
Expand Down Expand Up @@ -84,9 +83,9 @@ witness_ct ecdsa_index_to_witness(Builder& builder, uint32_t index)
return { &builder, value };
}

void create_ecdsa_verify_constraints(Builder& builder,
const EcdsaSecp256k1Constraint& input,
bool has_valid_witness_assignments)
void create_ecdsa_k1_verify_constraints(Builder& builder,
const EcdsaSecp256k1Constraint& input,
bool has_valid_witness_assignments)
{

if (has_valid_witness_assignments == false) {
Expand Down Expand Up @@ -144,6 +143,7 @@ void dummy_ecdsa_constraint(Builder& builder, EcdsaSecp256k1Constraint const& in
std::vector<uint32_t> pub_x_indices_;
std::vector<uint32_t> pub_y_indices_;
std::vector<uint32_t> signature_;
std::vector<uint32_t> message_indices_;
signature_.resize(64);

// Create a valid signature with a valid public key
Expand All @@ -161,17 +161,22 @@ void dummy_ecdsa_constraint(Builder& builder, EcdsaSecp256k1Constraint const& in
// We don't use them in a gate, so when we call assert_equal, they will be
// replaced as if they never existed.
for (size_t i = 0; i < 32; ++i) {
uint32_t m_wit = builder.add_variable(input.hashed_message[i]);
uint32_t x_wit = builder.add_variable(pub_x_value.slice(248 - i * 8, 256 - i * 8));
uint32_t y_wit = builder.add_variable(pub_y_value.slice(248 - i * 8, 256 - i * 8));
uint32_t r_wit = builder.add_variable(signature.r[i]);
uint32_t s_wit = builder.add_variable(signature.s[i]);
message_indices_.emplace_back(m_wit);
pub_x_indices_.emplace_back(x_wit);
pub_y_indices_.emplace_back(y_wit);
signature_[i] = r_wit;
signature_[i + 32] = s_wit;
}

// Call assert_equal(from, to) to replace the value in `to` by the value in `from`
for (size_t i = 0; i < input.hashed_message.size(); ++i) {
builder.assert_equal(message_indices_[i], input.hashed_message[i]);
}
for (size_t i = 0; i < input.pub_x_indices.size(); ++i) {
builder.assert_equal(pub_x_indices_[i], input.pub_x_indices[i]);
}
Expand Down
11 changes: 8 additions & 3 deletions cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include "barretenberg/crypto/ecdsa/ecdsa.hpp"
#include "barretenberg/dsl/types.hpp"
#include <vector>

Expand Down Expand Up @@ -26,12 +27,16 @@ struct EcdsaSecp256k1Constraint {
friend bool operator==(EcdsaSecp256k1Constraint const& lhs, EcdsaSecp256k1Constraint const& rhs) = default;
};

void create_ecdsa_verify_constraints(Builder& builder,
const EcdsaSecp256k1Constraint& input,
bool has_valid_witness_assignments = true);
void create_ecdsa_k1_verify_constraints(Builder& builder,
const EcdsaSecp256k1Constraint& input,
bool has_valid_witness_assignments = true);

void dummy_ecdsa_constraint(Builder& builder, EcdsaSecp256k1Constraint const& input);

crypto::ecdsa::signature ecdsa_convert_signature(Builder& builder, std::vector<uint32_t> signature);
witness_ct ecdsa_index_to_witness(Builder& builder, uint32_t index);
byte_array_ct ecdsa_vector_of_bytes_to_byte_array(Builder& builder, std::vector<uint32_t> vector_of_bytes);

template <typename B> inline void read(B& buf, EcdsaSecp256k1Constraint& constraint)
{
using serialize::read;
Expand Down
25 changes: 14 additions & 11 deletions cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ size_t generate_ecdsa_constraint(EcdsaSecp256k1Constraint& ecdsa_constraint, Wit

TEST(ECDSASecp256k1, TestECDSAConstraintSucceed)
{
EcdsaSecp256k1Constraint ecdsa_constraint;
EcdsaSecp256k1Constraint ecdsa_k1_constraint;
WitnessVector witness_values;
size_t num_variables = generate_ecdsa_constraint(ecdsa_constraint, witness_values);
size_t num_variables = generate_ecdsa_constraint(ecdsa_k1_constraint, witness_values);
acir_format constraint_system{
.varnum = static_cast<uint32_t>(num_variables),
.public_inputs = {},
.fixed_base_scalar_mul_constraints = {},
.logic_constraints = {},
.range_constraints = {},
.schnorr_constraints = {},
.ecdsa_constraints = { ecdsa_constraint },
.ecdsa_k1_constraints = { ecdsa_k1_constraint },
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand All @@ -105,7 +106,7 @@ TEST(ECDSASecp256k1, TestECDSAConstraintSucceed)

auto builder = create_circuit_with_witness(constraint_system, witness_values);

EXPECT_EQ(builder.get_variable(ecdsa_constraint.result), 1);
EXPECT_EQ(builder.get_variable(ecdsa_k1_constraint.result), 1);

auto composer = Composer();
auto prover = composer.create_prover(builder);
Expand All @@ -120,17 +121,18 @@ TEST(ECDSASecp256k1, TestECDSAConstraintSucceed)
// even though we are just building the circuit.
TEST(ECDSASecp256k1, TestECDSACompilesForVerifier)
{
EcdsaSecp256k1Constraint ecdsa_constraint;
EcdsaSecp256k1Constraint ecdsa_k1_constraint;
WitnessVector witness_values;
size_t num_variables = generate_ecdsa_constraint(ecdsa_constraint, witness_values);
size_t num_variables = generate_ecdsa_constraint(ecdsa_k1_constraint, witness_values);
acir_format constraint_system{
.varnum = static_cast<uint32_t>(num_variables),
.public_inputs = {},
.fixed_base_scalar_mul_constraints = {},
.logic_constraints = {},
.range_constraints = {},
.schnorr_constraints = {},
.ecdsa_constraints = { ecdsa_constraint },
.ecdsa_k1_constraints = { ecdsa_k1_constraint },
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand All @@ -146,9 +148,9 @@ TEST(ECDSASecp256k1, TestECDSACompilesForVerifier)

TEST(ECDSASecp256k1, TestECDSAConstraintFail)
{
EcdsaSecp256k1Constraint ecdsa_constraint;
EcdsaSecp256k1Constraint ecdsa_k1_constraint;
WitnessVector witness_values;
size_t num_variables = generate_ecdsa_constraint(ecdsa_constraint, witness_values);
size_t num_variables = generate_ecdsa_constraint(ecdsa_k1_constraint, witness_values);

// set result value to be false
witness_values[witness_values.size() - 1] = 0;
Expand All @@ -163,7 +165,8 @@ TEST(ECDSASecp256k1, TestECDSAConstraintFail)
.logic_constraints = {},
.range_constraints = {},
.schnorr_constraints = {},
.ecdsa_constraints = { ecdsa_constraint },
.ecdsa_k1_constraints = { ecdsa_k1_constraint },
.ecdsa_r1_constraints = {},
.sha256_constraints = {},
.blake2s_constraints = {},
.keccak_constraints = {},
Expand All @@ -176,7 +179,7 @@ TEST(ECDSASecp256k1, TestECDSAConstraintFail)
};

auto builder = create_circuit_with_witness(constraint_system, witness_values);
EXPECT_EQ(builder.get_variable(ecdsa_constraint.result), 0);
EXPECT_EQ(builder.get_variable(ecdsa_k1_constraint.result), 0);

auto composer = Composer();
auto prover = composer.create_prover(builder);
Expand Down
Loading

0 comments on commit adc4c7b

Please sign in to comment.