Get incorrect results by using the Multi-Hash-SHA1 API
- Dominant language
- C
- Stars
- 1.1k
- Forks
- 346
- PR merge metrics
- No merged PRs in 30d
Description
I refer to mh_sha1_test.c for calling Multi-Hash-SHA1 API
Here is the pseudo-code multi-hash API sequence:
1. Call mh_sha1_init() on a mh_sha1_ctx object to initialize a hash context for use with the context manager.
2. Call mh_sha1_update() to update hashes with input data(64k).
3. Call mh_sha1_finalize()finalize the message **digests** for multi-hash sha1.
Here is the openssl hash API sequence:
Call open-ssl SHA1() with the 64k input data to get the **digest**.
Error Result
Comparing the above two of digests, the results are inconsistent.
Expected Result
Get the correct result, which is consistent with the open-ssl SHA1() API
I checked the return value of above three API (mh_sha1_init() / mh_sha1_update() / mh_sha1_finalize()),
they are all return MH_SHA1_CTX_ERROR_NONE.
Contributor guide
Assessment
This issue has not been assessed yet.