Skip to content

x25519

1 post with the tag “x25519”

Hardware Ed25519 on the J3R452: recovering the JCOPX API from a CAP file

The J3R452 is a Java Card 3.0.5 Classic card running NXP JCOP 4.5. Its firmware contains a private JCOP eXtended (JCOPX) package that implements Ed25519 signing, verification and X25519 key agreement; the card-side library only calls into it. Curve25519-JavaCard is that thin layer. Its README quotes about 220 ms for an EdDSA signature and about 50 ms for X25519, says the full source is not provided for legal reasons, and invites anyone to disassemble the .cap to check that nothing funny is going on.

I took the invitation. I unpacked Curve25519.cap, recovered the private JCOPX interface it calls from the tokens and bytecode, rewrote the wrapper from source so that it links identically, and ran 20 checks on a real card, most of them byte-for-byte against an independent RFC 8032 / RFC 7748 implementation. This post is the write-up: what the CAP actually contains, how the private API was recovered, how the converter can be made to link against a package that only exists in card ROM, and what the card said when tested — including an X25519 byte-order trap the original README never mentions, and a J3R180 that refuses to load either version.