]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/whrlpool.h
whirlpool: fix preprocessor indentation
[thirdparty/openssl.git] / include / openssl / whrlpool.h
CommitLineData
21dcbebc
RS
1/*
2 * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
48f4ad77 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
21dcbebc
RS
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
ae4186b0
DMSP
10#ifndef OPENSSL_WHRLPOOL_H
11# define OPENSSL_WHRLPOOL_H
d86167ec
DMSP
12# pragma once
13
14# include <openssl/macros.h>
936c2b9e 15# ifndef OPENSSL_NO_DEPRECATED_3_0
d86167ec
DMSP
16# define HEADER_WHRLPOOL_H
17# endif
d1593e6b 18
c52ec197 19# include <openssl/opensslconf.h>
3c27208f
RS
20
21# ifndef OPENSSL_NO_WHIRLPOOL
c52ec197
P
22# include <openssl/e_os2.h>
23# include <stddef.h>
24# ifdef __cplusplus
d1593e6b 25extern "C" {
c52ec197 26# endif
d1593e6b 27
c52ec197
P
28# define WHIRLPOOL_DIGEST_LENGTH (512/8)
29# define WHIRLPOOL_BBLOCK 512
30# define WHIRLPOOL_COUNTER (256/8)
d1593e6b 31
0f113f3e
MC
32typedef struct {
33 union {
34 unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
35 /* double q is here to ensure 64-bit alignment */
36 double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
37 } H;
38 unsigned char data[WHIRLPOOL_BBLOCK / 8];
39 unsigned int bitoff;
40 size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
41} WHIRLPOOL_CTX;
d1593e6b 42
0f113f3e
MC
43int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
44int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);
45void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);
46int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
47unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);
d1593e6b 48
c52ec197 49# ifdef __cplusplus
d1593e6b 50}
c52ec197 51# endif
3c27208f 52# endif
d1593e6b
AP
53
54#endif