20 auto priv_key = from_buffer<grumpkin::fr>(private_key);
22 write(public_key_buf, pub_key);
29 auto account_public_key = from_buffer<grumpkin::g1::affine_element>(public_key_buffer);
30 write(output, -account_public_key);
34 uint8_t
const* private_key,
38 auto message = from_buffer<std::string>(message_buf);
39 auto priv_key = from_buffer<grumpkin::fr>(private_key);
42 auto sig = crypto::schnorr_construct_signature<Blake2sHasher, grumpkin::fq>(message, key_pair);
48 uint8_t
const* message_buf, uint8_t
const* pub_key, uint8_t
const* sig_s, uint8_t
const* sig_e,
bool* result)
50 auto pubk = from_buffer<grumpkin::g1::affine_element>(pub_key);
51 auto message = from_buffer<std::string>(message_buf);
52 std::array<uint8_t, 32> s;
53 std::array<uint8_t, 32> e;
58 crypto::schnorr_verify_signature<Blake2sHasher, grumpkin::fq, grumpkin::fr, grumpkin::g1>(message, pubk, sig);
65 auto priv_key = from_buffer<grumpkin::fr>(private_key);
79 auto pubkeys = from_buffer<std::vector<multisig::MultiSigPublicKey>>(signer_pubkey_buf);
84 write(combined_key_buf, *combined_key);
93 uint8_t* round_one_private_output_buf)
103 uint8_t
const* private_key,
104 uint8_t
const* signer_round_one_private_buf,
105 uint8_t
const* signer_pubkeys_buf,
106 uint8_t
const* round_one_public_buf,
107 uint8_t* round_two_buf,
111 auto message = from_buffer<std::string>(message_buf);
112 auto priv_key = from_buffer<grumpkin::fr>(private_key);
116 auto signer_pubkeys = from_buffer<std::vector<multisig::MultiSigPublicKey>>(signer_pubkeys_buf);
117 auto round_one_outputs = from_buffer<std::vector<multisig::RoundOnePublicOutput>>(round_one_public_buf);
119 auto round_one_private = from_buffer<multisig::RoundOnePrivateOutput>(signer_round_one_private_buf);
120 auto round_two_output =
123 if (round_two_output.has_value()) {
124 write(round_two_buf, *round_two_output);
132 uint8_t
const* signer_pubkeys_buf,
133 uint8_t
const* round_one_buf,
134 uint8_t
const* round_two_buf,
141 auto message = from_buffer<std::string>(message_buf);
142 auto signer_pubkeys = from_buffer<std::vector<multisig::MultiSigPublicKey>>(signer_pubkeys_buf);
143 auto round_one_outputs = from_buffer<std::vector<multisig::RoundOnePublicOutput>>(round_one_buf);
144 auto round_two_outputs = from_buffer<std::vector<multisig::RoundTwoPublicOutput>>(round_two_buf);
148 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...