abcrypt_encrypt_with_context(3)
NAME
abcrypt_encrypt_with_context - API function
SYNOPSIS
#include <abcrypt.h>
enum abcrypt_error_code abcrypt_encrypt_with_context(uint8_t *plaintext,
uintptr_t plaintext_len,
uint8_t *passphrase,
uintptr_t passphrase_len,
uint8_t *out,
uintptr_t out_len,
uint32_t argon2_type,
uint32_t argon2_version,
uint32_t memory_cost,
uint32_t time_cost,
uint32_t parallelism);
DESCRIPTION
This function encrypts plaintext with the specified Argon2 type, Argon2 version and Argon2 parameters and write to out.
Arguments
- plaintext
A pointer to the plaintext to encrypt.
- plaintext_len
Length of plaintext.
- passphrase
A pointer to the passphrase used for encryption.
- passphrase_len
Length of passphrase.
- out
A pointer to where to write the ciphertext.
- out_len
Length of out.
- argon2_type
The Argon2 type.
- argon2_version
The Argon2 version.
- memory_cost
The memory size in KiB.
- time_cost
The number of iterations.
- parallelism
The degree of parallelism.
Behavior is undefined if any of the following are true:
|
RETURN VALUE
Returns ABCRYPT_ERROR_CODE_OK
if successful, otherwise returns an error value
defined in abcrypt_error_code(3).