Skip to content

Commit

Permalink
Merge pull request #8102 from embhorn/topic2203
Browse files Browse the repository at this point in the history
Fix docs for invalid hash requirements.
  • Loading branch information
dgarske authored Oct 30, 2024
2 parents 72306b9 + f20f96c commit fc56060
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
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

0 comments on commit fc56060

Please sign in to comment.