Skip to content
instance method

OpenSSL::Cipher#auth_tag_len=

(::Integer) -> ::Integer
cipher.auth_tag_len = integer

Sets the length of the expected authentication tag for this Cipher. This method is available for some of AEAD ciphers that require the length to be set before starting encryption or decryption, such as CCM mode or OCB mode.

For CCM mode and OCB mode, the tag length must be set before iv= is set.

See also the “AEAD Interface” section of the man page EVP_EncryptInit(3). This method internally calls EVP_CIPHER_CTX_ctrl() with EVP_CTRL_AEAD_SET_TAG and a NULL buffer.

See also #auth_tag= #block_size #auth_tag #ccm_data_len= also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0