www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - sha3-d

reply dd <dd dax.moe> writes:
Hello all!

When I submitted my work to Phobos[1] earlier this year, it was 
rejected. (Understandably)

So I made a DUB package and forgot to announce it here!

Package: https://code.dlang.org/packages/sha3-d
Source: https://github.com/dd86k/sha3-d

[1] https://github.com/dlang/phobos/pull/7713
Oct 29 2021
next sibling parent reply WebFreak001 <d.forum webfreak.org> writes:
On Friday, 29 October 2021 at 15:13:38 UTC, dd wrote:
 Hello all!

 When I submitted my work to Phobos[1] earlier this year, it was 
 rejected. (Understandably)

 So I made a DUB package and forgot to announce it here!

 Package: https://code.dlang.org/packages/sha3-d
 Source: https://github.com/dd86k/sha3-d

 [1] https://github.com/dlang/phobos/pull/7713
Awesome! Haven't had the need to use SHA-3 yet myself, but given all the other growing ecosystems where this could be of use it's nice to have this high-performance implementation already. Would be cool having benchmarks comparing this to other implementations if great performance is a goal, as you already mentioned in your README it's much faster than keccack-tiny.
Oct 29 2021
parent reply dd <dd dax.moe> writes:
On Friday, 29 October 2021 at 15:18:39 UTC, WebFreak001 wrote:
 Awesome! Haven't had the need to use SHA-3 yet myself, but 
 given all the other growing ecosystems where this could be of 
 use it's nice to have this high-performance implementation 
 already.
SHA-3 has been in use in SQLite and in Euthereum for a while, which are enormous projects. SHA-1 is on life support with sha1cd and SHA-2 faces length extension attacks (even with SHA-2-256 and SHA-2-512 but not SHA-2-512/256).
 Would be cool having benchmarks comparing this to other 
 implementations if great performance is a goal, as you already 
 mentioned in your README it's much faster than keccack-tiny.
From memory, I remember getting ~10MiB/s when I first implemented keccak-tiny from C to D. When I rewrote the package to my liking, and I got ~130MiB/s. But these tests were in a VM on my i7-3770 so it's not really a conclusive thing. I could do a benchmark again.
Oct 29 2021
parent reply Johan <j j.nl> writes:
On Friday, 29 October 2021 at 15:33:57 UTC, dd wrote:
 On Friday, 29 October 2021 at 15:18:39 UTC, WebFreak001 wrote:

 Would be cool having benchmarks comparing this to other 
 implementations if great performance is a goal, as you already 
 mentioned in your README it's much faster than keccack-tiny.
From memory, I remember getting ~10MiB/s when I first implemented keccak-tiny from C to D. When I rewrote the package to my liking, and I got ~130MiB/s. But these tests were in a VM on my i7-3770 so it's not really a conclusive thing.
The readme mentions compilation with `-b release-nobounds`. 1. These are flags for DUB (?), can you add/replace it with the conversion to actual compiler flags? 2. Did you test without removing bounds checks? If there is a noticable performance drop, I think it'd be very worthwhile to modify the code such that there is no penalty of boundschecks (at -O3); I think in theory only very few bounds checks are needed. Enabling good performance _with_ boundschecks on means that the user is not forced to build his whole project without boundschecks, or move to separate compilation. cheers, Johan
Oct 30 2021
parent dd <dd dax.moe> writes:
On Saturday, 30 October 2021 at 09:59:38 UTC, Johan wrote:
 The readme mentions compilation with `-b release-nobounds`.
 1. These are flags for DUB (?), can you add/replace it with the 
 conversion to actual compiler flags?
I can do a manual compilation section. Though, it is documentation online: https://dub.pm/package-format-sdl.html#build-types
 2. Did you test without removing bounds checks? If there is a 
 noticable performance drop, I think it'd be very worthwhile to 
 modify the code such that there is no penalty of boundschecks 
 (at -O3); I think in theory only very few bounds checks are 
 needed. Enabling good performance _with_ boundschecks on means 
 that the user is not forced to build his whole project without 
 boundschecks, or move to separate compilation.
I haven't tested it with bounds checking. I could do a round of benchmarks with different compilers and build types.
Nov 01 2021
prev sibling next sibling parent reply =?ISO-8859-1?Q?Lu=EDs?= Ferreira <contact lsferreira.net> writes:
On Fri, 2021-10-29 at 15:13 +0000, dd via Digitalmars-d-announce wrote:
 Hello all!
=20
 When I submitted my work to Phobos[1] earlier this year, it was=20
 rejected. (Understandably)
=20
 So I made a DUB package and forgot to announce it here!
=20
 Package: https://code.dlang.org/packages/sha3-d
 Source: https://github.com/dd86k/sha3-d
=20
 [1] https://github.com/dlang/phobos/pull/7713
Amazing work dd! Are you considering implementing it with SIMD instructions with something like intel-intrinsics? --=20 Sincerely, Lu=C3=ADs Ferreira lsferreira.net
Oct 29 2021
parent dd <dd dax.moe> writes:
On Friday, 29 October 2021 at 16:02:14 UTC, Luís Ferreira wrote:
 On Fri, 2021-10-29 at 15:13 +0000, dd via 
 Digitalmars-d-announce wrote:
 Hello all!
 
 When I submitted my work to Phobos[1] earlier this year, it 
 was rejected. (Understandably)
 
 So I made a DUB package and forgot to announce it here!
 
 Package: https://code.dlang.org/packages/sha3-d
 Source: https://github.com/dd86k/sha3-d
 
 [1] https://github.com/dlang/phobos/pull/7713
Amazing work dd! Are you considering implementing it with SIMD instructions with something like intel-intrinsics?
That would be interesting, especially this is my kind of stuff. I'll be up to do it.
Nov 01 2021
prev sibling next sibling parent starcanopy <starcanopy protonmail.com> writes:
On Friday, 29 October 2021 at 15:13:38 UTC, dd wrote:
 Hello all!

 When I submitted my work to Phobos[1] earlier this year, it was 
 rejected. (Understandably)

 So I made a DUB package and forgot to announce it here!

 Package: https://code.dlang.org/packages/sha3-d
 Source: https://github.com/dd86k/sha3-d

 [1] https://github.com/dlang/phobos/pull/7713
Thank you so much for this! I have to rework a program, and it needs to support SHA3.
Nov 02 2021
prev sibling parent reply bauss <jj_1337 live.dk> writes:
On Friday, 29 October 2021 at 15:13:38 UTC, dd wrote:
 When I submitted my work to Phobos[1] earlier this year, it was 
 rejected. (Understandably)
What was the reasoning? I can't imagine it being worse than some of the terrible modules like std.json? In fact it looks very nice.
Nov 05 2021
parent dd <dd dax.moe> writes:
On Friday, 5 November 2021 at 07:00:06 UTC, bauss wrote:
 What was the reasoning? I can't imagine it being worse than 
 some of the terrible modules like std.json?
I have nothing against the decision, but you can read the comments here: https://github.com/dlang/phobos/pull/7713 I should still add support for some kind of acceleration (e.g., core.simd). The liberty I have with this being a DUB package is that I could even use intel-intrinsics.
Nov 05 2021