crypto_gnutls.c (189261) | crypto_gnutls.c (209158) |
---|---|
1/* 2 * WPA Supplicant / wrapper functions for libgcrypt 3 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * --- 43 unchanged lines hidden (view full) --- 52 53 gcry_cipher_open(&hd, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); 54 gcry_err_code(gcry_cipher_setkey(hd, pkey, 8)); 55 gcry_cipher_encrypt(hd, cypher, 8, clear, 8); 56 gcry_cipher_close(hd); 57} 58 59 | 1/* 2 * WPA Supplicant / wrapper functions for libgcrypt 3 * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * --- 43 unchanged lines hidden (view full) --- 52 53 gcry_cipher_open(&hd, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); 54 gcry_err_code(gcry_cipher_setkey(hd, pkey, 8)); 55 gcry_cipher_encrypt(hd, cypher, 8, clear, 8); 56 gcry_cipher_close(hd); 57} 58 59 |
60#ifdef EAP_TLS_FUNCS | |
61void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) 62{ 63 gcry_md_hd_t hd; 64 unsigned char *p; 65 size_t i; 66 67 if (gcry_md_open(&hd, GCRY_MD_MD5, 0) != GPG_ERR_NO_ERROR) 68 return; --- 88 unchanged lines hidden (view full) --- 157} 158 159 160void aes_decrypt_deinit(void *ctx) 161{ 162 gcry_cipher_hd_t hd = ctx; 163 gcry_cipher_close(hd); 164} | 60void md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) 61{ 62 gcry_md_hd_t hd; 63 unsigned char *p; 64 size_t i; 65 66 if (gcry_md_open(&hd, GCRY_MD_MD5, 0) != GPG_ERR_NO_ERROR) 67 return; --- 88 unchanged lines hidden (view full) --- 156} 157 158 159void aes_decrypt_deinit(void *ctx) 160{ 161 gcry_cipher_hd_t hd = ctx; 162 gcry_cipher_close(hd); 163} |
165#endif /* EAP_TLS_FUNCS */ | |
166 167 168int crypto_mod_exp(const u8 *base, size_t base_len, 169 const u8 *power, size_t power_len, 170 const u8 *modulus, size_t modulus_len, 171 u8 *result, size_t *result_len) 172{ 173 gcry_mpi_t bn_base = NULL, bn_exp = NULL, bn_modulus = NULL, --- 140 unchanged lines hidden --- | 164 165 166int crypto_mod_exp(const u8 *base, size_t base_len, 167 const u8 *power, size_t power_len, 168 const u8 *modulus, size_t modulus_len, 169 u8 *result, size_t *result_len) 170{ 171 gcry_mpi_t bn_base = NULL, bn_exp = NULL, bn_modulus = NULL, --- 140 unchanged lines hidden --- |