Class: Izokatu::Openssl::PrivateKey::Auth::CCM::Decrypter
- Inherits:
-
Decrypter
- Object
- Decrypter
- Default::Decrypter
- Decrypter
- Izokatu::Openssl::PrivateKey::Auth::CCM::Decrypter
- Defined in:
- lib/izokatu/openssl/private_key/auth/ccm/decrypter.rb
Overview
OpenSSL private key decrypter 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 Decrypter
Decrypter::DEFAULT_AUTH_TAG_LENGTH
Constants inherited from Default::Decrypter
Default::Decrypter::DEFAULT_OPTIONS
Instance Attribute Summary
Attributes inherited from Decrypter
Attributes inherited from Default::Decrypter
Attributes inherited from Decrypter
#decrypted_data, #decrypter, #encrypted_data
Instance Method Summary collapse
-
#initialize_auth_ccm_decrypter_params! ⇒ Object
private
Set length for iv and auth_tag before their initialization.
-
#initialize_auth_decrypter_params! ⇒ Object
private
Initializing decrypter auth params.
-
#initialize_decrypter_params! ⇒ Object
private
Initializing decrypter params.
-
#initialize_static_message_length! ⇒ Object
private
Initializing message length for cipher in CCM mode.
-
#verify_tag_size! ⇒ Object
private
Raising exception if auth tag is truncated.
Methods inherited from Decrypter
Methods inherited from Default::Decrypter
#create_decrypter!, #decrypt_data!, #initialize
Methods inherited from Decrypter
#decrypt_data!, #import_encrypted_data!, #initialize, #perform
Methods included from Callable
Constructor Details
This class inherits a constructor from Izokatu::Openssl::PrivateKey::Auth::Decrypter
Instance Method Details
#initialize_auth_ccm_decrypter_params! ⇒ Object (private)
Set length for iv and auth_tag before their initialization
31 32 33 34 |
# File 'lib/izokatu/openssl/private_key/auth/ccm/decrypter.rb', line 31 def initialize_auth_ccm_decrypter_params! decrypter.iv_len = DEFAULT_CCM_IV_LENGTH decrypter.auth_tag_len = DEFAULT_CCM_AUTH_TAG_LENGTH end |
#initialize_auth_decrypter_params! ⇒ Object (private)
Initializing decrypter auth params
40 41 42 43 |
# File 'lib/izokatu/openssl/private_key/auth/ccm/decrypter.rb', line 40 def initialize_auth_decrypter_params! super end |
#initialize_decrypter_params! ⇒ Object (private)
Initializing decrypter params
22 23 24 25 |
# File 'lib/izokatu/openssl/private_key/auth/ccm/decrypter.rb', line 22 def initialize_decrypter_params! initialize_auth_ccm_decrypter_params! super end |
#initialize_static_message_length! ⇒ Object (private)
Initializing message length for cipher in CCM mode
49 50 51 |
# File 'lib/izokatu/openssl/private_key/auth/ccm/decrypter.rb', line 49 def decrypter.ccm_data_len = encrypted_data.length unless cipher.include?('ARIA') end |
#verify_tag_size! ⇒ Object (private)
Redefined to use local auth tag length
Raising exception if auth tag is truncated
59 60 61 |
# File 'lib/izokatu/openssl/private_key/auth/ccm/decrypter.rb', line 59 def verify_tag_size! raise 'tag is truncated!' unless auth_tag.bytesize == DEFAULT_CCM_AUTH_TAG_LENGTH end |