[BACK]Return to xform.h CVS log [TXT][DIR] Up to [local] / sys / crypto

Annotation of sys/crypto/xform.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: xform.h,v 1.16 2005/05/25 05:47:53 markus Exp $       */
                      2:
                      3: /*
                      4:  * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
                      5:  *
                      6:  * This code was written by Angelos D. Keromytis in Athens, Greece, in
                      7:  * February 2000. Network Security Technologies Inc. (NSTI) kindly
                      8:  * supported the development of this code.
                      9:  *
                     10:  * Copyright (c) 2000 Angelos D. Keromytis
                     11:  *
                     12:  * Permission to use, copy, and modify this software with or without fee
                     13:  * is hereby granted, provided that this entire notice is included in
                     14:  * all source code copies of any software which is or includes a copy or
                     15:  * modification of this software.
                     16:  *
                     17:  * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
                     18:  * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
                     19:  * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
                     20:  * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
                     21:  * PURPOSE.
                     22:  */
                     23:
                     24: #ifndef _CRYPTO_XFORM_H_
                     25: #define _CRYPTO_XFORM_H_
                     26:
                     27: #include <crypto/md5.h>
                     28: #include <crypto/sha1.h>
                     29: #include <crypto/rmd160.h>
                     30: #include <crypto/sha2.h>
                     31:
                     32: /* Declarations */
                     33: struct auth_hash {
                     34:        int type;
                     35:        char *name;
                     36:        u_int16_t keysize;
                     37:        u_int16_t hashsize;
                     38:        u_int16_t authsize;
                     39:        u_int16_t ctxsize;
                     40:        void (*Init) (void *);
                     41:        int  (*Update) (void *, u_int8_t *, u_int16_t);
                     42:        void (*Final) (u_int8_t *, void *);
                     43: };
                     44:
                     45: struct enc_xform {
                     46:        int type;
                     47:        char *name;
                     48:        u_int16_t blocksize, ivsize;
                     49:        u_int16_t minkey, maxkey;
                     50:        void (*encrypt) (caddr_t, u_int8_t *);
                     51:        void (*decrypt) (caddr_t, u_int8_t *);
                     52:        int  (*setkey) (u_int8_t **, u_int8_t *, int len);
                     53:        void (*zerokey) (u_int8_t **);
                     54:        void (*reinit) (caddr_t, u_int8_t *);
                     55: };
                     56:
                     57: struct comp_algo {
                     58:        int type;
                     59:        char *name;
                     60:        size_t minlen;
                     61:        u_int32_t (*compress) (u_int8_t *, u_int32_t, u_int8_t **);
                     62:        u_int32_t (*decompress) (u_int8_t *, u_int32_t, u_int8_t **);
                     63: };
                     64:
                     65: union authctx {
                     66:        MD5_CTX md5ctx;
                     67:        SHA1_CTX sha1ctx;
                     68:        RMD160_CTX rmd160ctx;
                     69:        SHA256_CTX sha2_256ctx;
                     70:        SHA384_CTX sha2_384ctx;
                     71:        SHA512_CTX sha2_512ctx;
                     72: };
                     73:
                     74: extern struct enc_xform enc_xform_des;
                     75: extern struct enc_xform enc_xform_3des;
                     76: extern struct enc_xform enc_xform_blf;
                     77: extern struct enc_xform enc_xform_cast5;
                     78: extern struct enc_xform enc_xform_skipjack;
                     79: extern struct enc_xform enc_xform_rijndael128;
                     80: extern struct enc_xform enc_xform_aes_ctr;
                     81: extern struct enc_xform enc_xform_arc4;
                     82: extern struct enc_xform enc_xform_null;
                     83:
                     84: extern struct auth_hash auth_hash_md5;
                     85: extern struct auth_hash auth_hash_sha1;
                     86: extern struct auth_hash auth_hash_key_md5;
                     87: extern struct auth_hash auth_hash_key_sha1;
                     88: extern struct auth_hash auth_hash_hmac_md5_96;
                     89: extern struct auth_hash auth_hash_hmac_sha1_96;
                     90: extern struct auth_hash auth_hash_hmac_ripemd_160_96;
                     91: extern struct auth_hash auth_hash_hmac_sha2_256_96;
                     92: extern struct auth_hash auth_hash_hmac_sha2_384_96;
                     93: extern struct auth_hash auth_hash_hmac_sha2_512_96;
                     94:
                     95: extern struct comp_algo comp_algo_deflate;
                     96: extern struct comp_algo comp_algo_lzs;
                     97:
                     98: #endif /* _CRYPTO_XFORM_H_ */

CVSweb