/*1* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the OpenSSL license (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#ifndef __OSSL_SHA_H__10#define __OSSL_SHA_H__1112/*13* This is always included last which permits the namespace hacks below14* to work.15*/16#define SHA256_CTX OSSL_SHA256_CTX17#define SHA512_CTX OSSL_SHA512_CTX1819/* From include/openssl/sha.h */20# define SHA_LONG unsigned int2122# define SHA_LBLOCK 1623# define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a24* contiguous array of 32 bit wide25* big-endian values. */2627typedef struct SHAstate_st {28SHA_LONG h0, h1, h2, h3, h4;29SHA_LONG Nl, Nh;30SHA_LONG data[SHA_LBLOCK];31unsigned int num;32} SHA_CTX;3334# define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a35* contiguous array of 32 bit wide36* big-endian values. */3738typedef struct SHA256state_st {39SHA_LONG h[8];40SHA_LONG Nl, Nh;41SHA_LONG data[SHA_LBLOCK];42unsigned int num, md_len;43} SHA256_CTX;4445/*46* SHA-512 treats input data as a47* contiguous array of 64 bit48* wide big-endian values.49*/50# define SHA512_CBLOCK (SHA_LBLOCK*8)5152# define SHA_LONG64 unsigned long long53# define U64(C) C##ULL5455typedef struct SHA512state_st {56SHA_LONG64 h[8];57SHA_LONG64 Nl, Nh;58union {59SHA_LONG64 d[SHA_LBLOCK];60unsigned char p[SHA512_CBLOCK];61} u;62unsigned int num, md_len;63} SHA512_CTX;6465#endif /* !__OSSL_SHA_H__ */666768