Lines Matching defs:ciphertext

406     crypto_data_t *ciphertext, crypto_req_handle_t req)
424 AES_ARG_INPLACE(plaintext, ciphertext);
447 if (ciphertext->cd_length < length_needed) {
448 ciphertext->cd_length = length_needed;
452 saved_length = ciphertext->cd_length;
453 saved_offset = ciphertext->cd_offset;
458 ret = aes_encrypt_update(ctx, plaintext, ciphertext, req);
470 * it to existing ciphertext. So, need to adjust the left over
475 ciphertext->cd_offset = ciphertext->cd_length;
476 ciphertext->cd_length = saved_length - ciphertext->cd_length;
477 ret = ccm_encrypt_final((ccm_ctx_t *)aes_ctx, ciphertext,
483 if (plaintext != ciphertext) {
484 ciphertext->cd_length =
485 ciphertext->cd_offset - saved_offset;
487 ciphertext->cd_offset = saved_offset;
491 * it to existing ciphertext. So, need to adjust the left over
496 ciphertext->cd_offset = ciphertext->cd_length;
497 ciphertext->cd_length = saved_length - ciphertext->cd_length;
498 ret = gcm_encrypt_final((gcm_ctx_t *)aes_ctx, ciphertext,
505 if (plaintext != ciphertext) {
506 ciphertext->cd_length =
507 ciphertext->cd_offset - saved_offset;
509 ciphertext->cd_offset = saved_offset;
520 aes_decrypt(crypto_ctx_t *ctx, crypto_data_t *ciphertext,
537 == 0) && (ciphertext->cd_length & (AES_BLOCK_LEN - 1)) != 0) {
541 AES_ARG_INPLACE(ciphertext, plaintext);
556 length_needed = ciphertext->cd_length - aes_ctx->ac_tag_len;
565 length_needed = ciphertext->cd_length;
579 ret = aes_decrypt_update(ctx, ciphertext, plaintext, req);
596 if (plaintext != ciphertext) {
613 if (plaintext != ciphertext) {
636 crypto_data_t *ciphertext, crypto_req_handle_t req)
646 AES_ARG_INPLACE(plaintext, ciphertext);
648 /* compute number of bytes that will hold the ciphertext */
654 if (ciphertext->cd_length < out_len) {
655 ciphertext->cd_length = out_len;
659 saved_offset = ciphertext->cd_offset;
660 saved_length = ciphertext->cd_length;
668 plaintext, ciphertext, aes_encrypt_contiguous_blocks,
673 plaintext, ciphertext, aes_encrypt_contiguous_blocks,
678 plaintext, ciphertext, aes_encrypt_contiguous_blocks,
693 ciphertext, aes_encrypt_block);
697 if (plaintext != ciphertext)
698 ciphertext->cd_length =
699 ciphertext->cd_offset - saved_offset;
701 ciphertext->cd_length = saved_length;
703 ciphertext->cd_offset = saved_offset;
710 aes_decrypt_update(crypto_ctx_t *ctx, crypto_data_t *ciphertext,
721 AES_ARG_INPLACE(ciphertext, plaintext);
730 out_len += ciphertext->cd_length;
749 switch (ciphertext->cd_format) {
752 ciphertext, plaintext, aes_decrypt_contiguous_blocks,
757 ciphertext, plaintext, aes_decrypt_contiguous_blocks,
762 ciphertext, plaintext, aes_decrypt_contiguous_blocks,
783 if (ciphertext != plaintext)
873 * There must be no unprocessed ciphertext.
874 * This happens if the length of the last ciphertext is
961 crypto_key_t *key, crypto_data_t *plaintext, crypto_data_t *ciphertext,
970 AES_ARG_INPLACE(plaintext, ciphertext);
1013 if (ciphertext->cd_length < length_needed) {
1014 ciphertext->cd_length = length_needed;
1019 saved_offset = ciphertext->cd_offset;
1020 saved_length = ciphertext->cd_length;
1027 ret = crypto_update_iov(&aes_ctx, plaintext, ciphertext,
1031 ret = crypto_update_uio(&aes_ctx, plaintext, ciphertext,
1035 ret = crypto_update_mp(&aes_ctx, plaintext, ciphertext,
1045 ciphertext, AES_BLOCK_LEN, aes_encrypt_block,
1053 ciphertext, AES_BLOCK_LEN, aes_encrypt_block,
1061 ciphertext, aes_encrypt_block);
1069 if (plaintext != ciphertext) {
1070 ciphertext->cd_length =
1071 ciphertext->cd_offset - saved_offset;
1074 ciphertext->cd_length = saved_length;
1076 ciphertext->cd_offset = saved_offset;
1091 crypto_key_t *key, crypto_data_t *ciphertext, crypto_data_t *plaintext,
1100 AES_ARG_INPLACE(ciphertext, plaintext);
1103 * CCM, GCM, CTR, and GMAC modes do not require that ciphertext
1113 if ((ciphertext->cd_length & (AES_BLOCK_LEN - 1)) != 0)
1132 length_needed = ciphertext->cd_length - aes_ctx.ac_tag_len;
1140 length_needed = ciphertext->cd_length;
1160 switch (ciphertext->cd_format) {
1162 ret = crypto_update_iov(&aes_ctx, ciphertext, plaintext,
1166 ret = crypto_update_uio(&aes_ctx, ciphertext, plaintext,
1170 ret = crypto_update_mp(&aes_ctx, ciphertext, plaintext,
1188 (ciphertext != plaintext)) {
1201 (ciphertext != plaintext)) {
1209 if (ciphertext != plaintext)
1221 if (ciphertext != plaintext)