Tor 0.4.9.2-alpha-dev
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
context.h
1/* Copyright (c) 2020 tevador <tevador@gmail.com> */
2/* See LICENSE for licensing information */
3
4#ifndef CONTEXT_H
5#define CONTEXT_H
6
7#include <stdbool.h>
8
9#include "hashx.h"
10#include "blake2.h"
11#include "siphash.h"
12#include "program.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18HASHX_PRIVATE extern const blake2b_param hashx_blake2_params;
19
20#ifdef __cplusplus
21}
22#endif
23
24typedef struct hashx_program hashx_program;
25
26/* HashX context. */
27typedef struct hashx_ctx {
28 uint8_t* compiler_mem;
29 hashx_type ctx_type;
30 hashx_type func_type;
31 hashx_program program;
32#ifndef HASHX_BLOCK_MODE
33 siphash_state keys;
34#else
35 blake2b_param params;
36#endif
37} hashx_ctx;
38
39#endif