-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathgost_digest.h
More file actions
56 lines (43 loc) · 1.92 KB
/
gost_digest.h
File metadata and controls
56 lines (43 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <stddef.h>
#include <stdint.h>
#include "utils_one_level_inheritance.h"
struct gost_digest_st;
typedef struct gost_digest_st GOST_digest;
struct gost_digest_ctx_st;
typedef struct gost_digest_ctx_st GOST_digest_ctx;
typedef GOST_digest_ctx* (gost_digest_st_new_fn)(const GOST_digest *);
typedef void (gost_digest_st_free_fn)(GOST_digest_ctx *);
typedef int (gost_digest_st_init_fn)(GOST_digest_ctx *ctx);
typedef int (gost_digest_st_update_fn)(GOST_digest_ctx *ctx, const void *data, size_t count);
typedef int (gost_digest_st_final_fn)(GOST_digest_ctx *ctx, unsigned char *md);
typedef int (gost_digest_st_copy_fn)(GOST_digest_ctx *to, const GOST_digest_ctx *from);
typedef int (gost_digest_st_cleanup_fn)(GOST_digest_ctx *ctx);
typedef int (gost_digest_st_ctrl_fn)(GOST_digest_ctx *ctx, int cmd, int p1, void *p2);
typedef void (gost_digest_st_static_init_fn)(const GOST_digest *);
typedef void (gost_digest_st_static_deinit_fn)(const GOST_digest *);
struct gost_digest_st {
DECL_BASE(const struct gost_digest_st);
DECL_MEMBER(int, nid);
DECL_MEMBER(const char *, alias);
DECL_MEMBER(int, result_size);
DECL_MEMBER(int, input_blocksize);
DECL_MEMBER(int, flags);
DECL_MEMBER(const char *, micalg);
DECL_MEMBER(size_t, algctx_size);
DECL_MEMBER(gost_digest_st_new_fn *, new);
DECL_MEMBER(gost_digest_st_free_fn *, free);
DECL_MEMBER(gost_digest_st_init_fn *, init);
DECL_MEMBER(gost_digest_st_update_fn *, update);
DECL_MEMBER(gost_digest_st_final_fn *, final);
DECL_MEMBER(gost_digest_st_copy_fn *, copy);
DECL_MEMBER(gost_digest_st_cleanup_fn *, cleanup);
DECL_MEMBER(gost_digest_st_ctrl_fn *, ctrl);
DECL_MEMBER(gost_digest_st_static_init_fn *, static_init);
DECL_MEMBER(gost_digest_st_static_deinit_fn *, static_deinit);
};
struct gost_digest_ctx_st {
const GOST_digest* cls;
void* algctx;
};
void* GOST_digest_ctx_data(const GOST_digest_ctx* ctx);