Sha256: 4bdacc7edd88423bf34df80a18ee7631ec858b2f06726fefa6f4bcc93d25f8a6

Contents?: true

Size: 1.9 KB

Versions: 1

Compression:

Stored size: 1.9 KB

Contents

#include <cstdint>
#include <cstdlib>

// Holds possible configuration options
// See the [module level documentation](index.html) for more information.
struct Config;

// Password hashing primitives
//
// Each variant is backed up by different implementation.
// Internally, primitives can either be static values, for example,
// the `lazy_static` generated value `DEFAULT_PRIM`, or dynamically allocated
// variables, which are `Arc<Box<...>>`.
//
// Most operations are expected to be performed using the static functions,
// since most use the default algorithms. However, the flexibilty to support
// arbitrary parameter sets is essential.
struct Primitive;

extern "C" {

char *config_hash_password(const Config *config, const char *password);

char *config_migrate_hash(const Config *config, const char *hash);

bool config_verify_password(const Config *config, const char *hash, const char *password);

bool config_verify_password_update_hash(const Config *config,
                                        const char *hash,
                                        const char *password,
                                        char **new_hash);

Config *config_with_primitive(const Primitive *prim);

Primitive *default_argon2i();

Primitive *default_bcrypt();

Primitive *default_pbkdf2i();

Primitive *default_scrypt();

void free_Config(Config *config);

void free_Primitive(Primitive *prim);

void free_string(char *s);

char *hash_password(const char *password);

char *migrate_hash(const char *hash);

Primitive *new_argon2i(unsigned int passes, unsigned int lanes, unsigned int kib);

Primitive *new_bcrypt(unsigned int cost);

Primitive *new_scrypt(unsigned char log_n, unsigned int r, unsigned int p);

char *read_password(const char *prompt);

bool verify_password(const char *hash, const char *password);

bool verify_password_update_hash_in_place(const char *hash, const char *password, char **new_hash);

} // extern "C"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
libpasta-0.0.6-x86_64-linux ext/pasta-bindings/libpasta/libpasta-capi/include/pasta-bindings.h