diff --git a/build.sh b/build.sh index 1a746eadbb09d2539629fea84f1c0dc6b6418495..4fb801b815a5b54061b4bca79b9f3ee85ac26419 100644 --- a/build.sh +++ b/build.sh @@ -15,9 +15,9 @@ function main() make -j make install cd ../kae_engine - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig + export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig autoreconf -i - ./configure --libdir=/usr/local/lib/engines-1.1/ --enable-kae + ./configure --libdir=/usr/local/lib/engines-1.1/ make -j make install elif [ "$1" = "cleanup" ];then diff --git a/kae_engine/src/uadk_cipher.c b/kae_engine/src/uadk_cipher.c index cc06429f58e0d4f8f7259c491aff68a3364903c4..59d8e2bfe0d2c56d5ba1ccd74610894267081cd8 100644 --- a/kae_engine/src/uadk_cipher.c +++ b/kae_engine/src/uadk_cipher.c @@ -91,6 +91,9 @@ static int cipher_hw_v2_nids[] = { NID_des_ede3_cbc, NID_des_ede3_ecb, NID_sm4_ecb, + NID_sm4_cfb128, + NID_sm4_ofb128, + NID_sm4_ctr, 0, }; @@ -1007,7 +1010,18 @@ static int bind_v2_cipher(void) sizeof(struct cipher_priv_ctx), uadk_e_cipher_init, uadk_e_do_cipher, uadk_e_cipher_cleanup, EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv); - + UADK_CIPHER_DESCR(sm4_ofb128, 1, 16, 16, EVP_CIPH_OFB_MODE, + sizeof(struct cipher_priv_ctx), uadk_e_cipher_init, + uadk_e_do_cipher, uadk_e_cipher_cleanup, + EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv); + UADK_CIPHER_DESCR(sm4_cfb128, 1, 16, 16, EVP_CIPH_OFB_MODE, + sizeof(struct cipher_priv_ctx), uadk_e_cipher_init, + uadk_e_do_cipher, uadk_e_cipher_cleanup, + EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv); + UADK_CIPHER_DESCR(sm4_ctr, 1, 16, 16, EVP_CIPH_CTR_MODE, + sizeof(struct cipher_priv_ctx), uadk_e_cipher_init, + uadk_e_do_cipher, uadk_e_cipher_cleanup, + EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv); return 0; } @@ -1061,8 +1075,7 @@ static int bind_v3_cipher(void) sizeof(struct cipher_priv_ctx), uadk_e_cipher_init, uadk_e_do_cipher, uadk_e_cipher_cleanup, EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv); - - return 0; + return 0; } int uadk_e_bind_cipher(ENGINE *e)