14 auto priv_key = from_buffer<grumpkin::fr>(private_key);
16 write(public_key_buf, pub_key);
23 auto account_public_key = from_buffer<grumpkin::g1::affine_element>(public_key_buffer);
24 write(output, -account_public_key);
28 uint8_t
const* private_key,
32 auto message = from_buffer<std::string>(message_buf);
33 auto priv_key = from_buffer<grumpkin::fr>(private_key);
36 auto sig = crypto::schnorr_construct_signature<Blake2sHasher, grumpkin::fq>(message, key_pair);
42 uint8_t
const* message_buf, uint8_t
const* pub_key, uint8_t
const* sig_s, uint8_t
const* sig_e,
bool* result)
44 auto pubk = from_buffer<grumpkin::g1::affine_element>(pub_key);
45 auto message = from_buffer<std::string>(message_buf);
46 std::array<uint8_t, 32> s;
47 std::array<uint8_t, 32> e;
52 crypto::schnorr_verify_signature<Blake2sHasher, grumpkin::fq, grumpkin::fr, grumpkin::g1>(message, pubk, sig);
59 auto priv_key = from_buffer<grumpkin::fr>(private_key);
73 auto pubkeys = from_buffer<std::vector<multisig::MultiSigPublicKey>>(signer_pubkey_buf);
78 write(combined_key_buf, *combined_key);
87 uint8_t* round_one_private_output_buf)
97 uint8_t
const* private_key,
98 uint8_t
const* signer_round_one_private_buf,
99 uint8_t
const* signer_pubkeys_buf,
100 uint8_t
const* round_one_public_buf,
101 uint8_t* round_two_buf,
105 auto message = from_buffer<std::string>(message_buf);
106 auto priv_key = from_buffer<grumpkin::fr>(private_key);
110 auto signer_pubkeys = from_buffer<std::vector<multisig::MultiSigPublicKey>>(signer_pubkeys_buf);
111 auto round_one_outputs = from_buffer<std::vector<multisig::RoundOnePublicOutput>>(round_one_public_buf);
113 auto round_one_private = from_buffer<multisig::RoundOnePrivateOutput>(signer_round_one_private_buf);
114 auto round_two_output =
117 if (round_two_output.has_value()) {
118 write(round_two_buf, *round_two_output);
126 uint8_t
const* signer_pubkeys_buf,
127 uint8_t
const* round_one_buf,
128 uint8_t
const* round_two_buf,
135 auto message = from_buffer<std::string>(message_buf);
136 auto signer_pubkeys = from_buffer<std::vector<multisig::MultiSigPublicKey>>(signer_pubkeys_buf);
137 auto round_one_outputs = from_buffer<std::vector<multisig::RoundOnePublicOutput>>(round_one_buf);
138 auto round_two_outputs = from_buffer<std::vector<multisig::RoundTwoPublicOutput>>(round_two_buf);
142 if (sig.has_value()) {
Implements the SpeedyMuSig protocol; a secure 2-round interactive multisignature scheme whose signatu...
static std::optional< schnorr_signature > combine_signatures(const std::string &message, const std::vector< MultiSigPublicKey > &signer_pubkeys, const std::vector< RoundOnePublicOutput > &round_1_nonces, const std::vector< RoundTwoPublicOutput > &round_2_signature_shares)
the final step in the SpeedyMuSig multisig scheme. Can be computed by an untrusted 3rd party....
static std::pair< RoundOnePublicOutput, RoundOnePrivateOutput > construct_signature_round_1()
First round of SpeedyMuSig. Signers generate random nonce keypairs R = {r, [R]}, S = {s,...
static std::optional< RoundTwoPublicOutput > construct_signature_round_2(const std::string &message, const key_pair &signer, const RoundOnePrivateOutput &signer_round_1_private_output, const std::vector< MultiSigPublicKey > &signer_pubkeys, const std::vector< RoundOnePublicOutput > &round_1_nonces)
Second round of SpeedyMuSig. Given the signer pubkeys and the output of round 1, round 2 has each sig...
static std::optional< affine_element > validate_and_combine_signer_pubkeys(const std::vector< MultiSigPublicKey > &signer_pubkeys)
Computes the sum of all signer pubkeys. Output is the public key of the public-facing schnorr multisi...
static constexpr affine_element one() noexcept
group_elements::affine_element< Fq, Fr, Params > affine_element
static constexpr element one
WASM_EXPORT void schnorr_multisig_construct_signature_round_2(uint8_t const *message_buf, uint8_t const *private_key, uint8_t const *signer_round_one_private_buf, uint8_t const *signer_pubkeys_buf, uint8_t const *round_one_public_buf, uint8_t *round_two_buf, bool *success)
WASM_EXPORT void schnorr_negate_public_key(uint8_t const *public_key_buffer, uint8_t *output)
WASM_EXPORT void schnorr_multisig_combine_signatures(uint8_t const *message_buf, uint8_t const *signer_pubkeys_buf, uint8_t const *round_one_buf, uint8_t const *round_two_buf, uint8_t *s, uint8_t *e, bool *success)
WASM_EXPORT void schnorr_verify_signature(uint8_t const *message_buf, uint8_t const *pub_key, uint8_t const *sig_s, uint8_t const *sig_e, bool *result)
WASM_EXPORT void schnorr_multisig_construct_signature_round_1(uint8_t *round_one_public_output_buf, uint8_t *round_one_private_output_buf)
WASM_EXPORT void schnorr_compute_public_key(uint8_t const *private_key, uint8_t *public_key_buf)
WASM_EXPORT void schnorr_multisig_validate_and_combine_signer_pubkeys(uint8_t const *signer_pubkey_buf, affine_element::out_buf combined_key_buf, bool *success)
WASM_EXPORT void schnorr_construct_signature(uint8_t const *message_buf, uint8_t const *private_key, uint8_t *s, uint8_t *e)
typename multisig::MultiSigPublicKey multisig_public_key
WASM_EXPORT void schnorr_multisig_create_multisig_public_key(uint8_t const *private_key, uint8_t *multisig_pubkey_buf)
void write(B &buf, SchnorrProofOfPossession< G1, Hash > const &proof_of_possession)
Entry point for Barretenberg command-line interface.
void write(auto &buf, const msgpack_concepts::HasMsgPack auto &obj)
Automatically derived write for any object that defines .msgpack() (implicitly defined by MSGPACK_FIE...
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
MultiSigPublicKey wraps a signer's public key g1::affine_element along with a proof of posession: a s...