@@ -173,7 +173,7 @@ int wc_ed25519ctx_sign_msg(const byte* in, word32 inlen, byte* out,
173173 \param [in] hash 署名するメッセージのハッシュを含むバッファへのポインタ。
174174 \param [in] hashLen 署名するメッセージのハッシュの長さ。
175175 \param [out] out 生成された署名を格納するバッファ。
176- \param [in,out] outlen 出力バッファの最大長。メッセージ署名の生成に成功した後、outに書き込まれたバイト数が格納されます。
176+ \param [in,out] outLen 出力バッファの最大長。メッセージ署名の生成に成功した後、outに書き込まれたバイト数が格納されます。
177177 \param [in] key 署名を生成するために使用する秘密ed25519_keyへのポインタ。
178178 \param [in] context メッセージが署名されているコンテキストを含むバッファへのポインタ。
179179 \param [in] contextLen コンテキストバッファの長さ。
@@ -373,8 +373,8 @@ int wc_ed25519ctx_verify_msg(const byte* sig, word32 siglen, const byte* msg,
373373 byte hash[] = { メッセージのSHA-512ハッシュで初期化 };
374374 byte context[] = { 署名のコンテキストで初期化 };
375375 // 受信した公開鍵でkeyを初期化
376- ret = wc_ed25519ph_verify_hash(sig, sizeof(sig), msg , sizeof(msg ),
377- &verified, &key, );
376+ ret = wc_ed25519ph_verify_hash(sig, sizeof(sig), hash , sizeof(hash ),
377+ &verified, &key, context, sizeof(context) );
378378 if (ret < 0) {
379379 // 検証実行エラー
380380 } else if (verified == 0)
@@ -419,8 +419,8 @@ int wc_ed25519ph_verify_hash(const byte* sig, word32 siglen, const byte* hash,
419419 byte msg[] = { メッセージで初期化 };
420420 byte context[] = { 署名のコンテキストで初期化 };
421421 // 受信した公開鍵でkeyを初期化
422- ret = wc_ed25519ctx_verify_msg (sig, sizeof(sig), msg, sizeof(msg),
423- &verified, &key, );
422+ ret = wc_ed25519ph_verify_msg (sig, sizeof(sig), msg, sizeof(msg),
423+ &verified, &key, context, sizeof(context) );
424424 if (ret < 0) {
425425 // 検証実行エラー
426426 } else if (verified == 0)
@@ -429,8 +429,8 @@ int wc_ed25519ph_verify_hash(const byte* sig, word32 siglen, const byte* hash,
429429 \endcode
430430
431431 \sa wc_ed25519_verify_msg
432+ \sa wc_ed25519ctx_verify_msg
432433 \sa wc_ed25519ph_verify_hash
433- \sa wc_ed25519ph_verify_msg
434434 \sa wc_ed25519_sign_msg
435435*/
436436
@@ -645,7 +645,7 @@ int wc_ed25519_import_private_key(const byte* priv, word32 privSz,
645645
646646 ed25519_key key;
647647 wc_ed25519_init_key(&key);
648- ret = wc_ed25519_import_private_key (priv, sizeof(priv), pub, sizeof(pub),
648+ ret = wc_ed25519_import_private_key_ex (priv, sizeof(priv), pub, sizeof(pub),
649649 &key, 1);
650650 if (ret != 0) {
651651 // 鍵のインポートエラー
@@ -669,7 +669,7 @@ int wc_ed25519_import_private_key_ex(const byte* priv, word32 privSz,
669669
670670 \return 0 公開鍵のエクスポートに成功した場合に返されます。
671671 \return BAD_FUNC_ARG 入力値のいずれかがNULLと評価された場合に返されます。
672- \return BUFFER_E 提供されたバッファが秘密鍵を格納するのに十分な大きさでない場合に返されます 。このエラーを返す際、関数はoutLenに必要なサイズを設定します。
672+ \return BUFFER_E 提供されたバッファが公開鍵を格納するのに十分な大きさでない場合に返されます 。このエラーを返す際、関数はoutLenに必要なサイズを設定します。
673673
674674 \param [in] key 公開鍵をエクスポートするed25519_key構造体へのポインタ。
675675 \param [out] out 公開鍵を格納するバッファへのポインタ。
@@ -692,10 +692,11 @@ int wc_ed25519_import_private_key_ex(const byte* priv, word32 privSz,
692692
693693 \sa wc_ed25519_import_public
694694 \sa wc_ed25519_import_public_ex
695+ \sa wc_ed25519_export_private
695696 \sa wc_ed25519_export_private_only
696697*/
697698
698- int wc_ed25519_export_public (ed25519_key * key , byte * out , word32 * outLen );
699+ int wc_ed25519_export_public (const ed25519_key * key , byte * out , word32 * outLen );
699700
700701/*!
701702 \ingroup ED25519
@@ -725,11 +726,12 @@ int wc_ed25519_export_public(ed25519_key* key, byte* out, word32* outLen);
725726 \endcode
726727
727728 \sa wc_ed25519_export_public
729+ \sa wc_ed25519_export_private
728730 \sa wc_ed25519_import_private_key
729731 \sa wc_ed25519_import_private_key_ex
730732*/
731733
732- int wc_ed25519_export_private_only (ed25519_key * key , byte * out , word32 * outLen );
734+ int wc_ed25519_export_private_only (const ed25519_key * key , byte * out , word32 * outLen );
733735
734736/*!
735737 \ingroup ED25519
@@ -767,7 +769,7 @@ int wc_ed25519_export_private_only(ed25519_key* key, byte* out, word32* outLen);
767769 \sa wc_ed25519_export_private_only
768770*/
769771
770- int wc_ed25519_export_private (ed25519_key * key , byte * out , word32 * outLen );
772+ int wc_ed25519_export_private (const ed25519_key * key , byte * out , word32 * outLen );
771773
772774/*!
773775 \ingroup ED25519
@@ -805,7 +807,7 @@ int wc_ed25519_export_private(ed25519_key* key, byte* out, word32* outLen);
805807 \sa wc_ed25519_export_public
806808*/
807809
808- int wc_ed25519_export_key (ed25519_key * key ,
810+ int wc_ed25519_export_key (const ed25519_key * key ,
809811 byte * priv , word32 * privSz ,
810812 byte * pub , word32 * pubSz );
811813
@@ -866,7 +868,7 @@ int wc_ed25519_check_key(ed25519_key* key);
866868 \sa wc_ed25519_make_key
867869*/
868870
869- int wc_ed25519_size (ed25519_key * key );
871+ int wc_ed25519_size (const ed25519_key * key );
870872
871873/*!
872874 \ingroup ED25519
@@ -893,7 +895,7 @@ int wc_ed25519_size(ed25519_key* key);
893895 \sa wc_ed25519_pub_size
894896*/
895897
896- int wc_ed25519_priv_size (ed25519_key * key );
898+ int wc_ed25519_priv_size (const ed25519_key * key );
897899
898900/*!
899901 \ingroup ED25519
@@ -919,7 +921,7 @@ int wc_ed25519_priv_size(ed25519_key* key);
919921 \sa wc_ed25519_priv_size
920922*/
921923
922- int wc_ed25519_pub_size (ed25519_key * key );
924+ int wc_ed25519_pub_size (const ed25519_key * key );
923925
924926/*!
925927 \ingroup ED25519
@@ -946,4 +948,4 @@ int wc_ed25519_pub_size(ed25519_key* key);
946948 \sa wc_ed25519_sign_msg
947949*/
948950
949- int wc_ed25519_sig_size (ed25519_key * key );
951+ int wc_ed25519_sig_size (const ed25519_key * key );
0 commit comments