@@ -1532,6 +1532,87 @@ public func FfiConverterTypeMakeKeyPairResponse_lower(_ value: MakeKeyPairRespon
1532
1532
}
1533
1533
1534
1534
1535
+ /**
1536
+ * Represents the data required to authenticate with the master password.
1537
+ */
1538
+ public struct MasterPasswordAuthenticationData {
1539
+ public let kdf : Kdf
1540
+ public let salt : String
1541
+ public let masterPasswordAuthenticationHash : B64
1542
+
1543
+ // Default memberwise initializers are never public by default, so we
1544
+ // declare one manually.
1545
+ public init ( kdf: Kdf , salt: String , masterPasswordAuthenticationHash: B64 ) {
1546
+ self . kdf = kdf
1547
+ self . salt = salt
1548
+ self . masterPasswordAuthenticationHash = masterPasswordAuthenticationHash
1549
+ }
1550
+ }
1551
+
1552
+ #if compiler(>=6)
1553
+ extension MasterPasswordAuthenticationData : Sendable { }
1554
+ #endif
1555
+
1556
+
1557
+ extension MasterPasswordAuthenticationData : Equatable , Hashable {
1558
+ public static func == ( lhs: MasterPasswordAuthenticationData , rhs: MasterPasswordAuthenticationData ) -> Bool {
1559
+ if lhs. kdf != rhs. kdf {
1560
+ return false
1561
+ }
1562
+ if lhs. salt != rhs. salt {
1563
+ return false
1564
+ }
1565
+ if lhs. masterPasswordAuthenticationHash != rhs. masterPasswordAuthenticationHash {
1566
+ return false
1567
+ }
1568
+ return true
1569
+ }
1570
+
1571
+ public func hash( into hasher: inout Hasher ) {
1572
+ hasher. combine ( kdf)
1573
+ hasher. combine ( salt)
1574
+ hasher. combine ( masterPasswordAuthenticationHash)
1575
+ }
1576
+ }
1577
+
1578
+
1579
+
1580
+ #if swift(>=5.8)
1581
+ @_documentation ( visibility: private)
1582
+ #endif
1583
+ public struct FfiConverterTypeMasterPasswordAuthenticationData : FfiConverterRustBuffer {
1584
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> MasterPasswordAuthenticationData {
1585
+ return
1586
+ try MasterPasswordAuthenticationData (
1587
+ kdf: FfiConverterTypeKdf . read ( from: & buf) ,
1588
+ salt: FfiConverterString . read ( from: & buf) ,
1589
+ masterPasswordAuthenticationHash: FfiConverterTypeB64 . read ( from: & buf)
1590
+ )
1591
+ }
1592
+
1593
+ public static func write( _ value: MasterPasswordAuthenticationData , into buf: inout [ UInt8 ] ) {
1594
+ FfiConverterTypeKdf . write ( value. kdf, into: & buf)
1595
+ FfiConverterString . write ( value. salt, into: & buf)
1596
+ FfiConverterTypeB64 . write ( value. masterPasswordAuthenticationHash, into: & buf)
1597
+ }
1598
+ }
1599
+
1600
+
1601
+ #if swift(>=5.8)
1602
+ @_documentation ( visibility: private)
1603
+ #endif
1604
+ public func FfiConverterTypeMasterPasswordAuthenticationData_lift( _ buf: RustBuffer ) throws -> MasterPasswordAuthenticationData {
1605
+ return try FfiConverterTypeMasterPasswordAuthenticationData . lift ( buf)
1606
+ }
1607
+
1608
+ #if swift(>=5.8)
1609
+ @_documentation ( visibility: private)
1610
+ #endif
1611
+ public func FfiConverterTypeMasterPasswordAuthenticationData_lower( _ value: MasterPasswordAuthenticationData ) -> RustBuffer {
1612
+ return FfiConverterTypeMasterPasswordAuthenticationData . lower ( value)
1613
+ }
1614
+
1615
+
1535
1616
public struct MasterPasswordPolicyOptions {
1536
1617
public let minComplexity : UInt8
1537
1618
public let minLength : UInt8
@@ -1652,6 +1733,105 @@ public func FfiConverterTypeMasterPasswordPolicyOptions_lower(_ value: MasterPas
1652
1733
}
1653
1734
1654
1735
1736
+ /**
1737
+ * Represents the data required to unlock with the master password.
1738
+ */
1739
+ public struct MasterPasswordUnlockData {
1740
+ /**
1741
+ * The key derivation function used to derive the master key
1742
+ */
1743
+ public let kdf : Kdf
1744
+ /**
1745
+ * The master key wrapped user key
1746
+ */
1747
+ public let masterKeyWrappedUserKey : EncString
1748
+ /**
1749
+ * The salt used in the KDF, typically the user's email
1750
+ */
1751
+ public let salt : String
1752
+
1753
+ // Default memberwise initializers are never public by default, so we
1754
+ // declare one manually.
1755
+ public init (
1756
+ /**
1757
+ * The key derivation function used to derive the master key
1758
+ */kdf: Kdf ,
1759
+ /**
1760
+ * The master key wrapped user key
1761
+ */masterKeyWrappedUserKey: EncString ,
1762
+ /**
1763
+ * The salt used in the KDF, typically the user's email
1764
+ */salt: String ) {
1765
+ self . kdf = kdf
1766
+ self . masterKeyWrappedUserKey = masterKeyWrappedUserKey
1767
+ self . salt = salt
1768
+ }
1769
+ }
1770
+
1771
+ #if compiler(>=6)
1772
+ extension MasterPasswordUnlockData : Sendable { }
1773
+ #endif
1774
+
1775
+
1776
+ extension MasterPasswordUnlockData : Equatable , Hashable {
1777
+ public static func == ( lhs: MasterPasswordUnlockData , rhs: MasterPasswordUnlockData ) -> Bool {
1778
+ if lhs. kdf != rhs. kdf {
1779
+ return false
1780
+ }
1781
+ if lhs. masterKeyWrappedUserKey != rhs. masterKeyWrappedUserKey {
1782
+ return false
1783
+ }
1784
+ if lhs. salt != rhs. salt {
1785
+ return false
1786
+ }
1787
+ return true
1788
+ }
1789
+
1790
+ public func hash( into hasher: inout Hasher ) {
1791
+ hasher. combine ( kdf)
1792
+ hasher. combine ( masterKeyWrappedUserKey)
1793
+ hasher. combine ( salt)
1794
+ }
1795
+ }
1796
+
1797
+
1798
+
1799
+ #if swift(>=5.8)
1800
+ @_documentation ( visibility: private)
1801
+ #endif
1802
+ public struct FfiConverterTypeMasterPasswordUnlockData : FfiConverterRustBuffer {
1803
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> MasterPasswordUnlockData {
1804
+ return
1805
+ try MasterPasswordUnlockData (
1806
+ kdf: FfiConverterTypeKdf . read ( from: & buf) ,
1807
+ masterKeyWrappedUserKey: FfiConverterTypeEncString . read ( from: & buf) ,
1808
+ salt: FfiConverterString . read ( from: & buf)
1809
+ )
1810
+ }
1811
+
1812
+ public static func write( _ value: MasterPasswordUnlockData , into buf: inout [ UInt8 ] ) {
1813
+ FfiConverterTypeKdf . write ( value. kdf, into: & buf)
1814
+ FfiConverterTypeEncString . write ( value. masterKeyWrappedUserKey, into: & buf)
1815
+ FfiConverterString . write ( value. salt, into: & buf)
1816
+ }
1817
+ }
1818
+
1819
+
1820
+ #if swift(>=5.8)
1821
+ @_documentation ( visibility: private)
1822
+ #endif
1823
+ public func FfiConverterTypeMasterPasswordUnlockData_lift( _ buf: RustBuffer ) throws -> MasterPasswordUnlockData {
1824
+ return try FfiConverterTypeMasterPasswordUnlockData . lift ( buf)
1825
+ }
1826
+
1827
+ #if swift(>=5.8)
1828
+ @_documentation ( visibility: private)
1829
+ #endif
1830
+ public func FfiConverterTypeMasterPasswordUnlockData_lower( _ value: MasterPasswordUnlockData ) -> RustBuffer {
1831
+ return FfiConverterTypeMasterPasswordUnlockData . lower ( value)
1832
+ }
1833
+
1834
+
1655
1835
public struct RegisterKeyResponse {
1656
1836
public let masterPasswordHash : B64
1657
1837
public let encryptedUserKey : EncString
@@ -1886,6 +2066,105 @@ public func FfiConverterTypeUniffiConverterDummyRecord_lower(_ value: UniffiConv
1886
2066
}
1887
2067
1888
2068
2069
+ /**
2070
+ * Response from the `update_kdf` function
2071
+ */
2072
+ public struct UpdateKdfResponse {
2073
+ /**
2074
+ * The authentication data for the new KDF setting
2075
+ */
2076
+ public let masterPasswordAuthenticationData : MasterPasswordAuthenticationData
2077
+ /**
2078
+ * The unlock data for the new KDF setting
2079
+ */
2080
+ public let masterPasswordUnlockData : MasterPasswordUnlockData
2081
+ /**
2082
+ * The authentication data for the KDF setting prior to the change
2083
+ */
2084
+ public let oldMasterPasswordAuthenticationData : MasterPasswordAuthenticationData
2085
+
2086
+ // Default memberwise initializers are never public by default, so we
2087
+ // declare one manually.
2088
+ public init (
2089
+ /**
2090
+ * The authentication data for the new KDF setting
2091
+ */masterPasswordAuthenticationData: MasterPasswordAuthenticationData ,
2092
+ /**
2093
+ * The unlock data for the new KDF setting
2094
+ */masterPasswordUnlockData: MasterPasswordUnlockData ,
2095
+ /**
2096
+ * The authentication data for the KDF setting prior to the change
2097
+ */oldMasterPasswordAuthenticationData: MasterPasswordAuthenticationData ) {
2098
+ self . masterPasswordAuthenticationData = masterPasswordAuthenticationData
2099
+ self . masterPasswordUnlockData = masterPasswordUnlockData
2100
+ self . oldMasterPasswordAuthenticationData = oldMasterPasswordAuthenticationData
2101
+ }
2102
+ }
2103
+
2104
+ #if compiler(>=6)
2105
+ extension UpdateKdfResponse : Sendable { }
2106
+ #endif
2107
+
2108
+
2109
+ extension UpdateKdfResponse : Equatable , Hashable {
2110
+ public static func == ( lhs: UpdateKdfResponse , rhs: UpdateKdfResponse ) -> Bool {
2111
+ if lhs. masterPasswordAuthenticationData != rhs. masterPasswordAuthenticationData {
2112
+ return false
2113
+ }
2114
+ if lhs. masterPasswordUnlockData != rhs. masterPasswordUnlockData {
2115
+ return false
2116
+ }
2117
+ if lhs. oldMasterPasswordAuthenticationData != rhs. oldMasterPasswordAuthenticationData {
2118
+ return false
2119
+ }
2120
+ return true
2121
+ }
2122
+
2123
+ public func hash( into hasher: inout Hasher ) {
2124
+ hasher. combine ( masterPasswordAuthenticationData)
2125
+ hasher. combine ( masterPasswordUnlockData)
2126
+ hasher. combine ( oldMasterPasswordAuthenticationData)
2127
+ }
2128
+ }
2129
+
2130
+
2131
+
2132
+ #if swift(>=5.8)
2133
+ @_documentation ( visibility: private)
2134
+ #endif
2135
+ public struct FfiConverterTypeUpdateKdfResponse : FfiConverterRustBuffer {
2136
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> UpdateKdfResponse {
2137
+ return
2138
+ try UpdateKdfResponse (
2139
+ masterPasswordAuthenticationData: FfiConverterTypeMasterPasswordAuthenticationData . read ( from: & buf) ,
2140
+ masterPasswordUnlockData: FfiConverterTypeMasterPasswordUnlockData . read ( from: & buf) ,
2141
+ oldMasterPasswordAuthenticationData: FfiConverterTypeMasterPasswordAuthenticationData . read ( from: & buf)
2142
+ )
2143
+ }
2144
+
2145
+ public static func write( _ value: UpdateKdfResponse , into buf: inout [ UInt8 ] ) {
2146
+ FfiConverterTypeMasterPasswordAuthenticationData . write ( value. masterPasswordAuthenticationData, into: & buf)
2147
+ FfiConverterTypeMasterPasswordUnlockData . write ( value. masterPasswordUnlockData, into: & buf)
2148
+ FfiConverterTypeMasterPasswordAuthenticationData . write ( value. oldMasterPasswordAuthenticationData, into: & buf)
2149
+ }
2150
+ }
2151
+
2152
+
2153
+ #if swift(>=5.8)
2154
+ @_documentation ( visibility: private)
2155
+ #endif
2156
+ public func FfiConverterTypeUpdateKdfResponse_lift( _ buf: RustBuffer ) throws -> UpdateKdfResponse {
2157
+ return try FfiConverterTypeUpdateKdfResponse . lift ( buf)
2158
+ }
2159
+
2160
+ #if swift(>=5.8)
2161
+ @_documentation ( visibility: private)
2162
+ #endif
2163
+ public func FfiConverterTypeUpdateKdfResponse_lower( _ value: UpdateKdfResponse ) -> RustBuffer {
2164
+ return FfiConverterTypeUpdateKdfResponse . lower ( value)
2165
+ }
2166
+
2167
+
1889
2168
/**
1890
2169
* Response from the `update_password` function
1891
2170
*/
@@ -3249,8 +3528,8 @@ private let initializationResult: InitializationResult = {
3249
3528
return InitializationResult . contractVersionMismatch
3250
3529
}
3251
3530
3252
- uniffiEnsureBitwardenEncodingInitialized ( )
3253
3531
uniffiEnsureBitwardenCryptoInitialized ( )
3532
+ uniffiEnsureBitwardenEncodingInitialized ( )
3254
3533
return InitializationResult . ok
3255
3534
} ( )
3256
3535
0 commit comments