Skip to content

Commit

Permalink
Merge pull request #266 from tangem/IOS-3371_open_bip32
Browse files Browse the repository at this point in the history
Make Bip32 public
  • Loading branch information
tureck1y authored Apr 5, 2023
2 parents b4658cf + 695bb2e commit ea2ce8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions TangemSdk/TangemSdk/Crypto/HDWallet/BIP32/BIP32.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import Foundation
import CryptoKit

// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
struct BIP32 {
public struct BIP32 {
public init() {}

@available(iOS 13.0, *)
/// Generate an extended private key from the seed.
/// - Parameters:
/// - seed: The seed to use
/// - curve: The curve to use
/// - Returns: The `ExtendedPrivateKey`
func makeMasterKey(from seed: Data, curve: EllipticCurve) throws -> ExtendedPrivateKey {
public func makeMasterKey(from seed: Data, curve: EllipticCurve) throws -> ExtendedPrivateKey {
// The seed must be between 128 and 512 bits
guard 16...64 ~= seed.count else {
throw HDWalletError.invalidSeed
Expand Down

0 comments on commit ea2ce8b

Please sign in to comment.