--- libaitio/src/crypt.c 2014/02/08 22:06:17 1.10 +++ libaitio/src/crypt.c 2019/10/08 13:00:42 1.10.10.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: crypt.c,v 1.10 2014/02/08 22:06:17 misho Exp $ +* $Id: crypt.c,v 1.10.10.2 2019/10/08 13:00:42 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2014 +Copyright 2004 - 2019 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -205,9 +205,15 @@ io_ctr_AES(u_char *pInput, int inLen, u_char **ppOutpu while (inLen) { num = 0; memset(ecount_buf, 0, sizeof ecount_buf); +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + CRYPTO_ctr128_encrypt(pInput + total, (*ppOutput) + total, + (inLen / (AES_BLOCK_SIZE - 1)) ? (AES_BLOCK_SIZE - 1) : inLen, + &key, IV, ecount_buf, &num, (block128_f) AES_encrypt); +#else AES_ctr128_encrypt(pInput + total, (*ppOutput) + total, (inLen / (AES_BLOCK_SIZE - 1)) ? (AES_BLOCK_SIZE - 1) : inLen, &key, IV, ecount_buf, &num); +#endif if (num < 1) { e_free(*ppOutput); *ppOutput = NULL;