Skip to content

Add Cipher.getInstance("AES") support#142

Merged
rlm2002 merged 1 commit intowolfSSL:masterfrom
cconlon:CipherGenericAes
Aug 21, 2025
Merged

Add Cipher.getInstance("AES") support#142
rlm2002 merged 1 commit intowolfSSL:masterfrom
cconlon:CipherGenericAes

Conversation

@cconlon
Copy link
Member

@cconlon cconlon commented Aug 20, 2025

This PR adds support for the generic "AES" Cipher type (ex: Cipher.getInstance("AES");). Both SunJCE and Bouncy Castle map this to "AES/ECB/PKCS5Padding" internally, so we do the same here for compatibility.

This fixes one OpenJDK SunJCE test: crypto/Cipher/GCMAPI.java

@cconlon cconlon self-assigned this Aug 20, 2025
@cconlon cconlon requested a review from Copilot August 20, 2025 20:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the generic "AES" cipher specification to maintain compatibility with SunJCE and Bouncy Castle providers. The generic "AES" transform is mapped to "AES/ECB/PKCS5Padding" following the behavior of other standard providers.

  • Registers "AES" as an alias to the existing AES/ECB/PKCS5Padding cipher implementation
  • Adds comprehensive test coverage for the new generic AES cipher support
  • Updates documentation to reflect the new alias availability

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/main/java/com/wolfssl/provider/jce/WolfCryptProvider.java Registers the "AES" cipher alias mapping to AES/ECB/PKCS5Padding
src/test/java/com/wolfssl/provider/jce/test/WolfCryptCipherTest.java Adds "AES" to test arrays, implements dedicated test method, and updates IV consistency logic
README_JCE.md Documents the new AES alias in the supported algorithms list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cconlon cconlon assigned rlm2002 and unassigned cconlon Aug 20, 2025
@rlm2002 rlm2002 merged commit b13f649 into wolfSSL:master Aug 21, 2025
83 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants