![]() |
|
Data Structures | |
| struct | crypto_dh |
| Diffie Hellman state container. More... | |
Enumerations | |
| enum | crypto_hash_alg { CRYPTO_HASH_ALG_MD5, CRYPTO_HASH_ALG_SHA1, CRYPTO_HASH_ALG_HMAC_MD5, CRYPTO_HASH_ALG_HMAC_SHA1 } |
| enum | crypto_cipher_alg { CRYPTO_CIPHER_NULL = 0, CRYPTO_CIPHER_ALG_AES, CRYPTO_CIPHER_ALG_3DES, CRYPTO_CIPHER_ALG_DES, CRYPTO_CIPHER_ALG_RC2, CRYPTO_CIPHER_ALG_RC4 } |
Functions | |
| void | md4_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) |
| MD4 hash for data vector. | |
| void | md5_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) |
| MD5 hash for data vector. | |
| void | sha1_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) |
| SHA-1 hash for data vector. | |
| int | fips186_2_prf (const u8 *seed, size_t seed_len, u8 *x, size_t xlen) |
| NIST FIPS Publication 186-2 change notice 1 PRF. | |
| void | sha256_vector (size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) |
| SHA256 hash for data vector. | |
| void | des_encrypt (const u8 *clear, const u8 *key, u8 *cypher) |
| Encrypt one block with DES. | |
| void * | aes_encrypt_init (const u8 *key, size_t len) |
| Initialize AES for encryption. | |
| void | aes_encrypt (void *ctx, const u8 *plain, u8 *crypt) |
| Encrypt one AES block. | |
| void | aes_encrypt_deinit (void *ctx) |
| Deinitialize AES encryption. | |
| void * | aes_decrypt_init (const u8 *key, size_t len) |
| Initialize AES for decryption. | |
| void | aes_decrypt (void *ctx, const u8 *crypt, u8 *plain) |
| Decrypt one AES block. | |
| void | aes_decrypt_deinit (void *ctx) |
| Deinitialize AES decryption. | |
| crypto_hash * | crypto_hash_init (enum crypto_hash_alg alg, const u8 *key, size_t key_len) |
| Initialize hash/HMAC function. | |
| void | crypto_hash_update (struct crypto_hash *ctx, const u8 *data, size_t len) |
| Add data to hash calculation. | |
| int | crypto_hash_finish (struct crypto_hash *ctx, u8 *mac, size_t *len) |
| Complete hash calculation. | |
| crypto_cipher * | crypto_cipher_init (enum crypto_cipher_alg alg, const u8 *iv, const u8 *key, size_t key_len) |
| Initialize block/stream cipher function. | |
| int | crypto_cipher_encrypt (struct crypto_cipher *ctx, const u8 *plain, u8 *crypt, size_t len) |
| Cipher encrypt. | |
| int | crypto_cipher_decrypt (struct crypto_cipher *ctx, const u8 *crypt, u8 *plain, size_t len) |
| Cipher decrypt. | |
| void | crypto_cipher_deinit (struct crypto_cipher *ctx) |
| Free cipher context. | |
| crypto_public_key * | crypto_public_key_import (const u8 *key, size_t len) |
| Import an RSA public key. | |
| crypto_private_key * | crypto_private_key_import (const u8 *key, size_t len) |
| Import an RSA private key. | |
| crypto_public_key * | crypto_public_key_from_cert (const u8 *buf, size_t len) |
| Import an RSA public key from a certificate. | |
| int | crypto_public_key_encrypt_pkcs1_v15 (struct crypto_public_key *key, const u8 *in, size_t inlen, u8 *out, size_t *outlen) |
| Public key encryption (PKCS #1 v1.5). | |
| int | crypto_private_key_sign_pkcs1 (struct crypto_private_key *key, const u8 *in, size_t inlen, u8 *out, size_t *outlen) |
| Sign with private key (PKCS #1). | |
| void | crypto_public_key_free (struct crypto_public_key *key) |
| Free public key. | |
| void | crypto_private_key_free (struct crypto_private_key *key) |
| Free private key. | |
| int | crypto_public_key_decrypt_pkcs1 (struct crypto_public_key *key, const u8 *crypt, size_t crypt_len, u8 *plain, size_t *plain_len) |
| Decrypt PKCS #1 signature. | |
| int | crypto_global_init (void) |
| Initialize crypto wrapper. | |
| void | crypto_global_deinit (void) |
| Deinitialize crypto wrapper. | |
| 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) |
| Modular exponentiation of large integers. | |
| crypto_dh * | crypto_dh_init (const u8 *prime, int prime_len_bytes) |
| Initializes Diffie Hellman structures. | |
| int | crypto_dh_generate_key (struct crypto_dh *dh_state) |
| Creates Diffie Hellman private/public keys. | |
| int | crypto_dh_compute_key (struct crypto_dh *dh_state, const u8 *peer_pubkey, int peer_pubkey_len, u8 *dst) |
| Computes the shared secret from DH values. | |
| void | crypto_dh_cleanup (struct crypto_dh *dh_state) |
| Removes objects created during DH key exchange. | |
| void | crypto_dh_bignum_to_bin (const void *src, void *dst, int len) |
| Converts an big num representation to binary. | |
This file defines the cryptographic functions that need to be implemented for wpa_supplicant and hostapd. When TLS is not used, internal implementation of MD5, SHA1, and AES is used and no external libraries are required. When TLS is enabled (e.g., by enabling EAP-TLS or EAP-PEAP), the crypto library used by the TLS implementation is expected to be used for non-TLS needs, too, in order to save space by not implementing these functions twice.
Wrapper code for using each crypto library is in its own file (crypto*.c) and one of these files is build and linked in to provide the functions defined here.
|
||||||||||||||||
|
Decrypt one AES block.
|
|
|
Deinitialize AES decryption.
|
|
||||||||||||
|
Initialize AES for decryption.
|
|
||||||||||||||||
|
Encrypt one AES block.
|
|
|
Deinitialize AES encryption.
|
|
||||||||||||
|
Initialize AES for encryption.
|
|
||||||||||||||||||||
|
Cipher decrypt.
|
|
|
Free cipher context.
|
|
||||||||||||||||||||
|
Cipher encrypt.
|
|
||||||||||||||||||||
|
Initialize block/stream cipher function.
|
|
||||||||||||||||
|
Converts an big num representation to binary.
|
|
|
Removes objects created during DH key exchange.
|
|
||||||||||||||||||||
|
Computes the shared secret from DH values.
|
|
|
Creates Diffie Hellman private/public keys.
|
|
||||||||||||
|
Initializes Diffie Hellman structures.
|
|
|
Deinitialize crypto wrapper. 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. |
|
|
Initialize crypto wrapper. 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. |
|
||||||||||||||||
|
Complete hash calculation.
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. |
|
||||||||||||||||
|
Initialize hash/HMAC function.
|
|
||||||||||||||||
|
Add data to hash calculation.
|
|
||||||||||||||||||||||||||||||||||||
|
Modular exponentiation of large integers.
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. |
|
|
Free private key.
|
|
||||||||||||
|
Import an RSA private key.
|
|
||||||||||||||||||||||||
|
Sign with private key (PKCS #1).
|
|
||||||||||||||||||||||||
|
Decrypt PKCS #1 signature.
|
|
||||||||||||||||||||||||
|
Public key encryption (PKCS #1 v1.5).
|
|
|
Free public key.
|
|
||||||||||||
|
Import an RSA public key from a certificate.
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. |
|
||||||||||||
|
Import an RSA public key.
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. |
|
||||||||||||||||
|
Encrypt one block with DES.
|
|
||||||||||||||||||||
|
NIST FIPS Publication 186-2 change notice 1 PRF.
|
|
||||||||||||||||||||
|
MD4 hash for data vector.
|
|
||||||||||||||||||||
|
MD5 hash for data vector.
|
|
||||||||||||||||||||
|
SHA-1 hash for data vector.
|
|
||||||||||||||||||||
|
SHA256 hash for data vector.
|
1.4.6
| © 2005 Devicescape Software, Inc. All Rights Reserved. |