The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/crypto/openssl/ossl_sha.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
    3  *
    4  * Licensed under the OpenSSL license (the "License").  You may not use
    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  * $FreeBSD$
   10  */
   11 
   12 #ifndef __OSSL_SHA_H__
   13 #define __OSSL_SHA_H__
   14 
   15 /*
   16  * This is always included last which permits the namespace hacks below
   17  * to work.
   18  */
   19 #define SHA256_CTX      OSSL_SHA256_CTX
   20 #define SHA512_CTX      OSSL_SHA512_CTX
   21 
   22 /* From include/openssl/sha.h */
   23 # define SHA_LONG unsigned int
   24 
   25 # define SHA_LBLOCK      16
   26 # define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a
   27                                         * contiguous array of 32 bit wide
   28                                         * big-endian values. */
   29 
   30 typedef struct SHAstate_st {
   31     SHA_LONG h0, h1, h2, h3, h4;
   32     SHA_LONG Nl, Nh;
   33     SHA_LONG data[SHA_LBLOCK];
   34     unsigned int num;
   35 } SHA_CTX;
   36 
   37 # define SHA256_CBLOCK   (SHA_LBLOCK*4)/* SHA-256 treats input data as a
   38                                         * contiguous array of 32 bit wide
   39                                         * big-endian values. */
   40 
   41 typedef struct SHA256state_st {
   42     SHA_LONG h[8];
   43     SHA_LONG Nl, Nh;
   44     SHA_LONG data[SHA_LBLOCK];
   45     unsigned int num, md_len;
   46 } SHA256_CTX;
   47 
   48 /*
   49  * SHA-512 treats input data as a
   50  * contiguous array of 64 bit
   51  * wide big-endian values.
   52  */
   53 # define SHA512_CBLOCK   (SHA_LBLOCK*8)
   54 
   55 #  define SHA_LONG64 unsigned long long
   56 #  define U64(C)     C##ULL
   57 
   58 typedef struct SHA512state_st {
   59     SHA_LONG64 h[8];
   60     SHA_LONG64 Nl, Nh;
   61     union {
   62         SHA_LONG64 d[SHA_LBLOCK];
   63         unsigned char p[SHA512_CBLOCK];
   64     } u;
   65     unsigned int num, md_len;
   66 } SHA512_CTX;
   67 
   68 #endif /* !__OSSL_SHA_H__ */

Cache object: a35c328cdc119ffc6f8d595efb02b8d1


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.