licel / jcardsim

https://jcardsim.org
222 stars 123 forks source link

Support ALG_AES_CCM and ALG_AES_GCM #187

Closed pongpet-licel closed 2 years ago

pongpet-licel commented 2 years ago

Use example vectors from below links CCM https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38c.pdf https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/mac/ccmtestvectors.zip GCM https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/mac/gcmtestvectors.zip

Due to javacard 3.0.5 supports only the 12 byte IV length, which is the value recommended by NIST Special Publication 800-38D 5.2.1.1 Input Data, so the cipher is implemented and tested with 12-byte IV limitation https://docs.oracle.com/javacard/3.0.5/guide/supported-cryptography-classes.htm#JCUGC356