Instance Method
multiply(_:)
Creates a new P256K.Signing.PrivateKey by computing secret_key' = (secret_key × tweak) mod n via secp256k1_ec_seckey_tweak_mul, where n is the secp256k1 curve order.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
func multiply(_ tweak: [UInt8]) throws -> P256K.Signing.PrivateKey
Parameters
-
tweak
-
A 32-byte tweak scalar; must be non-zero and less than n.
Return Value
A new P256K.Signing.PrivateKey with the scaled secret scalar.
Discussion
Scalar multiplication pairs with public-key point scaling through G × (sk × t) = pk × t. Less common than add(_:) in Bitcoin workflows but useful for blinding schemes and some threshold-signature constructions.
Throws
secp256k1Error.underlyingCryptoError if the tweak is invalid or the result fails secp256k1_ec_seckey_verify.