diff --git a/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4DecrypterPerfTest.java b/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4DecrypterPerfTest.java index 89ce1f38..18bb30b5 100644 --- a/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4DecrypterPerfTest.java +++ b/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4DecrypterPerfTest.java @@ -291,6 +291,11 @@ public byte[] cbcPadding(DecrypterHolder holder) throws Exception { return holder.decrypterCBCPadding.doFinal(holder.ciphertextCBCPadding); } + @Benchmark + public byte[] cbcPaddingNative(DecrypterHolderNative holder) throws Exception { + return holder.decrypterCBCPadding.doFinal(holder.ciphertextCBCPadding); + } + @Benchmark public byte[] cbcPaddingBC(DecrypterHolderBC holder) throws Exception { return holder.decrypterCBCPadding.doFinal(holder.ciphertextCBCPadding); @@ -301,6 +306,11 @@ public byte[] cbcNoPadding(DecrypterHolder holder) throws Exception { return holder.decrypterCBCNoPadding.doFinal(holder.ciphertextCBCNoPadding); } + @Benchmark + public byte[] cbcNoPaddingNative(DecrypterHolderNative holder) throws Exception { + return holder.decrypterCBCNoPadding.doFinal(holder.ciphertextCBCNoPadding); + } + @Benchmark public byte[] cbcNoPaddingBC(DecrypterHolderBC holder) throws Exception { return holder.decrypterCBCNoPadding.doFinal(holder.ciphertextCBCNoPadding); @@ -311,6 +321,11 @@ public byte[] ecb(DecrypterHolder holder) throws Exception { return holder.decrypterECBNoPadding.doFinal(holder.ciphertextECBNoPadding); } + @Benchmark + public byte[] ecbNative(DecrypterHolderNative holder) throws Exception { + return holder.decrypterECBNoPadding.doFinal(holder.ciphertextECBNoPadding); + } + @Benchmark public byte[] ecbBC(DecrypterHolderBC holder) throws Exception { return holder.decrypterECBNoPadding.doFinal(holder.ciphertextECBNoPadding); @@ -321,6 +336,11 @@ public byte[] ctr(DecrypterHolder holder) throws Exception { return holder.decrypterCTRNoPadding.doFinal(holder.ciphertextCTRNoPadding); } + @Benchmark + public byte[] ctrNative(DecrypterHolderNative holder) throws Exception { + return holder.decrypterCTRNoPadding.doFinal(holder.ciphertextCTRNoPadding); + } + @Benchmark public byte[] ctrBC(DecrypterHolderBC holder) throws Exception { return holder.decrypterCTRNoPadding.doFinal(holder.ciphertextCTRNoPadding); @@ -331,6 +351,11 @@ public byte[] gcm(DecrypterHolder holder) throws Exception { return holder.decrypterGCMNoPadding.doFinal(holder.ciphertextGCMNoPadding); } + @Benchmark + public byte[] gcmNative(DecrypterHolderNative holder) throws Exception { + return holder.decrypterGCMNoPadding.doFinal(holder.ciphertextGCMNoPadding); + } + @Benchmark public byte[] gcmBC(DecrypterHolderBC holder) throws Exception { return holder.decrypterGCMNoPadding.doFinal(holder.ciphertextGCMNoPadding); diff --git a/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4EncrypterPerfTest.java b/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4EncrypterPerfTest.java index b1bbe29d..64b7bdf1 100644 --- a/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4EncrypterPerfTest.java +++ b/kona-crypto/src/jmh/java/com/tencent/kona/crypto/perf/SM4EncrypterPerfTest.java @@ -189,6 +189,11 @@ public byte[] cbcPadding(EncrypterHolder holder) throws Exception { return holder.encrypterCBCPadding.doFinal(DATA); } + @Benchmark + public byte[] cbcPaddingNative(EncrypterHolderNative holder) throws Exception { + return holder.encrypterCBCPadding.doFinal(DATA); + } + @Benchmark public byte[] cbcPaddingBC(EncrypterHolderBC holder) throws Exception { return holder.encrypterCBCPadding.doFinal(DATA); @@ -199,6 +204,11 @@ public byte[] cbcNoPadding(EncrypterHolder holder) throws Exception { return holder.encrypterCBCNoPadding.doFinal(DATA); } + @Benchmark + public byte[] cbcNoPaddingNative(EncrypterHolderNative holder) throws Exception { + return holder.encrypterCBCNoPadding.doFinal(DATA); + } + @Benchmark public byte[] cbcNoPaddingBC(EncrypterHolderBC holder) throws Exception { return holder.encrypterCBCNoPadding.doFinal(DATA); @@ -209,6 +219,11 @@ public byte[] ctr(EncrypterHolder holder) throws Exception { return holder.encrypterCTRNoPadding.doFinal(DATA); } + @Benchmark + public byte[] ctrNative(EncrypterHolderNative holder) throws Exception { + return holder.encrypterCTRNoPadding.doFinal(DATA); + } + @Benchmark public byte[] ctrBC(EncrypterHolderBC holder) throws Exception { return holder.encrypterCTRNoPadding.doFinal(DATA); @@ -219,6 +234,11 @@ public byte[] ecb(EncrypterHolder holder) throws Exception { return holder.encrypterECBNoPadding.doFinal(DATA); } + @Benchmark + public byte[] ecbNative(EncrypterHolderNative holder) throws Exception { + return holder.encrypterECBNoPadding.doFinal(DATA); + } + @Benchmark public byte[] ecbBC(EncrypterHolderBC holder) throws Exception { return holder.encrypterECBNoPadding.doFinal(DATA); @@ -229,6 +249,11 @@ public byte[] gcm(EncrypterHolder holder) throws Exception { return holder.encrypterGCMNoPadding.doFinal(DATA); } + @Benchmark + public byte[] gcmNative(EncrypterHolderNative holder) throws Exception { + return holder.encrypterGCMNoPadding.doFinal(DATA); + } + @Benchmark public byte[] gcmBC(EncrypterHolderBC holder) throws Exception { return holder.encrypterGCMNoPadding.doFinal(DATA);