Skip to content

Commit

Permalink
Supporting AES-CBC with NoPadding and PKCS7Padding
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhosv committed May 8, 2024
2 parents 6656ff9 + d855a69 commit ee2fa55
Show file tree
Hide file tree
Showing 35 changed files with 2,850 additions and 116 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/macos_ci_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install lcov
- name: Install dependencies from brew
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov
- name: Install clang-format
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install clang-format
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov golang clang-format
- name: Setup pip
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -70,12 +67,9 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install lcov
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov
- name: Install clang-format
- name: Install dependencies from brew
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install clang-format
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov golang clang-format
- name: Setup pip
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -107,12 +101,9 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install lcov
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov
- name: Install clang-format
- name: Install dependencies from brew
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install clang-format
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov golang clang-format
- name: Setup pip
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -142,7 +133,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install lcov clang-format golang
- name: Install dependencies from brew
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov clang-format golang
- name: Setup pip
Expand Down Expand Up @@ -187,7 +178,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install lcov clang-format golang
- name: Install dependencies from brew
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov clang-format golang
- name: Setup pip
Expand Down Expand Up @@ -221,7 +212,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install lcov clang-format golang
- name: Install lcov dependencies from brew
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install lcov clang-format golang
- name: Setup pip
Expand Down
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ add_library(
amazonCorrettoCryptoProvider SHARED
csrc/aes_gcm.cpp
csrc/aes_xts.cpp
csrc/aes_cbc.cpp
csrc/aes_kwp.cpp
csrc/agreement.cpp
csrc/bn.cpp
Expand Down Expand Up @@ -682,16 +683,18 @@ add_custom_target(check-junit-SecurityManager

DEPENDS accp-jar tests-jar)

add_custom_target(check-junit-AesGcmLazy
add_custom_target(check-junit-AesLazy
COMMAND ${TEST_JAVA_EXECUTABLE}
-Dcom.amazon.corretto.crypto.provider.nativeContextReleaseStrategy=LAZY
${TEST_RUNNER_ARGUMENTS}
--select-class=com.amazon.corretto.crypto.provider.test.AesTest
--select-class=com.amazon.corretto.crypto.provider.test.AesGcmKatTest
--select-class=com.amazon.corretto.crypto.provider.test.AesCbcTest
--select-class=com.amazon.corretto.crypto.provider.test.AesCbcNistTest

DEPENDS accp-jar tests-jar)

add_custom_target(check-junit-AesGcmEager
add_custom_target(check-junit-AesEager
COMMAND ${TEST_JAVA_EXECUTABLE}
-Dcom.amazon.corretto.crypto.provider.nativeContextReleaseStrategy=EAGER
${TEST_RUNNER_ARGUMENTS}
Expand Down Expand Up @@ -807,9 +810,10 @@ add_custom_target(check
check-junit
check-junit-SecurityManager
check-external-lib
check-junit-AesGcmLazy
check-junit-AesGcmEager
check-junit-DifferentTempDir)
check-junit-AesLazy
check-junit-AesEager
check-junit-DifferentTempDir
)

if(ENABLE_NATIVE_TEST_HOOKS)
add_custom_target(check-keyutils
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ Mac algorithms:

Cipher algorithms:
* AES/GCM/NoPadding
* AES_128/GCM/NoPadding
* AES_256/GCM/NoPadding
* AES_\<n\>/GCM/NoPadding, where n can be 128, or 256
* AES/KWP/NoPadding
* AES/XTS/NoPadding
* AES/CBC/NoPadding
* AES_\<n\>/CBC/NoPadding, where n can be 128, 192, or 256
* AES/CBC/PKCS5Padding
* AES_\<n\>/CBC/PKCS5Padding, where n can be 128, 192, or 256
* PKCS7Padding is also accepted with AES/CBC and it is treated the same as PKCS5.
* RSA/ECB/NoPadding
* RSA/ECB/PKCS1Padding
* RSA/ECB/OAEPPadding
Expand Down
Loading

0 comments on commit ee2fa55

Please sign in to comment.