X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=providers%2Fimplementations%2Fciphers%2Fcipher_des_hw.c;h=f52bade45ee12cb162697d9f26c4d5aff92752d3;hb=7cc355c2e4e081dca3c6c345a75a2ab16800c807;hp=7181c2290c1c5fe1842d1e63bb2fc5a1c1e5c284;hpb=33388b44b67145af2181b1e9528c381c8ea0d1b6;p=openssl.git diff --git a/providers/implementations/ciphers/cipher_des_hw.c b/providers/implementations/ciphers/cipher_des_hw.c index 7181c2290c..f52bade45e 100644 --- a/providers/implementations/ciphers/cipher_des_hw.c +++ b/providers/implementations/ciphers/cipher_des_hw.c @@ -65,7 +65,13 @@ static int cipher_hw_des_ecb_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out, static int cipher_hw_des_cbc_cipher(PROV_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t len) { - DES_key_schedule *key = &(((PROV_DES_CTX *)ctx)->dks.ks); + PROV_DES_CTX *dctx = (PROV_DES_CTX *)ctx; + DES_key_schedule *key = &(dctx->dks.ks); + + if (dctx->dstream.cbc != NULL) { + (*dctx->dstream.cbc) (in, out, len, key, ctx->iv); + return 1; + } while (len >= MAXCHUNK) { DES_ncbc_encrypt(in, out, MAXCHUNK, key, (DES_cblock *)ctx->iv,