Lines Matching refs:state

411     struct dev_crypto_state *state = ctx->cipher_data;
412 struct session_op *sess = &state->d_sess;
416 if (state->d_fd < 0)
443 if (ioctl(state->d_fd, CIOCCRYPT, &cryp) == -1) {
465 struct dev_crypto_state *state = ctx->cipher_data;
466 struct session_op *sess = &state->d_sess;
478 state->d_fd = -1;
484 if ((state->d_fd = get_dev_crypto()) < 0)
491 if (ioctl(state->d_fd, CIOCGSESSION, sess) == -1) {
492 put_dev_crypto(state->d_fd);
493 state->d_fd = -1;
506 struct dev_crypto_state *state = ctx->cipher_data;
507 struct session_op *sess = &state->d_sess;
509 if (state->d_fd < 0)
522 if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) == -1) {
527 put_dev_crypto(state->d_fd);
528 state->d_fd = -1;
765 struct dev_crypto_state *state = ctx->md_data;
766 struct session_op *sess = &state->d_sess;
774 memset(state, 0, sizeof(struct dev_crypto_state));
776 if ((state->d_fd = get_dev_crypto()) < 0) {
781 sess->mackey = state->dummy_mac_key;
785 if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) {
786 put_dev_crypto(state->d_fd);
787 state->d_fd = -1;
799 struct dev_crypto_state *state = ctx->md_data;
800 struct session_op *sess = &state->d_sess;
802 if (!data || state->d_fd < 0) {
814 OPENSSL_realloc(state->mac_data, state->mac_len + count);
821 state->mac_data = mac_data;
822 memcpy(state->mac_data + state->mac_len, data, count);
823 state->mac_len += count;
835 cryp.mac = (caddr_t) state->digest_res;
836 if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) {
846 struct dev_crypto_state *state = ctx->md_data;
847 struct session_op *sess = &state->d_sess;
851 if (!md || state->d_fd < 0) {
861 cryp.len = state->mac_len;
862 cryp.src = state->mac_data;
865 if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) {
873 memcpy(md, state->digest_res, ctx->digest->md_size);
881 struct dev_crypto_state *state = ctx->md_data;
882 struct session_op *sess = &state->d_sess;
884 if (state == NULL)
887 if (state->d_fd < 0) {
892 if (state->mac_data) {
893 OPENSSL_free(state->mac_data);
894 state->mac_data = NULL;
895 state->mac_len = 0;
898 if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) {
904 put_dev_crypto(state->d_fd);
905 state->d_fd = -1;