OpenIDC / cjose

C library implementing the Javascript Object Signing and Encryption (JOSE)
MIT License
16 stars 6 forks source link

Extract cjose_jwe_encrypt_iv to allow explicit IV #9

Closed zandbelt closed 2 years ago

zandbelt commented 2 years ago

It is currently not possible to pass a static IV to the encryption functions. This breaks systems that use a counter for GCM mode (rather than a random nonce). This PR extracts encryption functions that permit passing an explicit IV. It is backward compatible with the existing functions, and if NULL is passed, the existing IV-generation functions will be used.