cipher_algorithm Struct Reference

A cipher algorithm. More...

#include <crypto.h>


Data Fields

const char * name
 Algorithm name.
size_t ctxsize
 Context size.
size_t blocksize
 Block size.
int(* setkey )(void *ctx, const void *key, size_t keylen)
 Set key.
void(* setiv )(void *ctx, const void *iv)
 Set initialisation vector.
void(* encrypt )(void *ctx, const void *src, void *dst, size_t len)
 Encrypt data.
void(* decrypt )(void *ctx, const void *src, void *dst, size_t len)
 Decrypt data.


Detailed Description

A cipher algorithm.

Definition at line 48 of file crypto.h.


Field Documentation

Algorithm name.

Definition at line 50 of file crypto.h.

Referenced by tls_select_cipher().

Context size.

Definition at line 52 of file crypto.h.

Referenced by tls_send_plaintext(), and tls_set_cipher().

int( * cipher_algorithm::setkey)(void *ctx, const void *key, size_t keylen)

Set key.

Parameters:
ctx Context
key Key
keylen Key length
Return values:
rc Return status code

Referenced by cipher_setkey().

void( * cipher_algorithm::setiv)(void *ctx, const void *iv)

Set initialisation vector.

Parameters:
ctx Context
iv Initialisation vector

Referenced by cipher_setiv().

void( * cipher_algorithm::encrypt)(void *ctx, const void *src, void *dst, size_t len)

Encrypt data.

Parameters:
ctx Context
src Data to encrypt
dst Buffer for encrypted data
len Length of data
len is guaranteed to be a multiple of blocksize.

Referenced by cipher_encrypt().

void( * cipher_algorithm::decrypt)(void *ctx, const void *src, void *dst, size_t len)

Decrypt data.

Parameters:
ctx Context
src Data to decrypt
dst Buffer for decrypted data
len Length of data
len is guaranteed to be a multiple of blocksize.

Referenced by cipher_decrypt().


The documentation for this struct was generated from the following file:

Generated on Tue Apr 6 20:02:02 2010 for gPXE by  doxygen 1.5.7.1