babelouest / rhonabwy

Javascript Object Signing and Encryption (JOSE) library - JWK, JWKS, JWS, JWE and JWT
https://babelouest.github.io/rhonabwy/
GNU Lesser General Public License v2.1
45 stars 21 forks source link

Make authenticated decryption work with keys longer than 32 octets #8

Closed wbangna closed 3 years ago

wbangna commented 3 years ago

We just switched from cjose to rhonabwy and our JWE tests didn't work any more. I then compared your implementation with the implementation of cjose and found the difference in the calculation of the authentication tag. In your implementation the key length is fixed to 16 bytes, in the implentation of cjose the key length is calculated by dividing the original key length by two. This behaviour matches the examples found here:

With this patch our JWE tests do work again.

babelouest commented 3 years ago

Thanks a lot @wbangna for finding this one !