Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
OpenSSL::Cipher#ccm_data_len=
cipher.ccm_data_len = integer
ext/openssl/ossl_cipher.c
View on GitHub ↗
static VALUE
ossl_cipher_set_ccm_data_len(VALUE self, VALUE data_len)
{
int in_len, out_len;
EVP_CIPHER_CTX *ctx;
in_len = NUM2INT(data_len);
GetCipher(self, ctx);
if (EVP_CipherUpdate(ctx, NULL, &out_len, NULL, in_len) != 1)
ossl_raise(eCipherError, NULL);
return data_len;
}
Sets the total length of the plaintext / ciphertext message that will be processed by update in CCM mode.
Make sure to call this method after key= and iv= have been set, and before auth_data= or update are called.
This method is only available for CCM mode ciphers.
See also the “AEAD Interface” section of the man page EVP_EncryptInit(3).