Table of Contents

Delegate NonceFunctionHardened

Namespace
Secp256k1Net
Assembly
Secp256k1.Net.dll

A pointer to a function to deterministically generate a nonce.

Same as secp256k1_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.

public delegate int NonceFunctionHardened(Span<byte> nonce32, ReadOnlySpan<byte> msg, nuint msglen, ReadOnlySpan<byte> key32, ReadOnlySpan<byte> xonly_pk32, ReadOnlySpan<byte> algo, nuint algolen, nint data)

Parameters

nonce32 Span<byte>

pointer to a 32-byte array to be filled by the function

msg ReadOnlySpan<byte>

the message being verified. Is NULL if and only if msglen is 0.

msglen nuint

the length of the message

key32 ReadOnlySpan<byte>

pointer to a 32-byte secret key (will not be NULL)

xonly_pk32 ReadOnlySpan<byte>

the 32-byte serialized xonly pubkey corresponding to key32 (will not be NULL)

algo ReadOnlySpan<byte>

pointer to an array describing the signature algorithm (will not be NULL)

algolen nuint

the length of the algo array

data nint

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.

Returns

int

1 on success, 0 on failure.