- Notifications
You must be signed in to change notification settings - Fork0
AES-CMAC implementation in pure javascript
NotificationsYou must be signed in to change notification settings
jfamousket/aes-cmac-js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
AES-CMAC implementation in pure javascript usingsjcl. SeeRFC Spec.
For validation, this library contains passing test vectors taken from theRFC spec
, seetests/test.ts
.
// pass your key hereconstcmac=newAesCmac("0x2b7e151628aed2a6abf7158809cf4f3c");// encrypt 0x000... using your keyconstencrypted=cmac.encrypt(sjcl.codec.hex.toBits("0x00000000000000000000000000000000"));// expected outputconstexpected=sjcl.codec.hex.toBits("0x7df76b0c1ab899b33e42f047b91b546f");// should be trueconsole.log(sjcl.bitArray.equal(t_0,aes_0));
You can easily fork and try out a live version of the codeStackBlitz ⚡️