[][src]Crate argonautica_c

Build Status Crates.io Documentation Github.com License

Overview

argonautica-c is a C/C++ wrapper for argonautica.

Installation

  • Install Rust (version 1.26.0 or higher)
    • See here for instructions
  • Install LLVM/Clang (version 3.9 or higher)
    • Mac OS: brew install llvm, which requires Homebrew
    • Debian-based linux: apt-get install clang llvm-dev libclang-dev
    • Arch linux: pacman -S clang
    • Windows: Download a pre-built binary here
  • Clone the argonautica repository
    • git clone https://github.com/bcmyers/argonautica.git
    • cd argonautica
    • git submodule init
    • git submodule update
  • Build the library using Cargo
    • cargo build --release --features="simd", or
    • cargo build --release
  • Use the library
    • The library, which will be called libargonautica_c.dylib or something similar (depending on your OS), will be in the ./target/release directory
    • The header file, which will be called argonautica.h, will be in the ./argonautica-c/include directory

License

argonautica-c is licensed under either of:

at your option.

Enums

argonautica_backend_t

Available backends

argonautica_error_t

Argonautica errors

argonautica_variant_t

Available argon2 variants

argonautica_version_t

Available argon2 versions

Functions

argonautica_encoded_len

Function that returns the length of a string-encoded hash (in bytes and including the NULL byte). If an error occurrs, the function returns -1

argonautica_error_msg

Given an argonautica_error_t, this function will return an error message as a static char*

argonautica_hash

Function that hashes a password. It will modify the provided encoded buffer and return an argonautica_error_t indicating whether or not the hash was successful.

argonautica_verify

Function that verifies a password against a hash. It will modify the provided is_valid int and return an argonautica_error_t indicating whether or not the verification was successful.