VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/Streebog.h
blob: 3cb8d8ed4a86936ef72c4ec57021db3e9c95171f (plain)
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
/*
* Copyright (c) 2013, Alexey Degtyarev.
* All rights reserved.
*/

/* Adapted to VeraCrypt */

#ifndef STREEBOG_H
#define STREEBOG_H

#include "Common/Tcdefs.h"
#include "config.h"

#ifdef __cplusplus
extern "C" {
#endif

#define ALIGN(a)	CRYPTOPP_ALIGN_DATA(a)

typedef ALIGN(16) struct _STREEBOG_CTX
{
	ALIGN(16) unsigned char buffer[64];
	ALIGN(16) unsigned long long hash[8];
	ALIGN(16) unsigned long long h[8];
	ALIGN(16) unsigned long long N[8];
	ALIGN(16) unsigned long long Sigma[8];
	size_t bufsize;
	unsigned int digest_size;
} STREEBOG_CTX;

void STREEBOG_init(STREEBOG_CTX *ctx);
void STREEBOG_init256(STREEBOG_CTX *ctx);
void STREEBOG_add(STREEBOG_CTX *ctx, const byte *msg, size_t len);
void STREEBOG_finalize(STREEBOG_CTX *ctx, byte *out);

#ifdef __cplusplus
}
#endif

#endif