| 749 | } |
| 750 | |
| 751 | static struct cryptop_data * |
| 752 | cod_alloc(struct csession *cse, size_t aad_len, size_t len) |
| 753 | { |
| 754 | struct cryptop_data *cod; |
| 755 | |
| 756 | cod = malloc(sizeof(struct cryptop_data), M_XDATA, M_WAITOK | M_ZERO); |
| 757 | |
| 758 | cod->cse = cse; |
| 759 | if (crypto_get_params(cse->cses)->csp_flags & CSP_F_SEPARATE_AAD) { |
| 760 | if (aad_len != 0) |
| 761 | cod->aad = malloc(aad_len, M_XDATA, M_WAITOK); |
| 762 | cod->buf = malloc(len, M_XDATA, M_WAITOK); |
| 763 | } else |
| 764 | cod->buf = malloc(aad_len + len, M_XDATA, M_WAITOK); |
| 765 | if (crypto_get_params(cse->cses)->csp_flags & CSP_F_SEPARATE_OUTPUT) |
| 766 | cod->obuf = malloc(len, M_XDATA, M_WAITOK); |
| 767 | return (cod); |
| 768 | } |
| 769 | |
| 770 | static void |
| 771 | cod_free(struct cryptop_data *cod) |
no test coverage detected