1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

OpenSSL AES assembler implementation

Source commit: d3382232a8ce6513573a7651023e35783278b018
This commit is contained in:
Martin Prikryl
2025-11-13 12:46:18 +00:00
parent 1c985fa632
commit 5851fe38e0
4 changed files with 2717 additions and 2049 deletions

View File

@@ -20,7 +20,7 @@
CFLAG_WARNINGS=-Wno-incompatible-function-pointer-types -Wno-deprecated-declarations
CFLAG=$(CFLAG_COMMON) $(CFLAG_WARNINGS)
DEFINES=MD5_ASM;SHA1_ASM;SHA256_ASM;SHA512_ASM;RMD160_ASM
DEFINES=MD5_ASM;SHA1_ASM;SHA256_ASM;SHA512_ASM;RMD160_ASM;AES_ASM
DEFINES=$(DEFINES);OPENSSL_BN_ASM_PART_WORDS;OPENSSL_BN_ASM_MONT;OPENSSL_BN_ASM_GF2m
DEFINES=$(DEFINES);OPENSSL_NO_CAMELLIA;OPENSSL_NO_RC5;OPENSSL_NO_MDC2;OPENSSL_NO_WHIRLPOOL
DEFINES=$(DEFINES);OPENSSL_NO_SEED;OPENSSL_NO_CAPIENG;OPENSSL_NO_ENGINE;OPENSSL_NO_ZLIB
@@ -139,7 +139,7 @@ CRYPTOOBJ= \
$(OBJ_D)\bf_skey.obj $(OBJ_D)\bf_ecb.obj $(OBJ_D)\bf_cfb64.obj $(OBJ_D)\bf_ofb64.obj \
$(OBJ_D)\c_skey.obj $(OBJ_D)\c_ecb.obj $(OBJ_D)\c_cfb64.obj $(OBJ_D)\c_ofb64.obj \
$(OBJ_D)\aes_misc.obj $(OBJ_D)\aes_ecb.obj $(OBJ_D)\aes_cfb.obj $(OBJ_D)\aes_ofb.obj \
$(OBJ_D)\aes_ige.obj $(OBJ_D)\aes_wrap.obj $(OBJ_D)\aes_core.obj $(OBJ_D)\aes_cbc.obj \
$(OBJ_D)\aes_ige.obj $(OBJ_D)\aes_wrap.obj \
$(OBJ_D)\bn_add.obj $(OBJ_D)\bn_div.obj $(OBJ_D)\bn_exp.obj $(OBJ_D)\bn_lib.obj \
$(OBJ_D)\bn_ctx.obj $(OBJ_D)\bn_mul.obj $(OBJ_D)\bn_mod.obj $(OBJ_D)\bn_print.obj \
$(OBJ_D)\bn_rand.obj $(OBJ_D)\bn_shift.obj $(OBJ_D)\bn_word.obj $(OBJ_D)\bn_blind.obj \
@@ -352,7 +352,8 @@ CRYPTOOBJASM= \
$(OBJ_D)\sha1_586.obj \
$(OBJ_D)\bn_586.obj $(OBJ_D)\x86_mont.obj $(OBJ_D)\x86_gf2m.obj $(OBJ_D)\co_586.obj \
$(OBJ_D)\rmd_586.obj \
$(OBJ_D)\sha256_586.obj $(OBJ_D)\sha512_586.obj
$(OBJ_D)\sha256_586.obj $(OBJ_D)\sha512_586.obj \
$(OBJ_D)\aes_586.obj
###################################################################
all: banner $(TMP_D) lib
@@ -526,8 +527,6 @@ CRYPTOSRC= \
$(SRC_D)\crypto\aes\aes_ofb.c \
$(SRC_D)\crypto\aes\aes_ige.c \
$(SRC_D)\crypto\aes\aes_wrap.c \
$(SRC_D)\crypto\aes\aes_core.c \
$(SRC_D)\crypto\aes\aes_cbc.c \
$(SRC_D)\crypto\bn\bn_add.c \
$(SRC_D)\crypto\bn\bn_div.c \
$(SRC_D)\crypto\bn\bn_exp.c \
@@ -1250,6 +1249,9 @@ $(OBJ_D)\sha256_586.obj: $(SRC_D)\crypto\sha\asm\sha256_586.asm
$(OBJ_D)\sha512_586.obj: $(SRC_D)\crypto\sha\asm\sha512_586.asm
$(ASM) -o$(OBJ_D)\sha512_586.obj $(SRC_D)\crypto\sha\asm\sha512_586.asm
$(OBJ_D)\aes_586.obj: $(SRC_D)\crypto\aes\asm\aes_586.asm
$(ASM) -o$(OBJ_D)\aes_586.obj $(SRC_D)\crypto\aes\asm\aes_586.asm
$(O_SSL):
-if exist $(O_SSL) $(RM) $(O_SSL)
$(CC) $(LIB_CFLAGS) -output-dir $(TMP_D) @&&!

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
/*
* AES low level APIs are deprecated for public use, but still ok for internal
* use where we're using them to implement the higher level EVP interface, as is
* the case here.
*/
#include "internal/deprecated.h"
#include <openssl/aes.h>
#include <openssl/modes.h>
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const AES_KEY *key,
unsigned char *ivec, const int enc)
{
if (enc)
CRYPTO_cbc128_encrypt(in, out, len, key, ivec,
(block128_f) AES_encrypt);
else
CRYPTO_cbc128_decrypt(in, out, len, key, ivec,
(block128_f) AES_decrypt);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff