def encrypt(data, nonce, additional_data = '')
      valid?(data, nonce, additional_data)

      crypt(data, nonce) + mac(data, nonce, additional_data)
    end
def encrypt(data, nonce, additional_data = '')
      valid?(data, nonce, additional_data)

      crypt(data, nonce) + mac(data, nonce, additional_data)
    end
Creates a new CCM object.

 @param cipher [String] one of the supported algorithms like 'AES'
 @param key [String] the key used for encryption and decryption
 @param mac_len [Number] the length of the mac.
        needs to be in 4, 6, 8, 10, 12, 14, 16

 @return [Object] the new CCM object
 Encrypts the input data and appends mac for authentication.
 If there is additional data, its included into mac calculation.

 @param data [String] the data to encrypt
 @param nonce [String] the nonce used for encryption
 @param additional_data [String] additional data to
        authenticate with mac (not part of the output)

 @return [String] the encrypted data with appended mac