Class: Izokatu::Openssl::PrivateKey::Auth::CCM::Encrypter

Inherits:
Encrypter show all
Defined in:
lib/izokatu/openssl/private_key/auth/ccm/encrypter.rb

Overview

OpenSSL private key encrypter for authenticated ciphers in CCM mode

Constant Summary collapse

DEFAULT_CCM_IV_LENGTH =

Default iv (nonce) length for ciphers in CCM mode

7
DEFAULT_CCM_AUTH_TAG_LENGTH =

Default authentication tag length for ciphers in CCM mode

8

Constants inherited from Encrypter

Encrypter::DEFAULT_AUTH_OPTIONS

Constants inherited from Default::Encrypter

Default::Encrypter::DEFAULT_OPTIONS

Constants inherited from Encrypter

Encrypter::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from Encrypter

#auth_data

Attributes inherited from Default::Encrypter

#cipher, #key, #nonce

Attributes inherited from Encrypter

#clear_data, #encrypted_data, #encrypter

Instance Method Summary collapse

Methods inherited from Encrypter

#compute_auth_tag!, #decrypter_params, #encrypt_data!, #initialize

Methods inherited from Default::Encrypter

#create_encrypter!, #decrypter_params, #encrypt_data!, #initialize

Methods inherited from Encrypter

#encrypt_data!, #import_clear_data!, #initialize, #perform

Methods included from Callable

#call

Constructor Details

This class inherits a constructor from Izokatu::Openssl::PrivateKey::Auth::Encrypter

Instance Method Details

#initialize_auth_ccm_encrypter_params!Object (private)

Set length for iv and auth_tag before their initialization

Since:

  • 0.1.0



30
31
32
33
# File 'lib/izokatu/openssl/private_key/auth/ccm/encrypter.rb', line 30

def initialize_auth_ccm_encrypter_params!
  encrypter.iv_len = DEFAULT_CCM_IV_LENGTH
  encrypter.auth_tag_len = DEFAULT_CCM_AUTH_TAG_LENGTH
end

#initialize_auth_encrypter_params!(auth_data) ⇒ Object (private)

Initializing encrypter auth params

Since:

  • 0.1.0



39
40
41
42
# File 'lib/izokatu/openssl/private_key/auth/ccm/encrypter.rb', line 39

def initialize_auth_encrypter_params!(auth_data)
  initialize_static_message_length!
  super
end

#initialize_encrypter_params!Object (private)

Initializing encrypter params

Since:

  • 0.1.0



21
22
23
24
# File 'lib/izokatu/openssl/private_key/auth/ccm/encrypter.rb', line 21

def initialize_encrypter_params!
  initialize_auth_ccm_encrypter_params!
  super
end

#initialize_static_message_length!Object (private)

Initializing message length for cipher in CCM mode

Since:

  • 0.1.0



48
49
50
# File 'lib/izokatu/openssl/private_key/auth/ccm/encrypter.rb', line 48

def initialize_static_message_length!
  encrypter.ccm_data_len = clear_data.length unless cipher.include?('ARIA')
end