size_t *padlen, const unsigned char *in,
size_t len);
+/*
+ * Called from EVP_CipherInit when there is currently no context via
+ * the new_ctx() function
+ */
void ossl_gcm_initctx(void *provctx, PROV_GCM_CTX *ctx, size_t keybits,
const PROV_GCM_HW *hw)
{
ctx->libctx = PROV_LIBCTX_OF(provctx);
}
+/*
+ * Called by EVP_CipherInit via the _einit and _dinit functions
+ */
static int gcm_init(void *vctx, const unsigned char *key, size_t keylen,
const unsigned char *iv, size_t ivlen,
const OSSL_PARAM params[], int enc)
}
if (!ctx->hw->setkey(ctx, key, ctx->keylen))
return 0;
+ ctx->tls_enc_records = 0;
}
return ossl_gcm_set_ctx_params(ctx, params);
}
buf = dat->buf;
memcpy(buf, aad, aad_len);
dat->tls_aad_len = aad_len;
- dat->tls_enc_records = 0;
len = buf[aad_len - 2] << 8 | buf[aad_len - 1];
/* Correct length for explicit iv. */