ruby/ruby — pull request #569 by louismullie (2014-03-16 20:45:13+00:00)
Title: Finish adding support for AES-CCM mode

Currently, only the GCM mode of authenticated encryption are supported in Ruby. This patch adds support for the CCM mode of authenticated encryption. It also adds support for explicitly setting IV length, which is required by OpenSSL when dealing with non-standard IV lengths in CCM mode. See https://bugs.ruby-lang.org/issues/9642 for more information.

More details:

- Add #ossl_is_ccm macro for AES-128-CCM, AES-192-CCM and AES-256-CCM
- Modify OpenSSL::Cipher#authenticated? to return true for CCM modes
- Add ossl_ccm_set_auth_tag and ossl_ccm_get_auth_tag methods
- Modify OpenSSL::Cipher#auth_tag and OpenSSL::Cipher#auth_tag= to
support CCM
- Add OpenSSL::Cipher#iv_len= method to support non-standard CCM IV
lengths
- Add some documentation on how to use non-standard CCM IV lengths