| Data structure that contains additional
| arguments for schnorrsig_sign_custom.
|
| A schnorrsig_extraparams structure object can
| be initialized correctly by setting it to
| SCHNORRSIG_EXTRAPARAMS_INIT.
|
| Members:
|
| magic: set to SCHNORRSIG_EXTRAPARAMS_MAGIC
| at initialization and has no other
| function than making sure the
| object is initialized.
|
| noncefp: pointer to a nonce generation
| function. If NULL,
| nonce_function_bip340 is used
|
| ndata: pointer to arbitrary data used by
| the nonce generation function (can
| be NULL). If it is non-NULL and
| nonce_function_bip340 is used, then
| ndata must be a pointer to 32-byte
| auxiliary randomness as per
| BIP-340.
| algo argument for nonce_function_bip340
| to derive the nonce exactly as stated
| in BIP-340 by using the correct tagged
| hash function.
|
| NOTE: in c++ this was 13 bytes long
| Initializes SHA256 with fixed midstate.
| This midstate was computed by applying
|
| SHA256 to SHA256(“BIP0340/challenge”)||SHA256(“BIP0340/challenge”).
|
| Test vectors according to BIP-340 (“Schnorr
| Signatures for secp256k1”). See https://github.com/bitcoin/bips/blob/master/bip-0340/test-vectors.csv.
|
| Creates N_SIGS valid signatures and
| verifies them with verify and verify_batch
| (TODO). Then flips some bits and checks
| that verification now fails.
|
| Tests for the equality of two sha256
| structs. This function only produces
| a correct result if an integer multiple
| of 64 many bytes have been written into
| the hash functions.
|
| A pointer to a function to deterministically
| generate a nonce.
|
| Same as nonce function with the
| exception of accepting an additional pubkey
| argument and not requiring an attempt
| argument. The pubkey argument can protect
| signature schemes with key-prefixed challenge
| hash inputs against reusing the nonce when
| signing with the wrong precomputed pubkey.
|
| Returns: 1 if a nonce was successfully
| generated. 0 will cause signing to
| return an error.
|
| Out: nonce32: pointer to a 32-byte array to
| be filled by the function
|
| In: msg: the message being verified. Is
| NULL if and only if msglen is
| 0.
|
| msglen: the length of the message
|
| key32: pointer to a 32-byte secret key
| (will not be NULL)
|
| xonly_pk32: the 32-byte serialized xonly
| pubkey corresponding to key32
| (will not be NULL)
|
| algo: pointer to an array describing
| the signature algorithm (will
| not be NULL)
|
| algolen: the length of the algo array
|
| data: arbitrary data pointer that is
| passed through
|
| Except for test cases, this function should
| compute some cryptographic hash of the
| message, the key, the pubkey, the algorithm
| description, and data.