@@ -440,8 +440,8 @@ int wc_ed25519ctx_verify_msg(const byte* sig, word32 siglen, const byte* msg,
440440 byte hash[] = { initialize with SHA-512 hash of message };
441441 byte context[] = { initialize with context of signature };
442442 // initialize key with received public key
443- ret = wc_ed25519ph_verify_hash(sig, sizeof(sig), msg , sizeof(msg ),
444- &verified, &key, );
443+ ret = wc_ed25519ph_verify_hash(sig, sizeof(sig), hash , sizeof(hash ),
444+ &verified, &key, context, sizeof(context) );
445445 if (ret < 0) {
446446 // error performing verification
447447 } else if (verified == 0)
@@ -496,8 +496,8 @@ int wc_ed25519ph_verify_hash(const byte* sig, word32 siglen, const byte* hash,
496496 byte msg[] = { initialize with message };
497497 byte context[] = { initialize with context of signature };
498498 // initialize key with received public key
499- ret = wc_ed25519ctx_verify_msg (sig, sizeof(sig), msg, sizeof(msg),
500- &verified, &key, );
499+ ret = wc_ed25519ph_verify_msg (sig, sizeof(sig), msg, sizeof(msg),
500+ &verified, &key, context, sizeof(context) );
501501 if (ret < 0) {
502502 // error performing verification
503503 } else if (verified == 0)
@@ -506,8 +506,8 @@ int wc_ed25519ph_verify_hash(const byte* sig, word32 siglen, const byte* hash,
506506 \endcode
507507
508508 \sa wc_ed25519_verify_msg
509+ \sa wc_ed25519ctx_verify_msg
509510 \sa wc_ed25519ph_verify_hash
510- \sa wc_ed25519ph_verify_msg
511511 \sa wc_ed25519_sign_msg
512512*/
513513
@@ -747,7 +747,7 @@ int wc_ed25519_import_private_key(const byte* priv, word32 privSz,
747747
748748 ed25519_key key;
749749 wc_ed25519_init_key(&key);
750- ret = wc_ed25519_import_private_key (priv, sizeof(priv), pub, sizeof(pub),
750+ ret = wc_ed25519_import_private_key_ex (priv, sizeof(priv), pub, sizeof(pub),
751751 &key, 1);
752752 if (ret != 0) {
753753 // error importing key
@@ -774,7 +774,7 @@ int wc_ed25519_import_private_key_ex(const byte* priv, word32 privSz,
774774 \return 0 Returned upon successfully exporting the public key.
775775 \return BAD_FUNC_ARG Returned if any of the input values evaluate to NULL.
776776 \return BUFFER_E Returned if the buffer provided is not large enough to
777- store the private key. Upon returning this error, the function sets the
777+ store the public key. Upon returning this error, the function sets the
778778 size required in outLen.
779779
780780 \param [in] key Pointer to an ed25519_key structure from which to export the
@@ -801,10 +801,11 @@ int wc_ed25519_import_private_key_ex(const byte* priv, word32 privSz,
801801
802802 \sa wc_ed25519_import_public
803803 \sa wc_ed25519_import_public_ex
804+ \sa wc_ed25519_export_private
804805 \sa wc_ed25519_export_private_only
805806*/
806807
807- int wc_ed25519_export_public (ed25519_key * key , byte * out , word32 * outLen );
808+ int wc_ed25519_export_public (const ed25519_key * key , byte * out , word32 * outLen );
808809
809810/*!
810811 \ingroup ED25519
@@ -840,11 +841,12 @@ int wc_ed25519_export_public(ed25519_key* key, byte* out, word32* outLen);
840841 \endcode
841842
842843 \sa wc_ed25519_export_public
844+ \sa wc_ed25519_export_private
843845 \sa wc_ed25519_import_private_key
844846 \sa wc_ed25519_import_private_key_ex
845847*/
846848
847- int wc_ed25519_export_private_only (ed25519_key * key , byte * out , word32 * outLen );
849+ int wc_ed25519_export_private_only (const ed25519_key * key , byte * out , word32 * outLen );
848850
849851/*!
850852 \ingroup ED25519
@@ -888,7 +890,7 @@ int wc_ed25519_export_private_only(ed25519_key* key, byte* out, word32* outLen);
888890 \sa wc_ed25519_export_private_only
889891*/
890892
891- int wc_ed25519_export_private (ed25519_key * key , byte * out , word32 * outLen );
893+ int wc_ed25519_export_private (const ed25519_key * key , byte * out , word32 * outLen );
892894
893895/*!
894896 \ingroup ED25519
@@ -935,7 +937,7 @@ int wc_ed25519_export_private(ed25519_key* key, byte* out, word32* outLen);
935937 \sa wc_ed25519_export_public
936938*/
937939
938- int wc_ed25519_export_key (ed25519_key * key ,
940+ int wc_ed25519_export_key (const ed25519_key * key ,
939941 byte * priv , word32 * privSz ,
940942 byte * pub , word32 * pubSz );
941943
@@ -999,7 +1001,7 @@ int wc_ed25519_check_key(ed25519_key* key);
9991001 \sa wc_ed25519_make_key
10001002*/
10011003
1002- int wc_ed25519_size (ed25519_key * key );
1004+ int wc_ed25519_size (const ed25519_key * key );
10031005
10041006/*!
10051007 \ingroup ED25519
@@ -1028,7 +1030,7 @@ int wc_ed25519_size(ed25519_key* key);
10281030 \sa wc_ed25519_pub_size
10291031*/
10301032
1031- int wc_ed25519_priv_size (ed25519_key * key );
1033+ int wc_ed25519_priv_size (const ed25519_key * key );
10321034
10331035/*!
10341036 \ingroup ED25519
@@ -1056,7 +1058,7 @@ int wc_ed25519_priv_size(ed25519_key* key);
10561058 \sa wc_ed25519_priv_size
10571059*/
10581060
1059- int wc_ed25519_pub_size (ed25519_key * key );
1061+ int wc_ed25519_pub_size (const ed25519_key * key );
10601062
10611063/*!
10621064 \ingroup ED25519
@@ -1084,4 +1086,4 @@ int wc_ed25519_pub_size(ed25519_key* key);
10841086 \sa wc_ed25519_sign_msg
10851087*/
10861088
1087- int wc_ed25519_sig_size (ed25519_key * key );
1089+ int wc_ed25519_sig_size (const ed25519_key * key );
0 commit comments