Main Page | Data Structures | Directories | File List | Data Fields | Globals

hostap_crypt.h

Go to the documentation of this file.
00001 #ifndef PRISM2_CRYPT_H
00002 #define PRISM2_CRYPT_H
00003 
00004 struct hostap_crypto_ops {
00005         char *name;
00006 
00007         /* init new crypto context (e.g., allocate private data space,
00008          * select IV, etc.); returns NULL on failure or pointer to allocated
00009          * private data on success */
00010         void * (*init)(void);
00011 
00012         /* deinitialize crypto context and free allocated private data */
00013         void (*deinit)(void *priv);
00014 
00015         /* encrypt/decrypt return < 0 on error or number of bytes written
00016          * to out_buf; len is number of bytes in in_buf */
00017         int (*encrypt)(u8 *buf, int len, void *priv);
00018         int (*decrypt)(u8 *buf, int len, void *priv);
00019 
00020         int (*set_key)(int idx, void *key, int len, void *priv);
00021         int (*get_key)(int idx, void *key, int len, void *priv);
00022 
00023         int (*set_key_idx)(int idx, void *priv);
00024         int (*get_key_idx)(void *priv);
00025 
00026         /* maximum number of bytes added by encryption; encrypt buf is
00027          * allocated with extra_prefix_len bytes, copy of in_buf, and
00028          * extra_postfix_len; encrypt need not use all this space, but
00029          * the result must start at the beginning of the buffer and correct
00030          * length must be returned */
00031         int extra_prefix_len, extra_postfix_len;
00032 };
00033 
00034 
00035 int hostap_register_crypto_ops(struct hostap_crypto_ops *ops);
00036 int hostap_unregister_crypto_ops(struct hostap_crypto_ops *ops);
00037 struct hostap_crypto_ops * hostap_get_crypto_ops(const char *name);
00038 
00039 #endif /* PRISM2_CRYPT_H */

Generated on Mon Nov 21 15:58:09 2005 for openwifi by  doxygen 1.4.1