• Home
  • Raw
  • Download

Lines Matching refs:kop

107 static void zapparams(struct crypt_kop *kop);
108 static int cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r,
982 zapparams(struct crypt_kop *kop) in zapparams() argument
986 for (i = 0; i < kop->crk_iparams + kop->crk_oparams; i++) { in zapparams()
987 if (kop->crk_param[i].crp_p) in zapparams()
988 free(kop->crk_param[i].crp_p); in zapparams()
989 kop->crk_param[i].crp_p = NULL; in zapparams()
990 kop->crk_param[i].crp_nbits = 0; in zapparams()
995 cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, BIGNUM *s) in cryptodev_asym() argument
1003 kop->crk_param[kop->crk_iparams].crp_p = calloc(rlen, sizeof(char)); in cryptodev_asym()
1004 kop->crk_param[kop->crk_iparams].crp_nbits = rlen * 8; in cryptodev_asym()
1005 kop->crk_oparams++; in cryptodev_asym()
1008 kop->crk_param[kop->crk_iparams+1].crp_p = calloc(slen, sizeof(char)); in cryptodev_asym()
1009 kop->crk_param[kop->crk_iparams+1].crp_nbits = slen * 8; in cryptodev_asym()
1010 kop->crk_oparams++; in cryptodev_asym()
1013 if (ioctl(fd, CIOCKEY, kop) == 0) { in cryptodev_asym()
1015 crparam2bn(&kop->crk_param[kop->crk_iparams], r); in cryptodev_asym()
1017 crparam2bn(&kop->crk_param[kop->crk_iparams+1], s); in cryptodev_asym()
1028 struct crypt_kop kop; in cryptodev_bn_mod_exp() local
1039 memset(&kop, 0, sizeof kop); in cryptodev_bn_mod_exp()
1040 kop.crk_op = CRK_MOD_EXP; in cryptodev_bn_mod_exp()
1043 if (bn2crparam(a, &kop.crk_param[0])) in cryptodev_bn_mod_exp()
1045 if (bn2crparam(p, &kop.crk_param[1])) in cryptodev_bn_mod_exp()
1047 if (bn2crparam(m, &kop.crk_param[2])) in cryptodev_bn_mod_exp()
1049 kop.crk_iparams = 3; in cryptodev_bn_mod_exp()
1051 if (cryptodev_asym(&kop, BN_num_bytes(m), r, 0, NULL)) { in cryptodev_bn_mod_exp()
1056 } else if (ECANCELED == kop.crk_status) { in cryptodev_bn_mod_exp()
1064 zapparams(&kop); in cryptodev_bn_mod_exp()
1081 struct crypt_kop kop; in cryptodev_rsa_mod_exp() local
1089 memset(&kop, 0, sizeof kop); in cryptodev_rsa_mod_exp()
1090 kop.crk_op = CRK_MOD_EXP_CRT; in cryptodev_rsa_mod_exp()
1092 if (bn2crparam(rsa->p, &kop.crk_param[0])) in cryptodev_rsa_mod_exp()
1094 if (bn2crparam(rsa->q, &kop.crk_param[1])) in cryptodev_rsa_mod_exp()
1096 if (bn2crparam(I, &kop.crk_param[2])) in cryptodev_rsa_mod_exp()
1098 if (bn2crparam(rsa->dmp1, &kop.crk_param[3])) in cryptodev_rsa_mod_exp()
1100 if (bn2crparam(rsa->dmq1, &kop.crk_param[4])) in cryptodev_rsa_mod_exp()
1102 if (bn2crparam(rsa->iqmp, &kop.crk_param[5])) in cryptodev_rsa_mod_exp()
1104 kop.crk_iparams = 6; in cryptodev_rsa_mod_exp()
1106 if (cryptodev_asym(&kop, BN_num_bytes(rsa->n), r0, 0, NULL)) { in cryptodev_rsa_mod_exp()
1111 } else if (ECANCELED == kop.crk_status) { in cryptodev_rsa_mod_exp()
1119 zapparams(&kop); in cryptodev_rsa_mod_exp()
1181 struct crypt_kop kop; in cryptodev_dsa_do_sign() local
1192 memset(&kop, 0, sizeof kop); in cryptodev_dsa_do_sign()
1193 kop.crk_op = CRK_DSA_SIGN; in cryptodev_dsa_do_sign()
1196 kop.crk_param[0].crp_p = (caddr_t)dgst; in cryptodev_dsa_do_sign()
1197 kop.crk_param[0].crp_nbits = dlen * 8; in cryptodev_dsa_do_sign()
1198 if (bn2crparam(dsa->p, &kop.crk_param[1])) in cryptodev_dsa_do_sign()
1200 if (bn2crparam(dsa->q, &kop.crk_param[2])) in cryptodev_dsa_do_sign()
1202 if (bn2crparam(dsa->g, &kop.crk_param[3])) in cryptodev_dsa_do_sign()
1204 if (bn2crparam(dsa->priv_key, &kop.crk_param[4])) in cryptodev_dsa_do_sign()
1206 kop.crk_iparams = 5; in cryptodev_dsa_do_sign()
1208 if (cryptodev_asym(&kop, BN_num_bytes(dsa->q), r, in cryptodev_dsa_do_sign()
1220 kop.crk_param[0].crp_p = NULL; in cryptodev_dsa_do_sign()
1221 zapparams(&kop); in cryptodev_dsa_do_sign()
1229 struct crypt_kop kop; in cryptodev_dsa_verify() local
1232 memset(&kop, 0, sizeof kop); in cryptodev_dsa_verify()
1233 kop.crk_op = CRK_DSA_VERIFY; in cryptodev_dsa_verify()
1236 kop.crk_param[0].crp_p = (caddr_t)dgst; in cryptodev_dsa_verify()
1237 kop.crk_param[0].crp_nbits = dlen * 8; in cryptodev_dsa_verify()
1238 if (bn2crparam(dsa->p, &kop.crk_param[1])) in cryptodev_dsa_verify()
1240 if (bn2crparam(dsa->q, &kop.crk_param[2])) in cryptodev_dsa_verify()
1242 if (bn2crparam(dsa->g, &kop.crk_param[3])) in cryptodev_dsa_verify()
1244 if (bn2crparam(dsa->pub_key, &kop.crk_param[4])) in cryptodev_dsa_verify()
1246 if (bn2crparam(sig->r, &kop.crk_param[5])) in cryptodev_dsa_verify()
1248 if (bn2crparam(sig->s, &kop.crk_param[6])) in cryptodev_dsa_verify()
1250 kop.crk_iparams = 7; in cryptodev_dsa_verify()
1252 if (cryptodev_asym(&kop, 0, NULL, 0, NULL) == 0) { in cryptodev_dsa_verify()
1254 if(0 != kop.crk_status) dsaret = 0; in cryptodev_dsa_verify()
1261 kop.crk_param[0].crp_p = NULL; in cryptodev_dsa_verify()
1262 zapparams(&kop); in cryptodev_dsa_verify()
1290 struct crypt_kop kop; in cryptodev_dh_compute_key() local
1302 memset(&kop, 0, sizeof kop); in cryptodev_dh_compute_key()
1303 kop.crk_op = CRK_DH_COMPUTE_KEY; in cryptodev_dh_compute_key()
1306 if (bn2crparam(dh->priv_key, &kop.crk_param[0])) in cryptodev_dh_compute_key()
1308 if (bn2crparam(pub_key, &kop.crk_param[1])) in cryptodev_dh_compute_key()
1310 if (bn2crparam(dh->p, &kop.crk_param[2])) in cryptodev_dh_compute_key()
1312 kop.crk_iparams = 3; in cryptodev_dh_compute_key()
1314 kop.crk_param[3].crp_p = (caddr_t) key; in cryptodev_dh_compute_key()
1315 kop.crk_param[3].crp_nbits = keylen * 8; in cryptodev_dh_compute_key()
1316 kop.crk_oparams = 1; in cryptodev_dh_compute_key()
1318 if (ioctl(fd, CIOCKEY, &kop) == -1) { in cryptodev_dh_compute_key()
1324 kop.crk_param[3].crp_p = NULL; in cryptodev_dh_compute_key()
1325 zapparams(&kop); in cryptodev_dh_compute_key()