Skip to content

Commit

Permalink
Use NanaZip.Codecs.Hash.BCryptProvider instead of RHash to implement …
Browse files Browse the repository at this point in the history
…the MD4 hash algorithm.
  • Loading branch information
MouriNaruto committed Dec 18, 2024
1 parent 87108f9 commit ce92f98
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 312 deletions.
1 change: 1 addition & 0 deletions K7Pal/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ although the implementation may not in this repository.
- Cryptography
- Hash Functions
- MD2
- MD4
- MD5
- SHA-384
- SHA-512
5 changes: 5 additions & 0 deletions NanaZip.Codecs/NanaZip.Codecs.Hash.BCryptProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ namespace NanaZip::Codecs::Hash
return new BCryptProvider(BCRYPT_MD2_ALGORITHM);
}

IHasher* CreateMd4()
{
return new BCryptProvider(BCRYPT_MD4_ALGORITHM);
}

IHasher* CreateMd5()
{
return new BCryptProvider(BCRYPT_MD5_ALGORITHM);
Expand Down
64 changes: 0 additions & 64 deletions NanaZip.Codecs/NanaZip.Codecs.Hash.Md4.cpp

This file was deleted.

3 changes: 0 additions & 3 deletions NanaZip.Codecs/NanaZip.Codecs.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
<ClCompile Include="NanaZip.Codecs.Hash.Gost94.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Gost94CryptoPro.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Has160.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Md4.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Ripemd160.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Sha224.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Sha3224.cpp" />
Expand Down Expand Up @@ -225,7 +224,6 @@
<ClCompile Include="RHash\gost94.c" />
<ClCompile Include="RHash\has160.c" />
<ClCompile Include="RHash\hex.c" />
<ClCompile Include="RHash\md4.c" />
<ClCompile Include="RHash\rhash_sha1.c" />
<ClCompile Include="RHash\rhash_sha256.c" />
<ClCompile Include="RHash\rhash_util.c" />
Expand Down Expand Up @@ -427,7 +425,6 @@
<ClInclude Include="RHash\gost94.h" />
<ClInclude Include="RHash\has160.h" />
<ClInclude Include="RHash\hex.h" />
<ClInclude Include="RHash\md4.h" />
<ClInclude Include="RHash\ripemd-160.h" />
<ClInclude Include="RHash\sha1.h" />
<ClInclude Include="RHash\sha256.h" />
Expand Down
7 changes: 0 additions & 7 deletions NanaZip.Codecs/NanaZip.Codecs.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@
<ClCompile Include="RHash\hex.c">
<Filter>RHash</Filter>
</ClCompile>
<ClCompile Include="RHash\md4.c">
<Filter>RHash</Filter>
</ClCompile>
<ClCompile Include="RHash\ripemd-160.c">
<Filter>RHash</Filter>
</ClCompile>
Expand Down Expand Up @@ -376,7 +373,6 @@
<ClCompile Include="NanaZip.Codecs.Hash.Gost12256.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Gost12512.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Has160.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Md4.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Ripemd160.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Sha224.cpp" />
<ClCompile Include="NanaZip.Codecs.Hash.Sha3224.cpp" />
Expand Down Expand Up @@ -499,9 +495,6 @@
<ClInclude Include="RHash\hex.h">
<Filter>RHash</Filter>
</ClInclude>
<ClInclude Include="RHash\md4.h">
<Filter>RHash</Filter>
</ClInclude>
<ClInclude Include="RHash\ripemd-160.h">
<Filter>RHash</Filter>
</ClInclude>
Expand Down
206 changes: 0 additions & 206 deletions NanaZip.Codecs/RHash/md4.c

This file was deleted.

31 changes: 0 additions & 31 deletions NanaZip.Codecs/RHash/md4.h

This file was deleted.

3 changes: 2 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ Kenji Mouri
GOST R 34.11-94 CryptoPro, GOST R 34.11-2012 256, GOST R 34.11-2012 512,
HAS-160, RIPEMD-160, SHA-224, SHA3-224, SHA3-256, SHA3-384, SHA3-512,
Snefru-128, Snefru-256, Tiger, Tiger2, TTH, Whirlpool), xxHash (XXH3_64bits,
XXH3_128bits), GmSSL (SM3), and Windows CNG API (MD2, MD5, SHA-384, SHA-512).
XXH3_128bits), GmSSL (SM3), and Windows CNG API (MD2, MD4, MD5, SHA-384,
SHA-512).
- Enable Control Flow Guard (CFG) to all target binaries for mitigating ROP
attacks.
- Mark all x86 and x64 target binaries as compatible with Control-flow
Expand Down

0 comments on commit ce92f98

Please sign in to comment.