Add sm3/sm4 as pbe algorithms

This commit is contained in:
Zhi Guan
2018-09-08 10:38:43 +08:00
parent ccde5f4b17
commit f960a8fa27
2 changed files with 5 additions and 2 deletions

View File

@@ -96,8 +96,8 @@ static int sms4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
}
IMPLEMENT_BLOCK_CIPHER(sms4, ks, sms4, EVP_SMS4_KEY, NID_sms4,
SMS4_BLOCK_SIZE, SMS4_KEY_LENGTH, SMS4_IV_LENGTH, 128, 0,
sms4_init_key, NULL, NULL, NULL, NULL)
SMS4_BLOCK_SIZE, SMS4_KEY_LENGTH, SMS4_IV_LENGTH, 128,
EVP_CIPH_FLAG_DEFAULT_ASN1, sms4_init_key, NULL, NULL, NULL, NULL)
# define MAXBITCHUNK ((size_t)1<<(sizeof(size_t)*8-4))

View File

@@ -68,6 +68,9 @@ static const EVP_PBE_CTL builtin_pbe[] = {
{EVP_PBE_TYPE_PRF, NID_hmacWithSHA256, -1, NID_sha256, 0},
{EVP_PBE_TYPE_PRF, NID_hmacWithSHA384, -1, NID_sha384, 0},
{EVP_PBE_TYPE_PRF, NID_hmacWithSHA512, -1, NID_sha512, 0},
#ifndef OPENSSL_NO_SM3
{EVP_PBE_TYPE_PRF, NID_hmac_sm3, -1, NID_sm3, 0},
#endif
{EVP_PBE_TYPE_PRF, NID_id_HMACGostR3411_94, -1, NID_id_GostR3411_94, 0},
{EVP_PBE_TYPE_PRF, NID_id_tc26_hmac_gost_3411_2012_256, -1,
NID_id_GostR3411_2012_256, 0},