Lines Matching refs:stp

512 void fb64_stream_iv(DES_cblock seed, struct stinfo *stp)
515 memcpy(stp->str_iv, seed,sizeof(DES_cblock));
516 memcpy(stp->str_output, seed, sizeof(DES_cblock));
518 DES_set_key_checked(&stp->str_ikey, &stp->str_sched);
520 stp->str_index = sizeof(DES_cblock);
523 void fb64_stream_key(DES_cblock key, struct stinfo *stp)
525 memcpy(stp->str_ikey, key, sizeof(DES_cblock));
526 DES_set_key_checked((DES_cblock*)key, &stp->str_sched);
528 memcpy(stp->str_output, stp->str_iv, sizeof(DES_cblock));
530 stp->str_index = sizeof(DES_cblock);
557 struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1];
560 index = stp->str_index;
564 DES_ecb_encrypt(&stp->str_output, &b,&stp->str_sched, 1);
565 memcpy(stp->str_feed, b, sizeof(DES_cblock));
570 *s = stp->str_output[index] = (stp->str_feed[index] ^ *s);
574 stp->str_index = index;
579 struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1];
588 if (stp->str_index)
589 --stp->str_index;
593 index = stp->str_index++;
596 DES_ecb_encrypt(&stp->str_output,&b, &stp->str_sched, 1);
597 memcpy(stp->str_feed, b, sizeof(DES_cblock));
598 stp->str_index = 1; /* Next time will be 1 */
603 stp->str_output[index] = data;
604 return(data ^ stp->str_feed[index]);
629 struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1];
632 index = stp->str_index;
636 DES_ecb_encrypt(&stp->str_feed,&b, &stp->str_sched, 1);
637 memcpy(stp->str_feed, b, sizeof(DES_cblock));
640 *s++ ^= stp->str_feed[index];
643 stp->str_index = index;
648 struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1];
657 if (stp->str_index)
658 --stp->str_index;
662 index = stp->str_index++;
665 DES_ecb_encrypt(&stp->str_feed,&b,&stp->str_sched, 1);
666 memcpy(stp->str_feed, b, sizeof(DES_cblock));
667 stp->str_index = 1; /* Next time will be 1 */
671 return(data ^ stp->str_feed[index]);