Marcin Krzyzanowski 5 жил өмнө
parent
commit
5dcbdf5322
32 өөрчлөгдсөн 30 нэмэгдсэн , 45 устгасан
  1. 6 3
      Package.swift
  2. 0 21
      Package@swift-5.swift
  3. 0 0
      Tests/CryptoSwiftTests/AESCCMTests.swift
  4. 0 0
      Tests/CryptoSwiftTests/AESTests.swift
  5. 0 0
      Tests/CryptoSwiftTests/AESTestsPerf.swift
  6. 0 0
      Tests/CryptoSwiftTests/Access.swift
  7. 0 0
      Tests/CryptoSwiftTests/BlowfishTests.swift
  8. 0 0
      Tests/CryptoSwiftTests/Bridging.h
  9. 8 8
      Tests/CryptoSwiftTests/CBCMacTests.swift
  10. 0 0
      Tests/CryptoSwiftTests/CMACTests.swift
  11. 0 0
      Tests/CryptoSwiftTests/ChaCha20Poly1305Tests.swift
  12. 0 0
      Tests/CryptoSwiftTests/ChaCha20Tests.swift
  13. 0 0
      Tests/CryptoSwiftTests/ChaCha20TestsPerf.swift
  14. 0 0
      Tests/CryptoSwiftTests/Default-568h@2x.png
  15. 0 0
      Tests/CryptoSwiftTests/DigestTests.swift
  16. 0 0
      Tests/CryptoSwiftTests/DigestTestsPerf.swift
  17. 0 0
      Tests/CryptoSwiftTests/Error+Extension.swift
  18. 0 0
      Tests/CryptoSwiftTests/ExtensionsTest.swift
  19. 0 0
      Tests/CryptoSwiftTests/ExtensionsTestPerf.swift
  20. 0 0
      Tests/CryptoSwiftTests/HKDFTests.swift
  21. 0 0
      Tests/CryptoSwiftTests/HMACTests.swift
  22. 0 0
      Tests/CryptoSwiftTests/Info.plist
  23. 0 0
      Tests/CryptoSwiftTests/PBKDF.swift
  24. 0 0
      Tests/CryptoSwiftTests/PBKDFPerf.swift
  25. 0 0
      Tests/CryptoSwiftTests/PaddingTests.swift
  26. 0 0
      Tests/CryptoSwiftTests/Poly1305Tests.swift
  27. 0 0
      Tests/CryptoSwiftTests/RabbitTests.swift
  28. 0 0
      Tests/CryptoSwiftTests/RabbitTestsPerf.swift
  29. 0 0
      Tests/CryptoSwiftTests/ScryptTests.swift
  30. 0 0
      Tests/CryptoSwiftTests/ScryptTestsPerf.swift
  31. 13 10
      Tests/CryptoSwiftTests/XCTestManifests.swift
  32. 3 3
      Tests/LinuxMain.swift

+ 6 - 3
Package.swift

@@ -1,9 +1,12 @@
-// swift-tools-version:4.1
+// swift-tools-version:5.0
 
 import PackageDescription
 
 let package = Package(
     name: "CryptoSwift",
+    platforms: [
+        .macOS(.v10_10), .iOS(.v8), .tvOS(.v9),
+    ],
     products: [
         .library(
             name: "CryptoSwift",
@@ -11,8 +14,8 @@ let package = Package(
     ],
     targets: [
         .target(name: "CryptoSwift"),
-        .testTarget(name: "Tests", dependencies: ["CryptoSwift"]),
+        .testTarget(name: "CryptoSwiftTests", dependencies: ["CryptoSwift"]),
         .testTarget(name: "TestsPerformance", dependencies: ["CryptoSwift"]),
     ],
-    swiftLanguageVersions: [4]
+    swiftLanguageVersions: [.v5]
 )

+ 0 - 21
Package@swift-5.swift

@@ -1,21 +0,0 @@
-// swift-tools-version:5.0
-
-import PackageDescription
-
-let package = Package(
-    name: "CryptoSwift",
-    platforms: [
-        .macOS(.v10_10), .iOS(.v8), .tvOS(.v9),
-    ],
-    products: [
-        .library(
-            name: "CryptoSwift",
-            targets: ["CryptoSwift"])
-    ],
-    targets: [
-        .target(name: "CryptoSwift"),
-        .testTarget(name: "Tests", dependencies: ["CryptoSwift"]),
-        .testTarget(name: "TestsPerformance", dependencies: ["CryptoSwift"]),
-    ],
-    swiftLanguageVersions: [.v5]
-)

+ 0 - 0
Tests/Tests/AESCCMTests.swift → Tests/CryptoSwiftTests/AESCCMTests.swift


+ 0 - 0
Tests/Tests/AESTests.swift → Tests/CryptoSwiftTests/AESTests.swift


+ 0 - 0
Tests/Tests/AESTestsPerf.swift → Tests/CryptoSwiftTests/AESTestsPerf.swift


+ 0 - 0
Tests/Tests/Access.swift → Tests/CryptoSwiftTests/Access.swift


+ 0 - 0
Tests/Tests/BlowfishTests.swift → Tests/CryptoSwiftTests/BlowfishTests.swift


+ 0 - 0
Tests/Tests/Bridging.h → Tests/CryptoSwiftTests/Bridging.h


+ 8 - 8
Tests/Tests/CBCMacTests.swift → Tests/CryptoSwiftTests/CBCMacTests.swift

@@ -20,38 +20,38 @@ class CBCMacTests: XCTestCase {
         let key: Array<UInt8> = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]
         let msg: Array<UInt8> = []
         let expectedMac: Array<UInt8> = [0xf6, 0xc7, 0x1e, 0xed, 0xc3, 0xd9, 0x9b, 0xb1, 0x83, 0xcb, 0x5b, 0x8d, 0x15, 0x68, 0xe6, 0x06]
-        
+
         let cbcmac = try! CBCMAC(key: key).authenticate(msg)
         XCTAssertEqual(cbcmac, expectedMac, "Invalid authentication result")
     }
-    
+
     func testMessageLength16() {
         let key: Array<UInt8> = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]
         let msg: Array<UInt8> = [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a]
         let expectedMac: Array<UInt8> = [0x05, 0x39, 0xbd, 0xa3, 0x0b, 0x3f, 0x76, 0x34, 0x46, 0x6a, 0x75, 0xd9, 0x84, 0x18, 0xbf, 0x65]
-        
+
         let cbcmac = try! CBCMAC(key: key).authenticate(msg)
         XCTAssertEqual(cbcmac, expectedMac, "Invalid authentication result")
     }
-    
+
     func testMessageLength40() {
         let key: Array<UInt8> = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]
         let msg: Array<UInt8> = [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11]
         let expectedMac: Array<UInt8> = [0xa5, 0x26, 0x0f, 0x98, 0xf1, 0xab, 0xf2, 0xb2, 0x75, 0x62, 0xed, 0x5f, 0xc1, 0xfb, 0xeb, 0x8d]
-        
+
         let cbcmac = try! CBCMAC(key: key).authenticate(msg)
         XCTAssertEqual(cbcmac, expectedMac, "Invalid authentication result")
     }
-    
+
     func testMessageLength64() {
         let key: Array<UInt8> = [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c]
         let msg: Array<UInt8> = [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10]
         let expectedMac: Array<UInt8> = [0x5b, 0xf8, 0x2f, 0x1f, 0xe7, 0x48, 0x3b, 0x9a, 0x87, 0x5c, 0xaf, 0x3d, 0xed, 0x3a, 0x01, 0x71]
-        
+
         let cbcmac = try! CBCMAC(key: key).authenticate(msg)
         XCTAssertEqual(cbcmac, expectedMac, "Invalid authentication result")
     }
-    
+
     static let allTests = [
         ("testMessageLength0", testMessageLength0),
         ("testMessageLength16", testMessageLength16),

+ 0 - 0
Tests/Tests/CMACTests.swift → Tests/CryptoSwiftTests/CMACTests.swift


+ 0 - 0
Tests/Tests/ChaCha20Poly1305Tests.swift → Tests/CryptoSwiftTests/ChaCha20Poly1305Tests.swift


+ 0 - 0
Tests/Tests/ChaCha20Tests.swift → Tests/CryptoSwiftTests/ChaCha20Tests.swift


+ 0 - 0
Tests/Tests/ChaCha20TestsPerf.swift → Tests/CryptoSwiftTests/ChaCha20TestsPerf.swift


+ 0 - 0
Tests/Tests/Default-568h@2x.png → Tests/CryptoSwiftTests/Default-568h@2x.png


+ 0 - 0
Tests/Tests/DigestTests.swift → Tests/CryptoSwiftTests/DigestTests.swift


+ 0 - 0
Tests/Tests/DigestTestsPerf.swift → Tests/CryptoSwiftTests/DigestTestsPerf.swift


+ 0 - 0
Tests/Tests/Error+Extension.swift → Tests/CryptoSwiftTests/Error+Extension.swift


+ 0 - 0
Tests/Tests/ExtensionsTest.swift → Tests/CryptoSwiftTests/ExtensionsTest.swift


+ 0 - 0
Tests/Tests/ExtensionsTestPerf.swift → Tests/CryptoSwiftTests/ExtensionsTestPerf.swift


+ 0 - 0
Tests/Tests/HKDFTests.swift → Tests/CryptoSwiftTests/HKDFTests.swift


+ 0 - 0
Tests/Tests/HMACTests.swift → Tests/CryptoSwiftTests/HMACTests.swift


+ 0 - 0
Tests/Tests/Info.plist → Tests/CryptoSwiftTests/Info.plist


+ 0 - 0
Tests/Tests/PBKDF.swift → Tests/CryptoSwiftTests/PBKDF.swift


+ 0 - 0
Tests/Tests/PBKDFPerf.swift → Tests/CryptoSwiftTests/PBKDFPerf.swift


+ 0 - 0
Tests/Tests/PaddingTests.swift → Tests/CryptoSwiftTests/PaddingTests.swift


+ 0 - 0
Tests/Tests/Poly1305Tests.swift → Tests/CryptoSwiftTests/Poly1305Tests.swift


+ 0 - 0
Tests/Tests/RabbitTests.swift → Tests/CryptoSwiftTests/RabbitTests.swift


+ 0 - 0
Tests/Tests/RabbitTestsPerf.swift → Tests/CryptoSwiftTests/RabbitTestsPerf.swift


+ 0 - 0
Tests/Tests/ScryptTests.swift → Tests/CryptoSwiftTests/ScryptTests.swift


+ 0 - 0
Tests/Tests/ScryptTestsPerf.swift → Tests/CryptoSwiftTests/ScryptTestsPerf.swift


+ 13 - 10
Tests/Tests/XCTestManifests.swift → Tests/CryptoSwiftTests/XCTestManifests.swift

@@ -113,6 +113,18 @@ extension BlowfishTests {
     ]
 }
 
+extension CBCMacTests {
+    // DO NOT MODIFY: This is autogenerated, use:
+    //   `swift test --generate-linuxmain`
+    // to regenerate.
+    static let __allTests__CBCMacTests = [
+        ("testMessageLength0", testMessageLength0),
+        ("testMessageLength16", testMessageLength16),
+        ("testMessageLength40", testMessageLength40),
+        ("testMessageLength64", testMessageLength64),
+    ]
+}
+
 extension CMACTests {
     // DO NOT MODIFY: This is autogenerated, use:
     //   `swift test --generate-linuxmain`
@@ -303,15 +315,6 @@ extension RabbitTestsPerf {
     ]
 }
 
-extension RandomBytesSequenceTests {
-    // DO NOT MODIFY: This is autogenerated, use:
-    //   `swift test --generate-linuxmain`
-    // to regenerate.
-    static let __allTests__RandomBytesSequenceTests = [
-        ("testSequence", testSequence),
-    ]
-}
-
 extension Scrypt {
     // DO NOT MODIFY: This is autogenerated, use:
     //   `swift test --generate-linuxmain`
@@ -339,6 +342,7 @@ public func __allTests() -> [XCTestCaseEntry] {
         testCase(AESTestsPerf.__allTests__AESTestsPerf),
         testCase(Access.__allTests__Access),
         testCase(BlowfishTests.__allTests__BlowfishTests),
+        testCase(CBCMacTests.__allTests__CBCMacTests),
         testCase(CMACTests.__allTests__CMACTests),
         testCase(ChaCha20Poly1305Tests.__allTests__ChaCha20Poly1305Tests),
         testCase(ChaCha20Tests.__allTests__ChaCha20Tests),
@@ -355,7 +359,6 @@ public func __allTests() -> [XCTestCaseEntry] {
         testCase(Poly1305Tests.__allTests__Poly1305Tests),
         testCase(RabbitTests.__allTests__RabbitTests),
         testCase(RabbitTestsPerf.__allTests__RabbitTestsPerf),
-        testCase(RandomBytesSequenceTests.__allTests__RandomBytesSequenceTests),
         testCase(Scrypt.__allTests__Scrypt),
         testCase(ScryptTestsPeft.__allTests__ScryptTestsPeft),
     ]

+ 3 - 3
Tests/LinuxMain.swift

@@ -1,10 +1,10 @@
 import XCTest
 
-import Tests
+import CryptoSwiftTests
 import TestsPerformance
 
 var tests = [XCTestCaseEntry]()
-tests += Tests.__allTests()
-// tests += TestsPerformance.__allTests()
+tests += CryptoSwiftTests.__allTests()
+tests += TestsPerformance.__allTests()
 
 XCTMain(tests)