# `./fio-stl/159 lyra2.h`

5 public symbols.

### Types

#### `fio_lyra2_args_s`

```c
typedef struct {
/** The password to hash. */
fio_buf_info_s password;
/** The salt for the hash. */
fio_buf_info_s salt;
/** Time cost (number of rounds, minimum 1). */
uint64_t t_cost;
/** Memory cost (number of rows in the matrix, minimum 3). */
uint64_t m_cost;
/** Desired output length in bytes (default 32 if 0). */
size_t outlen;
/** Number of columns (default 256 if 0). */
size_t n_cols;
} fio_lyra2_args_s
```

Lyra2 named arguments.

_Symbol type:_ `type`

### Functions

#### `fio_lyra2`

```c
fio_u512 fio_lyra2(fio_lyra2_args_s args)
```

Computes Lyra2 password hash.

Uses Blake2b as the underlying sponge/hash function.
Matches the reference C implementation (nPARALLEL==1, SPONGE==0, RHO==1).

Output is written to the returned buffer (up to 512 bytes via fio_u512).
For outlen > 64, use fio_lyra2_hash() instead.

Use `fio_ct_is_eq` to compare output hashes in constant time.

_Symbol type:_ `function`

#### `fio_lyra2`

```c
#define fio_lyra2(...) fio_lyra2((fio_lyra2_args_s){__VA_ARGS__})
```



_Note:_ this may be a macro only / macro wrapper for a function.

_Symbol type:_ `macro`

#### `fio_lyra2_hash`

```c
int fio_lyra2_hash(void *out, fio_lyra2_args_s args)
```

Computes Lyra2 password hash into a caller-provided buffer.
Supports arbitrary output lengths.
Returns 0 on success, -1 on error.

_Symbol type:_ `function`

#### `fio_lyra2_hash`

```c
#define fio_lyra2_hash(out, ...)   \
  fio_lyra2_hash(out, (fio_lyra2_args_s){__VA_ARGS__})
```



_Note:_ this may be a macro only / macro wrapper for a function.

_Symbol type:_ `macro`

-----------------------------------------------------
