mbedtls

Partial/future CFFI to the awesome mbed TLS
https://github.com/jonasmalacofilho/mbedtls.hx

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

To install, run:

haxelib install mbedtls 0.0.8 

See using Haxelib in Haxelib documentation for more information.

README.md

mbedtls.hx

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

Usage

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";
        trace(mbedtls.Sha512.encode(fox));
    }
}
# test.hxml
-lib mbedtls
-main Test
-neko test.n

Status

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

Contributors
jonasmalacofilho
protocubo
Version
0.0.8
Published
8 months ago
License
BSD

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github