arm.swiftinterface 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. // swift-interface-format-version: 1.0
  2. // swift-compiler-version: Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)
  3. // swift-module-flags: -target armv7-apple-ios9.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=unchecked -O -module-name CryptoSwift
  4. @_exported import CryptoSwift
  5. import Darwin
  6. import Foundation
  7. import Swift
  8. public struct CFB : CryptoSwift.BlockMode {
  9. public enum Error : Swift.Error {
  10. case invalidInitializationVector
  11. public static func == (a: CryptoSwift.CFB.Error, b: CryptoSwift.CFB.Error) -> Swift.Bool
  12. public var hashValue: Swift.Int {
  13. get
  14. }
  15. public func hash(into hasher: inout Swift.Hasher)
  16. }
  17. public let options: CryptoSwift.BlockModeOption
  18. public init(iv: Swift.Array<Swift.UInt8>)
  19. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  20. }
  21. public class CMAC : CryptoSwift.Authenticator {
  22. public enum Error : Swift.Error {
  23. case wrongKeyLength
  24. public static func == (a: CryptoSwift.CMAC.Error, b: CryptoSwift.CMAC.Error) -> Swift.Bool
  25. public var hashValue: Swift.Int {
  26. get
  27. }
  28. public func hash(into hasher: inout Swift.Hasher)
  29. }
  30. public init(key: Swift.Array<Swift.UInt8>) throws
  31. public func authenticate(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  32. public func authenticate(_ bytes: Swift.Array<Swift.UInt8>, cipher: CryptoSwift.Cipher) throws -> Swift.Array<Swift.UInt8>
  33. @objc deinit
  34. }
  35. final public class GCM : CryptoSwift.BlockMode {
  36. public enum Mode {
  37. case combined
  38. case detached
  39. public static func == (a: CryptoSwift.GCM.Mode, b: CryptoSwift.GCM.Mode) -> Swift.Bool
  40. public var hashValue: Swift.Int {
  41. get
  42. }
  43. public func hash(into hasher: inout Swift.Hasher)
  44. }
  45. final public let options: CryptoSwift.BlockModeOption
  46. public enum Error : Swift.Error {
  47. case invalidInitializationVector
  48. case fail
  49. public static func == (a: CryptoSwift.GCM.Error, b: CryptoSwift.GCM.Error) -> Swift.Bool
  50. public var hashValue: Swift.Int {
  51. get
  52. }
  53. public func hash(into hasher: inout Swift.Hasher)
  54. }
  55. final public var authenticationTag: Swift.Array<Swift.UInt8>?
  56. public init(iv: Swift.Array<Swift.UInt8>, additionalAuthenticatedData: Swift.Array<Swift.UInt8>? = nil, tagLength: Swift.Int = 16, mode: CryptoSwift.GCM.Mode = .detached)
  57. convenience public init(iv: Swift.Array<Swift.UInt8>, authenticationTag: Swift.Array<Swift.UInt8>, additionalAuthenticatedData: Swift.Array<Swift.UInt8>? = nil, mode: CryptoSwift.GCM.Mode = .detached)
  58. final public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  59. @objc deinit
  60. }
  61. @_inheritsConvenienceInitializers final public class CBCMAC : CryptoSwift.CMAC {
  62. override final public func authenticate(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  63. @objc deinit
  64. override public init(key: Swift.Array<Swift.UInt8>) throws
  65. }
  66. extension AES {
  67. convenience public init(key: Swift.String, iv: Swift.String, padding: CryptoSwift.Padding = .pkcs7) throws
  68. }
  69. public struct HKDF {
  70. public enum Error : Swift.Error {
  71. case invalidInput
  72. case derivedKeyTooLong
  73. public static func == (a: CryptoSwift.HKDF.Error, b: CryptoSwift.HKDF.Error) -> Swift.Bool
  74. public var hashValue: Swift.Int {
  75. get
  76. }
  77. public func hash(into hasher: inout Swift.Hasher)
  78. }
  79. public init(password: Swift.Array<Swift.UInt8>, salt: Swift.Array<Swift.UInt8>? = nil, info: Swift.Array<Swift.UInt8>? = nil, keyLength: Swift.Int? = nil, variant: CryptoSwift.HMAC.Variant = .sha256) throws
  80. public func calculate() throws -> Swift.Array<Swift.UInt8>
  81. }
  82. final public class HMAC : CryptoSwift.Authenticator {
  83. public enum Error : Swift.Error {
  84. case authenticateError
  85. case invalidInput
  86. public static func == (a: CryptoSwift.HMAC.Error, b: CryptoSwift.HMAC.Error) -> Swift.Bool
  87. public var hashValue: Swift.Int {
  88. get
  89. }
  90. public func hash(into hasher: inout Swift.Hasher)
  91. }
  92. public enum Variant {
  93. case sha1, sha256, sha384, sha512, md5
  94. public static func == (a: CryptoSwift.HMAC.Variant, b: CryptoSwift.HMAC.Variant) -> Swift.Bool
  95. public var hashValue: Swift.Int {
  96. get
  97. }
  98. public func hash(into hasher: inout Swift.Hasher)
  99. }
  100. public init(key: Swift.Array<Swift.UInt8>, variant: CryptoSwift.HMAC.Variant = .md5)
  101. final public func authenticate(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  102. @objc deinit
  103. }
  104. @_hasMissingDesignatedInitializers final public class AEADChaCha20Poly1305 : CryptoSwift.AEAD {
  105. public static let kLen: Swift.Int
  106. public static var ivRange: Swift.Range<Swift.Int>
  107. public static func encrypt(_ plainText: Swift.Array<Swift.UInt8>, key: Swift.Array<Swift.UInt8>, iv: Swift.Array<Swift.UInt8>, authenticationHeader: Swift.Array<Swift.UInt8>) throws -> (cipherText: Swift.Array<Swift.UInt8>, authenticationTag: Swift.Array<Swift.UInt8>)
  108. public static func decrypt(_ cipherText: Swift.Array<Swift.UInt8>, key: Swift.Array<Swift.UInt8>, iv: Swift.Array<Swift.UInt8>, authenticationHeader: Swift.Array<Swift.UInt8>, authenticationTag: Swift.Array<Swift.UInt8>) throws -> (plainText: Swift.Array<Swift.UInt8>, success: Swift.Bool)
  109. @objc deinit
  110. }
  111. final public class Poly1305 : CryptoSwift.Authenticator {
  112. public enum Error : Swift.Error {
  113. case authenticateError
  114. public static func == (a: CryptoSwift.Poly1305.Error, b: CryptoSwift.Poly1305.Error) -> Swift.Bool
  115. public var hashValue: Swift.Int {
  116. get
  117. }
  118. public func hash(into hasher: inout Swift.Hasher)
  119. }
  120. public static let blockSize: Swift.Int
  121. public init(key: Swift.Array<Swift.UInt8>)
  122. final public func authenticate(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  123. @objc deinit
  124. }
  125. public protocol Cryptor {
  126. mutating func seek(to: Swift.Int) throws
  127. }
  128. public typealias CipherOperationOnBlock = (Swift.ArraySlice<Swift.UInt8>) -> Swift.Array<Swift.UInt8>?
  129. public protocol BlockMode {
  130. var options: CryptoSwift.BlockModeOption { get }
  131. func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  132. }
  133. public enum CipherError : Swift.Error {
  134. case encrypt
  135. case decrypt
  136. public static func == (a: CryptoSwift.CipherError, b: CryptoSwift.CipherError) -> Swift.Bool
  137. public var hashValue: Swift.Int {
  138. get
  139. }
  140. public func hash(into hasher: inout Swift.Hasher)
  141. }
  142. public protocol Cipher : AnyObject {
  143. var keySize: Swift.Int { get }
  144. func encrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  145. func encrypt(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  146. func decrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  147. func decrypt(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  148. }
  149. extension Cipher {
  150. public func encrypt(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  151. public func decrypt(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  152. }
  153. final public class SHA2 {
  154. public enum Variant : Swift.RawRepresentable {
  155. case sha224, sha256, sha384, sha512
  156. public var digestLength: Swift.Int {
  157. get
  158. }
  159. public var blockSize: Swift.Int {
  160. get
  161. }
  162. public typealias RawValue = Swift.Int
  163. public var rawValue: CryptoSwift.SHA2.Variant.RawValue {
  164. get
  165. }
  166. public init?(rawValue: CryptoSwift.SHA2.Variant.RawValue)
  167. }
  168. public init(variant: CryptoSwift.SHA2.Variant)
  169. final public func calculate(for bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  170. @objc deinit
  171. }
  172. extension SHA2 : CryptoSwift.Updatable {
  173. final public func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  174. }
  175. extension Blowfish {
  176. convenience public init(key: Swift.String, iv: Swift.String, padding: CryptoSwift.Padding = .pkcs7) throws
  177. }
  178. public protocol Updatable {
  179. mutating func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool) throws -> Swift.Array<Swift.UInt8>
  180. mutating func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool, output: (Swift.Array<Swift.UInt8>) -> Swift.Void) throws
  181. }
  182. extension Updatable {
  183. public mutating func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false, output: (Swift.Array<Swift.UInt8>) -> Swift.Void) throws
  184. public mutating func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  185. public mutating func update(withBytes bytes: Swift.Array<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  186. public mutating func update(withBytes bytes: Swift.Array<Swift.UInt8>, isLast: Swift.Bool = false, output: (Swift.Array<Swift.UInt8>) -> Swift.Void) throws
  187. public mutating func finish(withBytes bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  188. public mutating func finish(withBytes bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  189. public mutating func finish() throws -> Swift.Array<Swift.UInt8>
  190. public mutating func finish(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, output: (Swift.Array<Swift.UInt8>) -> Swift.Void) throws
  191. public mutating func finish(withBytes bytes: Swift.Array<Swift.UInt8>, output: (Swift.Array<Swift.UInt8>) -> Swift.Void) throws
  192. public mutating func finish(output: (Swift.Array<Swift.UInt8>) -> Swift.Void) throws
  193. }
  194. @_hasMissingDesignatedInitializers final public class Checksum {
  195. @objc deinit
  196. }
  197. extension Checksum {
  198. public static func crc32(_ message: Swift.Array<Swift.UInt8>, seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Swift.UInt32
  199. public static func crc32c(_ message: Swift.Array<Swift.UInt8>, seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Swift.UInt32
  200. public static func crc16(_ message: Swift.Array<Swift.UInt8>, seed: Swift.UInt16? = nil) -> Swift.UInt16
  201. }
  202. extension Rabbit {
  203. convenience public init(key: Swift.String) throws
  204. convenience public init(key: Swift.String, iv: Swift.String) throws
  205. }
  206. extension PKCS5 {
  207. public struct PBKDF1 {
  208. public enum Error : Swift.Error {
  209. case invalidInput
  210. case derivedKeyTooLong
  211. public static func == (a: CryptoSwift.PKCS5.PBKDF1.Error, b: CryptoSwift.PKCS5.PBKDF1.Error) -> Swift.Bool
  212. public var hashValue: Swift.Int {
  213. get
  214. }
  215. public func hash(into hasher: inout Swift.Hasher)
  216. }
  217. public enum Variant {
  218. case md5, sha1
  219. public static func == (a: CryptoSwift.PKCS5.PBKDF1.Variant, b: CryptoSwift.PKCS5.PBKDF1.Variant) -> Swift.Bool
  220. public var hashValue: Swift.Int {
  221. get
  222. }
  223. public func hash(into hasher: inout Swift.Hasher)
  224. }
  225. public init(password: Swift.Array<Swift.UInt8>, salt: Swift.Array<Swift.UInt8>, variant: CryptoSwift.PKCS5.PBKDF1.Variant = .sha1, iterations: Swift.Int = 4096, keyLength: Swift.Int? = nil) throws
  226. public func calculate() -> Swift.Array<Swift.UInt8>
  227. }
  228. }
  229. public protocol Cryptors : AnyObject {
  230. func makeEncryptor() throws -> CryptoSwift.Cryptor & CryptoSwift.Updatable
  231. func makeDecryptor() throws -> CryptoSwift.Cryptor & CryptoSwift.Updatable
  232. static func randomIV(_ blockSize: Swift.Int) -> Swift.Array<Swift.UInt8>
  233. }
  234. extension Cryptors {
  235. public static func randomIV(_ count: Swift.Int) -> Swift.Array<Swift.UInt8>
  236. }
  237. public struct ECB : CryptoSwift.BlockMode {
  238. public let options: CryptoSwift.BlockModeOption
  239. public init()
  240. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  241. }
  242. public protocol CipherModeWorker {
  243. var cipherOperation: CryptoSwift.CipherOperationOnBlock { get }
  244. var additionalBufferSize: Swift.Int { get }
  245. mutating func encrypt(block plaintext: Swift.ArraySlice<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  246. mutating func decrypt(block ciphertext: Swift.ArraySlice<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  247. }
  248. public protocol BlockModeWorker : CryptoSwift.CipherModeWorker {
  249. var blockSize: Swift.Int { get }
  250. }
  251. public protocol CounterModeWorker : CryptoSwift.CipherModeWorker {
  252. associatedtype Counter
  253. var counter: Self.Counter { get set }
  254. }
  255. public protocol SeekableModeWorker : CryptoSwift.CipherModeWorker {
  256. mutating func seek(to position: Swift.Int) throws
  257. }
  258. public protocol StreamModeWorker : CryptoSwift.CipherModeWorker {
  259. }
  260. public protocol FinalizingEncryptModeWorker : CryptoSwift.CipherModeWorker {
  261. mutating func finalize(encrypt ciphertext: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.ArraySlice<Swift.UInt8>
  262. }
  263. public protocol FinalizingDecryptModeWorker : CryptoSwift.CipherModeWorker {
  264. @discardableResult
  265. mutating func willDecryptLast(bytes ciphertext: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.ArraySlice<Swift.UInt8>
  266. mutating func didDecryptLast(bytes plaintext: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.ArraySlice<Swift.UInt8>
  267. mutating func finalize(decrypt plaintext: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.ArraySlice<Swift.UInt8>
  268. }
  269. extension HMAC {
  270. convenience public init(key: Swift.String, variant: CryptoSwift.HMAC.Variant = .md5) throws
  271. }
  272. extension String {
  273. public var bytes: Swift.Array<Swift.UInt8> {
  274. get
  275. }
  276. public func md5() -> Swift.String
  277. public func sha1() -> Swift.String
  278. public func sha224() -> Swift.String
  279. public func sha256() -> Swift.String
  280. public func sha384() -> Swift.String
  281. public func sha512() -> Swift.String
  282. public func sha3(_ variant: CryptoSwift.SHA3.Variant) -> Swift.String
  283. public func crc32(seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Swift.String
  284. public func crc32c(seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Swift.String
  285. public func crc16(seed: Swift.UInt16? = nil) -> Swift.String
  286. public func encrypt(cipher: CryptoSwift.Cipher) throws -> Swift.String
  287. public func encryptToBase64(cipher: CryptoSwift.Cipher) throws -> Swift.String?
  288. public func authenticate<A>(with authenticator: A) throws -> Swift.String where A : CryptoSwift.Authenticator
  289. }
  290. public enum PKCS7 {
  291. }
  292. final public class SHA1 {
  293. public init()
  294. final public func calculate(for bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  295. @objc deinit
  296. }
  297. extension SHA1 : CryptoSwift.Updatable {
  298. @discardableResult
  299. final public func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  300. }
  301. public enum Bit : Swift.Int {
  302. case zero
  303. case one
  304. public typealias RawValue = Swift.Int
  305. public init?(rawValue: Swift.Int)
  306. public var rawValue: Swift.Int {
  307. get
  308. }
  309. }
  310. extension ChaCha20 {
  311. convenience public init(key: Swift.String, iv: Swift.String) throws
  312. }
  313. public struct CCM {
  314. public enum Error : Swift.Error {
  315. case invalidInitializationVector
  316. case invalidParameter
  317. case fail
  318. public static func == (a: CryptoSwift.CCM.Error, b: CryptoSwift.CCM.Error) -> Swift.Bool
  319. public var hashValue: Swift.Int {
  320. get
  321. }
  322. public func hash(into hasher: inout Swift.Hasher)
  323. }
  324. public let options: CryptoSwift.BlockModeOption
  325. public var authenticationTag: Swift.Array<Swift.UInt8>?
  326. public init(iv: Swift.Array<Swift.UInt8>, tagLength: Swift.Int, messageLength: Swift.Int, additionalAuthenticatedData: Swift.Array<Swift.UInt8>? = nil)
  327. public init(iv: Swift.Array<Swift.UInt8>, tagLength: Swift.Int, messageLength: Swift.Int, authenticationTag: Swift.Array<Swift.UInt8>, additionalAuthenticatedData: Swift.Array<Swift.UInt8>? = nil)
  328. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  329. }
  330. public struct CTR {
  331. public enum Error : Swift.Error {
  332. case invalidInitializationVector
  333. public static func == (a: CryptoSwift.CTR.Error, b: CryptoSwift.CTR.Error) -> Swift.Bool
  334. public var hashValue: Swift.Int {
  335. get
  336. }
  337. public func hash(into hasher: inout Swift.Hasher)
  338. }
  339. public let options: CryptoSwift.BlockModeOption
  340. public init(iv: Swift.Array<Swift.UInt8>, counter: Swift.Int = 0)
  341. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  342. }
  343. final public class MD5 {
  344. public init()
  345. final public func calculate(for bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  346. @objc deinit
  347. }
  348. extension MD5 : CryptoSwift.Updatable {
  349. final public func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  350. }
  351. final public class AES {
  352. public enum Error : Swift.Error {
  353. case invalidKeySize
  354. case dataPaddingRequired
  355. case invalidData
  356. public static func == (a: CryptoSwift.AES.Error, b: CryptoSwift.AES.Error) -> Swift.Bool
  357. public var hashValue: Swift.Int {
  358. get
  359. }
  360. public func hash(into hasher: inout Swift.Hasher)
  361. }
  362. public enum Variant : Swift.Int {
  363. case aes128, aes192, aes256
  364. public typealias RawValue = Swift.Int
  365. public init?(rawValue: Swift.Int)
  366. public var rawValue: Swift.Int {
  367. get
  368. }
  369. }
  370. public static let blockSize: Swift.Int
  371. final public let keySize: Swift.Int
  372. final public let variant: CryptoSwift.AES.Variant
  373. public init(key: Swift.Array<Swift.UInt8>, blockMode: CryptoSwift.BlockMode, padding: CryptoSwift.Padding = .pkcs7) throws
  374. @objc deinit
  375. }
  376. extension AES : CryptoSwift.Cipher {
  377. final public func encrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  378. final public func decrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  379. }
  380. final public class Blowfish {
  381. public enum Error : Swift.Error {
  382. case dataPaddingRequired
  383. case invalidKeyOrInitializationVector
  384. case invalidInitializationVector
  385. case invalidBlockMode
  386. public static func == (a: CryptoSwift.Blowfish.Error, b: CryptoSwift.Blowfish.Error) -> Swift.Bool
  387. public var hashValue: Swift.Int {
  388. get
  389. }
  390. public func hash(into hasher: inout Swift.Hasher)
  391. }
  392. public static let blockSize: Swift.Int
  393. final public let keySize: Swift.Int
  394. public init(key: Swift.Array<Swift.UInt8>, blockMode: CryptoSwift.BlockMode = CBC(iv: Array<UInt8>(repeating: 0, count: Blowfish.blockSize)), padding: CryptoSwift.Padding) throws
  395. @objc deinit
  396. }
  397. extension Blowfish : CryptoSwift.Cipher {
  398. final public func encrypt<C>(_ bytes: C) throws -> Swift.Array<Swift.UInt8> where C : Swift.Collection, C.Element == Swift.UInt8, C.Index == Swift.Int
  399. final public func decrypt<C>(_ bytes: C) throws -> Swift.Array<Swift.UInt8> where C : Swift.Collection, C.Element == Swift.UInt8, C.Index == Swift.Int
  400. }
  401. public protocol PaddingProtocol {
  402. func add(to: Swift.Array<Swift.UInt8>, blockSize: Swift.Int) -> Swift.Array<Swift.UInt8>
  403. func remove(from: Swift.Array<Swift.UInt8>, blockSize: Swift.Int?) -> Swift.Array<Swift.UInt8>
  404. }
  405. public enum Padding : CryptoSwift.PaddingProtocol {
  406. case noPadding, zeroPadding, pkcs7, pkcs5, iso78164
  407. public func add(to: Swift.Array<Swift.UInt8>, blockSize: Swift.Int) -> Swift.Array<Swift.UInt8>
  408. public func remove(from: Swift.Array<Swift.UInt8>, blockSize: Swift.Int?) -> Swift.Array<Swift.UInt8>
  409. public static func == (a: CryptoSwift.Padding, b: CryptoSwift.Padding) -> Swift.Bool
  410. public var hashValue: Swift.Int {
  411. get
  412. }
  413. public func hash(into hasher: inout Swift.Hasher)
  414. }
  415. extension Data {
  416. public func checksum() -> Swift.UInt16
  417. public func md5() -> Foundation.Data
  418. public func sha1() -> Foundation.Data
  419. public func sha224() -> Foundation.Data
  420. public func sha256() -> Foundation.Data
  421. public func sha384() -> Foundation.Data
  422. public func sha512() -> Foundation.Data
  423. public func sha3(_ variant: CryptoSwift.SHA3.Variant) -> Foundation.Data
  424. public func crc32(seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Foundation.Data
  425. public func crc32c(seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Foundation.Data
  426. public func crc16(seed: Swift.UInt16? = nil) -> Foundation.Data
  427. public func encrypt(cipher: CryptoSwift.Cipher) throws -> Foundation.Data
  428. public func decrypt(cipher: CryptoSwift.Cipher) throws -> Foundation.Data
  429. public func authenticate(with authenticator: CryptoSwift.Authenticator) throws -> Foundation.Data
  430. }
  431. extension Data {
  432. public init(hex: Swift.String)
  433. public var bytes: Swift.Array<Swift.UInt8> {
  434. get
  435. }
  436. public func toHexString() -> Swift.String
  437. }
  438. public protocol _UInt8Type {
  439. }
  440. extension UInt8 : CryptoSwift._UInt8Type {
  441. }
  442. extension UInt8 {
  443. public func bits() -> [CryptoSwift.Bit]
  444. public func bits() -> Swift.String
  445. }
  446. public struct OFB : CryptoSwift.BlockMode {
  447. public enum Error : Swift.Error {
  448. case invalidInitializationVector
  449. public static func == (a: CryptoSwift.OFB.Error, b: CryptoSwift.OFB.Error) -> Swift.Bool
  450. public var hashValue: Swift.Int {
  451. get
  452. }
  453. public func hash(into hasher: inout Swift.Hasher)
  454. }
  455. public let options: CryptoSwift.BlockModeOption
  456. public init(iv: Swift.Array<Swift.UInt8>)
  457. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  458. }
  459. public struct BlockModeOption : Swift.OptionSet {
  460. public let rawValue: Swift.Int
  461. public init(rawValue: Swift.Int)
  462. public typealias Element = CryptoSwift.BlockModeOption
  463. public typealias ArrayLiteralElement = CryptoSwift.BlockModeOption
  464. public typealias RawValue = Swift.Int
  465. }
  466. extension AES : CryptoSwift.Cryptors {
  467. final public func makeEncryptor() throws -> CryptoSwift.Cryptor & CryptoSwift.Updatable
  468. final public func makeDecryptor() throws -> CryptoSwift.Cryptor & CryptoSwift.Updatable
  469. }
  470. extension Array where Element == Swift.UInt8 {
  471. public init(hex: Swift.String)
  472. public func toHexString() -> Swift.String
  473. }
  474. extension Array where Element == Swift.UInt8 {
  475. @available(*, deprecated)
  476. public func chunks(size chunksize: Swift.Int) -> Swift.Array<Swift.Array<Element>>
  477. public func md5() -> [Element]
  478. public func sha1() -> [Element]
  479. public func sha224() -> [Element]
  480. public func sha256() -> [Element]
  481. public func sha384() -> [Element]
  482. public func sha512() -> [Element]
  483. public func sha2(_ variant: CryptoSwift.SHA2.Variant) -> [Element]
  484. public func sha3(_ variant: CryptoSwift.SHA3.Variant) -> [Element]
  485. public func crc32(seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Swift.UInt32
  486. public func crc32c(seed: Swift.UInt32? = nil, reflect: Swift.Bool = true) -> Swift.UInt32
  487. public func crc16(seed: Swift.UInt16? = nil) -> Swift.UInt16
  488. public func encrypt(cipher: CryptoSwift.Cipher) throws -> [Element]
  489. public func decrypt(cipher: CryptoSwift.Cipher) throws -> [Element]
  490. public func authenticate<A>(with authenticator: A) throws -> [Element] where A : CryptoSwift.Authenticator
  491. }
  492. public enum PKCS5 {
  493. }
  494. public protocol AEAD {
  495. static var kLen: Swift.Int { get }
  496. static var ivRange: Swift.Range<Swift.Int> { get }
  497. }
  498. final public class OCB : CryptoSwift.BlockMode {
  499. public enum Mode {
  500. case combined
  501. case detached
  502. public static func == (a: CryptoSwift.OCB.Mode, b: CryptoSwift.OCB.Mode) -> Swift.Bool
  503. public var hashValue: Swift.Int {
  504. get
  505. }
  506. public func hash(into hasher: inout Swift.Hasher)
  507. }
  508. final public let options: CryptoSwift.BlockModeOption
  509. public enum Error : Swift.Error {
  510. case invalidNonce
  511. case fail
  512. public static func == (a: CryptoSwift.OCB.Error, b: CryptoSwift.OCB.Error) -> Swift.Bool
  513. public var hashValue: Swift.Int {
  514. get
  515. }
  516. public func hash(into hasher: inout Swift.Hasher)
  517. }
  518. final public var authenticationTag: Swift.Array<Swift.UInt8>?
  519. public init(nonce N: Swift.Array<Swift.UInt8>, additionalAuthenticatedData: Swift.Array<Swift.UInt8>? = nil, tagLength: Swift.Int = 16, mode: CryptoSwift.OCB.Mode = .detached)
  520. convenience public init(nonce N: Swift.Array<Swift.UInt8>, authenticationTag: Swift.Array<Swift.UInt8>, additionalAuthenticatedData: Swift.Array<Swift.UInt8>? = nil, mode: CryptoSwift.OCB.Mode = .detached)
  521. final public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  522. @objc deinit
  523. }
  524. public struct PCBC : CryptoSwift.BlockMode {
  525. public enum Error : Swift.Error {
  526. case invalidInitializationVector
  527. public static func == (a: CryptoSwift.PCBC.Error, b: CryptoSwift.PCBC.Error) -> Swift.Bool
  528. public var hashValue: Swift.Int {
  529. get
  530. }
  531. public func hash(into hasher: inout Swift.Hasher)
  532. }
  533. public let options: CryptoSwift.BlockModeOption
  534. public init(iv: Swift.Array<Swift.UInt8>)
  535. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  536. }
  537. final public class ChaCha20 {
  538. public enum Error : Swift.Error {
  539. case invalidKeyOrInitializationVector
  540. case notSupported
  541. public static func == (a: CryptoSwift.ChaCha20.Error, b: CryptoSwift.ChaCha20.Error) -> Swift.Bool
  542. public var hashValue: Swift.Int {
  543. get
  544. }
  545. public func hash(into hasher: inout Swift.Hasher)
  546. }
  547. public static let blockSize: Swift.Int
  548. final public let keySize: Swift.Int
  549. public init(key: Swift.Array<Swift.UInt8>, iv nonce: Swift.Array<Swift.UInt8>) throws
  550. @objc deinit
  551. }
  552. extension ChaCha20 : CryptoSwift.Cipher {
  553. final public func encrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  554. final public func decrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  555. }
  556. extension ChaCha20 {
  557. public struct ChaChaEncryptor : CryptoSwift.Cryptor, CryptoSwift.Updatable {
  558. public mutating func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  559. public func seek(to: Swift.Int) throws
  560. }
  561. }
  562. extension ChaCha20 {
  563. public struct ChaChaDecryptor : CryptoSwift.Cryptor, CryptoSwift.Updatable {
  564. public mutating func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = true) throws -> Swift.Array<Swift.UInt8>
  565. public func seek(to: Swift.Int) throws
  566. }
  567. }
  568. extension ChaCha20 : CryptoSwift.Cryptors {
  569. final public func makeEncryptor() -> CryptoSwift.Cryptor & CryptoSwift.Updatable
  570. final public func makeDecryptor() -> CryptoSwift.Cryptor & CryptoSwift.Updatable
  571. }
  572. public struct CBC : CryptoSwift.BlockMode {
  573. public enum Error : Swift.Error {
  574. case invalidInitializationVector
  575. public static func == (a: CryptoSwift.CBC.Error, b: CryptoSwift.CBC.Error) -> Swift.Bool
  576. public var hashValue: Swift.Int {
  577. get
  578. }
  579. public func hash(into hasher: inout Swift.Hasher)
  580. }
  581. public let options: CryptoSwift.BlockModeOption
  582. public init(iv: Swift.Array<Swift.UInt8>)
  583. public func worker(blockSize: Swift.Int, cipherOperation: @escaping CryptoSwift.CipherOperationOnBlock, encryptionOperation: @escaping CryptoSwift.CipherOperationOnBlock) throws -> CryptoSwift.CipherModeWorker
  584. }
  585. extension PKCS5 {
  586. public struct PBKDF2 {
  587. public enum Error : Swift.Error {
  588. case invalidInput
  589. case derivedKeyTooLong
  590. public static func == (a: CryptoSwift.PKCS5.PBKDF2.Error, b: CryptoSwift.PKCS5.PBKDF2.Error) -> Swift.Bool
  591. public var hashValue: Swift.Int {
  592. get
  593. }
  594. public func hash(into hasher: inout Swift.Hasher)
  595. }
  596. public init(password: Swift.Array<Swift.UInt8>, salt: Swift.Array<Swift.UInt8>, iterations: Swift.Int = 4096, keyLength: Swift.Int? = nil, variant: CryptoSwift.HMAC.Variant = .sha256) throws
  597. public func calculate() throws -> Swift.Array<Swift.UInt8>
  598. }
  599. }
  600. public protocol Authenticator {
  601. func authenticate(_ bytes: Swift.Array<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  602. }
  603. final public class Rabbit {
  604. public enum Error : Swift.Error {
  605. case invalidKeyOrInitializationVector
  606. public static func == (a: CryptoSwift.Rabbit.Error, b: CryptoSwift.Rabbit.Error) -> Swift.Bool
  607. public var hashValue: Swift.Int {
  608. get
  609. }
  610. public func hash(into hasher: inout Swift.Hasher)
  611. }
  612. public static let ivSize: Swift.Int
  613. public static let keySize: Swift.Int
  614. public static let blockSize: Swift.Int
  615. final public var keySize: Swift.Int {
  616. get
  617. }
  618. convenience public init(key: Swift.Array<Swift.UInt8>) throws
  619. public init(key: Swift.Array<Swift.UInt8>, iv: Swift.Array<Swift.UInt8>?) throws
  620. @objc deinit
  621. }
  622. extension Rabbit : CryptoSwift.Cipher {
  623. final public func encrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  624. final public func decrypt(_ bytes: Swift.ArraySlice<Swift.UInt8>) throws -> Swift.Array<Swift.UInt8>
  625. }
  626. @_hasMissingDesignatedInitializers public class BlockDecryptor : CryptoSwift.Cryptor, CryptoSwift.Updatable {
  627. public func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  628. public func seek(to position: Swift.Int) throws
  629. @objc deinit
  630. }
  631. extension String {
  632. public func decryptBase64ToString(cipher: CryptoSwift.Cipher) throws -> Swift.String
  633. public func decryptBase64(cipher: CryptoSwift.Cipher) throws -> Swift.Array<Swift.UInt8>
  634. }
  635. extension Array where Element == Swift.UInt8 {
  636. public func toBase64() -> Swift.String?
  637. public init(base64: Swift.String)
  638. }
  639. final public class SHA3 {
  640. final public let blockSize: Swift.Int
  641. final public let digestLength: Swift.Int
  642. final public let markByte: Swift.UInt8
  643. public enum Variant {
  644. case sha224, sha256, sha384, sha512, keccak224, keccak256, keccak384, keccak512
  645. public var outputLength: Swift.Int {
  646. get
  647. }
  648. public static func == (a: CryptoSwift.SHA3.Variant, b: CryptoSwift.SHA3.Variant) -> Swift.Bool
  649. public var hashValue: Swift.Int {
  650. get
  651. }
  652. public func hash(into hasher: inout Swift.Hasher)
  653. }
  654. public init(variant: CryptoSwift.SHA3.Variant)
  655. final public func calculate(for bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  656. @objc deinit
  657. }
  658. extension SHA3 : CryptoSwift.Updatable {
  659. final public func update(withBytes bytes: Swift.ArraySlice<Swift.UInt8>, isLast: Swift.Bool = false) throws -> Swift.Array<Swift.UInt8>
  660. }
  661. final public class Scrypt {
  662. public init(password: Swift.Array<Swift.UInt8>, salt: Swift.Array<Swift.UInt8>, dkLen: Swift.Int, N: Swift.Int, r: Swift.Int, p: Swift.Int) throws
  663. final public func calculate() throws -> [Swift.UInt8]
  664. @objc deinit
  665. }
  666. @available(*, renamed: "Digest")
  667. public typealias Hash = CryptoSwift.Digest
  668. public struct Digest {
  669. public static func md5(_ bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  670. public static func sha1(_ bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  671. public static func sha224(_ bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  672. public static func sha256(_ bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  673. public static func sha384(_ bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  674. public static func sha512(_ bytes: Swift.Array<Swift.UInt8>) -> Swift.Array<Swift.UInt8>
  675. public static func sha2(_ bytes: Swift.Array<Swift.UInt8>, variant: CryptoSwift.SHA2.Variant) -> Swift.Array<Swift.UInt8>
  676. public static func sha3(_ bytes: Swift.Array<Swift.UInt8>, variant: CryptoSwift.SHA3.Variant) -> Swift.Array<Swift.UInt8>
  677. }
  678. extension CryptoSwift.CFB.Error : Swift.Equatable {}
  679. extension CryptoSwift.CFB.Error : Swift.Hashable {}
  680. extension CryptoSwift.CMAC.Error : Swift.Equatable {}
  681. extension CryptoSwift.CMAC.Error : Swift.Hashable {}
  682. extension CryptoSwift.GCM.Mode : Swift.Equatable {}
  683. extension CryptoSwift.GCM.Mode : Swift.Hashable {}
  684. extension CryptoSwift.GCM.Error : Swift.Equatable {}
  685. extension CryptoSwift.GCM.Error : Swift.Hashable {}
  686. extension CryptoSwift.HKDF.Error : Swift.Equatable {}
  687. extension CryptoSwift.HKDF.Error : Swift.Hashable {}
  688. extension CryptoSwift.HMAC.Error : Swift.Equatable {}
  689. extension CryptoSwift.HMAC.Error : Swift.Hashable {}
  690. extension CryptoSwift.HMAC.Variant : Swift.Equatable {}
  691. extension CryptoSwift.HMAC.Variant : Swift.Hashable {}
  692. extension CryptoSwift.Poly1305.Error : Swift.Equatable {}
  693. extension CryptoSwift.Poly1305.Error : Swift.Hashable {}
  694. extension CryptoSwift.CipherError : Swift.Equatable {}
  695. extension CryptoSwift.CipherError : Swift.Hashable {}
  696. extension CryptoSwift.SHA2.Variant : Swift.Equatable {}
  697. extension CryptoSwift.SHA2.Variant : Swift.Hashable {}
  698. extension CryptoSwift.PKCS5.PBKDF1.Error : Swift.Equatable {}
  699. extension CryptoSwift.PKCS5.PBKDF1.Error : Swift.Hashable {}
  700. extension CryptoSwift.PKCS5.PBKDF1.Variant : Swift.Equatable {}
  701. extension CryptoSwift.PKCS5.PBKDF1.Variant : Swift.Hashable {}
  702. extension CryptoSwift.Bit : Swift.Equatable {}
  703. extension CryptoSwift.Bit : Swift.Hashable {}
  704. extension CryptoSwift.Bit : Swift.RawRepresentable {}
  705. extension CryptoSwift.CCM : CryptoSwift.BlockMode {}
  706. extension CryptoSwift.CCM.Error : Swift.Equatable {}
  707. extension CryptoSwift.CCM.Error : Swift.Hashable {}
  708. extension CryptoSwift.CTR : CryptoSwift.BlockMode {}
  709. extension CryptoSwift.CTR.Error : Swift.Equatable {}
  710. extension CryptoSwift.CTR.Error : Swift.Hashable {}
  711. extension CryptoSwift.AES.Error : Swift.Equatable {}
  712. extension CryptoSwift.AES.Error : Swift.Hashable {}
  713. extension CryptoSwift.AES.Variant : Swift.Equatable {}
  714. extension CryptoSwift.AES.Variant : Swift.Hashable {}
  715. extension CryptoSwift.AES.Variant : Swift.RawRepresentable {}
  716. extension CryptoSwift.Blowfish.Error : Swift.Equatable {}
  717. extension CryptoSwift.Blowfish.Error : Swift.Hashable {}
  718. extension CryptoSwift.Padding : Swift.Equatable {}
  719. extension CryptoSwift.Padding : Swift.Hashable {}
  720. extension CryptoSwift.OFB.Error : Swift.Equatable {}
  721. extension CryptoSwift.OFB.Error : Swift.Hashable {}
  722. extension CryptoSwift.OCB.Mode : Swift.Equatable {}
  723. extension CryptoSwift.OCB.Mode : Swift.Hashable {}
  724. extension CryptoSwift.OCB.Error : Swift.Equatable {}
  725. extension CryptoSwift.OCB.Error : Swift.Hashable {}
  726. extension CryptoSwift.PCBC.Error : Swift.Equatable {}
  727. extension CryptoSwift.PCBC.Error : Swift.Hashable {}
  728. extension CryptoSwift.ChaCha20.Error : Swift.Equatable {}
  729. extension CryptoSwift.ChaCha20.Error : Swift.Hashable {}
  730. extension CryptoSwift.CBC.Error : Swift.Equatable {}
  731. extension CryptoSwift.CBC.Error : Swift.Hashable {}
  732. extension CryptoSwift.PKCS5.PBKDF2.Error : Swift.Equatable {}
  733. extension CryptoSwift.PKCS5.PBKDF2.Error : Swift.Hashable {}
  734. extension CryptoSwift.Rabbit.Error : Swift.Equatable {}
  735. extension CryptoSwift.Rabbit.Error : Swift.Hashable {}
  736. extension CryptoSwift.SHA3.Variant : Swift.Equatable {}
  737. extension CryptoSwift.SHA3.Variant : Swift.Hashable {}