本文整理汇总了C++中AES::ctr_encrypt方法的典型用法代码示例。如果您正苦于以下问题:C++ AES::ctr_encrypt方法的具体用法?C++ AES::ctr_encrypt怎么用?C++ AES::ctr_encrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AES
的用法示例。
在下文中一共展示了AES::ctr_encrypt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode_payloads
Mikey_Payloads* Mikey_Payload_KEMAC::decode_payloads( int firstPayloadType, byte_t * encrKey, int encrKeyLength, byte_t * iv )
{
byte_t * decrData = new byte_t[ encr_data_length_value ];
AES * aes;
switch( encr_alg_value)
{
case MIKEY_PAYLOAD_KEMAC_ENCR_AES_CM_128:
aes = new AES( encrKey, encrKeyLength );
aes->ctr_encrypt( encr_data_ptr, encr_data_length_value, decrData, iv );
delete aes;
break;
case MIKEY_PAYLOAD_KEMAC_ENCR_NULL:
memcpy( decrData, encr_data_ptr, encr_data_length_value );
break;
case MIKEY_PAYLOAD_KEMAC_ENCR_AES_KW_128:
//TODO
default:
delete [] decrData;
throw Mikey_Exception(
"Unknown encryption algorithm" );
break;
}
Mikey_Payloads *output =
new Mikey_Payloads( firstPayloadType, decrData, encr_data_length_value );
// decrData is owned and deleted by MikeyPayloads
return output;
}