HD

public struct HD

A struct used to provide a number of functions needed to handle derivation paths and derive nodes for creating HD key pairs

Types and constants

  • Default Tezos derivation path

    Declaration

    Swift

    public static let defaultDerivationPath: String
  • Default Tezos derivation path with supplied index

    Declaration

    Swift

    public static func defaultDerivationPath(withAccountIndex index: Int) -> String
  • Errors that can be thrown

    See more

    Declaration

    Swift

    public enum HDError : Error
  • A struct representing a Node in a HD chain

    Declaration

    Swift

    public struct Node

Hashing

  • Compute a HMAC using SHA512

    Declaration

    Swift

    public static func hmac(message: Data, key: Data) -> Data

Derive Nodes

  • Derive a nnode from a message and a key

    Declaration

    Swift

    public static func deriveNode(message: Data, key: Data) throws -> Node
  • Derive the root (or master) node from cryptographic seed data

    Declaration

    Swift

    public static func deriveRootNode(seed: Data) throws -> Node
  • Derive a child node from a Node and a given index

    Declaration

    Swift

    public static func deriveChildNode(node: Node, index: BigUInt) throws -> Node

Helpers

  • Convert a derivation path into an array of BigUInt so it can be interated

    Declaration

    Swift

    public static func convertDerivationPathToArray(_ derivationPath: String) throws -> [BigUInt]
  • Very basic validation of a derivation path

    Declaration

    Swift

    public static func validateDerivationPath(_ derivationPath: String) -> Bool