Lines Matching refs:c1
20 BN_ULONG c1 = 0; in bn_mul_add_words() local
24 return c1; in bn_mul_add_words()
28 mul_add(rp[0], ap[0], w, c1); in bn_mul_add_words()
29 mul_add(rp[1], ap[1], w, c1); in bn_mul_add_words()
30 mul_add(rp[2], ap[2], w, c1); in bn_mul_add_words()
31 mul_add(rp[3], ap[3], w, c1); in bn_mul_add_words()
38 mul_add(rp[0], ap[0], w, c1); in bn_mul_add_words()
44 return c1; in bn_mul_add_words()
49 BN_ULONG c1 = 0; in bn_mul_words() local
53 return c1; in bn_mul_words()
57 mul(rp[0], ap[0], w, c1); in bn_mul_words()
58 mul(rp[1], ap[1], w, c1); in bn_mul_words()
59 mul(rp[2], ap[2], w, c1); in bn_mul_words()
60 mul(rp[3], ap[3], w, c1); in bn_mul_words()
67 mul(rp[0], ap[0], w, c1); in bn_mul_words()
72 return c1; in bn_mul_words()
448 # define mul_add_c(a,b,c0,c1,c2) do { \ argument
454 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
457 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
463 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
467 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
470 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
476 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
479 # define sqr_add_c2(a,i,j,c0,c1,c2) \ argument
480 mul_add_c2((a)[i],(a)[j],c0,c1,c2)
487 # define mul_add_c(a,b,c0,c1,c2) do { \ argument
492 c1 += hi; c2 += (c1<hi); \
495 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
500 c1 += tt; c2 += (c1<tt); \
502 c1 += hi; c2 += (c1<hi); \
505 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
510 c1 += hi; c2 += (c1<hi); \
513 # define sqr_add_c2(a,i,j,c0,c1,c2) \ argument
514 mul_add_c2((a)[i],(a)[j],c0,c1,c2)
521 # define mul_add_c(a,b,c0,c1,c2) do { \ argument
526 c1 += hi; c2 += (c1<hi); \
529 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
534 c1 += tt; c2 += (c1<tt); \
536 c1 += hi; c2 += (c1<hi); \
539 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
544 c1 += hi; c2 += (c1<hi); \
547 # define sqr_add_c2(a,i,j,c0,c1,c2) \ argument
548 mul_add_c2((a)[i],(a)[j],c0,c1,c2)
555 # define mul_add_c(a,b,c0,c1,c2) do { \ argument
560 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
563 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
570 c1 = (c1+tt)&BN_MASK2; c2 += (c1<tt); \
572 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
575 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
579 c1 = (c1+hi)&BN_MASK2; c2 += (c1<hi); \
582 # define sqr_add_c2(a,i,j,c0,c1,c2) \ argument
583 mul_add_c2((a)[i],(a)[j],c0,c1,c2)
588 BN_ULONG c1, c2, c3; in bn_mul_comba8() local
590 c1 = 0; in bn_mul_comba8()
593 mul_add_c(a[0], b[0], c1, c2, c3); in bn_mul_comba8()
594 r[0] = c1; in bn_mul_comba8()
595 c1 = 0; in bn_mul_comba8()
596 mul_add_c(a[0], b[1], c2, c3, c1); in bn_mul_comba8()
597 mul_add_c(a[1], b[0], c2, c3, c1); in bn_mul_comba8()
600 mul_add_c(a[2], b[0], c3, c1, c2); in bn_mul_comba8()
601 mul_add_c(a[1], b[1], c3, c1, c2); in bn_mul_comba8()
602 mul_add_c(a[0], b[2], c3, c1, c2); in bn_mul_comba8()
605 mul_add_c(a[0], b[3], c1, c2, c3); in bn_mul_comba8()
606 mul_add_c(a[1], b[2], c1, c2, c3); in bn_mul_comba8()
607 mul_add_c(a[2], b[1], c1, c2, c3); in bn_mul_comba8()
608 mul_add_c(a[3], b[0], c1, c2, c3); in bn_mul_comba8()
609 r[3] = c1; in bn_mul_comba8()
610 c1 = 0; in bn_mul_comba8()
611 mul_add_c(a[4], b[0], c2, c3, c1); in bn_mul_comba8()
612 mul_add_c(a[3], b[1], c2, c3, c1); in bn_mul_comba8()
613 mul_add_c(a[2], b[2], c2, c3, c1); in bn_mul_comba8()
614 mul_add_c(a[1], b[3], c2, c3, c1); in bn_mul_comba8()
615 mul_add_c(a[0], b[4], c2, c3, c1); in bn_mul_comba8()
618 mul_add_c(a[0], b[5], c3, c1, c2); in bn_mul_comba8()
619 mul_add_c(a[1], b[4], c3, c1, c2); in bn_mul_comba8()
620 mul_add_c(a[2], b[3], c3, c1, c2); in bn_mul_comba8()
621 mul_add_c(a[3], b[2], c3, c1, c2); in bn_mul_comba8()
622 mul_add_c(a[4], b[1], c3, c1, c2); in bn_mul_comba8()
623 mul_add_c(a[5], b[0], c3, c1, c2); in bn_mul_comba8()
626 mul_add_c(a[6], b[0], c1, c2, c3); in bn_mul_comba8()
627 mul_add_c(a[5], b[1], c1, c2, c3); in bn_mul_comba8()
628 mul_add_c(a[4], b[2], c1, c2, c3); in bn_mul_comba8()
629 mul_add_c(a[3], b[3], c1, c2, c3); in bn_mul_comba8()
630 mul_add_c(a[2], b[4], c1, c2, c3); in bn_mul_comba8()
631 mul_add_c(a[1], b[5], c1, c2, c3); in bn_mul_comba8()
632 mul_add_c(a[0], b[6], c1, c2, c3); in bn_mul_comba8()
633 r[6] = c1; in bn_mul_comba8()
634 c1 = 0; in bn_mul_comba8()
635 mul_add_c(a[0], b[7], c2, c3, c1); in bn_mul_comba8()
636 mul_add_c(a[1], b[6], c2, c3, c1); in bn_mul_comba8()
637 mul_add_c(a[2], b[5], c2, c3, c1); in bn_mul_comba8()
638 mul_add_c(a[3], b[4], c2, c3, c1); in bn_mul_comba8()
639 mul_add_c(a[4], b[3], c2, c3, c1); in bn_mul_comba8()
640 mul_add_c(a[5], b[2], c2, c3, c1); in bn_mul_comba8()
641 mul_add_c(a[6], b[1], c2, c3, c1); in bn_mul_comba8()
642 mul_add_c(a[7], b[0], c2, c3, c1); in bn_mul_comba8()
645 mul_add_c(a[7], b[1], c3, c1, c2); in bn_mul_comba8()
646 mul_add_c(a[6], b[2], c3, c1, c2); in bn_mul_comba8()
647 mul_add_c(a[5], b[3], c3, c1, c2); in bn_mul_comba8()
648 mul_add_c(a[4], b[4], c3, c1, c2); in bn_mul_comba8()
649 mul_add_c(a[3], b[5], c3, c1, c2); in bn_mul_comba8()
650 mul_add_c(a[2], b[6], c3, c1, c2); in bn_mul_comba8()
651 mul_add_c(a[1], b[7], c3, c1, c2); in bn_mul_comba8()
654 mul_add_c(a[2], b[7], c1, c2, c3); in bn_mul_comba8()
655 mul_add_c(a[3], b[6], c1, c2, c3); in bn_mul_comba8()
656 mul_add_c(a[4], b[5], c1, c2, c3); in bn_mul_comba8()
657 mul_add_c(a[5], b[4], c1, c2, c3); in bn_mul_comba8()
658 mul_add_c(a[6], b[3], c1, c2, c3); in bn_mul_comba8()
659 mul_add_c(a[7], b[2], c1, c2, c3); in bn_mul_comba8()
660 r[9] = c1; in bn_mul_comba8()
661 c1 = 0; in bn_mul_comba8()
662 mul_add_c(a[7], b[3], c2, c3, c1); in bn_mul_comba8()
663 mul_add_c(a[6], b[4], c2, c3, c1); in bn_mul_comba8()
664 mul_add_c(a[5], b[5], c2, c3, c1); in bn_mul_comba8()
665 mul_add_c(a[4], b[6], c2, c3, c1); in bn_mul_comba8()
666 mul_add_c(a[3], b[7], c2, c3, c1); in bn_mul_comba8()
669 mul_add_c(a[4], b[7], c3, c1, c2); in bn_mul_comba8()
670 mul_add_c(a[5], b[6], c3, c1, c2); in bn_mul_comba8()
671 mul_add_c(a[6], b[5], c3, c1, c2); in bn_mul_comba8()
672 mul_add_c(a[7], b[4], c3, c1, c2); in bn_mul_comba8()
675 mul_add_c(a[7], b[5], c1, c2, c3); in bn_mul_comba8()
676 mul_add_c(a[6], b[6], c1, c2, c3); in bn_mul_comba8()
677 mul_add_c(a[5], b[7], c1, c2, c3); in bn_mul_comba8()
678 r[12] = c1; in bn_mul_comba8()
679 c1 = 0; in bn_mul_comba8()
680 mul_add_c(a[6], b[7], c2, c3, c1); in bn_mul_comba8()
681 mul_add_c(a[7], b[6], c2, c3, c1); in bn_mul_comba8()
684 mul_add_c(a[7], b[7], c3, c1, c2); in bn_mul_comba8()
686 r[15] = c1; in bn_mul_comba8()
691 BN_ULONG c1, c2, c3; in bn_mul_comba4() local
693 c1 = 0; in bn_mul_comba4()
696 mul_add_c(a[0], b[0], c1, c2, c3); in bn_mul_comba4()
697 r[0] = c1; in bn_mul_comba4()
698 c1 = 0; in bn_mul_comba4()
699 mul_add_c(a[0], b[1], c2, c3, c1); in bn_mul_comba4()
700 mul_add_c(a[1], b[0], c2, c3, c1); in bn_mul_comba4()
703 mul_add_c(a[2], b[0], c3, c1, c2); in bn_mul_comba4()
704 mul_add_c(a[1], b[1], c3, c1, c2); in bn_mul_comba4()
705 mul_add_c(a[0], b[2], c3, c1, c2); in bn_mul_comba4()
708 mul_add_c(a[0], b[3], c1, c2, c3); in bn_mul_comba4()
709 mul_add_c(a[1], b[2], c1, c2, c3); in bn_mul_comba4()
710 mul_add_c(a[2], b[1], c1, c2, c3); in bn_mul_comba4()
711 mul_add_c(a[3], b[0], c1, c2, c3); in bn_mul_comba4()
712 r[3] = c1; in bn_mul_comba4()
713 c1 = 0; in bn_mul_comba4()
714 mul_add_c(a[3], b[1], c2, c3, c1); in bn_mul_comba4()
715 mul_add_c(a[2], b[2], c2, c3, c1); in bn_mul_comba4()
716 mul_add_c(a[1], b[3], c2, c3, c1); in bn_mul_comba4()
719 mul_add_c(a[2], b[3], c3, c1, c2); in bn_mul_comba4()
720 mul_add_c(a[3], b[2], c3, c1, c2); in bn_mul_comba4()
723 mul_add_c(a[3], b[3], c1, c2, c3); in bn_mul_comba4()
724 r[6] = c1; in bn_mul_comba4()
730 BN_ULONG c1, c2, c3; in bn_sqr_comba8() local
732 c1 = 0; in bn_sqr_comba8()
735 sqr_add_c(a, 0, c1, c2, c3); in bn_sqr_comba8()
736 r[0] = c1; in bn_sqr_comba8()
737 c1 = 0; in bn_sqr_comba8()
738 sqr_add_c2(a, 1, 0, c2, c3, c1); in bn_sqr_comba8()
741 sqr_add_c(a, 1, c3, c1, c2); in bn_sqr_comba8()
742 sqr_add_c2(a, 2, 0, c3, c1, c2); in bn_sqr_comba8()
745 sqr_add_c2(a, 3, 0, c1, c2, c3); in bn_sqr_comba8()
746 sqr_add_c2(a, 2, 1, c1, c2, c3); in bn_sqr_comba8()
747 r[3] = c1; in bn_sqr_comba8()
748 c1 = 0; in bn_sqr_comba8()
749 sqr_add_c(a, 2, c2, c3, c1); in bn_sqr_comba8()
750 sqr_add_c2(a, 3, 1, c2, c3, c1); in bn_sqr_comba8()
751 sqr_add_c2(a, 4, 0, c2, c3, c1); in bn_sqr_comba8()
754 sqr_add_c2(a, 5, 0, c3, c1, c2); in bn_sqr_comba8()
755 sqr_add_c2(a, 4, 1, c3, c1, c2); in bn_sqr_comba8()
756 sqr_add_c2(a, 3, 2, c3, c1, c2); in bn_sqr_comba8()
759 sqr_add_c(a, 3, c1, c2, c3); in bn_sqr_comba8()
760 sqr_add_c2(a, 4, 2, c1, c2, c3); in bn_sqr_comba8()
761 sqr_add_c2(a, 5, 1, c1, c2, c3); in bn_sqr_comba8()
762 sqr_add_c2(a, 6, 0, c1, c2, c3); in bn_sqr_comba8()
763 r[6] = c1; in bn_sqr_comba8()
764 c1 = 0; in bn_sqr_comba8()
765 sqr_add_c2(a, 7, 0, c2, c3, c1); in bn_sqr_comba8()
766 sqr_add_c2(a, 6, 1, c2, c3, c1); in bn_sqr_comba8()
767 sqr_add_c2(a, 5, 2, c2, c3, c1); in bn_sqr_comba8()
768 sqr_add_c2(a, 4, 3, c2, c3, c1); in bn_sqr_comba8()
771 sqr_add_c(a, 4, c3, c1, c2); in bn_sqr_comba8()
772 sqr_add_c2(a, 5, 3, c3, c1, c2); in bn_sqr_comba8()
773 sqr_add_c2(a, 6, 2, c3, c1, c2); in bn_sqr_comba8()
774 sqr_add_c2(a, 7, 1, c3, c1, c2); in bn_sqr_comba8()
777 sqr_add_c2(a, 7, 2, c1, c2, c3); in bn_sqr_comba8()
778 sqr_add_c2(a, 6, 3, c1, c2, c3); in bn_sqr_comba8()
779 sqr_add_c2(a, 5, 4, c1, c2, c3); in bn_sqr_comba8()
780 r[9] = c1; in bn_sqr_comba8()
781 c1 = 0; in bn_sqr_comba8()
782 sqr_add_c(a, 5, c2, c3, c1); in bn_sqr_comba8()
783 sqr_add_c2(a, 6, 4, c2, c3, c1); in bn_sqr_comba8()
784 sqr_add_c2(a, 7, 3, c2, c3, c1); in bn_sqr_comba8()
787 sqr_add_c2(a, 7, 4, c3, c1, c2); in bn_sqr_comba8()
788 sqr_add_c2(a, 6, 5, c3, c1, c2); in bn_sqr_comba8()
791 sqr_add_c(a, 6, c1, c2, c3); in bn_sqr_comba8()
792 sqr_add_c2(a, 7, 5, c1, c2, c3); in bn_sqr_comba8()
793 r[12] = c1; in bn_sqr_comba8()
794 c1 = 0; in bn_sqr_comba8()
795 sqr_add_c2(a, 7, 6, c2, c3, c1); in bn_sqr_comba8()
798 sqr_add_c(a, 7, c3, c1, c2); in bn_sqr_comba8()
800 r[15] = c1; in bn_sqr_comba8()
805 BN_ULONG c1, c2, c3; in bn_sqr_comba4() local
807 c1 = 0; in bn_sqr_comba4()
810 sqr_add_c(a, 0, c1, c2, c3); in bn_sqr_comba4()
811 r[0] = c1; in bn_sqr_comba4()
812 c1 = 0; in bn_sqr_comba4()
813 sqr_add_c2(a, 1, 0, c2, c3, c1); in bn_sqr_comba4()
816 sqr_add_c(a, 1, c3, c1, c2); in bn_sqr_comba4()
817 sqr_add_c2(a, 2, 0, c3, c1, c2); in bn_sqr_comba4()
820 sqr_add_c2(a, 3, 0, c1, c2, c3); in bn_sqr_comba4()
821 sqr_add_c2(a, 2, 1, c1, c2, c3); in bn_sqr_comba4()
822 r[3] = c1; in bn_sqr_comba4()
823 c1 = 0; in bn_sqr_comba4()
824 sqr_add_c(a, 2, c2, c3, c1); in bn_sqr_comba4()
825 sqr_add_c2(a, 3, 1, c2, c3, c1); in bn_sqr_comba4()
828 sqr_add_c2(a, 3, 2, c3, c1, c2); in bn_sqr_comba4()
831 sqr_add_c(a, 3, c1, c2, c3); in bn_sqr_comba4()
832 r[6] = c1; in bn_sqr_comba4()
855 BN_ULONG c0, c1, ml, *tp, n0; in bn_mul_mont() local
899 c1 = (tp[num] + c0) & BN_MASK2; in bn_mul_mont()
900 tp[num] = c1; in bn_mul_mont()
901 tp[num + 1] = (c1 < c0 ? 1 : 0); in bn_mul_mont()
903 c1 = tp[0]; in bn_mul_mont()
904 ml = (c1 * n0) & BN_MASK2; in bn_mul_mont()
909 mul_add(c1, np[0], ml, mh, c0); in bn_mul_mont()
911 mul_add(c1, ml, np[0], c0); in bn_mul_mont()
914 c1 = tp[j]; in bn_mul_mont()
916 mul_add(c1, np[j], ml, mh, c0); in bn_mul_mont()
918 mul_add(c1, ml, np[j], c0); in bn_mul_mont()
920 tp[j - 1] = c1 & BN_MASK2; in bn_mul_mont()
922 c1 = (tp[num] + c0) & BN_MASK2; in bn_mul_mont()
923 tp[num - 1] = c1; in bn_mul_mont()
924 tp[num] = tp[num + 1] + (c1 < c0 ? 1 : 0); in bn_mul_mont()
996 BN_ULONG c0, c1, *tp, n0 = *n0p; in bn_mul_mont() local
1007 c1 = (tp[num] + c0) & BN_MASK2; in bn_mul_mont()
1008 tp[num] = c1; in bn_mul_mont()
1009 tp[num + 1] = (c1 < c0 ? 1 : 0); in bn_mul_mont()
1012 c1 = (tp[num] + c0) & BN_MASK2; in bn_mul_mont()
1013 tp[num] = c1; in bn_mul_mont()
1014 tp[num + 1] += (c1 < c0 ? 1 : 0); in bn_mul_mont()