Type Alias
P256K.KeyAgreement.PrivateKey.HashFunctionType
The C function type for a custom ECDH hash function that serializes the shared EC point into secret bytes.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
typealias HashFunctionType = (UnsafeMutablePointer<UInt8>?, UnsafePointer<UInt8>?, UnsafePointer<UInt8>?, UnsafeMutableRawPointer?) -> Int32
Discussion
Matches the upstream secp256k1_ecdh_hash_function typedef in Vendor/secp256k1/include/secp256k1_ecdh.h. The installed closure receives the 32-byte x and y coordinates of the shared point along with a user-data pointer; the upstream contract requires returning 1 on success (allowing secp256k1_ecdh itself to return 1) and 0 on failure (which propagates as secp256k1_ecdh returning 0).