@ -35,7 +35,7 @@ int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
}
void des_encrypt ( const u8 * clear , const u8 * key , u8 * cypher )
int des_encrypt ( const u8 * clear , const u8 * key , u8 * cypher )
{
u8 pkey [ 8 ] , next , tmp ;
int i ;
@ -53,6 +53,7 @@ void des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
des_setup ( pkey , 8 , 0 , & skey ) ;
des_ecb_encrypt ( clear , cypher , & skey ) ;
des_done ( & skey ) ;
return 0 ;
}
@ -96,10 +97,10 @@ void * aes_encrypt_init(const u8 *key, size_t len)
}
void aes_encrypt ( void * ctx , const u8 * plain , u8 * crypt )
int aes_encrypt ( void * ctx , const u8 * plain , u8 * crypt )
{
symmetric_key * skey = ctx ;
aes_ecb_encrypt ( plain , crypt , skey ) ;
return aes_ecb_encrypt ( plain , crypt , skey ) = = CRYPT_OK ? 0 : - 1 ;
}
@ -125,10 +126,10 @@ void * aes_decrypt_init(const u8 *key, size_t len)
}
void aes_decrypt ( void * ctx , const u8 * crypt , u8 * plain )
int aes_decrypt ( void * ctx , const u8 * crypt , u8 * plain )
{
symmetric_key * skey = ctx ;
aes_ecb_encrypt ( plain , ( u8 * ) crypt , skey ) ;
return aes_ecb_encrypt ( plain , ( u8 * ) crypt , skey ) = = CRYPT_OK ? 0 : - 1 ;
}
@ -297,7 +298,7 @@ struct crypto_cipher {
struct crypto_cipher * crypto_cipher_init ( enum crypto_cipher_alg alg ,
const u8 * iv , const u8 * key ,
size_t key_len )
{
{
struct crypto_cipher * ctx ;
int idx , res , rc4 = 0 ;