Lines Matching defs:ocd
113 struct octo_sess **ocd;
176 ocd = malloc(sc->sc_sesnum * sizeof(struct octo_sess *),
178 if (ocd == NULL) {
190 memcpy(ocd, sc->sc_sessions,
195 sc->sc_sessions = ocd;
198 ocd = &sc->sc_sessions[i];
201 *ocd = malloc(sizeof(struct octo_sess), M_DEVBUF, M_NOWAIT | M_ZERO);
202 if (*ocd == NULL) {
209 (*ocd)->octo_encklen = (encini->cri_klen + 7) / 8;
210 memcpy((*ocd)->octo_enckey, encini->cri_key, (*ocd)->octo_encklen);
214 (*ocd)->octo_macklen = (macini->cri_klen + 7) / 8;
215 memcpy((*ocd)->octo_mackey, macini->cri_key, (*ocd)->octo_macklen);
218 (*ocd)->octo_mlen = 0;
220 (*ocd)->octo_mlen = encini->cri_mlen;
222 (*ocd)->octo_mlen = macini->cri_mlen;
224 (*ocd)->octo_mlen = 12;
234 (*ocd)->octo_ivsize = 8;
237 (*ocd)->octo_encrypt = octo_des_cbc_md5_encrypt;
238 (*ocd)->octo_decrypt = octo_des_cbc_md5_decrypt;
239 octo_calc_hash(0, macini->cri_key, (*ocd)->octo_hminner,
240 (*ocd)->octo_hmouter);
243 (*ocd)->octo_encrypt = octo_des_cbc_sha1_encrypt;
244 (*ocd)->octo_decrypt = octo_des_cbc_sha1_encrypt;
245 octo_calc_hash(1, macini->cri_key, (*ocd)->octo_hminner,
246 (*ocd)->octo_hmouter);
249 (*ocd)->octo_encrypt = octo_des_cbc_encrypt;
250 (*ocd)->octo_decrypt = octo_des_cbc_decrypt;
259 (*ocd)->octo_ivsize = 16;
262 (*ocd)->octo_encrypt = octo_aes_cbc_md5_encrypt;
263 (*ocd)->octo_decrypt = octo_aes_cbc_md5_decrypt;
264 octo_calc_hash(0, macini->cri_key, (*ocd)->octo_hminner,
265 (*ocd)->octo_hmouter);
268 (*ocd)->octo_encrypt = octo_aes_cbc_sha1_encrypt;
269 (*ocd)->octo_decrypt = octo_aes_cbc_sha1_decrypt;
270 octo_calc_hash(1, macini->cri_key, (*ocd)->octo_hminner,
271 (*ocd)->octo_hmouter);
274 (*ocd)->octo_encrypt = octo_aes_cbc_encrypt;
275 (*ocd)->octo_decrypt = octo_aes_cbc_decrypt;
284 (*ocd)->octo_encrypt = octo_null_md5_encrypt;
285 (*ocd)->octo_decrypt = octo_null_md5_encrypt;
286 octo_calc_hash(0, macini->cri_key, (*ocd)->octo_hminner,
287 (*ocd)->octo_hmouter);
290 (*ocd)->octo_encrypt = octo_null_sha1_encrypt;
291 (*ocd)->octo_decrypt = octo_null_sha1_encrypt;
292 octo_calc_hash(1, macini->cri_key, (*ocd)->octo_hminner,
293 (*ocd)->octo_hmouter);
301 (*ocd)->octo_encalg = encini ? encini->cri_alg : -1;
302 (*ocd)->octo_macalg = macini ? macini->cri_alg : -1;