Instance Method
signature(for:auxiliaryRand:)
Generates a BIP-340 Schnorr signature from a pre-computed digest using caller-supplied auxiliary randomness.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
func signature<D>(for digest: D, auxiliaryRand: [UInt8]) throws -> P256K.Schnorr.SchnorrSignature where D : Digest
Parameters
-
digest
-
The pre-computed message digest to sign.
-
auxiliaryRand
-
Exactly 32 bytes of auxiliary randomness for BIP-340 nonce derivation; pass zeroed bytes to disable.
Return Value
A 64-byte P256K.Schnorr.SchnorrSignature.
Discussion
Throws
secp256k1Error.underlyingCryptoError if signature production fails.