-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Batch 10: BIP39Entropy UF exp and more (#101)
- Loading branch information
1 parent
5498570
commit fcf1fc4
Showing
57 changed files
with
1,025 additions
and
85 deletions.
There are no files selected for viewing
73 changes: 69 additions & 4 deletions
73
apple/Sources/Sargon/Extensions/Methods/Crypto/Derivation/Mnemonic+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...argon/Extensions/Methods/Profile/Factor/FactorSourceCryptoParameters+Wrap+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-23. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension FactorSourceCryptoParameters { | ||
public static let babylon: Self = newFactorSourceCryptoParametersPresetBabylonOnly() | ||
|
||
public static let olympia: Self = newFactorSourceCryptoParametersPresetOlympiaOnly() | ||
|
||
public static let babylonOlympiaCompatible: Self = newFactorSourceCryptoParametersPresetBabylonOlympiaCompatible() | ||
|
||
public var supportsOlympia: Bool { | ||
factorSourceCryptoParametersSupportsOlympia(parameters: self) | ||
} | ||
|
||
public var supportsBabylon: Bool { | ||
factorSourceCryptoParametersSupportsBabylon(parameters: self) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...urces/Sargon/Extensions/SampleValues/Crypto/Derivation/BIP39/BIP39Word+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-24. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension BIP39Word { | ||
public static let sample: Self = newBip39WordSample() | ||
public static let sampleOther: Self = newBip39WordSampleOther() | ||
} | ||
#endif // DEBUG |
16 changes: 16 additions & 0 deletions
16
...on/Extensions/SampleValues/Profile/Factor/FactorSourceCryptoParameters+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-23. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension FactorSourceCryptoParameters { | ||
public static let sample: Self = newFactorSourceCryptoParametersSample() | ||
public static let sampleOther: Self = newFactorSourceCryptoParametersSampleOther() | ||
} | ||
#endif // DEBUG |
9 changes: 9 additions & 0 deletions
9
apple/Sources/Sargon/Extensions/Swiftified/Crypto/Derivation/BIP39Word+Swiftified.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
import SargonUniFFI | ||
|
||
public typealias BIP39Word = Bip39Word | ||
extension BIP39Word: SargonModel {} | ||
extension BIP39Word: Identifiable { | ||
|
||
public typealias ID = U11 | ||
|
||
public var id: ID { | ||
index | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ces/Sargon/Extensions/Swiftified/Profile/Factor/FactorSource/FactorSourceIDProtocol.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-04-24. | ||
// | ||
|
||
import Foundation | ||
|
||
public protocol FactorSourceIDProtocol: SargonModel & CustomStringConvertible { | ||
var asGeneral: FactorSourceID { get } | ||
func toString() -> String | ||
} | ||
|
||
extension FactorSourceIDProtocol { | ||
public var description: String { | ||
toString() | ||
} | ||
} | ||
|
||
public protocol FactorSourceIDSpecificProtocol: FactorSourceIDProtocol & Codable { | ||
static func extract(from someFactorSourceID: some FactorSourceIDProtocol) -> Self? | ||
} |
Oops, something went wrong.