Skip to content

Commit af9e32c

Browse files
committed
fix: test
1 parent 597763e commit af9e32c

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ jobs:
5555
env:
5656
DOTNET_EnableAVX: 0
5757

58-
- name: Run tests (Disable SSE)
59-
if: matrix.os != 'macos-latest'
60-
working-directory: test/${{ env.ProjectName }}.Tests
61-
run: dotnet test -c Release
62-
env:
63-
DOTNET_EnableSSE: 0
64-
65-
- name: Run tests (Disable HWIntrinsic)
66-
if: matrix.os != 'macos-latest'
67-
working-directory: test/${{ env.ProjectName }}.Tests
68-
run: dotnet test -c Release
69-
env:
70-
DOTNET_EnableHWIntrinsic: 0
71-
7258
build:
7359
needs: [check_format, test]
7460
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}

test/CryptoBase.Tests/SM4CTRTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using CryptoBase.SymmetricCryptos.BlockCryptoModes.CTR;
44
using CryptoBase.SymmetricCryptos.BlockCryptos.SM4;
55
using CryptoBase.SymmetricCryptos.StreamCryptos;
6+
using System.Runtime.Intrinsics.X86;
67

78
namespace CryptoBase.Tests;
89

@@ -61,7 +62,11 @@ public void TestX86(string keyHex, string ivHex, string sourceHex, string expect
6162
T(new CTR128StreamModeX86(new SM4Crypto(key), iv), source, expected);
6263
T(new CTR128StreamModeBlock4X86(new SM4CryptoX86(key), iv), source, expected);
6364
T(new CTR128StreamModeBlock8X86(new SM4CryptoBlock8X86(key), iv), source, expected);
64-
T(new CTR128StreamModeBlock8AvxX86(new SM4CryptoBlock8X86(key), iv), source, expected);
65-
T(new CTR128StreamModeBlock16X86(new SM4CryptoBlock16X86(key), iv), source, expected);
65+
66+
if (Avx2.IsSupported)
67+
{
68+
T(new CTR128StreamModeBlock8AvxX86(new SM4CryptoBlock8X86(key), iv), source, expected);
69+
T(new CTR128StreamModeBlock16X86(new SM4CryptoBlock16X86(key), iv), source, expected);
70+
}
6671
}
6772
}

0 commit comments

Comments
 (0)