Lines Matching refs:a
75 void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n) in bn_sqr_words() argument
83 sqr(r[0], r[1], a[0]); in bn_sqr_words()
84 sqr(r[2], r[3], a[1]); in bn_sqr_words()
85 sqr(r[4], r[5], a[2]); in bn_sqr_words()
86 sqr(r[6], r[7], a[3]); in bn_sqr_words()
87 a += 4; in bn_sqr_words()
93 sqr(r[0], r[1], a[0]); in bn_sqr_words()
94 a++; in bn_sqr_words()
168 void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n) in bn_sqr_words() argument
176 sqr64(r[0], r[1], a[0]); in bn_sqr_words()
177 sqr64(r[2], r[3], a[1]); in bn_sqr_words()
178 sqr64(r[4], r[5], a[2]); in bn_sqr_words()
179 sqr64(r[6], r[7], a[3]); in bn_sqr_words()
180 a += 4; in bn_sqr_words()
186 sqr64(r[0], r[1], a[0]); in bn_sqr_words()
187 a++; in bn_sqr_words()
272 BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, in bn_add_words() argument
283 ll += (BN_ULLONG) a[0] + b[0]; in bn_add_words()
286 ll += (BN_ULLONG) a[1] + b[1]; in bn_add_words()
289 ll += (BN_ULLONG) a[2] + b[2]; in bn_add_words()
292 ll += (BN_ULLONG) a[3] + b[3]; in bn_add_words()
295 a += 4; in bn_add_words()
302 ll += (BN_ULLONG) a[0] + b[0]; in bn_add_words()
305 a++; in bn_add_words()
313 BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, in bn_add_words() argument
325 t = a[0]; in bn_add_words()
331 t = a[1]; in bn_add_words()
337 t = a[2]; in bn_add_words()
343 t = a[3]; in bn_add_words()
349 a += 4; in bn_add_words()
356 t = a[0]; in bn_add_words()
362 a++; in bn_add_words()
371 BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, in bn_sub_words() argument
383 t1 = a[0]; in bn_sub_words()
390 t1 = a[1]; in bn_sub_words()
397 t1 = a[2]; in bn_sub_words()
404 t1 = a[3]; in bn_sub_words()
411 a += 4; in bn_sub_words()
418 t1 = a[0]; in bn_sub_words()
425 a++; in bn_sub_words()
448 # define mul_add_c(a,b,c0,c1,c2) do { \ argument
450 BN_ULLONG t = (BN_ULLONG)(a)*(b); \
457 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
459 BN_ULLONG t = (BN_ULLONG)(a)*(b); \
470 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
472 BN_ULLONG t = (BN_ULLONG)a[i]*a[i]; \
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
488 BN_ULONG ta = (a), tb = (b); \
495 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
496 BN_ULONG ta = (a), tb = (b); \
505 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
506 BN_ULONG ta = (a)[i]; \
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
522 BN_ULONG ta = (a), tb = (b); \
529 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
530 BN_ULONG ta = (a), tb = (b), tt; \
539 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
540 BN_ULONG ta = (a)[i]; \
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
556 BN_ULONG lo = LBITS(a), hi = HBITS(a); \
563 # define mul_add_c2(a,b,c0,c1,c2) do { \ argument
565 BN_ULONG lo = LBITS(a), hi = HBITS(a); \
575 # define sqr_add_c(a,i,c0,c1,c2) do { \ argument
577 sqr64(lo,hi,(a)[i]); \
582 # define sqr_add_c2(a,i,j,c0,c1,c2) \ argument
583 mul_add_c2((a)[i],(a)[j],c0,c1,c2)
586 void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) in bn_mul_comba8() argument
593 mul_add_c(a[0], b[0], c1, c2, c3); 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()
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()
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()
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()
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()
689 void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) in bn_mul_comba4() argument
696 mul_add_c(a[0], b[0], c1, c2, c3); 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()
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()
728 void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a) in bn_sqr_comba8() argument
735 sqr_add_c(a, 0, c1, c2, c3); 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()
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()
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()
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()
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()
803 void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a) in bn_sqr_comba4() argument
810 sqr_add_c(a, 0, c1, c2, c3); 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()
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()
958 void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a) in bn_sqr_comba4() argument
961 bn_sqr_normal(r, a, 4, t); in bn_sqr_comba4()
964 void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a) in bn_sqr_comba8() argument
967 bn_sqr_normal(r, a, 8, t); in bn_sqr_comba8()
970 void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) in bn_mul_comba4() argument
972 r[4] = bn_mul_words(&(r[0]), a, 4, b[0]); in bn_mul_comba4()
973 r[5] = bn_mul_add_words(&(r[1]), a, 4, b[1]); in bn_mul_comba4()
974 r[6] = bn_mul_add_words(&(r[2]), a, 4, b[2]); in bn_mul_comba4()
975 r[7] = bn_mul_add_words(&(r[3]), a, 4, b[3]); in bn_mul_comba4()
978 void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) in bn_mul_comba8() argument
980 r[8] = bn_mul_words(&(r[0]), a, 8, b[0]); in bn_mul_comba8()
981 r[9] = bn_mul_add_words(&(r[1]), a, 8, b[1]); in bn_mul_comba8()
982 r[10] = bn_mul_add_words(&(r[2]), a, 8, b[2]); in bn_mul_comba8()
983 r[11] = bn_mul_add_words(&(r[3]), a, 8, b[3]); in bn_mul_comba8()
984 r[12] = bn_mul_add_words(&(r[4]), a, 8, b[4]); in bn_mul_comba8()
985 r[13] = bn_mul_add_words(&(r[5]), a, 8, b[5]); in bn_mul_comba8()
986 r[14] = bn_mul_add_words(&(r[6]), a, 8, b[6]); in bn_mul_comba8()
987 r[15] = bn_mul_add_words(&(r[7]), a, 8, b[7]); in bn_mul_comba8()