Lines Matching refs:swd

709 	struct swcr_data **swd;
735 swd = malloc(swcr_sesnum * sizeof(struct swcr_data *),
737 if (swd == NULL) {
749 bcopy(swcr_sessions, swd,
754 swcr_sessions = swd;
758 swd = &swcr_sessions[i];
762 *swd = malloc(sizeof(struct swcr_data),
764 if (*swd == NULL) {
800 (*swd)->sw_exf = txf;
810 error = txf->setkey(&((*swd)->sw_kschedule),
818 (*swd)->sw_exf = txf;
842 (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA,
844 if ((*swd)->sw_ictx == NULL) {
850 (*swd)->sw_octx = malloc(axf->ctxsize, M_CRYPTO_DATA,
852 if ((*swd)->sw_octx == NULL) {
859 swcr_authprepare(axf, *swd, cri->cri_key,
863 (*swd)->sw_mlen = cri->cri_mlen;
864 (*swd)->sw_axf = axf;
874 (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA,
876 if ((*swd)->sw_ictx == NULL) {
882 (*swd)->sw_octx = malloc(cri->cri_klen / 8,
884 if ((*swd)->sw_octx == NULL) {
892 swcr_authprepare(axf, *swd, cri->cri_key,
896 (*swd)->sw_mlen = cri->cri_mlen;
897 (*swd)->sw_axf = axf;
907 (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA,
909 if ((*swd)->sw_ictx == NULL) {
915 axf->Init((*swd)->sw_ictx);
916 (*swd)->sw_mlen = cri->cri_mlen;
917 (*swd)->sw_axf = axf;
939 (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA,
941 if ((*swd)->sw_ictx == NULL) {
946 axf->Init((*swd)->sw_ictx);
947 axf->Setkey((*swd)->sw_ictx, cri->cri_key, len);
948 (*swd)->sw_axf = axf;
953 (*swd)->sw_cxf = cxf;
961 (*swd)->sw_alg = cri->cri_alg;
963 swd = &((*swd)->sw_next);
986 struct swcr_data *swd;
1000 while ((swd = swcr_sessions[sid]) != NULL) {
1001 swcr_sessions[sid] = swd->sw_next;
1003 switch (swd->sw_alg) {
1016 txf = swd->sw_exf;
1018 if (swd->sw_kschedule)
1019 txf->zerokey(&(swd->sw_kschedule));
1029 axf = swd->sw_axf;
1031 if (swd->sw_ictx) {
1032 bzero(swd->sw_ictx, axf->ctxsize);
1033 free(swd->sw_ictx, M_CRYPTO_DATA);
1035 if (swd->sw_octx) {
1036 bzero(swd->sw_octx, axf->ctxsize);
1037 free(swd->sw_octx, M_CRYPTO_DATA);
1043 axf = swd->sw_axf;
1045 if (swd->sw_ictx) {
1046 bzero(swd->sw_ictx, axf->ctxsize);
1047 free(swd->sw_ictx, M_CRYPTO_DATA);
1049 if (swd->sw_octx) {
1050 bzero(swd->sw_octx, swd->sw_klen);
1051 free(swd->sw_octx, M_CRYPTO_DATA);
1060 axf = swd->sw_axf;
1062 if (swd->sw_ictx)
1063 free(swd->sw_ictx, M_CRYPTO_DATA);
1067 cxf = swd->sw_cxf;
1071 free(swd, M_CRYPTO_DATA);