libkeccak-d 1.0.2

A simple SHA-3 / Keccak hash function for Dlang, wraps keccak-tiny C implementation

To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


This is a quick and dirty Dlang wrapper around keccak-tiny (a sha3 implementation written in C). Improve it, fix it, use it, and eventually a hero will offer to maintain it, make it into a proper Dlang module.

From NIST: NIST announced the SHA-3 Cryptographic Hash Algorithm Competition on November 2, 2007, and ended the competition on October 2, 2012, when it announced KECCAK as the winning algorithm to be standardized as the new SHA-3.


  • NIST SHA-3 Project
  • Wrapper around: (fork of) forked from: (not maintained)
  • Reading on @safe and @trusted:
  • Test cases inspired by:


Because this D module wraps a C library, you the reader will need to build the library through means available on your platform. It appears the keecak-tiny library will build with clang, gcc, or probably some other variant not mentioned.

From a posix compliant shell, run sh to grab and build keccak-tiny.

Windows Notes

Since we don't provide a VS build or a fancy cmake build (that might be a good idea in the future), it is recommended that you use a POSIX shell like a ConEMU or similar to build. This implies that you will have a Clang or gccc installed as well. Install it before you get started.

On windows you may need to rename your library to keccak-tiny.lib.

Building the D library

We recommend a Dlang compiler based on DMD v2.076.1 or later.

dub build --compiler=ldc2


dub test --compiler=ldc2


import iotone.libkeccak

ubyte[32] dataout;
ubyte[] datain = cast(ubyte[])("The quick brown fox jumps over the lazy dog".dup);
ubyte[] datain2 = cast(ubyte[])("".dup);
shake256(dataout.ptr, 32 /* bytes */, datain.ptr, datain.length);

  • David J. Kordsmeier
1.0.2 2019-Jun-12
1.0.1 2018-Nov-07
1.0.0 2018-Nov-06
~master 2019-Nov-06
~1-fix-windows-build 2019-Jun-11
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 35 downloads total

Short URL: