Delegate NonceFunction
- Namespace
- Secp256k1Net
- Assembly
- Secp256k1.Net.dll
A pointer to a function to deterministically generate a nonce.
public delegate int NonceFunction(Span<byte> nonce32, ReadOnlySpan<byte> msg32, ReadOnlySpan<byte> key32, ReadOnlySpan<byte> algo16, nint data, uint attempt)
Parameters
nonce32Span<byte>pointer to a 32-byte array to be filled by the function.
msg32ReadOnlySpan<byte>the 32-byte message hash being verified (will not be NULL)
key32ReadOnlySpan<byte>pointer to a 32-byte secret key (will not be NULL)
algo16ReadOnlySpan<byte>pointer to a 16-byte array describing the signature algorithm (will be NULL for ECDSA for compatibility).
datanintArbitrary data pointer that is passed through.
attemptuinthow many iterations we have tried to find a nonce. This will almost always be 0, but different attempt values are required to result in a different nonce.
Except for test cases, this function should compute some cryptographic hash of the message, the algorithm, the key and the attempt.
Returns
- int
1 on success, 0 on failure.