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

feat: added ripemd160.cpp #2796

Closed
wants to merge 27 commits into from

Conversation

ShreeHarish
Copy link

Description of Change

Implemented the RIPEMD160 hashing, per request #2795

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Implemented the RIPEMD160 hashing algorithm. Implemented using threads for parallel processing.

@realstealthninja realstealthninja linked an issue Oct 9, 2024 that may be closed by this pull request
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
@realstealthninja realstealthninja added awaiting modification Do not merge until modifications are made Proper Documentation Required requested to write the documentation properly labels Oct 9, 2024
@ShreeHarish
Copy link
Author

updated all changes that was posted in this PR

hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
@ShreeHarish
Copy link
Author

updated recently requested changes

@ShreeHarish ShreeHarish reopened this Oct 10, 2024
@ShreeHarish
Copy link
Author

Kindly ping me for any other clarifications

hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
@ShreeHarish
Copy link
Author

I have some warnings in functions with switch cases that the control may reach the end of a fucntion without returning anything. But all of them are internal functions and it can be proved that the control can never reach the end of the function without returning anything. How can we handle this?

can this be ignored or should I handle to not produce any warnings?

Example of the warning is provided below.

C-Plus-Plus\hashing\ripemd_160.cpp:66:5: warning: control reaches end of non-void function [-Wreturn-type]
66 | }
| ^

@realstealthninja
Copy link
Collaborator

I have some warnings in functions with switch cases that the control may reach the end of a fucntion without returning anything. But all of them are internal functions and it can be proved that the control can never reach the end of the function without returning anything. How can we handle this?

can this be ignored or should I handle to not produce any warnings?

Example of the warning is provided below.

C-Plus-Plus\hashing\ripemd_160.cpp:66:5: warning: control reaches end of non-void function [-Wreturn-type]
66 | }
| ^

If j > 5 your function wont return anything. Throw and error in a default case. Probably an invalid argument error also add a @note to the functions with the switch statement stating that j must be less than 5

@ShreeHarish
Copy link
Author

resolved warnings

hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
@ShreeHarish
Copy link
Author

Kindly ping me for any other clarifications

hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
hashing/ripemd_160.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@realstealthninja realstealthninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for this pr!

@realstealthninja realstealthninja added approved Approved; waiting for merge hacktoberfest-accepted Accepted to be counted towards Hacktoberfest and removed awaiting modification Do not merge until modifications are made Proper Documentation Required requested to write the documentation properly labels Oct 23, 2024
@ShreeHarish
Copy link
Author

@Panquesito7 can you review the code if its good to go?

@ShreeHarish
Copy link
Author

/Users/runner/work/C-Plus-Plus/C-Plus-Plus/hashing/ripemd_160.cpp:354:50: error: must explicitly qualify name of member function when taking its address
[ 37%] Linking CXX executable quadratic_probing_hash_table
std::thread compute_for_block_thread(&compute_for_block, this, &A,
^~~~~~~~~~~~~~~~~~
RIPEMD160::

Got this error when running on mac environment.

I modified the code as

std::thread compute_for_block_thread(&RIPEMD160::compute_for_block, this, &A,

If there is still any issue, kindly ping me.

@realstealthninja
Copy link
Collaborator

@ShreeHarish

@ShreeHarish ShreeHarish closed this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved; waiting for merge hacktoberfest-accepted Accepted to be counted towards Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Implement RIPEMD160 hashing
2 participants