Lines Matching full:stp

490 fb64_stream_iv(Block seed, struct stinfo *stp)  in fb64_stream_iv()  argument
493 memmove((void *)stp->str_iv, (void *)seed, sizeof(Block)); in fb64_stream_iv()
494 memmove((void *)stp->str_output, (void *)seed, sizeof(Block)); in fb64_stream_iv()
496 DES_key_sched((Block *)stp->str_ikey, &stp->str_sched); in fb64_stream_iv()
498 stp->str_index = sizeof(Block); in fb64_stream_iv()
502 fb64_stream_key(Block key, struct stinfo *stp) in fb64_stream_key() argument
504 memmove((void *)stp->str_ikey, (void *)key, sizeof(Block)); in fb64_stream_key()
505 DES_key_sched((Block *)key, &stp->str_sched); in fb64_stream_key()
507 memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block)); in fb64_stream_key()
509 stp->str_index = sizeof(Block); in fb64_stream_key()
537 struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1]; in cfb64_encrypt() local
540 idx = stp->str_index; in cfb64_encrypt()
544 DES_ecb_encrypt((Block *)stp->str_output, (Block *)b, &stp->str_sched, 1); in cfb64_encrypt()
545 memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); in cfb64_encrypt()
550 *s = stp->str_output[idx] = (stp->str_feed[idx] ^ *s); in cfb64_encrypt()
554 stp->str_index = idx; in cfb64_encrypt()
560 struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1]; in cfb64_decrypt() local
569 if (stp->str_index) in cfb64_decrypt()
570 --stp->str_index; in cfb64_decrypt()
574 idx = stp->str_index++; in cfb64_decrypt()
577 DES_ecb_encrypt((Block *)stp->str_output, (Block *)b, &stp->str_sched, 1); in cfb64_decrypt()
578 memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); in cfb64_decrypt()
579 stp->str_index = 1; /* Next time will be 1 */ in cfb64_decrypt()
584 stp->str_output[idx] = data; in cfb64_decrypt()
585 return(data ^ stp->str_feed[idx]); in cfb64_decrypt()
610 struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1]; in ofb64_encrypt() local
613 idx = stp->str_index; in ofb64_encrypt()
617 DES_ecb_encrypt((Block *)stp->str_feed, (Block *)b, &stp->str_sched, 1); in ofb64_encrypt()
618 memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); in ofb64_encrypt()
621 *s++ ^= stp->str_feed[idx]; in ofb64_encrypt()
624 stp->str_index = idx; in ofb64_encrypt()
630 struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1]; in ofb64_decrypt() local
639 if (stp->str_index) in ofb64_decrypt()
640 --stp->str_index; in ofb64_decrypt()
644 idx = stp->str_index++; in ofb64_decrypt()
647 DES_ecb_encrypt((Block *)stp->str_feed, (Block *)b, &stp->str_sched, 1); in ofb64_decrypt()
648 memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); in ofb64_decrypt()
649 stp->str_index = 1; /* Next time will be 1 */ in ofb64_decrypt()
653 return(data ^ stp->str_feed[idx]); in ofb64_decrypt()