mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-29 03:36:27 +08:00
Add 128-EEA3, 128-EIA3, ZUC-MAC, ZUC256, ZUC256-MAC and EVP_zuc256
This commit is contained in:
@@ -293,5 +293,6 @@ void openssl_add_all_ciphers_int(void)
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_ZUC
|
||||
EVP_add_cipher(EVP_zuc());
|
||||
EVP_add_cipher(EVP_zuc256());
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -109,4 +109,31 @@ const EVP_CIPHER *EVP_zuc(void)
|
||||
{
|
||||
return &zuc_cipher;
|
||||
}
|
||||
|
||||
static int zuc256_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
|
||||
const unsigned char *iv, int enc)
|
||||
{
|
||||
EVP_ZUC_KEY *dctx = EVP_C_DATA(EVP_ZUC_KEY, ctx);
|
||||
ZUC256_set_key(&dctx->ks, key, iv);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const EVP_CIPHER zuc256_cipher = {
|
||||
NID_zuc256,
|
||||
1,
|
||||
ZUC256_KEY_LENGTH,
|
||||
ZUC256_IV_LENGTH,
|
||||
0,
|
||||
zuc256_init_key,
|
||||
zuc_do_cipher,
|
||||
NULL,
|
||||
sizeof(EVP_ZUC_KEY),
|
||||
NULL,NULL,NULL,NULL,
|
||||
};
|
||||
|
||||
const EVP_CIPHER *EVP_zuc256(void)
|
||||
{
|
||||
return &zuc256_cipher;
|
||||
}
|
||||
|
||||
#endif /* OPENSSL_NO_ZUC */
|
||||
|
||||
Reference in New Issue
Block a user