3
openSSL暗号ライブラリの以下の関数のパラメータを理解しようとしています。私が把握することができたhere与えられた提案を通じて協力することによりOpenSSLのAES_ctr128_encrypt()のパラメータ詳細
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
size_t length, const AES_KEY *key,
unsigned char ivec[AES_BLOCK_SIZE],
unsigned char ecount_buf[AES_BLOCK_SIZE],
unsigned int *num);
:
*in - is the buffer in.
*out - is the buffer out.
length - is the the length of the *in buffer.
*key - is the private key.
ivec[0-7] - is the random IV
ivec[8-15] - is the counter thats incremented for every block that's encrypted.
私は
ecount_buf
とnum
パラメータに関する一定していません。
num
は、コールが返された後にlength % AES_BLOCK_SIZE
に設定されています。
ecount_buf
のパラメータは何ですか?
あなたは 'AES_encrypt'とフレンドを使うべきではありません。これはソフトウェアのみの実装なので、AES-NIなどのハードウェアサポートは受けられません。あなたは 'EVP_ *'関数を使っていなければなりません。 OpenSSL wikiの[EVP Symmetric Encryption and Decryption](http://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption)を参照してください。実際には、機密性と信頼性の両方を提供するため、おそらく認証された暗号化を使用するべきです。 OpenSSL wikiの[EVP Authenticated Encryption and Decryption](http://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption)を参照してください。 – jww