Lines Matching refs:crp
76 ossl_aes_cbc(struct ossl_session_cipher *s, struct cryptop *crp, in ossl_aes_cbc() argument
91 encrypt = CRYPTO_OP_IS_ENCRYPT(crp->crp_op); in ossl_aes_cbc()
92 plen = crp->crp_payload_length; in ossl_aes_cbc()
98 if (crp->crp_cipher_key != NULL) { in ossl_aes_cbc()
100 error = cipher->set_encrypt_key(crp->crp_cipher_key, in ossl_aes_cbc()
103 error = cipher->set_decrypt_key(crp->crp_cipher_key, in ossl_aes_cbc()
114 crypto_read_iv(crp, iv); in ossl_aes_cbc()
117 crypto_cursor_init(&cc_in, &crp->crp_buf); in ossl_aes_cbc()
118 crypto_cursor_advance(&cc_in, crp->crp_payload_start); in ossl_aes_cbc()
120 if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { in ossl_aes_cbc()
121 crypto_cursor_init(&cc_out, &crp->crp_obuf); in ossl_aes_cbc()
122 crypto_cursor_advance(&cc_out, crp->crp_payload_output_start); in ossl_aes_cbc()
173 ossl_aes_gcm(struct ossl_session_cipher *s, struct cryptop *crp, in ossl_aes_gcm() argument
185 encrypt = CRYPTO_OP_IS_ENCRYPT(crp->crp_op); in ossl_aes_gcm()
187 if (crp->crp_cipher_key != NULL) { in ossl_aes_gcm()
189 error = s->cipher->set_encrypt_key(crp->crp_cipher_key, in ossl_aes_gcm()
193 error = s->cipher->set_decrypt_key(crp->crp_cipher_key, in ossl_aes_gcm()
204 crypto_read_iv(crp, iv); in ossl_aes_gcm()
207 if (crp->crp_aad != NULL) { in ossl_aes_gcm()
208 if (ctx.ops->aad(&ctx, crp->crp_aad, crp->crp_aad_length) != 0) in ossl_aes_gcm()
211 crypto_cursor_init(&cc_in, &crp->crp_buf); in ossl_aes_gcm()
212 crypto_cursor_advance(&cc_in, crp->crp_aad_start); in ossl_aes_gcm()
213 for (size_t alen = crp->crp_aad_length; alen > 0; in ossl_aes_gcm()
223 crypto_cursor_init(&cc_in, &crp->crp_buf); in ossl_aes_gcm()
224 crypto_cursor_advance(&cc_in, crp->crp_payload_start); in ossl_aes_gcm()
225 if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { in ossl_aes_gcm()
226 crypto_cursor_init(&cc_out, &crp->crp_obuf); in ossl_aes_gcm()
227 crypto_cursor_advance(&cc_out, crp->crp_payload_output_start); in ossl_aes_gcm()
232 for (size_t plen = crp->crp_payload_length; plen > 0; plen -= seglen) { in ossl_aes_gcm()
252 crypto_copyback(crp, crp->crp_digest_start, GMAC_DIGEST_LEN, in ossl_aes_gcm()
255 crypto_copydata(crp, crp->crp_digest_start, GMAC_DIGEST_LEN, in ossl_aes_gcm()