Lines Matching defs:sav
200 ah_sumsiz_1216(sav)
201 struct secasvar *sav;
203 if (!sav)
205 if (sav->flags & SADB_X_EXT_OLD)
212 ah_sumsiz_zero(sav)
213 struct secasvar *sav;
215 if (!sav)
221 ah_none_mature(sav)
222 struct secasvar *sav;
224 if (sav->sah->saidx.proto == IPPROTO_AH) {
235 __unused struct secasvar *sav)
258 __unused struct secasvar *sav)
265 ah_keyed_md5_init(state, sav)
267 struct secasvar *sav;
276 state->sav = sav;
282 if (state->sav) {
284 (u_int8_t *)_KEYBUF(state->sav->key_auth),
285 (u_int)_KEYLEN(state->sav->key_auth));
292 if (_KEYLEN(state->sav->key_auth) < 56)
293 padlen = 64 - 8 - _KEYLEN(state->sav->key_auth);
295 padlen = 64 + 64 - 8 - _KEYLEN(state->sav->key_auth);
296 keybitlen = _KEYLEN(state->sav->key_auth);
344 if (state->sav) {
346 (u_int8_t *)_KEYBUF(state->sav->key_auth),
347 (u_int)_KEYLEN(state->sav->key_auth));
355 ah_keyed_sha1_mature(sav)
356 struct secasvar *sav;
360 if (!sav->key_auth) {
365 algo = ah_algorithm_lookup(sav->alg_auth);
371 if (sav->key_auth->sadb_key_bits < algo->keymin
372 || algo->keymax < sav->key_auth->sadb_key_bits) {
375 sav->key_auth->sadb_key_bits));
383 ah_keyed_sha1_init(state, sav)
385 struct secasvar *sav;
395 state->sav = sav;
403 if (state->sav) {
404 SHA1Update(ctxt, (u_int8_t *)_KEYBUF(state->sav->key_auth),
405 (u_int)_KEYLEN(state->sav->key_auth));
410 if (_KEYLEN(state->sav->key_auth) < 56)
411 padlen = 64 - 8 - _KEYLEN(state->sav->key_auth);
413 padlen = 64 + 64 - 8 - _KEYLEN(state->sav->key_auth);
414 keybitlen = _KEYLEN(state->sav->key_auth);
467 if (state->sav) {
468 SHA1Update(ctxt, (u_int8_t *)_KEYBUF(state->sav->key_auth),
469 (u_int)_KEYLEN(state->sav->key_auth));
478 ah_hmac_md5_mature(sav)
479 struct secasvar *sav;
483 if (!sav->key_auth) {
488 algo = ah_algorithm_lookup(sav->alg_auth);
494 if (sav->key_auth->sadb_key_bits < algo->keymin
495 || algo->keymax < sav->key_auth->sadb_key_bits) {
498 sav->key_auth->sadb_key_bits));
506 ah_hmac_md5_init(state, sav)
508 struct secasvar *sav;
521 state->sav = sav;
531 if (64 < _KEYLEN(state->sav->key_auth)) {
533 MD5Update(ctxt, _KEYBUF(state->sav->key_auth),
534 _KEYLEN(state->sav->key_auth));
539 key = _KEYBUF(state->sav->key_auth);
540 keylen = _KEYLEN(state->sav->key_auth);
602 ah_hmac_sha1_mature(sav)
603 struct secasvar *sav;
607 if (!sav->key_auth) {
612 algo = ah_algorithm_lookup(sav->alg_auth);
618 if (sav->key_auth->sadb_key_bits < algo->keymin
619 || algo->keymax < sav->key_auth->sadb_key_bits) {
622 sav->key_auth->sadb_key_bits));
630 ah_hmac_sha1_init(state, sav)
632 struct secasvar *sav;
645 state->sav = sav;
656 if (64 < _KEYLEN(state->sav->key_auth)) {
658 SHA1Update(ctxt, _KEYBUF(state->sav->key_auth),
659 _KEYLEN(state->sav->key_auth));
664 key = _KEYBUF(state->sav->key_auth);
665 keylen = _KEYLEN(state->sav->key_auth);
729 ah_hmac_sha2_256_mature(sav)
730 struct secasvar *sav;
734 if (!sav->key_auth) {
740 algo = ah_algorithm_lookup(sav->alg_auth);
747 if (sav->key_auth->sadb_key_bits < algo->keymin ||
748 algo->keymax < sav->key_auth->sadb_key_bits) {
751 sav->key_auth->sadb_key_bits));
759 ah_hmac_sha2_256_init(state, sav)
761 struct secasvar *sav;
774 state->sav = sav;
785 if (64 < _KEYLEN(state->sav->key_auth)) {
789 SHA256_Update(ctxt, _KEYBUF(state->sav->key_auth),
790 _KEYLEN(state->sav->key_auth));
795 key = _KEYBUF(state->sav->key_auth);
796 keylen = _KEYLEN(state->sav->key_auth);
861 ah_hmac_sha2_384_mature(sav)
862 struct secasvar *sav;
866 if (!sav->key_auth) {
872 algo = ah_algorithm_lookup(sav->alg_auth);
879 if (sav->key_auth->sadb_key_bits < algo->keymin ||
880 algo->keymax < sav->key_auth->sadb_key_bits) {
883 sav->key_auth->sadb_key_bits));
891 ah_hmac_sha2_384_init(state, sav)
893 struct secasvar *sav;
906 state->sav = sav;
918 if (64 < _KEYLEN(state->sav->key_auth)) {
922 SHA384_Update(ctxt, _KEYBUF(state->sav->key_auth),
923 _KEYLEN(state->sav->key_auth));
928 key = _KEYBUF(state->sav->key_auth);
929 keylen = _KEYLEN(state->sav->key_auth);
994 ah_hmac_sha2_512_mature(sav)
995 struct secasvar *sav;
999 if (!sav->key_auth) {
1005 algo = ah_algorithm_lookup(sav->alg_auth);
1012 if (sav->key_auth->sadb_key_bits < algo->keymin ||
1013 algo->keymax < sav->key_auth->sadb_key_bits) {
1016 sav->key_auth->sadb_key_bits));
1024 ah_hmac_sha2_512_init(state, sav)
1026 struct secasvar *sav;
1039 state->sav = sav;
1051 if (64 < _KEYLEN(state->sav->key_auth)) {
1055 SHA512_Update(ctxt, _KEYBUF(state->sav->key_auth),
1056 _KEYLEN(state->sav->key_auth));
1061 key = _KEYBUF(state->sav->key_auth);
1062 keylen = _KEYLEN(state->sav->key_auth);
1183 ah4_calccksum(m, ahdat, len, algo, sav)
1188 struct secasvar *sav;
1207 error = (algo->init)(&algos, sav);
1346 hdrsiz = (sav->flags & SADB_X_EXT_OLD)
1349 siz = (*algo->sumsiz)(sav);
1398 if (len < (*algo->sumsiz)(sav)) {
1404 bcopy(&sumbuf[0], ahdat, (*algo->sumsiz)(sav));
1426 ah6_calccksum(m, ahdat, len, algo, sav)
1431 struct secasvar *sav;
1444 error = (algo->init)(&algos, sav);
1499 hdrsiz = (sav->flags & SADB_X_EXT_OLD)
1502 siz = (*algo->sumsiz)(sav);
1625 if (len < (*algo->sumsiz)(sav)) {
1631 bcopy(&sumbuf[0], ahdat, (*algo->sumsiz)(sav));