Lines Matching defs:state
265 struct ah_algorithm_state *state,
268 state->foo = NULL;
274 __unused struct ah_algorithm_state *state,
282 __unused struct ah_algorithm_state *state,
297 ah_keyed_md5_init(state, sav)
298 struct ah_algorithm_state *state;
305 if (!state)
308 state->sav = sav;
309 state->foo = (void *)_MALLOC(sizeof(MD5_CTX), M_TEMP, M_NOWAIT);
310 if (state->foo == NULL)
313 MD5Init((MD5_CTX *)state->foo);
314 if (state->sav) {
315 MD5Update((MD5_CTX *)state->foo,
316 (u_int8_t *)_KEYBUF(state->sav->key_auth),
317 (u_int)_KEYLEN(state->sav->key_auth));
324 if (_KEYLEN(state->sav->key_auth) < 56)
325 padlen = 64 - 8 - _KEYLEN(state->sav->key_auth);
327 padlen = 64 + 64 - 8 - _KEYLEN(state->sav->key_auth);
328 keybitlen = _KEYLEN(state->sav->key_auth);
332 MD5Update((MD5_CTX *)state->foo, &buf[0], 1);
337 MD5Update((MD5_CTX *)state->foo, &buf[0], sizeof(buf));
341 MD5Update((MD5_CTX *)state->foo, &buf[0], padlen);
348 MD5Update((MD5_CTX *)state->foo, buf, 8);
355 ah_keyed_md5_loop(state, addr, len)
356 struct ah_algorithm_state *state;
360 if (!state)
363 MD5Update((MD5_CTX *)state->foo, addr, len);
367 ah_keyed_md5_result(state, addr, l)
368 struct ah_algorithm_state *state;
374 if (!state)
377 if (state->sav) {
378 MD5Update((MD5_CTX *)state->foo,
379 (u_int8_t *)_KEYBUF(state->sav->key_auth),
380 (u_int)_KEYLEN(state->sav->key_auth));
382 MD5Final(&digest[0], (MD5_CTX *)state->foo);
383 FREE(state->foo, M_TEMP);
416 ah_keyed_sha1_init(state, sav)
417 struct ah_algorithm_state *state;
425 if (!state)
428 state->sav = sav;
429 state->foo = (void *)_MALLOC(sizeof(SHA1_CTX), M_TEMP, M_NOWAIT);
430 if (!state->foo)
433 ctxt = (SHA1_CTX *)state->foo;
436 if (state->sav) {
437 SHA1Update(ctxt, (u_int8_t *)_KEYBUF(state->sav->key_auth),
438 (u_int)_KEYLEN(state->sav->key_auth));
443 if (_KEYLEN(state->sav->key_auth) < 56)
444 padlen = 64 - 8 - _KEYLEN(state->sav->key_auth);
446 padlen = 64 + 64 - 8 - _KEYLEN(state->sav->key_auth);
447 keybitlen = _KEYLEN(state->sav->key_auth);
474 ah_keyed_sha1_loop(state, addr, len)
475 struct ah_algorithm_state *state;
481 if (!state || !state->foo)
483 ctxt = (SHA1_CTX *)state->foo;
489 ah_keyed_sha1_result(state, addr, l)
490 struct ah_algorithm_state *state;
497 if (!state || !state->foo)
499 ctxt = (SHA1_CTX *)state->foo;
501 if (state->sav) {
502 SHA1Update(ctxt, (u_int8_t *)_KEYBUF(state->sav->key_auth),
503 (u_int)_KEYLEN(state->sav->key_auth));
508 FREE(state->foo, M_TEMP);
540 ah_hmac_md5_init(state, sav)
541 struct ah_algorithm_state *state;
552 if (!state)
555 state->sav = sav;
556 state->foo = (void *)_MALLOC(64 + 64 + sizeof(MD5_CTX), M_TEMP, M_NOWAIT);
557 if (!state->foo)
560 ipad = (u_char *)state->foo;
565 if (64 < _KEYLEN(state->sav->key_auth)) {
567 MD5Update(ctxt, _KEYBUF(state->sav->key_auth),
568 _KEYLEN(state->sav->key_auth));
573 key = (u_char *) _KEYBUF(state->sav->key_auth);
574 keylen = _KEYLEN(state->sav->key_auth);
593 ah_hmac_md5_loop(state, addr, len)
594 struct ah_algorithm_state *state;
600 if (!state || !state->foo)
602 ctxt = (MD5_CTX *)(void *)(((caddr_t)state->foo) + 128);
607 ah_hmac_md5_result(state, addr, l)
608 struct ah_algorithm_state *state;
617 if (!state || !state->foo)
620 ipad = (u_char *)state->foo;
633 FREE(state->foo, M_TEMP);
665 ah_hmac_sha1_init(state, sav)
666 struct ah_algorithm_state *state;
677 if (!state)
680 state->sav = sav;
681 state->foo = (void *)_MALLOC(64 + 64 + sizeof(SHA1_CTX),
683 if (!state->foo)
686 ipad = (u_char *)state->foo;
691 if (64 < _KEYLEN(state->sav->key_auth)) {
693 SHA1Update(ctxt, _KEYBUF(state->sav->key_auth),
694 _KEYLEN(state->sav->key_auth));
699 key = (u_char *) _KEYBUF(state->sav->key_auth);
700 keylen = _KEYLEN(state->sav->key_auth);
719 ah_hmac_sha1_loop(state, addr, len)
720 struct ah_algorithm_state *state;
726 if (!state || !state->foo)
729 ctxt = (SHA1_CTX *)(void *)(((u_char *)state->foo) + 128);
734 ah_hmac_sha1_result(state, addr, l)
735 struct ah_algorithm_state *state;
744 if (!state || !state->foo)
747 ipad = (u_char *)state->foo;
760 FREE(state->foo, M_TEMP);
805 ah_hmac_sha2_256_init(state, sav)
806 struct ah_algorithm_state *state;
817 if (!state)
820 state->sav = sav;
821 state->foo = (void *)_MALLOC(64 + 64 + sizeof(SHA256_CTX),
823 if (!state->foo)
826 ipad = (u_char *)state->foo;
831 if (64 < _KEYLEN(state->sav->key_auth)) {
835 SHA256_Update(ctxt, (const u_int8_t *) _KEYBUF(state->sav->key_auth),
836 _KEYLEN(state->sav->key_auth));
841 key = (u_char *) _KEYBUF(state->sav->key_auth);
842 keylen = _KEYLEN(state->sav->key_auth);
862 ah_hmac_sha2_256_loop(state, addr, len)
863 struct ah_algorithm_state *state;
869 if (!state || !state->foo)
872 ctxt = (SHA256_CTX *)(void *)(((u_char *)state->foo) + 128);
877 ah_hmac_sha2_256_result(state, addr, l)
878 struct ah_algorithm_state *state;
887 if (!state || !state->foo)
890 ipad = (u_char *)state->foo;
903 FREE(state->foo, M_TEMP);
947 ah_hmac_sha2_384_init(state, sav)
948 struct ah_algorithm_state *state;
959 if (!state)
962 state->sav = sav;
963 state->foo = (void *)_MALLOC(128 + 128 + sizeof(SHA384_CTX),
965 if (!state->foo)
967 bzero(state->foo, 128 + 128 + sizeof(SHA384_CTX));
969 ipad = (u_char *)state->foo;
974 if (128 < _KEYLEN(state->sav->key_auth)) {
978 SHA384_Update(ctxt, (const u_int8_t *) _KEYBUF(state->sav->key_auth),
979 _KEYLEN(state->sav->key_auth));
984 key = (u_char *) _KEYBUF(state->sav->key_auth);
985 keylen = _KEYLEN(state->sav->key_auth);
1005 ah_hmac_sha2_384_loop(state, addr, len)
1006 struct ah_algorithm_state *state;
1012 if (!state || !state->foo)
1015 ctxt = (SHA384_CTX *)(void *)(((u_char *)state->foo) + 256);
1020 ah_hmac_sha2_384_result(state, addr, l)
1021 struct ah_algorithm_state *state;
1030 if (!state || !state->foo)
1033 ipad = (u_char *)state->foo;
1046 FREE(state->foo, M_TEMP);
1090 ah_hmac_sha2_512_init(state, sav)
1091 struct ah_algorithm_state *state;
1102 if (!state)
1105 state->sav = sav;
1106 state->foo = (void *)_MALLOC(128 + 128 + sizeof(SHA512_CTX),
1108 if (!state->foo)
1110 bzero(state->foo, 128 + 128 + sizeof(SHA512_CTX));
1112 ipad = (u_char *)state->foo;
1117 if (128 < _KEYLEN(state->sav->key_auth)) {
1121 SHA512_Update(ctxt, (const u_int8_t *) _KEYBUF(state->sav->key_auth),
1122 _KEYLEN(state->sav->key_auth));
1127 key = (u_char *) _KEYBUF(state->sav->key_auth);
1128 keylen = _KEYLEN(state->sav->key_auth);
1148 ah_hmac_sha2_512_loop(state, addr, len)
1149 struct ah_algorithm_state *state;
1155 if (!state || !state->foo)
1158 ctxt = (SHA512_CTX *)(void *)(((u_char *)state->foo) + 256);
1163 ah_hmac_sha2_512_result(state, addr, l)
1164 struct ah_algorithm_state *state;
1173 if (!state || !state->foo)
1176 ipad = (u_char *)state->foo;
1189 FREE(state->foo, M_TEMP);