Files
wolfssl/doc/dox_comments/header_files-ja/chacha.h

68 lines
3.2 KiB
C
Raw Normal View History

/*!
\ingroup ChaCha
\brief Chachaオブジェクトの初期化ベクトルnonce使WC_CHACHA_SETKEYを使用して使
\return 0
\return BAD_FUNC_ARG CTX入力引数の処理中にエラーが発生した場合
\param ctx IVを設定するChacha構造へのポインタ
\param inIv Chacha構造を初期化するための12バイトの初期化ベクトルを含むバッファへのポインタ
_Example_
\code
ChaCha enc;
// initialize enc with wc_Chacha_SetKey
byte iv[12];
// initialize iv
if( wc_Chacha_SetIV(&enc, iv, 0) != 0) {
// error initializing ChaCha structure
}
\endcode
\sa wc_Chacha_SetKey
\sa wc_Chacha_Process
*/
int wc_Chacha_SetIV(ChaCha* ctx, const byte* inIv, word32 counter);
/*!
\ingroup ChaCha
\brief
\return 0
\return BAD_FUNC_ARG CTX入力引数の処理中にエラーが発生した場合
\param ctx IVを設定するChacha構造へのポインタ
\param output
\param input
_Example_
\code
ChaCha enc;
// initialize enc with wc_Chacha_SetKey and wc_Chacha_SetIV
byte plain[] = { // initialize plaintext };
byte cipher[sizeof(plain)];
if( wc_Chacha_Process(&enc, cipher, plain, sizeof(plain)) != 0) {
// error processing ChaCha cipher
}
\endcode
\sa wc_Chacha_SetKey
\sa wc_Chacha_Process
*/
int wc_Chacha_Process(ChaCha* ctx, byte* cipher, const byte* plain,
word32 msglen);
/*!
\ingroup ChaCha
\brief Chachaオブジェクトのキーを設定し使NONCEをWC_CHACHA_SETIVで設定する前にWC_CHACHA_PROCESSを使用した暗号化に使用する前に呼び出す必要があります
\return 0
\return BAD_FUNC_ARG CTX入力引数の処理中にエラーが発生した場合1632
\param ctx Chacha構造へのポインタ
\param key Chacha構造を初期化するための16または32バイトのキーを含むバッファへのポインタ
_Example_
\code
ChaCha enc;
byte key[] = { // initialize key };
if( wc_Chacha_SetKey(&enc, key, sizeof(key)) != 0) {
// error initializing ChaCha structure
}
\endcode
\sa wc_Chacha_SetIV
\sa wc_Chacha_Process
*/
int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz);