Classes | Functions
crypto_gnutls.c File Reference
#include "includes.h"
#include <gcrypt.h>
#include "common.h"
#include "crypto.h"
Include dependency graph for crypto_gnutls.c:

Go to the source code of this file.

Classes

struct  crypto_cipher

Functions

void aes_decrypt (void *ctx, const u8 *crypt, u8 *plain)
void aes_decrypt_deinit (void *ctx)
void * aes_decrypt_init (const u8 *key, size_t len)
void aes_encrypt (void *ctx, const u8 *plain, u8 *crypt)
void aes_encrypt_deinit (void *ctx)
void * aes_encrypt_init (const u8 *key, size_t len)
int crypto_cipher_decrypt (struct crypto_cipher *ctx, const u8 *crypt, u8 *plain, size_t len)
void crypto_cipher_deinit (struct crypto_cipher *ctx)
int crypto_cipher_encrypt (struct crypto_cipher *ctx, const u8 *plain, u8 *crypt, size_t len)
struct crypto_ciphercrypto_cipher_init (enum crypto_cipher_alg alg, const u8 *iv, const u8 *key, size_t key_len)
int crypto_mod_exp (const u8 *base, size_t base_len, const u8 *power, size_t power_len, const u8 *modulus, size_t modulus_len, u8 *result, size_t *result_len)
void des_encrypt (const u8 *clear, const u8 *key, u8 *cypher)
int md4_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
int md5_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
int sha1_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)

Function Documentation

void aes_decrypt ( void *  ctx,
const u8 *  crypt,
u8 *  plain 
)

aes_decrypt - Decrypt one AES block : Context pointer from aes_encrypt_init() : Encrypted data (16 bytes) : Buffer for the decrypted data (16 bytes)

Definition at line 146 of file crypto_gnutls.c.

void aes_decrypt_deinit ( void *  ctx)

aes_decrypt_deinit - Deinitialize AES decryption : Context pointer from aes_encrypt_init()

Definition at line 153 of file crypto_gnutls.c.

void* aes_decrypt_init ( const u8 *  key,
size_t  len 
)

aes_decrypt_init - Initialize AES for decryption : Decryption key : Key length in bytes (usually 16, i.e., 128 bits) Returns: Pointer to context data or NULL on failure

Definition at line 130 of file crypto_gnutls.c.

void aes_encrypt ( void *  ctx,
const u8 *  plain,
u8 *  crypt 
)

aes_encrypt - Encrypt one AES block : Context pointer from aes_encrypt_init() : Plaintext data to be encrypted (16 bytes) : Buffer for the encrypted data (16 bytes)

Definition at line 116 of file crypto_gnutls.c.

void aes_encrypt_deinit ( void *  ctx)

aes_encrypt_deinit - Deinitialize AES encryption : Context pointer from aes_encrypt_init()

Definition at line 123 of file crypto_gnutls.c.

void* aes_encrypt_init ( const u8 *  key,
size_t  len 
)

aes_encrypt_init - Initialize AES for encryption : Encryption key : Key length in bytes (usually 16, i.e., 128 bits) Returns: Pointer to context data or NULL on failure

Definition at line 97 of file crypto_gnutls.c.

int crypto_cipher_decrypt ( struct crypto_cipher ctx,
const u8 *  crypt,
u8 *  plain,
size_t  len 
)

crypto_cipher_decrypt - Cipher decrypt : Context pointer from crypto_cipher_init() : Ciphertext to decrypt : Resulting plaintext : Length of the cipher text Returns: 0 on success, -1 on failure

This function is only used with internal TLSv1 implementation (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need to implement this.

Definition at line 290 of file crypto_gnutls.c.

void crypto_cipher_deinit ( struct crypto_cipher ctx)

crypto_cipher_decrypt - Free cipher context : Context pointer from crypto_cipher_init()

This function is only used with internal TLSv1 implementation (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need to implement this.

Definition at line 300 of file crypto_gnutls.c.

int crypto_cipher_encrypt ( struct crypto_cipher ctx,
const u8 *  plain,
u8 *  crypt,
size_t  len 
)

crypto_cipher_encrypt - Cipher encrypt : Context pointer from crypto_cipher_init() : Plaintext to cipher : Resulting ciphertext : Length of the plaintext Returns: 0 on success, -1 on failure

This function is only used with internal TLSv1 implementation (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need to implement this.

Definition at line 280 of file crypto_gnutls.c.

struct crypto_cipher* crypto_cipher_init ( enum crypto_cipher_alg  alg,
const u8 *  iv,
const u8 *  key,
size_t  key_len 
) [read]

crypto_cipher_init - Initialize block/stream cipher function : Cipher algorithm : Initialization vector for block ciphers or NULL for stream ciphers : Cipher key : Length of key in bytes Returns: Pointer to cipher context to use with other cipher functions or NULL on failure

This function is only used with internal TLSv1 implementation (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need to implement this.

Definition at line 201 of file crypto_gnutls.c.

int crypto_mod_exp ( const u8 *  base,
size_t  base_len,
const u8 *  power,
size_t  power_len,
const u8 *  modulus,
size_t  modulus_len,
u8 *  result,
size_t *  result_len 
)

crypto_mod_exp - Modular exponentiation of large integers : Base integer (big endian byte array) : Length of base integer in bytes : Power integer (big endian byte array) : Length of power integer in bytes : Modulus integer (big endian byte array) : Length of modulus integer in bytes

Returns:
: Buffer for the result : Result length (max buffer size on input, real len on output) Returns: 0 on success, -1 on failure

This function calculates result = base ^ power mod modulus. modules_len is used as the maximum size of modulus buffer. It is set to the used size on success.

This function is only used with internal TLSv1 implementation (CONFIG_TLS=internal). If that is not used, the crypto wrapper does not need to implement this.

Definition at line 160 of file crypto_gnutls.c.

void des_encrypt ( const u8 *  clear,
const u8 *  key,
u8 *  cypher 
)

des_encrypt - Encrypt one block with DES : 8 octets (in) : 7 octets (in) (no parity bits included) : 8 octets (out)

Definition at line 39 of file crypto_gnutls.c.

int md4_vector ( size_t  num_elem,
const u8 *  addr[],
const size_t *  len,
u8 *  mac 
)

md4_vector - MD4 hash for data vector : Number of elements in the data vector : Pointers to the data areas : Lengths of the data blocks : Buffer for the hash Returns: 0 on success, -1 on failure

Definition at line 21 of file crypto_gnutls.c.

int md5_vector ( size_t  num_elem,
const u8 *  addr[],
const size_t *  len,
u8 *  mac 
)

md5_vector - MD5 hash for data vector : Number of elements in the data vector : Pointers to the data areas : Lengths of the data blocks : Buffer for the hash Returns: 0 on success, -1 on failure

Definition at line 61 of file crypto_gnutls.c.

int sha1_vector ( size_t  num_elem,
const u8 *  addr[],
const size_t *  len,
u8 *  mac 
)

sha1_vector - SHA-1 hash for data vector : Number of elements in the data vector : Pointers to the data areas : Lengths of the data blocks : Buffer for the hash Returns: 0 on success, -1 on failure

Definition at line 79 of file crypto_gnutls.c.



wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Jan 2 2014 11:25:16