Instance Method
multiply(_:format:)
Creates a new P256K.Signing.PublicKey by computing public_key' = public_key × tweak via secp256k1_ec_pubkey_tweak_mul.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
func multiply(_ tweak: [UInt8], format: P256K.Format = .compressed) throws -> P256K.Signing.PublicKey
Parameters
-
tweak
-
A 32-byte tweak scalar; must be non-zero.
-
format
-
The serialization format of the returned P256K.Signing.PublicKey; defaults to .compressed.
Return Value
A new P256K.Signing.PublicKey equal to the original key multiplied by the tweak scalar.
Discussion
The public-key counterpart to multiply(_:); applying the same tweak to both forms yields a valid (sk', pk') pair.
Throws
secp256k1Error.underlyingCryptoError if the tweak is invalid or the result is the point at infinity.