| @@ -1,18 +1,18 @@ | | | @@ -1,18 +1,18 @@ |
1 | $NetBSD: patch-lib_hcrypto_libtommath_tommath.h,v 1.2 2011/09/15 09:32:32 wiz Exp $ | | 1 | $NetBSD: patch-lib_hcrypto_libtommath_tommath.h,v 1.3 2011/09/15 13:01:14 hans Exp $ |
2 | | | 2 | |
3 | --- /dev/null 1 Jan 1970 00:00:00 -0000 | | 3 | --- lib/hcrypto/libtommath/tommath.h.orig 2011-09-15 09:31:23.190661136 +0200 |
4 | +++ lib/hcrypto/libtommath/tommath.h 29 Oct 2010 01:14:54 -0000 | | 4 | +++ lib/hcrypto/libtommath/tommath.h 2011-09-15 09:32:00.326647970 +0200 |
5 | @@ -0,0 +1,588 @@ | | 5 | @@ -0,0 +1,587 @@ |
6 | +/* LibTomMath, multiple-precision integer library -- Tom St Denis | | 6 | +/* LibTomMath, multiple-precision integer library -- Tom St Denis |
7 | + * | | 7 | + * |
8 | + * LibTomMath is a library that provides multiple-precision | | 8 | + * LibTomMath is a library that provides multiple-precision |
9 | + * integer arithmetic as well as number theoretic functionality. | | 9 | + * integer arithmetic as well as number theoretic functionality. |
10 | + * | | 10 | + * |
11 | + * The library was designed directly after the MPI library by | | 11 | + * The library was designed directly after the MPI library by |
12 | + * Michael Fromberger but has been written from scratch with | | 12 | + * Michael Fromberger but has been written from scratch with |
13 | + * additional optimizations in place. | | 13 | + * additional optimizations in place. |
14 | + * | | 14 | + * |
15 | + * The library is free for all purposes without any express | | 15 | + * The library is free for all purposes without any express |
16 | + * guarantee it works. | | 16 | + * guarantee it works. |
17 | + * | | 17 | + * |
18 | + * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com | | 18 | + * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com |
| @@ -580,1092 +580,13 @@ $NetBSD: patch-lib_hcrypto_libtommath_to | | | @@ -580,1092 +580,13 @@ $NetBSD: patch-lib_hcrypto_libtommath_to |
580 | +int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c); | | 580 | +int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c); |
581 | +int fast_mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp); | | 581 | +int fast_mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp); |
582 | +int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int mode); | | 582 | +int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int mode); |
583 | +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); | | 583 | +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); |
584 | +void bn_reverse(unsigned char *s, int len); | | 584 | +void bn_reverse(unsigned char *s, int len); |
585 | + | | 585 | + |
586 | +extern const char *mp_s_rmap; | | 586 | +extern const char *mp_s_rmap; |
587 | + | | 587 | + |
588 | +#ifdef __cplusplus | | 588 | +#ifdef __cplusplus |
589 | + } | | 589 | + } |
590 | +#endif | | 590 | +#endif |
591 | + | | 591 | + |
592 | +#endif | | 592 | +#endif |
593 | + | | | |
594 | + | | | |
595 | +/* $Source: /home/ryo/public_nerv/netbsd/pkgsrc/cvsroot/pkgsrc/security/heimdal/patches/Attic/patch-lib_hcrypto_libtommath_tommath.h,v $ */ | | | |
596 | +/* $Revision: 1.2 $ */ | | | |
597 | +/* $Date: 2011/09/15 09:32:32 $ */ | | | |
598 | --- /dev/null 1 Jan 1970 00:00:00 -0000 | | | |
599 | +++ lib/hcrypto/libtommath/tommath_class.h 29 Oct 2010 01:14:54 -0000 | | | |
600 | @@ -0,0 +1,1000 @@ | | | |
601 | +#if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) | | | |
602 | +#if defined(LTM2) | | | |
603 | +#define LTM3 | | | |
604 | +#endif | | | |
605 | +#if defined(LTM1) | | | |
606 | +#define LTM2 | | | |
607 | +#endif | | | |
608 | +#define LTM1 | | | |
609 | + | | | |
610 | +#if defined(LTM_ALL) | | | |
611 | +#define BN_ERROR_C | | | |
612 | +#define BN_FAST_MP_INVMOD_C | | | |
613 | +#define BN_FAST_MP_MONTGOMERY_REDUCE_C | | | |
614 | +#define BN_FAST_S_MP_MUL_DIGS_C | | | |
615 | +#define BN_FAST_S_MP_MUL_HIGH_DIGS_C | | | |
616 | +#define BN_FAST_S_MP_SQR_C | | | |
617 | +#define BN_MP_2EXPT_C | | | |
618 | +#define BN_MP_ABS_C | | | |
619 | +#define BN_MP_ADD_C | | | |
620 | +#define BN_MP_ADD_D_C | | | |
621 | +#define BN_MP_ADDMOD_C | | | |
622 | +#define BN_MP_AND_C | | | |
623 | +#define BN_MP_CLAMP_C | | | |
624 | +#define BN_MP_CLEAR_C | | | |
625 | +#define BN_MP_CLEAR_MULTI_C | | | |
626 | +#define BN_MP_CMP_C | | | |
627 | +#define BN_MP_CMP_D_C | | | |
628 | +#define BN_MP_CMP_MAG_C | | | |
629 | +#define BN_MP_CNT_LSB_C | | | |
630 | +#define BN_MP_COPY_C | | | |
631 | +#define BN_MP_COUNT_BITS_C | | | |
632 | +#define BN_MP_DIV_C | | | |
633 | +#define BN_MP_DIV_2_C | | | |
634 | +#define BN_MP_DIV_2D_C | | | |
635 | +#define BN_MP_DIV_3_C | | | |
636 | +#define BN_MP_DIV_D_C | | | |
637 | +#define BN_MP_DR_IS_MODULUS_C | | | |
638 | +#define BN_MP_DR_REDUCE_C | | | |
639 | +#define BN_MP_DR_SETUP_C | | | |
640 | +#define BN_MP_EXCH_C | | | |
641 | +#define BN_MP_EXPT_D_C | | | |
642 | +#define BN_MP_EXPTMOD_C | | | |
643 | +#define BN_MP_EXPTMOD_FAST_C | | | |
644 | +#define BN_MP_EXTEUCLID_C | | | |
645 | +#define BN_MP_FREAD_C | | | |
646 | +#define BN_MP_FWRITE_C | | | |
647 | +#define BN_MP_GCD_C | | | |
648 | +#define BN_MP_GET_INT_C | | | |
649 | +#define BN_MP_GROW_C | | | |
650 | +#define BN_MP_INIT_C | | | |
651 | +#define BN_MP_INIT_COPY_C | | | |
652 | +#define BN_MP_INIT_MULTI_C | | | |
653 | +#define BN_MP_INIT_SET_C | | | |
654 | +#define BN_MP_INIT_SET_INT_C | | | |
655 | +#define BN_MP_INIT_SIZE_C | | | |
656 | +#define BN_MP_INVMOD_C | | | |
657 | +#define BN_MP_INVMOD_SLOW_C | | | |
658 | +#define BN_MP_IS_SQUARE_C | | | |
659 | +#define BN_MP_JACOBI_C | | | |
660 | +#define BN_MP_KARATSUBA_MUL_C | | | |
661 | +#define BN_MP_KARATSUBA_SQR_C | | | |
662 | +#define BN_MP_LCM_C | | | |
663 | +#define BN_MP_LSHD_C | | | |
664 | +#define BN_MP_MOD_C | | | |
665 | +#define BN_MP_MOD_2D_C | | | |
666 | +#define BN_MP_MOD_D_C | | | |
667 | +#define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C | | | |
668 | +#define BN_MP_MONTGOMERY_REDUCE_C | | | |
669 | +#define BN_MP_MONTGOMERY_SETUP_C | | | |
670 | +#define BN_MP_MUL_C | | | |
671 | +#define BN_MP_MUL_2_C | | | |
672 | +#define BN_MP_MUL_2D_C | | | |
673 | +#define BN_MP_MUL_D_C | | | |
674 | +#define BN_MP_MULMOD_C | | | |
675 | +#define BN_MP_N_ROOT_C | | | |
676 | +#define BN_MP_NEG_C | | | |
677 | +#define BN_MP_OR_C | | | |
678 | +#define BN_MP_PRIME_FERMAT_C | | | |
679 | +#define BN_MP_PRIME_IS_DIVISIBLE_C | | | |
680 | +#define BN_MP_PRIME_IS_PRIME_C | | | |
681 | +#define BN_MP_PRIME_MILLER_RABIN_C | | | |
682 | +#define BN_MP_PRIME_NEXT_PRIME_C | | | |
683 | +#define BN_MP_PRIME_RABIN_MILLER_TRIALS_C | | | |
684 | +#define BN_MP_PRIME_RANDOM_EX_C | | | |
685 | +#define BN_MP_RADIX_SIZE_C | | | |
686 | +#define BN_MP_RADIX_SMAP_C | | | |
687 | +#define BN_MP_RAND_C | | | |
688 | +#define BN_MP_READ_RADIX_C | | | |
689 | +#define BN_MP_READ_SIGNED_BIN_C | | | |
690 | +#define BN_MP_READ_UNSIGNED_BIN_C | | | |
691 | +#define BN_MP_REDUCE_C | | | |
692 | +#define BN_MP_REDUCE_2K_C | | | |
693 | +#define BN_MP_REDUCE_2K_L_C | | | |
694 | +#define BN_MP_REDUCE_2K_SETUP_C | | | |
695 | +#define BN_MP_REDUCE_2K_SETUP_L_C | | | |
696 | +#define BN_MP_REDUCE_IS_2K_C | | | |
697 | +#define BN_MP_REDUCE_IS_2K_L_C | | | |
698 | +#define BN_MP_REDUCE_SETUP_C | | | |
699 | +#define BN_MP_RSHD_C | | | |
700 | +#define BN_MP_SET_C | | | |
701 | +#define BN_MP_SET_INT_C | | | |
702 | +#define BN_MP_SHRINK_C | | | |
703 | +#define BN_MP_SIGNED_BIN_SIZE_C | | | |
704 | +#define BN_MP_SQR_C | | | |
705 | +#define BN_MP_SQRMOD_C | | | |
706 | +#define BN_MP_SQRT_C | | | |
707 | +#define BN_MP_SUB_C | | | |
708 | +#define BN_MP_SUB_D_C | | | |
709 | +#define BN_MP_SUBMOD_C | | | |
710 | +#define BN_MP_TO_SIGNED_BIN_C | | | |
711 | +#define BN_MP_TO_SIGNED_BIN_N_C | | | |
712 | +#define BN_MP_TO_UNSIGNED_BIN_C | | | |
713 | +#define BN_MP_TO_UNSIGNED_BIN_N_C | | | |
714 | +#define BN_MP_TOOM_MUL_C | | | |
715 | +#define BN_MP_TOOM_SQR_C | | | |
716 | +#define BN_MP_TORADIX_C | | | |
717 | +#define BN_MP_TORADIX_N_C | | | |
718 | +#define BN_MP_UNSIGNED_BIN_SIZE_C | | | |
719 | +#define BN_MP_XOR_C | | | |
720 | +#define BN_MP_ZERO_C | | | |
721 | +#define BN_MP_ZERO_MULTI_C | | | |
722 | +#define BN_PRIME_TAB_C | | | |
723 | +#define BN_REVERSE_C | | | |
724 | +#define BN_S_MP_ADD_C | | | |
725 | +#define BN_S_MP_EXPTMOD_C | | | |
726 | +#define BN_S_MP_MUL_DIGS_C | | | |
727 | +#define BN_S_MP_MUL_HIGH_DIGS_C | | | |
728 | +#define BN_S_MP_SQR_C | | | |
729 | +#define BN_S_MP_SUB_C | | | |
730 | +#define BNCORE_C | | | |
731 | +#endif | | | |
732 | + | | | |
733 | +#if defined(BN_ERROR_C) | | | |
734 | + #define BN_MP_ERROR_TO_STRING_C | | | |
735 | +#endif | | | |
736 | + | | | |
737 | +#if defined(BN_FAST_MP_INVMOD_C) | | | |
738 | + #define BN_MP_ISEVEN_C | | | |
739 | + #define BN_MP_INIT_MULTI_C | | | |
740 | + #define BN_MP_COPY_C | | | |
741 | + #define BN_MP_MOD_C | | | |
742 | + #define BN_MP_SET_C | | | |
743 | + #define BN_MP_DIV_2_C | | | |
744 | + #define BN_MP_ISODD_C | | | |
745 | + #define BN_MP_SUB_C | | | |
746 | + #define BN_MP_CMP_C | | | |
747 | + #define BN_MP_ISZERO_C | | | |
748 | + #define BN_MP_CMP_D_C | | | |
749 | + #define BN_MP_ADD_C | | | |
750 | + #define BN_MP_EXCH_C | | | |
751 | + #define BN_MP_CLEAR_MULTI_C | | | |
752 | +#endif | | | |
753 | + | | | |
754 | +#if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C) | | | |
755 | + #define BN_MP_GROW_C | | | |
756 | + #define BN_MP_RSHD_C | | | |
757 | + #define BN_MP_CLAMP_C | | | |
758 | + #define BN_MP_CMP_MAG_C | | | |
759 | + #define BN_S_MP_SUB_C | | | |
760 | +#endif | | | |
761 | + | | | |
762 | +#if defined(BN_FAST_S_MP_MUL_DIGS_C) | | | |
763 | + #define BN_MP_GROW_C | | | |
764 | + #define BN_MP_CLAMP_C | | | |
765 | +#endif | | | |
766 | + | | | |
767 | +#if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C) | | | |
768 | + #define BN_MP_GROW_C | | | |
769 | + #define BN_MP_CLAMP_C | | | |
770 | +#endif | | | |
771 | + | | | |
772 | +#if defined(BN_FAST_S_MP_SQR_C) | | | |
773 | + #define BN_MP_GROW_C | | | |
774 | + #define BN_MP_CLAMP_C | | | |
775 | +#endif | | | |
776 | + | | | |
777 | +#if defined(BN_MP_2EXPT_C) | | | |
778 | + #define BN_MP_ZERO_C | | | |
779 | + #define BN_MP_GROW_C | | | |
780 | +#endif | | | |
781 | + | | | |
782 | +#if defined(BN_MP_ABS_C) | | | |
783 | + #define BN_MP_COPY_C | | | |
784 | +#endif | | | |
785 | + | | | |
786 | +#if defined(BN_MP_ADD_C) | | | |
787 | + #define BN_S_MP_ADD_C | | | |
788 | + #define BN_MP_CMP_MAG_C | | | |
789 | + #define BN_S_MP_SUB_C | | | |
790 | +#endif | | | |
791 | + | | | |
792 | +#if defined(BN_MP_ADD_D_C) | | | |
793 | + #define BN_MP_GROW_C | | | |
794 | + #define BN_MP_SUB_D_C | | | |
795 | + #define BN_MP_CLAMP_C | | | |
796 | +#endif | | | |
797 | + | | | |
798 | +#if defined(BN_MP_ADDMOD_C) | | | |
799 | + #define BN_MP_INIT_C | | | |
800 | + #define BN_MP_ADD_C | | | |
801 | + #define BN_MP_CLEAR_C | | | |
802 | + #define BN_MP_MOD_C | | | |
803 | +#endif | | | |
804 | + | | | |
805 | +#if defined(BN_MP_AND_C) | | | |
806 | + #define BN_MP_INIT_COPY_C | | | |
807 | + #define BN_MP_CLAMP_C | | | |
808 | + #define BN_MP_EXCH_C | | | |
809 | + #define BN_MP_CLEAR_C | | | |
810 | +#endif | | | |
811 | + | | | |
812 | +#if defined(BN_MP_CLAMP_C) | | | |
813 | +#endif | | | |
814 | + | | | |
815 | +#if defined(BN_MP_CLEAR_C) | | | |
816 | +#endif | | | |
817 | + | | | |
818 | +#if defined(BN_MP_CLEAR_MULTI_C) | | | |
819 | + #define BN_MP_CLEAR_C | | | |
820 | +#endif | | | |
821 | + | | | |
822 | +#if defined(BN_MP_CMP_C) | | | |
823 | + #define BN_MP_CMP_MAG_C | | | |
824 | +#endif | | | |
825 | + | | | |
826 | +#if defined(BN_MP_CMP_D_C) | | | |
827 | +#endif | | | |
828 | + | | | |
829 | +#if defined(BN_MP_CMP_MAG_C) | | | |
830 | +#endif | | | |
831 | + | | | |
832 | +#if defined(BN_MP_CNT_LSB_C) | | | |
833 | + #define BN_MP_ISZERO_C | | | |
834 | +#endif | | | |
835 | + | | | |
836 | +#if defined(BN_MP_COPY_C) | | | |
837 | + #define BN_MP_GROW_C | | | |
838 | +#endif | | | |
839 | + | | | |
840 | +#if defined(BN_MP_COUNT_BITS_C) | | | |
841 | +#endif | | | |
842 | + | | | |
843 | +#if defined(BN_MP_DIV_C) | | | |
844 | + #define BN_MP_ISZERO_C | | | |
845 | + #define BN_MP_CMP_MAG_C | | | |
846 | + #define BN_MP_COPY_C | | | |
847 | + #define BN_MP_ZERO_C | | | |
848 | + #define BN_MP_INIT_MULTI_C | | | |
849 | + #define BN_MP_SET_C | | | |
850 | + #define BN_MP_COUNT_BITS_C | | | |
851 | + #define BN_MP_ABS_C | | | |
852 | + #define BN_MP_MUL_2D_C | | | |
853 | + #define BN_MP_CMP_C | | | |
854 | + #define BN_MP_SUB_C | | | |
855 | + #define BN_MP_ADD_C | | | |
856 | + #define BN_MP_DIV_2D_C | | | |
857 | + #define BN_MP_EXCH_C | | | |
858 | + #define BN_MP_CLEAR_MULTI_C | | | |
859 | + #define BN_MP_INIT_SIZE_C | | | |
860 | + #define BN_MP_INIT_C | | | |
861 | + #define BN_MP_INIT_COPY_C | | | |
862 | + #define BN_MP_LSHD_C | | | |
863 | + #define BN_MP_RSHD_C | | | |
864 | + #define BN_MP_MUL_D_C | | | |
865 | + #define BN_MP_CLAMP_C | | | |
866 | + #define BN_MP_CLEAR_C | | | |
867 | +#endif | | | |
868 | + | | | |
869 | +#if defined(BN_MP_DIV_2_C) | | | |
870 | + #define BN_MP_GROW_C | | | |
871 | + #define BN_MP_CLAMP_C | | | |
872 | +#endif | | | |
873 | + | | | |
874 | +#if defined(BN_MP_DIV_2D_C) | | | |
875 | + #define BN_MP_COPY_C | | | |
876 | + #define BN_MP_ZERO_C | | | |
877 | + #define BN_MP_INIT_C | | | |
878 | + #define BN_MP_MOD_2D_C | | | |
879 | + #define BN_MP_CLEAR_C | | | |
880 | + #define BN_MP_RSHD_C | | | |
881 | + #define BN_MP_CLAMP_C | | | |
882 | + #define BN_MP_EXCH_C | | | |
883 | +#endif | | | |
884 | + | | | |
885 | +#if defined(BN_MP_DIV_3_C) | | | |
886 | + #define BN_MP_INIT_SIZE_C | | | |
887 | + #define BN_MP_CLAMP_C | | | |
888 | + #define BN_MP_EXCH_C | | | |
889 | + #define BN_MP_CLEAR_C | | | |
890 | +#endif | | | |
891 | + | | | |
892 | +#if defined(BN_MP_DIV_D_C) | | | |
893 | + #define BN_MP_ISZERO_C | | | |
894 | + #define BN_MP_COPY_C | | | |
895 | + #define BN_MP_DIV_2D_C | | | |
896 | + #define BN_MP_DIV_3_C | | | |
897 | + #define BN_MP_INIT_SIZE_C | | | |
898 | + #define BN_MP_CLAMP_C | | | |
899 | + #define BN_MP_EXCH_C | | | |
900 | + #define BN_MP_CLEAR_C | | | |
901 | +#endif | | | |
902 | + | | | |
903 | +#if defined(BN_MP_DR_IS_MODULUS_C) | | | |
904 | +#endif | | | |
905 | + | | | |
906 | +#if defined(BN_MP_DR_REDUCE_C) | | | |
907 | + #define BN_MP_GROW_C | | | |
908 | + #define BN_MP_CLAMP_C | | | |
909 | + #define BN_MP_CMP_MAG_C | | | |
910 | + #define BN_S_MP_SUB_C | | | |
911 | +#endif | | | |
912 | + | | | |
913 | +#if defined(BN_MP_DR_SETUP_C) | | | |
914 | +#endif | | | |
915 | + | | | |
916 | +#if defined(BN_MP_EXCH_C) | | | |
917 | +#endif | | | |
918 | + | | | |
919 | +#if defined(BN_MP_EXPT_D_C) | | | |
920 | + #define BN_MP_INIT_COPY_C | | | |
921 | + #define BN_MP_SET_C | | | |
922 | + #define BN_MP_SQR_C | | | |
923 | + #define BN_MP_CLEAR_C | | | |
924 | + #define BN_MP_MUL_C | | | |
925 | +#endif | | | |
926 | + | | | |
927 | +#if defined(BN_MP_EXPTMOD_C) | | | |
928 | + #define BN_MP_INIT_C | | | |
929 | + #define BN_MP_INVMOD_C | | | |
930 | + #define BN_MP_CLEAR_C | | | |
931 | + #define BN_MP_ABS_C | | | |
932 | + #define BN_MP_CLEAR_MULTI_C | | | |
933 | + #define BN_MP_REDUCE_IS_2K_L_C | | | |
934 | + #define BN_S_MP_EXPTMOD_C | | | |
935 | + #define BN_MP_DR_IS_MODULUS_C | | | |
936 | + #define BN_MP_REDUCE_IS_2K_C | | | |
937 | + #define BN_MP_ISODD_C | | | |
938 | + #define BN_MP_EXPTMOD_FAST_C | | | |
939 | +#endif | | | |
940 | + | | | |
941 | +#if defined(BN_MP_EXPTMOD_FAST_C) | | | |
942 | + #define BN_MP_COUNT_BITS_C | | | |
943 | + #define BN_MP_INIT_C | | | |
944 | + #define BN_MP_CLEAR_C | | | |
945 | + #define BN_MP_MONTGOMERY_SETUP_C | | | |
946 | + #define BN_FAST_MP_MONTGOMERY_REDUCE_C | | | |
947 | + #define BN_MP_MONTGOMERY_REDUCE_C | | | |
948 | + #define BN_MP_DR_SETUP_C | | | |
949 | + #define BN_MP_DR_REDUCE_C | | | |
950 | + #define BN_MP_REDUCE_2K_SETUP_C | | | |
951 | + #define BN_MP_REDUCE_2K_C | | | |
952 | + #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C | | | |
953 | + #define BN_MP_MULMOD_C | | | |
954 | + #define BN_MP_SET_C | | | |
955 | + #define BN_MP_MOD_C | | | |
956 | + #define BN_MP_COPY_C | | | |
957 | + #define BN_MP_SQR_C | | | |
958 | + #define BN_MP_MUL_C | | | |
959 | + #define BN_MP_EXCH_C | | | |
960 | +#endif | | | |
961 | + | | | |
962 | +#if defined(BN_MP_EXTEUCLID_C) | | | |
963 | + #define BN_MP_INIT_MULTI_C | | | |
964 | + #define BN_MP_SET_C | | | |
965 | + #define BN_MP_COPY_C | | | |
966 | + #define BN_MP_ISZERO_C | | | |
967 | + #define BN_MP_DIV_C | | | |
968 | + #define BN_MP_MUL_C | | | |
969 | + #define BN_MP_SUB_C | | | |
970 | + #define BN_MP_NEG_C | | | |
971 | + #define BN_MP_EXCH_C | | | |
972 | + #define BN_MP_CLEAR_MULTI_C | | | |
973 | +#endif | | | |
974 | + | | | |
975 | +#if defined(BN_MP_FREAD_C) | | | |
976 | + #define BN_MP_ZERO_C | | | |
977 | + #define BN_MP_S_RMAP_C | | | |
978 | + #define BN_MP_MUL_D_C | | | |
979 | + #define BN_MP_ADD_D_C | | | |
980 | + #define BN_MP_CMP_D_C | | | |
981 | +#endif | | | |
982 | + | | | |
983 | +#if defined(BN_MP_FWRITE_C) | | | |
984 | + #define BN_MP_RADIX_SIZE_C | | | |
985 | + #define BN_MP_TORADIX_C | | | |
986 | +#endif | | | |
987 | + | | | |
988 | +#if defined(BN_MP_GCD_C) | | | |
989 | + #define BN_MP_ISZERO_C | | | |
990 | + #define BN_MP_ABS_C | | | |
991 | + #define BN_MP_ZERO_C | | | |
992 | + #define BN_MP_INIT_COPY_C | | | |
993 | + #define BN_MP_CNT_LSB_C | | | |
994 | + #define BN_MP_DIV_2D_C | | | |
995 | + #define BN_MP_CMP_MAG_C | | | |
996 | + #define BN_MP_EXCH_C | | | |
997 | + #define BN_S_MP_SUB_C | | | |
998 | + #define BN_MP_MUL_2D_C | | | |
999 | + #define BN_MP_CLEAR_C | | | |
1000 | +#endif | | | |
1001 | + | | | |
1002 | +#if defined(BN_MP_GET_INT_C) | | | |
1003 | +#endif | | | |
1004 | + | | | |
1005 | +#if defined(BN_MP_GROW_C) | | | |
1006 | +#endif | | | |
1007 | + | | | |
1008 | +#if defined(BN_MP_INIT_C) | | | |
1009 | +#endif | | | |
1010 | + | | | |
1011 | +#if defined(BN_MP_INIT_COPY_C) | | | |
1012 | + #define BN_MP_COPY_C | | | |
1013 | +#endif | | | |
1014 | + | | | |
1015 | +#if defined(BN_MP_INIT_MULTI_C) | | | |
1016 | + #define BN_MP_ERR_C | | | |
1017 | + #define BN_MP_INIT_C | | | |
1018 | + #define BN_MP_CLEAR_C | | | |
1019 | +#endif | | | |
1020 | + | | | |
1021 | +#if defined(BN_MP_INIT_SET_C) | | | |
1022 | + #define BN_MP_INIT_C | | | |
1023 | + #define BN_MP_SET_C | | | |
1024 | +#endif | | | |
1025 | + | | | |
1026 | +#if defined(BN_MP_INIT_SET_INT_C) | | | |
1027 | + #define BN_MP_INIT_C | | | |
1028 | + #define BN_MP_SET_INT_C | | | |
1029 | +#endif | | | |
1030 | + | | | |
1031 | +#if defined(BN_MP_INIT_SIZE_C) | | | |
1032 | + #define BN_MP_INIT_C | | | |
1033 | +#endif | | | |
1034 | + | | | |
1035 | +#if defined(BN_MP_INVMOD_C) | | | |
1036 | + #define BN_MP_ISZERO_C | | | |
1037 | + #define BN_MP_ISODD_C | | | |
1038 | + #define BN_FAST_MP_INVMOD_C | | | |
1039 | + #define BN_MP_INVMOD_SLOW_C | | | |
1040 | +#endif | | | |
1041 | + | | | |
1042 | +#if defined(BN_MP_INVMOD_SLOW_C) | | | |
1043 | + #define BN_MP_ISZERO_C | | | |
1044 | + #define BN_MP_INIT_MULTI_C | | | |
1045 | + #define BN_MP_MOD_C | | | |
1046 | + #define BN_MP_COPY_C | | | |
1047 | + #define BN_MP_ISEVEN_C | | | |
1048 | + #define BN_MP_SET_C | | | |
1049 | + #define BN_MP_DIV_2_C | | | |
1050 | + #define BN_MP_ISODD_C | | | |
1051 | + #define BN_MP_ADD_C | | | |
1052 | + #define BN_MP_SUB_C | | | |
1053 | + #define BN_MP_CMP_C | | | |
1054 | + #define BN_MP_CMP_D_C | | | |
1055 | + #define BN_MP_CMP_MAG_C | | | |
1056 | + #define BN_MP_EXCH_C | | | |
1057 | + #define BN_MP_CLEAR_MULTI_C | | | |
1058 | +#endif | | | |
1059 | + | | | |
1060 | +#if defined(BN_MP_IS_SQUARE_C) | | | |
1061 | + #define BN_MP_MOD_D_C | | | |
1062 | + #define BN_MP_INIT_SET_INT_C | | | |
1063 | + #define BN_MP_MOD_C | | | |
1064 | + #define BN_MP_GET_INT_C | | | |
1065 | + #define BN_MP_SQRT_C | | | |
1066 | + #define BN_MP_SQR_C | | | |
1067 | + #define BN_MP_CMP_MAG_C | | | |
1068 | + #define BN_MP_CLEAR_C | | | |
1069 | +#endif | | | |
1070 | + | | | |
1071 | +#if defined(BN_MP_JACOBI_C) | | | |
1072 | + #define BN_MP_CMP_D_C | | | |
1073 | + #define BN_MP_ISZERO_C | | | |
1074 | + #define BN_MP_INIT_COPY_C | | | |
1075 | + #define BN_MP_CNT_LSB_C | | | |
1076 | + #define BN_MP_DIV_2D_C | | | |
1077 | + #define BN_MP_MOD_C | | | |
1078 | + #define BN_MP_CLEAR_C | | | |
1079 | +#endif | | | |
1080 | + | | | |
1081 | +#if defined(BN_MP_KARATSUBA_MUL_C) | | | |
1082 | + #define BN_MP_MUL_C | | | |
1083 | + #define BN_MP_INIT_SIZE_C | | | |
1084 | + #define BN_MP_CLAMP_C | | | |
1085 | + #define BN_MP_SUB_C | | | |
1086 | + #define BN_MP_ADD_C | | | |
1087 | + #define BN_MP_LSHD_C | | | |
1088 | + #define BN_MP_CLEAR_C | | | |
1089 | +#endif | | | |
1090 | + | | | |
1091 | +#if defined(BN_MP_KARATSUBA_SQR_C) | | | |
1092 | + #define BN_MP_INIT_SIZE_C | | | |
1093 | + #define BN_MP_CLAMP_C | | | |
1094 | + #define BN_MP_SQR_C | | | |
1095 | + #define BN_MP_SUB_C | | | |
1096 | + #define BN_S_MP_ADD_C | | | |
1097 | + #define BN_MP_LSHD_C | | | |
1098 | + #define BN_MP_ADD_C | | | |
1099 | + #define BN_MP_CLEAR_C | | | |
1100 | +#endif | | | |
1101 | + | | | |
1102 | +#if defined(BN_MP_LCM_C) | | | |
1103 | + #define BN_MP_INIT_MULTI_C | | | |
1104 | + #define BN_MP_GCD_C | | | |
1105 | + #define BN_MP_CMP_MAG_C | | | |
1106 | + #define BN_MP_DIV_C | | | |
1107 | + #define BN_MP_MUL_C | | | |
1108 | + #define BN_MP_CLEAR_MULTI_C | | | |
1109 | +#endif | | | |
1110 | + | | | |
1111 | +#if defined(BN_MP_LSHD_C) | | | |
1112 | + #define BN_MP_GROW_C | | | |
1113 | + #define BN_MP_RSHD_C | | | |
1114 | +#endif | | | |
1115 | + | | | |
1116 | +#if defined(BN_MP_MOD_C) | | | |
1117 | + #define BN_MP_INIT_C | | | |
1118 | + #define BN_MP_DIV_C | | | |
1119 | + #define BN_MP_CLEAR_C | | | |
1120 | + #define BN_MP_ADD_C | | | |
1121 | + #define BN_MP_EXCH_C | | | |
1122 | +#endif | | | |
1123 | + | | | |
1124 | +#if defined(BN_MP_MOD_2D_C) | | | |
1125 | + #define BN_MP_ZERO_C | | | |
1126 | + #define BN_MP_COPY_C | | | |
1127 | + #define BN_MP_CLAMP_C | | | |
1128 | +#endif | | | |
1129 | + | | | |
1130 | +#if defined(BN_MP_MOD_D_C) | | | |
1131 | + #define BN_MP_DIV_D_C | | | |
1132 | +#endif | | | |
1133 | + | | | |
1134 | +#if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C) | | | |
1135 | + #define BN_MP_COUNT_BITS_C | | | |
1136 | + #define BN_MP_2EXPT_C | | | |
1137 | + #define BN_MP_SET_C | | | |
1138 | + #define BN_MP_MUL_2_C | | | |
1139 | + #define BN_MP_CMP_MAG_C | | | |
1140 | + #define BN_S_MP_SUB_C | | | |
1141 | +#endif | | | |
1142 | + | | | |
1143 | +#if defined(BN_MP_MONTGOMERY_REDUCE_C) | | | |
1144 | + #define BN_FAST_MP_MONTGOMERY_REDUCE_C | | | |
1145 | + #define BN_MP_GROW_C | | | |
1146 | + #define BN_MP_CLAMP_C | | | |
1147 | + #define BN_MP_RSHD_C | | | |
1148 | + #define BN_MP_CMP_MAG_C | | | |
1149 | + #define BN_S_MP_SUB_C | | | |
1150 | +#endif | | | |
1151 | + | | | |
1152 | +#if defined(BN_MP_MONTGOMERY_SETUP_C) | | | |
1153 | +#endif | | | |
1154 | + | | | |
1155 | +#if defined(BN_MP_MUL_C) | | | |
1156 | + #define BN_MP_TOOM_MUL_C | | | |
1157 | + #define BN_MP_KARATSUBA_MUL_C | | | |
1158 | + #define BN_FAST_S_MP_MUL_DIGS_C | | | |
1159 | + #define BN_S_MP_MUL_C | | | |
1160 | + #define BN_S_MP_MUL_DIGS_C | | | |
1161 | +#endif | | | |
1162 | + | | | |
1163 | +#if defined(BN_MP_MUL_2_C) | | | |
1164 | + #define BN_MP_GROW_C | | | |
1165 | +#endif | | | |
1166 | + | | | |
1167 | +#if defined(BN_MP_MUL_2D_C) | | | |
1168 | + #define BN_MP_COPY_C | | | |
1169 | + #define BN_MP_GROW_C | | | |
1170 | + #define BN_MP_LSHD_C | | | |
1171 | + #define BN_MP_CLAMP_C | | | |
1172 | +#endif | | | |
1173 | + | | | |
1174 | +#if defined(BN_MP_MUL_D_C) | | | |
1175 | + #define BN_MP_GROW_C | | | |
1176 | + #define BN_MP_CLAMP_C | | | |
1177 | +#endif | | | |
1178 | + | | | |
1179 | +#if defined(BN_MP_MULMOD_C) | | | |
1180 | + #define BN_MP_INIT_C | | | |
1181 | + #define BN_MP_MUL_C | | | |
1182 | + #define BN_MP_CLEAR_C | | | |
1183 | + #define BN_MP_MOD_C | | | |
1184 | +#endif | | | |
1185 | + | | | |
1186 | +#if defined(BN_MP_N_ROOT_C) | | | |
1187 | + #define BN_MP_INIT_C | | | |
1188 | + #define BN_MP_SET_C | | | |
1189 | + #define BN_MP_COPY_C | | | |
1190 | + #define BN_MP_EXPT_D_C | | | |
1191 | + #define BN_MP_MUL_C | | | |
1192 | + #define BN_MP_SUB_C | | | |
1193 | + #define BN_MP_MUL_D_C | | | |
1194 | + #define BN_MP_DIV_C | | | |
1195 | + #define BN_MP_CMP_C | | | |
1196 | + #define BN_MP_SUB_D_C | | | |
1197 | + #define BN_MP_EXCH_C | | | |
1198 | + #define BN_MP_CLEAR_C | | | |
1199 | +#endif | | | |
1200 | + | | | |
1201 | +#if defined(BN_MP_NEG_C) | | | |
1202 | + #define BN_MP_COPY_C | | | |
1203 | + #define BN_MP_ISZERO_C | | | |
1204 | +#endif | | | |
1205 | + | | | |
1206 | +#if defined(BN_MP_OR_C) | | | |
1207 | + #define BN_MP_INIT_COPY_C | | | |
1208 | + #define BN_MP_CLAMP_C | | | |
1209 | + #define BN_MP_EXCH_C | | | |
1210 | + #define BN_MP_CLEAR_C | | | |
1211 | +#endif | | | |
1212 | + | | | |
1213 | +#if defined(BN_MP_PRIME_FERMAT_C) | | | |
1214 | + #define BN_MP_CMP_D_C | | | |
1215 | + #define BN_MP_INIT_C | | | |
1216 | + #define BN_MP_EXPTMOD_C | | | |
1217 | + #define BN_MP_CMP_C | | | |
1218 | + #define BN_MP_CLEAR_C | | | |
1219 | +#endif | | | |
1220 | + | | | |
1221 | +#if defined(BN_MP_PRIME_IS_DIVISIBLE_C) | | | |
1222 | + #define BN_MP_MOD_D_C | | | |
1223 | +#endif | | | |
1224 | + | | | |
1225 | +#if defined(BN_MP_PRIME_IS_PRIME_C) | | | |
1226 | + #define BN_MP_CMP_D_C | | | |
1227 | + #define BN_MP_PRIME_IS_DIVISIBLE_C | | | |
1228 | + #define BN_MP_INIT_C | | | |
1229 | + #define BN_MP_SET_C | | | |
1230 | + #define BN_MP_PRIME_MILLER_RABIN_C | | | |
1231 | + #define BN_MP_CLEAR_C | | | |
1232 | +#endif | | | |
1233 | + | | | |
1234 | +#if defined(BN_MP_PRIME_MILLER_RABIN_C) | | | |
1235 | + #define BN_MP_CMP_D_C | | | |
1236 | + #define BN_MP_INIT_COPY_C | | | |
1237 | + #define BN_MP_SUB_D_C | | | |
1238 | + #define BN_MP_CNT_LSB_C | | | |
1239 | + #define BN_MP_DIV_2D_C | | | |
1240 | + #define BN_MP_EXPTMOD_C | | | |
1241 | + #define BN_MP_CMP_C | | | |
1242 | + #define BN_MP_SQRMOD_C | | | |
1243 | + #define BN_MP_CLEAR_C | | | |
1244 | +#endif | | | |
1245 | + | | | |
1246 | +#if defined(BN_MP_PRIME_NEXT_PRIME_C) | | | |
1247 | + #define BN_MP_CMP_D_C | | | |
1248 | + #define BN_MP_SET_C | | | |
1249 | + #define BN_MP_SUB_D_C | | | |
1250 | + #define BN_MP_ISEVEN_C | | | |
1251 | + #define BN_MP_MOD_D_C | | | |
1252 | + #define BN_MP_INIT_C | | | |
1253 | + #define BN_MP_ADD_D_C | | | |
1254 | + #define BN_MP_PRIME_MILLER_RABIN_C | | | |
1255 | + #define BN_MP_CLEAR_C | | | |
1256 | +#endif | | | |
1257 | + | | | |
1258 | +#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C) | | | |
1259 | +#endif | | | |
1260 | + | | | |
1261 | +#if defined(BN_MP_PRIME_RANDOM_EX_C) | | | |
1262 | + #define BN_MP_READ_UNSIGNED_BIN_C | | | |
1263 | + #define BN_MP_PRIME_IS_PRIME_C | | | |
1264 | + #define BN_MP_SUB_D_C | | | |
1265 | + #define BN_MP_DIV_2_C | | | |
1266 | + #define BN_MP_MUL_2_C | | | |
1267 | + #define BN_MP_ADD_D_C | | | |
1268 | +#endif | | | |
1269 | + | | | |
1270 | +#if defined(BN_MP_RADIX_SIZE_C) | | | |
1271 | + #define BN_MP_COUNT_BITS_C | | | |
1272 | + #define BN_MP_INIT_COPY_C | | | |
1273 | + #define BN_MP_ISZERO_C | | | |
1274 | + #define BN_MP_DIV_D_C | | | |
1275 | + #define BN_MP_CLEAR_C | | | |
1276 | +#endif | | | |
1277 | + | | | |
1278 | +#if defined(BN_MP_RADIX_SMAP_C) | | | |
1279 | + #define BN_MP_S_RMAP_C | | | |
1280 | +#endif | | | |
1281 | + | | | |
1282 | +#if defined(BN_MP_RAND_C) | | | |
1283 | + #define BN_MP_ZERO_C | | | |
1284 | + #define BN_MP_ADD_D_C | | | |
1285 | + #define BN_MP_LSHD_C | | | |
1286 | +#endif | | | |
1287 | + | | | |
1288 | +#if defined(BN_MP_READ_RADIX_C) | | | |
1289 | + #define BN_MP_ZERO_C | | | |
1290 | + #define BN_MP_S_RMAP_C | | | |
1291 | + #define BN_MP_RADIX_SMAP_C | | | |
1292 | + #define BN_MP_MUL_D_C | | | |
1293 | + #define BN_MP_ADD_D_C | | | |
1294 | + #define BN_MP_ISZERO_C | | | |
1295 | +#endif | | | |
1296 | + | | | |
1297 | +#if defined(BN_MP_READ_SIGNED_BIN_C) | | | |
1298 | + #define BN_MP_READ_UNSIGNED_BIN_C | | | |
1299 | +#endif | | | |
1300 | + | | | |
1301 | +#if defined(BN_MP_READ_UNSIGNED_BIN_C) | | | |
1302 | + #define BN_MP_GROW_C | | | |
1303 | + #define BN_MP_ZERO_C | | | |
1304 | + #define BN_MP_MUL_2D_C | | | |
1305 | + #define BN_MP_CLAMP_C | | | |
1306 | +#endif | | | |
1307 | + | | | |
1308 | +#if defined(BN_MP_REDUCE_C) | | | |
1309 | + #define BN_MP_REDUCE_SETUP_C | | | |
1310 | + #define BN_MP_INIT_COPY_C | | | |
1311 | + #define BN_MP_RSHD_C | | | |
1312 | + #define BN_MP_MUL_C | | | |
1313 | + #define BN_S_MP_MUL_HIGH_DIGS_C | | | |
1314 | + #define BN_FAST_S_MP_MUL_HIGH_DIGS_C | | | |
1315 | + #define BN_MP_MOD_2D_C | | | |
1316 | + #define BN_S_MP_MUL_DIGS_C | | | |
1317 | + #define BN_MP_SUB_C | | | |
1318 | + #define BN_MP_CMP_D_C | | | |
1319 | + #define BN_MP_SET_C | | | |
1320 | + #define BN_MP_LSHD_C | | | |
1321 | + #define BN_MP_ADD_C | | | |
1322 | + #define BN_MP_CMP_C | | | |
1323 | + #define BN_S_MP_SUB_C | | | |
1324 | + #define BN_MP_CLEAR_C | | | |
1325 | +#endif | | | |
1326 | + | | | |
1327 | +#if defined(BN_MP_REDUCE_2K_C) | | | |
1328 | + #define BN_MP_INIT_C | | | |
1329 | + #define BN_MP_COUNT_BITS_C | | | |
1330 | + #define BN_MP_DIV_2D_C | | | |
1331 | + #define BN_MP_MUL_D_C | | | |
1332 | + #define BN_S_MP_ADD_C | | | |
1333 | + #define BN_MP_CMP_MAG_C | | | |
1334 | + #define BN_S_MP_SUB_C | | | |
1335 | + #define BN_MP_CLEAR_C | | | |
1336 | +#endif | | | |
1337 | + | | | |
1338 | +#if defined(BN_MP_REDUCE_2K_L_C) | | | |
1339 | + #define BN_MP_INIT_C | | | |
1340 | + #define BN_MP_COUNT_BITS_C | | | |
1341 | + #define BN_MP_DIV_2D_C | | | |
1342 | + #define BN_MP_MUL_C | | | |
1343 | + #define BN_S_MP_ADD_C | | | |
1344 | + #define BN_MP_CMP_MAG_C | | | |
1345 | + #define BN_S_MP_SUB_C | | | |
1346 | + #define BN_MP_CLEAR_C | | | |
1347 | +#endif | | | |
1348 | + | | | |
1349 | +#if defined(BN_MP_REDUCE_2K_SETUP_C) | | | |
1350 | + #define BN_MP_INIT_C | | | |
1351 | + #define BN_MP_COUNT_BITS_C | | | |
1352 | + #define BN_MP_2EXPT_C | | | |
1353 | + #define BN_MP_CLEAR_C | | | |
1354 | + #define BN_S_MP_SUB_C | | | |
1355 | +#endif | | | |
1356 | + | | | |
1357 | +#if defined(BN_MP_REDUCE_2K_SETUP_L_C) | | | |
1358 | + #define BN_MP_INIT_C | | | |
1359 | + #define BN_MP_2EXPT_C | | | |
1360 | + #define BN_MP_COUNT_BITS_C | | | |
1361 | + #define BN_S_MP_SUB_C | | | |
1362 | + #define BN_MP_CLEAR_C | | | |
1363 | +#endif | | | |
1364 | + | | | |
1365 | +#if defined(BN_MP_REDUCE_IS_2K_C) | | | |
1366 | + #define BN_MP_REDUCE_2K_C | | | |
1367 | + #define BN_MP_COUNT_BITS_C | | | |
1368 | +#endif | | | |
1369 | + | | | |
1370 | +#if defined(BN_MP_REDUCE_IS_2K_L_C) | | | |
1371 | +#endif | | | |
1372 | + | | | |
1373 | +#if defined(BN_MP_REDUCE_SETUP_C) | | | |
1374 | + #define BN_MP_2EXPT_C | | | |
1375 | + #define BN_MP_DIV_C | | | |
1376 | +#endif | | | |
1377 | + | | | |
1378 | +#if defined(BN_MP_RSHD_C) | | | |
1379 | + #define BN_MP_ZERO_C | | | |
1380 | +#endif | | | |
1381 | + | | | |
1382 | +#if defined(BN_MP_SET_C) | | | |
1383 | + #define BN_MP_ZERO_C | | | |
1384 | +#endif | | | |
1385 | + | | | |
1386 | +#if defined(BN_MP_SET_INT_C) | | | |
1387 | + #define BN_MP_ZERO_C | | | |
1388 | + #define BN_MP_MUL_2D_C | | | |
1389 | + #define BN_MP_CLAMP_C | | | |
1390 | +#endif | | | |
1391 | + | | | |
1392 | +#if defined(BN_MP_SHRINK_C) | | | |
1393 | +#endif | | | |
1394 | + | | | |
1395 | +#if defined(BN_MP_SIGNED_BIN_SIZE_C) | | | |
1396 | + #define BN_MP_UNSIGNED_BIN_SIZE_C | | | |
1397 | +#endif | | | |
1398 | + | | | |
1399 | +#if defined(BN_MP_SQR_C) | | | |
1400 | + #define BN_MP_TOOM_SQR_C | | | |
1401 | + #define BN_MP_KARATSUBA_SQR_C | | | |
1402 | + #define BN_FAST_S_MP_SQR_C | | | |
1403 | + #define BN_S_MP_SQR_C | | | |
1404 | +#endif | | | |
1405 | + | | | |
1406 | +#if defined(BN_MP_SQRMOD_C) | | | |
1407 | + #define BN_MP_INIT_C | | | |
1408 | + #define BN_MP_SQR_C | | | |
1409 | + #define BN_MP_CLEAR_C | | | |
1410 | + #define BN_MP_MOD_C | | | |
1411 | +#endif | | | |
1412 | + | | | |
1413 | +#if defined(BN_MP_SQRT_C) | | | |
1414 | + #define BN_MP_N_ROOT_C | | | |
1415 | + #define BN_MP_ISZERO_C | | | |
1416 | + #define BN_MP_ZERO_C | | | |
1417 | + #define BN_MP_INIT_COPY_C | | | |
1418 | + #define BN_MP_RSHD_C | | | |
1419 | + #define BN_MP_DIV_C | | | |
1420 | + #define BN_MP_ADD_C | | | |
1421 | + #define BN_MP_DIV_2_C | | | |
1422 | + #define BN_MP_CMP_MAG_C | | | |
1423 | + #define BN_MP_EXCH_C | | | |
1424 | + #define BN_MP_CLEAR_C | | | |
1425 | +#endif | | | |
1426 | + | | | |
1427 | +#if defined(BN_MP_SUB_C) | | | |
1428 | + #define BN_S_MP_ADD_C | | | |
1429 | + #define BN_MP_CMP_MAG_C | | | |
1430 | + #define BN_S_MP_SUB_C | | | |
1431 | +#endif | | | |
1432 | + | | | |
1433 | +#if defined(BN_MP_SUB_D_C) | | | |
1434 | + #define BN_MP_GROW_C | | | |
1435 | + #define BN_MP_ADD_D_C | | | |
1436 | + #define BN_MP_CLAMP_C | | | |
1437 | +#endif | | | |
1438 | + | | | |
1439 | +#if defined(BN_MP_SUBMOD_C) | | | |
1440 | + #define BN_MP_INIT_C | | | |
1441 | + #define BN_MP_SUB_C | | | |
1442 | + #define BN_MP_CLEAR_C | | | |
1443 | + #define BN_MP_MOD_C | | | |
1444 | +#endif | | | |
1445 | + | | | |
1446 | +#if defined(BN_MP_TO_SIGNED_BIN_C) | | | |
1447 | + #define BN_MP_TO_UNSIGNED_BIN_C | | | |
1448 | +#endif | | | |
1449 | + | | | |
1450 | +#if defined(BN_MP_TO_SIGNED_BIN_N_C) | | | |
1451 | + #define BN_MP_SIGNED_BIN_SIZE_C | | | |
1452 | + #define BN_MP_TO_SIGNED_BIN_C | | | |
1453 | +#endif | | | |
1454 | + | | | |
1455 | +#if defined(BN_MP_TO_UNSIGNED_BIN_C) | | | |
1456 | + #define BN_MP_INIT_COPY_C | | | |
1457 | + #define BN_MP_ISZERO_C | | | |
1458 | + #define BN_MP_DIV_2D_C | | | |
1459 | + #define BN_MP_CLEAR_C | | | |
1460 | +#endif | | | |
1461 | + | | | |
1462 | +#if defined(BN_MP_TO_UNSIGNED_BIN_N_C) | | | |
1463 | + #define BN_MP_UNSIGNED_BIN_SIZE_C | | | |
1464 | + #define BN_MP_TO_UNSIGNED_BIN_C | | | |
1465 | +#endif | | | |
1466 | + | | | |
1467 | +#if defined(BN_MP_TOOM_MUL_C) | | | |
1468 | + #define BN_MP_INIT_MULTI_C | | | |
1469 | + #define BN_MP_MOD_2D_C | | | |
1470 | + #define BN_MP_COPY_C | | | |
1471 | + #define BN_MP_RSHD_C | | | |
1472 | + #define BN_MP_MUL_C | | | |
1473 | + #define BN_MP_MUL_2_C | | | |
1474 | + #define BN_MP_ADD_C | | | |
1475 | + #define BN_MP_SUB_C | | | |
1476 | + #define BN_MP_DIV_2_C | | | |
1477 | + #define BN_MP_MUL_2D_C | | | |
1478 | + #define BN_MP_MUL_D_C | | | |
1479 | + #define BN_MP_DIV_3_C | | | |
1480 | + #define BN_MP_LSHD_C | | | |
1481 | + #define BN_MP_CLEAR_MULTI_C | | | |
1482 | +#endif | | | |
1483 | + | | | |
1484 | +#if defined(BN_MP_TOOM_SQR_C) | | | |
1485 | + #define BN_MP_INIT_MULTI_C | | | |
1486 | + #define BN_MP_MOD_2D_C | | | |
1487 | + #define BN_MP_COPY_C | | | |
1488 | + #define BN_MP_RSHD_C | | | |
1489 | + #define BN_MP_SQR_C | | | |
1490 | + #define BN_MP_MUL_2_C | | | |
1491 | + #define BN_MP_ADD_C | | | |
1492 | + #define BN_MP_SUB_C | | | |
1493 | + #define BN_MP_DIV_2_C | | | |
1494 | + #define BN_MP_MUL_2D_C | | | |
1495 | + #define BN_MP_MUL_D_C | | | |
1496 | + #define BN_MP_DIV_3_C | | | |
1497 | + #define BN_MP_LSHD_C | | | |
1498 | + #define BN_MP_CLEAR_MULTI_C | | | |
1499 | +#endif | | | |
1500 | + | | | |
1501 | +#if defined(BN_MP_TORADIX_C) | | | |
1502 | + #define BN_MP_ISZERO_C | | | |
1503 | + #define BN_MP_INIT_COPY_C | | | |
1504 | + #define BN_MP_DIV_D_C | | | |
1505 | + #define BN_MP_CLEAR_C | | | |
1506 | + #define BN_MP_S_RMAP_C | | | |
1507 | +#endif | | | |
1508 | + | | | |
1509 | +#if defined(BN_MP_TORADIX_N_C) | | | |
1510 | + #define BN_MP_ISZERO_C | | | |
1511 | + #define BN_MP_INIT_COPY_C | | | |
1512 | + #define BN_MP_DIV_D_C | | | |
1513 | + #define BN_MP_CLEAR_C | | | |
1514 | + #define BN_MP_S_RMAP_C | | | |
1515 | +#endif | | | |
1516 | + | | | |
1517 | +#if defined(BN_MP_UNSIGNED_BIN_SIZE_C) | | | |
1518 | + #define BN_MP_COUNT_BITS_C | | | |
1519 | +#endif | | | |
1520 | + | | | |
1521 | +#if defined(BN_MP_XOR_C) | | | |
1522 | + #define BN_MP_INIT_COPY_C | | | |
1523 | + #define BN_MP_CLAMP_C | | | |
1524 | + #define BN_MP_EXCH_C | | | |
1525 | + #define BN_MP_CLEAR_C | | | |
1526 | +#endif | | | |
1527 | + | | | |
1528 | +#if defined(BN_MP_ZERO_C) | | | |
1529 | +#endif | | | |
1530 | + | | | |
1531 | +#if defined(BN_PRIME_TAB_C) | | | |
1532 | +#endif | | | |
1533 | + | | | |
1534 | +#if defined(BN_REVERSE_C) | | | |
1535 | +#endif | | | |
1536 | + | | | |
1537 | +#if defined(BN_S_MP_ADD_C) | | | |
1538 | + #define BN_MP_GROW_C | | | |
1539 | + #define BN_MP_CLAMP_C | | | |
1540 | +#endif | | | |
1541 | + | | | |
1542 | +#if defined(BN_S_MP_EXPTMOD_C) | | | |
1543 | + #define BN_MP_COUNT_BITS_C | | | |
1544 | + #define BN_MP_INIT_C | | | |
1545 | + #define BN_MP_CLEAR_C | | | |
1546 | + #define BN_MP_REDUCE_SETUP_C | | | |
1547 | + #define BN_MP_REDUCE_C | | | |
1548 | + #define BN_MP_REDUCE_2K_SETUP_L_C | | | |
1549 | + #define BN_MP_REDUCE_2K_L_C | | | |
1550 | + #define BN_MP_MOD_C | | | |
1551 | + #define BN_MP_COPY_C | | | |
1552 | + #define BN_MP_SQR_C | | | |
1553 | + #define BN_MP_MUL_C | | | |
1554 | + #define BN_MP_SET_C | | | |
1555 | + #define BN_MP_EXCH_C | | | |
1556 | +#endif | | | |
1557 | + | | | |
1558 | +#if defined(BN_S_MP_MUL_DIGS_C) | | | |
1559 | + #define BN_FAST_S_MP_MUL_DIGS_C | | | |
1560 | + #define BN_MP_INIT_SIZE_C | | | |
1561 | + #define BN_MP_CLAMP_C | | | |
1562 | + #define BN_MP_EXCH_C | | | |
1563 | + #define BN_MP_CLEAR_C | | | |
1564 | +#endif | | | |
1565 | + | | | |
1566 | +#if defined(BN_S_MP_MUL_HIGH_DIGS_C) | | | |
1567 | + #define BN_FAST_S_MP_MUL_HIGH_DIGS_C | | | |
1568 | + #define BN_MP_INIT_SIZE_C | | | |
1569 | + #define BN_MP_CLAMP_C | | | |
1570 | + #define BN_MP_EXCH_C | | | |
1571 | + #define BN_MP_CLEAR_C | | | |
1572 | +#endif | | | |
1573 | + | | | |
1574 | +#if defined(BN_S_MP_SQR_C) | | | |
1575 | + #define BN_MP_INIT_SIZE_C | | | |
1576 | + #define BN_MP_CLAMP_C | | | |
1577 | + #define BN_MP_EXCH_C | | | |
1578 | + #define BN_MP_CLEAR_C | | | |
1579 | +#endif | | | |
1580 | + | | | |
1581 | +#if defined(BN_S_MP_SUB_C) | | | |
1582 | + #define BN_MP_GROW_C | | | |
1583 | + #define BN_MP_CLAMP_C | | | |
1584 | +#endif | | | |
1585 | + | | | |
1586 | +#if defined(BNCORE_C) | | | |
1587 | +#endif | | | |
1588 | + | | | |
1589 | +#ifdef LTM3 | | | |
1590 | +#define LTM_LAST | | | |
1591 | +#endif | | | |
1592 | +#include <tommath_superclass.h> | | | |
1593 | +#include <tommath_class.h> | | | |
1594 | +#else | | | |
1595 | +#define LTM_LAST | | | |
1596 | +#endif | | | |
1597 | --- /dev/null 1 Jan 1970 00:00:00 -0000 | | | |
1598 | +++ lib/hcrypto/libtommath/tommath_superclass.h 29 Oct 2010 01:14:54 -0000 | | | |
1599 | @@ -0,0 +1,72 @@ | | | |
1600 | +/* super class file for PK algos */ | | | |
1601 | + | | | |
1602 | +/* default ... include all MPI */ | | | |
1603 | +#define LTM_ALL | | | |
1604 | + | | | |
1605 | +/* RSA only (does not support DH/DSA/ECC) */ | | | |
1606 | +/* #define SC_RSA_1 */ | | | |
1607 | + | | | |
1608 | +/* For reference.... On an Athlon64 optimizing for speed... | | | |
1609 | + | | | |
1610 | + LTM's mpi.o with all functions [striped] is 142KiB in size. | | | |
1611 | + | | | |
1612 | +*/ | | | |
1613 | + | | | |
1614 | +/* Works for RSA only, mpi.o is 68KiB */ | | | |
1615 | +#ifdef SC_RSA_1 | | | |
1616 | + #define BN_MP_SHRINK_C | | | |
1617 | + #define BN_MP_LCM_C | | | |
1618 | + #define BN_MP_PRIME_RANDOM_EX_C | | | |
1619 | + #define BN_MP_INVMOD_C | | | |
1620 | + #define BN_MP_GCD_C | | | |
1621 | + #define BN_MP_MOD_C | | | |
1622 | + #define BN_MP_MULMOD_C | | | |
1623 | + #define BN_MP_ADDMOD_C | | | |
1624 | + #define BN_MP_EXPTMOD_C | | | |
1625 | + #define BN_MP_SET_INT_C | | | |
1626 | + #define BN_MP_INIT_MULTI_C | | | |
1627 | + #define BN_MP_CLEAR_MULTI_C | | | |
1628 | + #define BN_MP_UNSIGNED_BIN_SIZE_C | | | |
1629 | + #define BN_MP_TO_UNSIGNED_BIN_C | | | |
1630 | + #define BN_MP_MOD_D_C | | | |
1631 | + #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C | | | |
1632 | + #define BN_REVERSE_C | | | |
1633 | + #define BN_PRIME_TAB_C | | | |
1634 | + | | | |
1635 | + /* other modifiers */ | | | |
1636 | + #define BN_MP_DIV_SMALL /* Slower division, not critical */ | | | |
1637 | + | | | |
1638 | + /* here we are on the last pass so we turn things off. The functions classes are still there | | | |
1639 | + * but we remove them specifically from the build. This also invokes tweaks in functions | | | |
1640 | + * like removing support for even moduli, etc... | | | |
1641 | + */ | | | |
1642 | +#ifdef LTM_LAST | | | |
1643 | + #undef BN_MP_TOOM_MUL_C | | | |
1644 | + #undef BN_MP_TOOM_SQR_C | | | |
1645 | + #undef BN_MP_KARATSUBA_MUL_C | | | |
1646 | + #undef BN_MP_KARATSUBA_SQR_C | | | |
1647 | + #undef BN_MP_REDUCE_C | | | |
1648 | + #undef BN_MP_REDUCE_SETUP_C | | | |
1649 | + #undef BN_MP_DR_IS_MODULUS_C | | | |
1650 | + #undef BN_MP_DR_SETUP_C | | | |
1651 | + #undef BN_MP_DR_REDUCE_C | | | |
1652 | + #undef BN_MP_REDUCE_IS_2K_C | | | |
1653 | + #undef BN_MP_REDUCE_2K_SETUP_C | | | |
1654 | + #undef BN_MP_REDUCE_2K_C | | | |
1655 | + #undef BN_S_MP_EXPTMOD_C | | | |
1656 | + #undef BN_MP_DIV_3_C | | | |
1657 | + #undef BN_S_MP_MUL_HIGH_DIGS_C | | | |
1658 | + #undef BN_FAST_S_MP_MUL_HIGH_DIGS_C | | | |
1659 | + #undef BN_FAST_MP_INVMOD_C | | | |
1660 | + | | | |
1661 | + /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold | | | |
1662 | + * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] | | | |
1663 | + * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without | | | |
1664 | + * trouble. | | | |
1665 | + */ | | | |
1666 | + #undef BN_S_MP_MUL_DIGS_C | | | |
1667 | + #undef BN_S_MP_SQR_C | | | |
1668 | + #undef BN_MP_MONTGOMERY_REDUCE_C | | | |
1669 | +#endif | | | |
1670 | + | | | |
1671 | +#endif | | | |