SharedSecret

public struct SharedSecret : ContiguousBytes
extension SharedSecret: Hashable
extension SharedSecret: CustomStringConvertible, Equatable

A Key Agreement Result A SharedSecret has to go through a Key Derivation Function before being able to use by a symmetric key operation.

  • Declaration

    Swift

    public func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R
  • Derives a symmetric encryption key using X9.63 key derivation.

    Declaration

    Swift

    public func x963DerivedSymmetricKey<H, SI>(using hashFunction: H.Type, sharedInfo: SI, outputByteCount: Int) -> SymmetricKey where H : HashFunction, SI : DataProtocol

    Parameters

    hashFunction

    The Hash Function to use for key derivation.

    sharedInfo

    The Shared Info to use for key derivation.

    outputByteCount

    The length in bytes of resulting symmetric key.

    Return Value

    The derived symmetric key

  • Derives a symmetric encryption key using HKDF key derivation.

    Declaration

    Swift

    public func hkdfDerivedSymmetricKey<H, Salt, SI>(using hashFunction: H.Type, salt: Salt, sharedInfo: SI, outputByteCount: Int) -> SymmetricKey where H : HashFunction, Salt : DataProtocol, SI : DataProtocol

    Parameters

    hashFunction

    The Hash Function to use for key derivation.

    salt

    The salt to use for key derivation.

    sharedInfo

    The Shared Info to use for key derivation.

    outputByteCount

    The length in bytes of resulting symmetric key.

    Return Value

    The derived symmetric key

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)
  • Declaration

    Swift

    public static func == (lhs: `Self`, rhs: `Self`) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func == <D>(lhs: `Self`, rhs: D) -> Bool where D : DataProtocol
  • Declaration

    Swift

    public var description: String { get }