Browse Source

Add Botan 3.0, comment some tests, due to removed algorithms

zhibog 2 years ago
parent
commit
077a611a5e

+ 7 - 2
.github/workflows/ci.yml

@@ -56,9 +56,9 @@ jobs:
     runs-on: macos-latest
     runs-on: macos-latest
     steps:
     steps:
       - uses: actions/checkout@v1
       - uses: actions/checkout@v1
-      - name: Download LLVM and setup PATH
+      - name: Download LLVM, botan and setup PATH
         run: |
         run: |
-          brew install llvm@11
+          brew install llvm@11 botan
           echo "/usr/local/opt/llvm@11/bin" >> $GITHUB_PATH
           echo "/usr/local/opt/llvm@11/bin" >> $GITHUB_PATH
           TMP_PATH=$(xcrun --show-sdk-path)/user/include
           TMP_PATH=$(xcrun --show-sdk-path)/user/include
           echo "CPATH=$TMP_PATH" >> $GITHUB_ENV
           echo "CPATH=$TMP_PATH" >> $GITHUB_ENV
@@ -87,6 +87,11 @@ jobs:
           cd tests/core
           cd tests/core
           make
           make
         timeout-minutes: 10
         timeout-minutes: 10
+      - name: Vendor library tests
+        run: |
+          cd tests/vendor
+          make
+        timeout-minutes: 10
       - name: Odin internals tests
       - name: Odin internals tests
         run: |
         run: |
           cd tests/internal
           cd tests/internal

BIN
tests/vendor/botan.dll


+ 5 - 5
tests/vendor/botan/test_vendor_botan.odin

@@ -70,8 +70,8 @@ main :: proc() {
     test_sha3_256(&t)
     test_sha3_256(&t)
     test_sha3_384(&t)
     test_sha3_384(&t)
     test_sha3_512(&t)
     test_sha3_512(&t)
-    test_shake_128(&t)
-    test_shake_256(&t)
+    // test_shake_128(&t)
+    // test_shake_256(&t)
     test_keccak_512(&t)
     test_keccak_512(&t)
     test_whirlpool(&t)
     test_whirlpool(&t)
     test_gost(&t)
     test_gost(&t)
@@ -79,9 +79,9 @@ main :: proc() {
     test_streebog_512(&t)
     test_streebog_512(&t)
     test_blake2b(&t)
     test_blake2b(&t)
     test_ripemd_160(&t)
     test_ripemd_160(&t)
-    test_tiger_128(&t)
-    test_tiger_160(&t)
-    test_tiger_192(&t)
+    // test_tiger_128(&t)
+    // test_tiger_160(&t)
+    // test_tiger_192(&t)
     test_sm3(&t)
     test_sm3(&t)
     test_skein512_256(&t)
     test_skein512_256(&t)
     test_skein512_512(&t)
     test_skein512_512(&t)

BIN
vendor/botan/bindings/botan.lib


+ 2 - 2
vendor/botan/bindings/botan.odin

@@ -62,7 +62,7 @@ CRL_SIGN                  :: x509_cert_key_constraints(512)
 ENCIPHER_ONLY             :: x509_cert_key_constraints(256)
 ENCIPHER_ONLY             :: x509_cert_key_constraints(256)
 DECIPHER_ONLY             :: x509_cert_key_constraints(128)
 DECIPHER_ONLY             :: x509_cert_key_constraints(128)
 
 
-HASH_SHA1           :: "SHA1"
+HASH_SHA1           :: "SHA-1"
 HASH_SHA_224        :: "SHA-224"
 HASH_SHA_224        :: "SHA-224"
 HASH_SHA_256        :: "SHA-256"
 HASH_SHA_256        :: "SHA-256"
 HASH_SHA_384        :: "SHA-384"
 HASH_SHA_384        :: "SHA-384"
@@ -143,7 +143,7 @@ fpe_t                :: ^fpe_struct
 when ODIN_OS == .Windows {
 when ODIN_OS == .Windows {
     foreign import botan_lib "botan.lib"
     foreign import botan_lib "botan.lib"
 } else {
 } else {
-    foreign import botan_lib "system:botan-2"
+    foreign import botan_lib "system:botan-3"
 }
 }
 
 
 @(default_calling_convention="c")
 @(default_calling_convention="c")