Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs for invalid hash requirements. #8102

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions doc/dox_comments/header_files/ed25519.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ int wc_ed25519ctx_sign_msg(const byte* in, word32 inlen, byte* out,

\brief This function signs a message digest using an ed25519_key object
to guarantee authenticity. The context is included as part of the data
signed. The message is pre-hashed before signature calculation. The hash
algorithm used to create message digest must be SHAKE-256.
signed. The message is pre-hashed before signature calculation.

\return 0 Returned upon successfully generating a signature for the
message digest.
Expand Down
6 changes: 2 additions & 4 deletions doc/dox_comments/header_files/ed448.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ int wc_ed448_sign_msg(const byte* in, word32 inlen, byte* out,
\brief This function signs a message digest using an ed448_key object
to guarantee authenticity. The context is included as part of the data
signed. The hash is the pre-hashed message before signature calculation.
The hash algorithm used to create message digest must be SHAKE-256.

\return 0 Returned upon successfully generating a signature for the
message digest.
Expand Down Expand Up @@ -162,7 +161,7 @@ int wc_ed448_sign_msg(const byte* in, word32 inlen, byte* out,

byte sig[114]; // will hold generated signature
sigSz = sizeof(sig);
byte hash[] = { initialize with SHAKE-256 hash of message };
byte hash[] = { initialize hash of message };
byte context[] = { initialize with context of signing };

wc_InitRng(&rng); // initialize rng
Expand Down Expand Up @@ -297,7 +296,6 @@ int wc_ed448_verify_msg(const byte* sig, word32 siglen, const byte* msg,
\brief This function verifies the Ed448 signature of the digest of a message
to ensure authenticity. The context is included as part of the data
verified. The hash is the pre-hashed message before signature calculation.
The hash algorithm used to create message digest must be SHAKE-256.
The answer is returned through res, with 1 corresponding to a valid
signature, and 0 corresponding to an invalid signature.

Expand Down Expand Up @@ -325,7 +323,7 @@ int wc_ed448_verify_msg(const byte* sig, word32 siglen, const byte* msg,
int ret, verified = 0;

byte sig[] { initialize with received signature };
byte hash[] = { initialize with SHAKE-256 hash of message };
byte hash[] = { initialize hash of message };
byte context[] = { initialize with context of signature };
// initialize key with received public key
ret = wc_ed448ph_verify_hash(sig, sizeof(sig), hash, sizeof(hash),
Expand Down
Loading