def _create_ccm_cipher(factory, **kwargs):
 try:
  key = key = kwargs.pop('key')
 except KeyError as e:
  raise TypeError(('Missing parameter: ' + str(e)))
 nonce = kwargs.pop('nonce', None)
 if (nonce is None):
  nonce = get_random_bytes(11)
 mac_len = kwargs.pop('mac_len', factory.block_size)
 msg_len = kwargs.pop('msg_len', None)
 assoc_len = kwargs.pop('assoc_len', None)
 cipher_params = dict(kwargs)
 return CcmMode(factory, key, nonce, mac_len, msg_len, assoc_len, cipher_params)

def _create_ccm_cipher ( factory , ** kwargs ) : try : key = key = kwargs . pop ( 'key' ) except KeyError as e : raise TypeError ( ( 'Missing parameter: ' + str ( e ) ) ) nonce = kwargs . pop ( 'nonce' , None ) if ( nonce is None ) : nonce = get_random_bytes ( 11 ) mac_len = kwargs . pop ( 'mac_len' , factory . block_size ) msg_len = kwargs . pop ( 'msg_len' , None ) assoc_len = kwargs . pop ( 'assoc_len' , None ) cipher_params = dict ( kwargs ) return CcmMode ( factory , key , nonce , mac_len , msg_len , assoc_len , cipher_params )
create a new block cipher .