-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add SM3 #5495
Add SM3 #5495
Conversation
Thank you for your contribution! Your PR has passed all tests, including 32-bit, ARM, ASAN, no-OMP, ... We will give feedback soon. |
Thank you for the contribution @SamuraiOcto! The added
although where you use third-party SM3 code, you need to use their original license (or maybe public domain statement). Also, at least as seen in GitHub, these files appear to use 4-space indentation? We normally use tabs, and assume tab width 8. Finally, are the current settings for When you revise this PR, please amend the one commit and force-push. Please do not add more commits. |
Oh, please also add an entry to |
|
Thanks, this looks almost ready to merge.
Great. You also need to add your copyright statement to there, if you wrote that file.
It is per-thread, so we multiply it by the actual number of threads.
Normally, it's to be tuned manually at 1 thread or in a non-OpenMP build, then once you have it at optimal value for that, you tune |
I think I'll just merge this and then add a copyright line using your GitHub username on it... |
OK, merged and I'm testing and preparing further changes. Added copyright statement: +++ b/src/sm3_fmt_plug.c
@@ -1,9 +1,12 @@
-/* SM3 format plugin
+/*
+ * SM3 format plugin
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted.
+ * Copyright (c) 2024 SamuraiOcto
*
- * There's ABSOLUTELY NO WARRANTY, express or implied.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted.
+ *
+ * There's ABSOLUTELY NO WARRANTY, express or implied.
*/
#if FMT_EXTERNS_H
Somehow performance with OpenMP is awful - way lower than at 1 thread. Running with Also confirmed that the auto-generated Reviewing the code, I see it somehow limits hash comparisons to 16 bytes - why is that? Perhaps copied from another format, and is a bug here? |
OK, I've made several commits on top of yours @SamuraiOcto and pushed them into bleeding-jumbo. You're adding several dynamic preload formats. Can you please document those in |
@SamuraiOcto Reminding you that this is still missing the above documentation, which I'd appreciate you adding via a separate PR. Thanks! |
Thanks for merging this and sorry for the delay. #5512 adds the missing documentation |
This adds the SM3 hash function that is fairly widespread, mainly in China, but which was not yet present in john. For now this is just a basic but slow-ish implementation. Perhaps I might add avx2 later. Let me know if things should be changed.