forked from gost-engine/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgost_cipher.h
More file actions
35 lines (32 loc) · 1.83 KB
/
Copy pathgost_cipher.h
File metadata and controls
35 lines (32 loc) · 1.83 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
#pragma once
#include <stddef.h>
#include <openssl/types.h>
struct gost_cipher_ctx_st;
struct gost_cipher_st;
typedef struct gost_cipher_st GOST_cipher;
int GOST_cipher_type(const GOST_cipher *c);
int GOST_cipher_nid(const GOST_cipher *c);
int GOST_cipher_flags(const GOST_cipher *c);
int GOST_cipher_key_length(const GOST_cipher *c);
int GOST_cipher_iv_length(const GOST_cipher *c);
int GOST_cipher_block_size(const GOST_cipher *c);
int GOST_cipher_mode(const GOST_cipher *c);
int GOST_cipher_ctx_size(const GOST_cipher *c);
int (*GOST_cipher_init_fn(const GOST_cipher *c))(struct gost_cipher_ctx_st *ctx,
const unsigned char *key,
const unsigned char *iv,
int enc);
// Fill ASN1_TYPE *params struct based on ctx
int (*GOST_cipher_set_asn1_parameters_fn(const GOST_cipher *c))(struct gost_cipher_ctx_st *ctx,
ASN1_TYPE *params);
// Modify ctx based on ASN1_TYPE *params struct
int (*GOST_cipher_get_asn1_parameters_fn(const GOST_cipher *c))(struct gost_cipher_ctx_st *ctx,
ASN1_TYPE *params);
int (*GOST_cipher_do_cipher_fn(const GOST_cipher *c))(struct gost_cipher_ctx_st *ctx,
unsigned char *out,
const unsigned char *in,
size_t inl);
int (*GOST_cipher_cleanup_fn(const GOST_cipher *c))(struct gost_cipher_ctx_st *ctx);
int (*GOST_cipher_ctrl_fn(const GOST_cipher *c))(struct gost_cipher_ctx_st *ctx,
int type, int arg,
void *ptr);