Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:52

0001 /*
0002  * Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved.
0003  *
0004  * Licensed under the Apache License 2.0 (the "License").  You may not use
0005  * this file except in compliance with the License.  You can obtain a copy
0006  * in the file LICENSE in the source distribution or at
0007  * https://www.openssl.org/source/license.html
0008  */
0009 
0010 #ifndef OPENSSL_WHRLPOOL_H
0011 # define OPENSSL_WHRLPOOL_H
0012 # pragma once
0013 
0014 # include <openssl/macros.h>
0015 # ifndef OPENSSL_NO_DEPRECATED_3_0
0016 #  define HEADER_WHRLPOOL_H
0017 # endif
0018 
0019 # include <openssl/opensslconf.h>
0020 
0021 # ifndef OPENSSL_NO_WHIRLPOOL
0022 #  include <openssl/e_os2.h>
0023 #  include <stddef.h>
0024 #  ifdef __cplusplus
0025 extern "C" {
0026 #  endif
0027 
0028 #  define WHIRLPOOL_DIGEST_LENGTH (512/8)
0029 
0030 #  if !defined(OPENSSL_NO_DEPRECATED_3_0)
0031 
0032 #   define WHIRLPOOL_BBLOCK        512
0033 #   define WHIRLPOOL_COUNTER       (256/8)
0034 
0035 typedef struct {
0036     union {
0037         unsigned char c[WHIRLPOOL_DIGEST_LENGTH];
0038         /* double q is here to ensure 64-bit alignment */
0039         double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];
0040     } H;
0041     unsigned char data[WHIRLPOOL_BBLOCK / 8];
0042     unsigned int bitoff;
0043     size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];
0044 } WHIRLPOOL_CTX;
0045 #  endif
0046 #  ifndef OPENSSL_NO_DEPRECATED_3_0
0047 OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
0048 OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Update(WHIRLPOOL_CTX *c,
0049                                            const void *inp, size_t bytes);
0050 OSSL_DEPRECATEDIN_3_0 void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,
0051                                                const void *inp, size_t bits);
0052 OSSL_DEPRECATEDIN_3_0 int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);
0053 OSSL_DEPRECATEDIN_3_0 unsigned char *WHIRLPOOL(const void *inp, size_t bytes,
0054                                                unsigned char *md);
0055 #  endif
0056 
0057 #  ifdef __cplusplus
0058 }
0059 #  endif
0060 # endif
0061 
0062 #endif