A modern cryptography library. Work in progress, not ready for use yet.

Yawning Angel 0f6d78b3c6 ChaCha20: Move the `core.cpuid` import to a more restricted scope. 3 hours ago
benchmarks 8442592646 bench: Add a SipHash-2-4 benchmark. 2 days ago
source 0f6d78b3c6 ChaCha20: Move the `core.cpuid` import to a more restricted scope. 3 hours ago
views c676b0681e SipHash: Initial import. 2 days ago
.editorconfig 0e94cea02a Add a editorconfig for dfmt, ignore some more files. 3 weeks ago
.gitignore 83ce0a9603 Add a simple benchmark. 2 weeks ago
README.md d8fbd29464 docs; Update the README.md. (No functional changes) 1 day ago
dub.json ad8379a522 Use exceptions instead of asserts in most locations. 4 days ago


deuterium - A modern cryptography library.

Yawning Angel (yawning at schwanenlied dot me)

A modern cryptography library for the D language, mostly written because I'm rage-quitting Go for my pet projects. This is being used primarily as an excuse to learn D well.

Supported Primitives:

  • Cryptographic pseudo-random number generation
    • ChaCha20 based CSPRNG backed by OS entropy
    • Raw OS entropy
  • Message Authentication Codes
    • Poly1305
    • SipHash-2-4
  • Stream ciphers
    • ChaCha20/XChaCha20

Planned Primitives:

  • Block ciphers
    • AES
  • ECC
    • X25519/Ed25519
    • (Maybe) X448
  • Hash functions
    • BLAKE2
    • SHA3/SHAKE
  • Stream ciphers
    • CTR-AES
  • AE
    • NaCl style boxes (Poly1305/XChaCha20)
  • AEAD
    • AEZv5
    • HS1-SIV
    • Poly1305ChaCha20
  • PQ Primitives
    • NewHope-Simple
    • SPHINCS-256


  • Most people will probably be happier calling OpenSSL or libsodium.
  • All primitives are written to be immune to timing side-channel attacks, though some utility functions are not.
  • Correct, maintainable, fast in decreasing order of importance.
  • Where possible, established implementations have been used as the basis of deuterium's implementations.
  • Performance tuning is centered around the assumption that LDC is used when building for performance, and that a modern 64 bit Intel system with at least SSSE3 is the target.
  • I do not have and therefore do not care about OSX or Windows.
  • A modest amount of effort will be made to avoid breaking API changes without a major version bump, however API stability while the the project is in the 0.0.x series is not guaranteed.