Skip to content

Port Crypt::Rijndael to PerlOnJava Java crypto backend #1105

Description

@fglock

Summary

Port Crypt::Rijndael 1.16 to PerlOnJava.

Current failure

The distribution is XS-only (Rijndael.xs and _rijndael.c). Its Perl
module calls XSLoader::load, and PerlOnJava currently reports:

Can't load loadable object for module Crypt::Rijndael: no Java XS implementation available

All three upstream test files fail at load time, before any subtests run:
t/00_load.t, t/modes.t, and t/rt/27632.t.

Failure log:
/tmp/cpan_random_logs/20260824-171428-41866/failures/Crypt-Rijndael--from--Crypt-Rijndael.log

Why this is worth porting

Crypt::Rijndael has a substantial reverse-dependency footprint. MetaCPAN
lists users including Crypt::OpenPGP, Lemonldap::NG::Common, XAO::Web,
App::OATH, Crypt::OpenToken, Crypt::Fernet, HTTP::Cookies::Chrome,
DBIx::Squirrel, Data::Entropy, and Perlmazing. Local CPAN metadata also
shows dependencies from AC::Yenta and MooX::Role::CryptedPassword.

Proposed implementation

  • Replace the XS-only loading path with a PerlOnJava implementation backed by
    Java's standard cryptography APIs where the semantics match.
  • Preserve the public API and constants, including new, keysize,
    blocksize, set_iv, encrypt, and decrypt.
  • Cover the modes exercised by the upstream suite: CBC, CFB, CTR, ECB, and
    OFB; verify PCBC behavior if it is part of the public compatibility surface.
  • Support 128-, 192-, and 256-bit keys and the 16-byte block size.
  • Add permanent bundled regression coverage using the upstream test vectors;
    validate both JVM and interpreter backends.
  • Document any Rijndael variants that cannot be represented by the Java
    provider rather than silently accepting incompatible behavior.

This is a crypto portability port, so it should use the normal Java
cryptography infrastructure rather than an FFM/native-call shim.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions