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

Cache object: 05afaba82261df994fe0bee2d7ee0e3f


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