diff --git a/kae_engine/README.md b/kae_engine/README.md index aa80eb043424431494d82e48f9b6e55f68600e9f..d44327a799a76976c2345a336216eb059601e21e 100644 --- a/kae_engine/README.md +++ b/kae_engine/README.md @@ -3,9 +3,9 @@ OpenSSL engine for uadk - [Prerequisites](#prerequisites) - [Installation Instruction](#installation-instruction) - - [Build & Install OpenSSL](#build-&-install-openssl) - - [Build & Install UADK](#build-&-install-uadk) - - [Build & Install OpenSSL UADK engine](#build-&-install-openssl-uadk-engine) + - [Build and install OpenSSL](#build-and-install-openssl) + - [Build and install UADK](#build-and-install-uadk) + - [Build and install UADK engine](#build-and-install-uadk-engine) - [Testing](#testing) - [Install libraries to the temp folder](#Install-libraries-to-the-temp-folder) - [Environment variable of uadk engin](#Environment-variable-of-uadk-engine) @@ -20,7 +20,7 @@ Prerequisites Installation Instruction ======================== -Build & Install OpenSSL +Build and install OpenSSL ----------------------- ``` @@ -34,7 +34,7 @@ Build & Install OpenSSL openssl version ``` -Build & Install UADK +Build and install UADK -------------------- ``` @@ -49,11 +49,11 @@ Build & Install UADK * If get error:"cannot find -lnuma", please install the libnuma-dev * If get error:"fatal error: zlib.h: No such file or directory", please install zlib. -Build & Install OpenSSL UADK Engine +Build and install UADK Engine ----------------------------------- ``` - git clone https://github.com/Linaro/openssl-uadk.git - cd openssl-uadk + git clone https://github.com/Linaro/uadk_engine.git + cd uadk_engine autoreconf -i ./configure --libdir=/usr/local/lib/engines-1.1/ --enable-kae make @@ -92,7 +92,7 @@ Install libraries to the temp folder $ pkg-config libwd --libs -L/tmp/build/lib -lwd - $ cd openssl-uadk + $ cd uadk_engine $ autoreconf $ ./configure --prefix=/tmp/build $ make; make install diff --git a/kae_engine/configure.ac b/kae_engine/configure.ac index c31e09931b63ee8ca7cb9e0e19034239c758b629..502cc0c72a95c9a2c45bc1e2a7658765175ca291 100644 --- a/kae_engine/configure.ac +++ b/kae_engine/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([openssl-uadk], [1.0.1]) +AC_INIT([uadk_engine], [1.1]) AC_CONFIG_SRCDIR([src/e_uadk.c]) AM_INIT_AUTOMAKE([1.10 no-define]) diff --git a/kae_engine/docs/ReleaseNotes.md b/kae_engine/docs/ReleaseNotes.md index f760db87e63ab12bf60156073c06ea54851eb47c..3041e6920638924dd84ca7d6e5f204580f6bbc1b 100644 --- a/kae_engine/docs/ReleaseNotes.md +++ b/kae_engine/docs/ReleaseNotes.md @@ -1,5 +1,5 @@ -# UADK engine Release Pre v1.1 November 2022 +# UADK engine Release v1.1 December 2022 ## New Features @@ -41,5 +41,5 @@ ## Working combination -- UADK v2.3.28 +- UADK v2.4 - OpenSSL 1.1.1f diff --git a/kae_engine/docs/maintenance.md b/kae_engine/docs/maintenance.md index e4bcd3ef2b1ffcd8cda7c29e824a753f8567e457..c0ade141cadb62cf355a1648ab1004aff1ee0946 100644 --- a/kae_engine/docs/maintenance.md +++ b/kae_engine/docs/maintenance.md @@ -5,7 +5,7 @@ Clone UADK from [Github](https://github.com/Linaro/uadk). -Clone openssl-uadk from [Github](https://github.com/Linaro/openssl-uadk). +Clone uadk_engine from [Github](https://github.com/Linaro/uadk_engine). ## License diff --git a/kae_engine/src/Makefile.am b/kae_engine/src/Makefile.am index 9d53d9e70ad5c8711bc6b3c2ef0535e2ca45db2a..a26ed8d4abcaa3375bd788ec29169d98d865edeb 100644 --- a/kae_engine/src/Makefile.am +++ b/kae_engine/src/Makefile.am @@ -1,4 +1,4 @@ -VERSION = 1:0:1 +VERSION = 1:1 ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES=kae.la diff --git a/kae_engine/src/uadk_cipher.c b/kae_engine/src/uadk_cipher.c index 59d8e2bfe0d2c56d5ba1ccd74610894267081cd8..5e3cead646def8dbbd5c375a0d60072a624a953a 100644 --- a/kae_engine/src/uadk_cipher.c +++ b/kae_engine/src/uadk_cipher.c @@ -341,7 +341,7 @@ static int uadk_get_accel_platform(char *alg_name) { struct uacce_dev *dev; - dev = wd_get_accel_dev("cipher"); + dev = wd_get_accel_dev(alg_name); if (dev == NULL) return 0; diff --git a/kae_engine/src/uadk_rsa.c b/kae_engine/src/uadk_rsa.c index 96c898fb122cf361f494bcaabf810597a8f394a0..a1bb2cf3be23852311851360520f77dbba61c485 100644 --- a/kae_engine/src/uadk_rsa.c +++ b/kae_engine/src/uadk_rsa.c @@ -187,7 +187,7 @@ static int rsa_prime_mul_res(int num, struct rsa_prime_param *param, } static int check_rsa_prime_sufficient(int *num, const int *bitsr, - int *bitse, const int *n, + int *bitse, int * const n, struct rsa_prime_param *param, BN_CTX *ctx, BN_GENCB *cb) { @@ -230,7 +230,8 @@ static int check_rsa_prime_sufficient(int *num, const int *bitsr, else return -1; - ret = BN_GENCB_call(cb, GENCB_NEXT, *n++); + ret = BN_GENCB_call(cb, GENCB_NEXT, *n); + (*n)++; if (!ret) return -1; @@ -287,14 +288,15 @@ static int check_rsa_prime_equal(int num, BIGNUM *rsa_p, BIGNUM *rsa_q, return UADK_E_SUCCESS; } -static int check_rsa_prime_useful(const int *n, struct rsa_prime_param *param, +static int check_rsa_prime_useful(int * const n, struct rsa_prime_param *param, BIGNUM *e_pub, BN_CTX *ctx, BN_GENCB *cb) { unsigned long err; + int ret; /* - * BN_sub(r,a,b) substracts b from a and place the result in r, - * r = a-b. + * BN_sub(r, a, b) substracts b from a and place the result in r, + * r = a - b. * BN_value_one() returns a BIGNUM constant of value 1. * r2 = prime - 1. */ @@ -303,11 +305,11 @@ static int check_rsa_prime_useful(const int *n, struct rsa_prime_param *param, ERR_set_mark(); BN_set_flags(param->r2, BN_FLG_CONSTTIME); /* - * BN_mod_inverse(r,a,n,ctx) used to compute inverse modulo n. + * BN_mod_inverse(r, a, n, ctx) used to compute inverse modulo n. * Precisely, it computes the inverse of "a" modulo "n", and places - * the result in "r", which means (a * r) % n==1. + * the result in "r", which means (a * r) % n == 1. * If r == NULL, error. If r != NULL, success. - * The expected result: (r2 * r1) % e_pub ==1, + * The expected result: (r2 * r1) % e_pub == 1, * the inverse of r2 exist, that is r1. */ if (BN_mod_inverse(param->r1, param->r2, e_pub, ctx)) @@ -320,13 +322,15 @@ static int check_rsa_prime_useful(const int *n, struct rsa_prime_param *param, else return BN_ERR; - if (!BN_GENCB_call(cb, GENCB_NEXT, *n++)) + ret = BN_GENCB_call(cb, GENCB_NEXT, *n); + (*n)++; + if (!ret) return BN_ERR; return GET_ERR_FINISH; } -static int get_rsa_prime_once(int num, const int *bitsr, const int *n, +static int get_rsa_prime_once(int num, const int *bitsr, int * const n, BIGNUM *e_pub, struct rsa_prime_param *param, BN_CTX *ctx, BN_GENCB *cb) {