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/xform.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*      $FreeBSD: releng/10.1/sys/opencrypto/xform.h 219026 2011-02-25 09:29:32Z vanhu $        */
    2 /*      $OpenBSD: xform.h,v 1.8 2001/08/28 12:20:43 ben Exp $   */
    3 
    4 /*-
    5  * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
    6  *
    7  * This code was written by Angelos D. Keromytis in Athens, Greece, in
    8  * February 2000. Network Security Technologies Inc. (NSTI) kindly
    9  * supported the development of this code.
   10  *
   11  * Copyright (c) 2000 Angelos D. Keromytis
   12  *
   13  * Permission to use, copy, and modify this software without fee
   14  * is hereby granted, provided that this entire notice is included in
   15  * all source code copies of any software which is or includes a copy or
   16  * modification of this software. 
   17  *
   18  * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
   19  * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
   20  * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
   21  * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
   22  * PURPOSE.
   23  */
   24 
   25 #ifndef _CRYPTO_XFORM_H_
   26 #define _CRYPTO_XFORM_H_
   27 
   28 #include <sys/md5.h>
   29 #include <crypto/sha1.h>
   30 #include <crypto/sha2/sha2.h>
   31 #include <opencrypto/rmd160.h>
   32 
   33 /* Declarations */
   34 struct auth_hash {
   35         int type;
   36         char *name;
   37         u_int16_t keysize;
   38         u_int16_t hashsize; 
   39         u_int16_t blocksize;
   40         u_int16_t ctxsize;
   41         void (*Init) (void *);
   42         int  (*Update) (void *, u_int8_t *, u_int16_t);
   43         void (*Final) (u_int8_t *, void *);
   44 };
   45 
   46 /* XXX use a define common with other hash stuff ! */
   47 #define AH_ALEN_MAX     64      /* max authenticator hash length */
   48 
   49 struct enc_xform {
   50         int type;
   51         char *name;
   52         u_int16_t blocksize;
   53         u_int16_t minkey, maxkey;
   54         void (*encrypt) (caddr_t, u_int8_t *);
   55         void (*decrypt) (caddr_t, u_int8_t *);
   56         int (*setkey) (u_int8_t **, u_int8_t *, int len);
   57         void (*zerokey) (u_int8_t **);
   58         void (*reinit) (caddr_t, u_int8_t *);
   59 };
   60 
   61 struct comp_algo {
   62         int type;
   63         char *name;
   64         size_t minlen;
   65         u_int32_t (*compress) (u_int8_t *, u_int32_t, u_int8_t **);
   66         u_int32_t (*decompress) (u_int8_t *, u_int32_t, u_int8_t **);
   67 };
   68 
   69 union authctx {
   70         MD5_CTX md5ctx;
   71         SHA1_CTX sha1ctx;
   72         RMD160_CTX rmd160ctx;
   73         SHA256_CTX sha256ctx;
   74         SHA384_CTX sha384ctx;
   75         SHA512_CTX sha512ctx;
   76 };
   77 
   78 extern struct enc_xform enc_xform_null;
   79 extern struct enc_xform enc_xform_des;
   80 extern struct enc_xform enc_xform_3des;
   81 extern struct enc_xform enc_xform_blf;
   82 extern struct enc_xform enc_xform_cast5;
   83 extern struct enc_xform enc_xform_skipjack;
   84 extern struct enc_xform enc_xform_rijndael128;
   85 extern struct enc_xform enc_xform_aes_xts;
   86 extern struct enc_xform enc_xform_arc4;
   87 extern struct enc_xform enc_xform_camellia;
   88 
   89 extern struct auth_hash auth_hash_null;
   90 extern struct auth_hash auth_hash_key_md5;
   91 extern struct auth_hash auth_hash_key_sha1;
   92 extern struct auth_hash auth_hash_hmac_md5;
   93 extern struct auth_hash auth_hash_hmac_sha1;
   94 extern struct auth_hash auth_hash_hmac_ripemd_160;
   95 extern struct auth_hash auth_hash_hmac_sha2_256;
   96 extern struct auth_hash auth_hash_hmac_sha2_384;
   97 extern struct auth_hash auth_hash_hmac_sha2_512;
   98 
   99 extern struct comp_algo comp_algo_deflate;
  100 
  101 #ifdef _KERNEL
  102 #include <sys/malloc.h>
  103 MALLOC_DECLARE(M_XDATA);
  104 #endif
  105 #endif /* _CRYPTO_XFORM_H_ */

Cache object: e73b8f5671a5765d4a0fee8568d6369e


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