Lines Matching refs:stp

497 void fb64_stream_iv(DES_cblock seed, struct stinfo *stp)
500 memcpy(stp->str_iv, seed,sizeof(DES_cblock));
501 memcpy(stp->str_output, seed, sizeof(DES_cblock));
503 DES_set_key_checked(&stp->str_ikey, &stp->str_sched);
505 stp->str_index = sizeof(DES_cblock);
508 void fb64_stream_key(DES_cblock key, struct stinfo *stp)
510 memcpy(stp->str_ikey, key, sizeof(DES_cblock));
511 DES_set_key_checked((DES_cblock*)key, &stp->str_sched);
513 memcpy(stp->str_output, stp->str_iv, sizeof(DES_cblock));
515 stp->str_index = sizeof(DES_cblock);
542 struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1];
545 index = stp->str_index;
549 DES_ecb_encrypt(&stp->str_output, &b,&stp->str_sched, 1);
550 memcpy(stp->str_feed, b, sizeof(DES_cblock));
555 *s = stp->str_output[index] = (stp->str_feed[index] ^ *s);
559 stp->str_index = index;
564 struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1];
573 if (stp->str_index)
574 --stp->str_index;
578 index = stp->str_index++;
581 DES_ecb_encrypt(&stp->str_output,&b, &stp->str_sched, 1);
582 memcpy(stp->str_feed, b, sizeof(DES_cblock));
583 stp->str_index = 1; /* Next time will be 1 */
588 stp->str_output[index] = data;
589 return(data ^ stp->str_feed[index]);
614 struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1];
617 index = stp->str_index;
621 DES_ecb_encrypt(&stp->str_feed,&b, &stp->str_sched, 1);
622 memcpy(stp->str_feed, b, sizeof(DES_cblock));
625 *s++ ^= stp->str_feed[index];
628 stp->str_index = index;
633 struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1];
642 if (stp->str_index)
643 --stp->str_index;
647 index = stp->str_index++;
650 DES_ecb_encrypt(&stp->str_feed,&b,&stp->str_sched, 1);
651 memcpy(stp->str_feed, b, sizeof(DES_cblock));
652 stp->str_index = 1; /* Next time will be 1 */
656 return(data ^ stp->str_feed[index]);