mbedtls 0.0.8

Partial/future CFFI to the awesome mbed TLS

Released 2017-10-11.

To install, run:

haxelib install mbedtls 0.0.8

See using Haxelib in Haxelib documentation for more information.

This is not the latest stable version of mbedtls. See version 0.0.9 for the latest version.

Current version0.0.9
StatisticsInstalled 89 times



Partial/future CFFI for Haxe/Neko to the awesome mbed TLS (or, for now, fast hash functions for Haxe/Neko)


When possible, the Haxe APIs follow existing std counterparts, so that the library can be a simple to adopt performance upgrade.

Eventually, more efficient and/or lower-level APIs will be provided as well.

// Test.hx
class Test {
    static function main()
        var fox = "The quick brown fox jumps over the lazy dog";
# test.hxml
-lib mbedtls
-main Test
-neko test.n


Work is ongoing...

CFFI coverage:

  • [x] crypto hash functions: SHA2 family (SHA224, SHA256, SHA384, SHA512)
  • [x] other/older hash functions: MD5, SHA1
  • [ ] and more

Build/package coverage:

  • [x] Linux x86/x86-64
  • [ ] Windows (under development/help wanted)
  • [ ] Mac (help wanted)
  • [ ] iOS ARM (help wanted)
  • [ ] Linux ARM

Target coverage:

  • [x] Neko
  • [ ] C++/Hxcpp (help wanted)

Original motivation

To give a very substancial performance boost for modules running on Tora and computing a lot of hashes (password hashing, file deduplication/identification, etc.).

Even with CFFI overhead and badly implementated I/O, performance is now much closer to the <hash>sum utilities from coreutils.

screenshot from 2017-10-11 15-55-07