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/opencrypto/gmac.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 /* $NetBSD: gmac.h,v 1.3 2020/06/29 23:34:48 riastradh Exp $ */
    2 /* OpenBSD: gmac.h,v 1.1 2010/09/22 11:54:23 mikeb Exp */
    3 
    4 /*
    5  * Copyright (c) 2010 Mike Belopuhov <mike@vantronix.net>
    6  *
    7  * Permission to use, copy, modify, and distribute this software for any
    8  * purpose with or without fee is hereby granted, provided that the above
    9  * copyright notice and this permission notice appear in all copies.
   10  *
   11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   18  */
   19 
   20 #ifndef _GMAC_H_
   21 #define _GMAC_H_
   22 
   23 #include <crypto/aes/aes.h>
   24 
   25 #define GMAC_BLOCK_LEN          16
   26 #define GMAC_DIGEST_LEN         16
   27 
   28 #ifdef _LP64
   29 #define GMAC_INT uint64_t
   30 #define GMAC_INTLEN 8
   31 #else
   32 #define GMAC_INT uint32_t
   33 #define GMAC_INTLEN 4
   34 #endif
   35 
   36 typedef struct _GHASH_CTX {
   37         GMAC_INT        H[GMAC_BLOCK_LEN/GMAC_INTLEN];  /* hash subkey */
   38         GMAC_INT        S[GMAC_BLOCK_LEN/GMAC_INTLEN];  /* state */
   39         GMAC_INT        Z[GMAC_BLOCK_LEN/GMAC_INTLEN];  /* initial state */
   40 } GHASH_CTX;
   41 
   42 typedef struct _AES_GMAC_CTX {
   43         GHASH_CTX       ghash;
   44         struct aesenc   K;
   45         uint8_t         J[GMAC_BLOCK_LEN];              /* counter block */
   46         int             rounds;
   47 } AES_GMAC_CTX;
   48 
   49 #include <sys/cdefs.h>
   50 
   51 __BEGIN_DECLS
   52 void    AES_GMAC_Init(AES_GMAC_CTX *);
   53 void    AES_GMAC_Setkey(AES_GMAC_CTX *, const uint8_t *, uint16_t);
   54 void    AES_GMAC_Reinit(AES_GMAC_CTX *, const uint8_t *, uint16_t);
   55 int     AES_GMAC_Update(AES_GMAC_CTX *, const uint8_t *, uint16_t);
   56 void    AES_GMAC_Final(uint8_t [GMAC_DIGEST_LEN], AES_GMAC_CTX *);
   57 __END_DECLS
   58 
   59 #endif /* _GMAC_H_ */

Cache object: 5cb94a5de1046a2189279e039567be74


[ 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.