diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/ec/ectest.c | 419 |
1 files changed, 1 insertions, 418 deletions
diff --git a/src/regress/lib/libcrypto/ec/ectest.c b/src/regress/lib/libcrypto/ec/ectest.c index d2253609cd..6984db6d60 100644 --- a/src/regress/lib/libcrypto/ec/ectest.c +++ b/src/regress/lib/libcrypto/ec/ectest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ectest.c,v 1.14 2023/04/17 20:41:02 tb Exp $ */ | 1 | /* $OpenBSD: ectest.c,v 1.15 2023/04/18 07:54:42 tb Exp $ */ |
| 2 | /* crypto/ec/ectest.c */ | 2 | /* crypto/ec/ectest.c */ |
| 3 | /* | 3 | /* |
| 4 | * Originally written by Bodo Moeller for the OpenSSL project. | 4 | * Originally written by Bodo Moeller for the OpenSSL project. |
| @@ -771,420 +771,6 @@ prime_field_tests(void) | |||
| 771 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ | 771 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ |
| 772 | if (!EC_GROUP_copy(_variable, group)) ABORT; \ | 772 | if (!EC_GROUP_copy(_variable, group)) ABORT; \ |
| 773 | 773 | ||
| 774 | #ifndef OPENSSL_NO_EC2M | ||
| 775 | |||
| 776 | static void char2_field_tests(void) | ||
| 777 | { | ||
| 778 | BN_CTX *ctx = NULL; | ||
| 779 | BIGNUM *p, *a, *b; | ||
| 780 | EC_GROUP *group; | ||
| 781 | EC_GROUP *C2_K163 = NULL, *C2_K233 = NULL, *C2_K283 = NULL, *C2_K409 = NULL, *C2_K571 = NULL; | ||
| 782 | EC_GROUP *C2_B163 = NULL, *C2_B233 = NULL, *C2_B283 = NULL, *C2_B409 = NULL, *C2_B571 = NULL; | ||
| 783 | EC_POINT *P, *Q, *R; | ||
| 784 | BIGNUM *x, *y, *z, *cof; | ||
| 785 | unsigned char buf[100]; | ||
| 786 | size_t i, len; | ||
| 787 | int k; | ||
| 788 | |||
| 789 | #if 1 /* optional */ | ||
| 790 | ctx = BN_CTX_new(); | ||
| 791 | if (!ctx) | ||
| 792 | ABORT; | ||
| 793 | #endif | ||
| 794 | |||
| 795 | p = BN_new(); | ||
| 796 | a = BN_new(); | ||
| 797 | b = BN_new(); | ||
| 798 | if (!p || !a || !b) | ||
| 799 | ABORT; | ||
| 800 | |||
| 801 | if (!BN_hex2bn(&p, "13")) | ||
| 802 | ABORT; | ||
| 803 | if (!BN_hex2bn(&a, "3")) | ||
| 804 | ABORT; | ||
| 805 | if (!BN_hex2bn(&b, "1")) | ||
| 806 | ABORT; | ||
| 807 | |||
| 808 | group = EC_GROUP_new(EC_GF2m_simple_method()); /* applications should use EC_GROUP_new_curve_GF2m | ||
| 809 | * so that the library gets to choose the EC_METHOD */ | ||
| 810 | if (!group) | ||
| 811 | ABORT; | ||
| 812 | if (!EC_GROUP_set_curve(group, p, a, b, ctx)) | ||
| 813 | ABORT; | ||
| 814 | |||
| 815 | { | ||
| 816 | EC_GROUP *tmp; | ||
| 817 | tmp = EC_GROUP_new(EC_GROUP_method_of(group)); | ||
| 818 | if (!tmp) | ||
| 819 | ABORT; | ||
| 820 | if (!EC_GROUP_copy(tmp, group)) | ||
| 821 | ABORT; | ||
| 822 | EC_GROUP_free(group); | ||
| 823 | group = tmp; | ||
| 824 | } | ||
| 825 | |||
| 826 | if (!EC_GROUP_get_curve(group, p, a, b, ctx)) | ||
| 827 | ABORT; | ||
| 828 | |||
| 829 | fprintf(stdout, "Curve defined by Weierstrass equation\n y^2 + x*y = x^3 + a*x^2 + b (mod 0x"); | ||
| 830 | BN_print_fp(stdout, p); | ||
| 831 | fprintf(stdout, ")\n a = 0x"); | ||
| 832 | BN_print_fp(stdout, a); | ||
| 833 | fprintf(stdout, "\n b = 0x"); | ||
| 834 | BN_print_fp(stdout, b); | ||
| 835 | fprintf(stdout, "\n(0x... means binary polynomial)\n"); | ||
| 836 | |||
| 837 | P = EC_POINT_new(group); | ||
| 838 | Q = EC_POINT_new(group); | ||
| 839 | R = EC_POINT_new(group); | ||
| 840 | if (!P || !Q || !R) | ||
| 841 | ABORT; | ||
| 842 | |||
| 843 | if (!EC_POINT_set_to_infinity(group, P)) | ||
| 844 | ABORT; | ||
| 845 | if (!EC_POINT_is_at_infinity(group, P)) | ||
| 846 | ABORT; | ||
| 847 | |||
| 848 | buf[0] = 0; | ||
| 849 | if (!EC_POINT_oct2point(group, Q, buf, 1, ctx)) | ||
| 850 | ABORT; | ||
| 851 | |||
| 852 | if (!EC_POINT_add(group, P, P, Q, ctx)) | ||
| 853 | ABORT; | ||
| 854 | if (!EC_POINT_is_at_infinity(group, P)) | ||
| 855 | ABORT; | ||
| 856 | |||
| 857 | x = BN_new(); | ||
| 858 | y = BN_new(); | ||
| 859 | z = BN_new(); | ||
| 860 | cof = BN_new(); | ||
| 861 | if (!x || !y || !z || !cof) | ||
| 862 | ABORT; | ||
| 863 | |||
| 864 | if (!BN_hex2bn(&x, "6")) | ||
| 865 | ABORT; | ||
| 866 | /* Change test based on whether binary point compression is enabled or not. */ | ||
| 867 | #ifdef OPENSSL_EC_BIN_PT_COMP | ||
| 868 | if (!EC_POINT_set_compressed_coordinates(group, Q, x, 1, ctx)) | ||
| 869 | ABORT; | ||
| 870 | #else | ||
| 871 | if (!BN_hex2bn(&y, "8")) | ||
| 872 | ABORT; | ||
| 873 | if (!EC_POINT_set_affine_coordinates(group, Q, x, y, ctx)) | ||
| 874 | ABORT; | ||
| 875 | #endif | ||
| 876 | if (!EC_POINT_is_on_curve(group, Q, ctx)) { | ||
| 877 | /* Change test based on whether binary point compression is enabled or not. */ | ||
| 878 | #ifdef OPENSSL_EC_BIN_PT_COMP | ||
| 879 | if (!EC_POINT_get_affine_coordinates(group, Q, x, y, ctx)) | ||
| 880 | ABORT; | ||
| 881 | #endif | ||
| 882 | fprintf(stderr, "Point is not on curve: x = 0x"); | ||
| 883 | BN_print_fp(stderr, x); | ||
| 884 | fprintf(stderr, ", y = 0x"); | ||
| 885 | BN_print_fp(stderr, y); | ||
| 886 | fprintf(stderr, "\n"); | ||
| 887 | ABORT; | ||
| 888 | } | ||
| 889 | |||
| 890 | fprintf(stdout, "A cyclic subgroup:\n"); | ||
| 891 | k = 100; | ||
| 892 | do | ||
| 893 | { | ||
| 894 | if (k-- == 0) | ||
| 895 | ABORT; | ||
| 896 | |||
| 897 | if (EC_POINT_is_at_infinity(group, P)) | ||
| 898 | fprintf(stdout, " point at infinity\n"); | ||
| 899 | else { | ||
| 900 | if (!EC_POINT_get_affine_coordinates(group, P, x, y, ctx)) | ||
| 901 | ABORT; | ||
| 902 | |||
| 903 | fprintf(stdout, " x = 0x"); | ||
| 904 | BN_print_fp(stdout, x); | ||
| 905 | fprintf(stdout, ", y = 0x"); | ||
| 906 | BN_print_fp(stdout, y); | ||
| 907 | fprintf(stdout, "\n"); | ||
| 908 | } | ||
| 909 | |||
| 910 | if (!EC_POINT_copy(R, P)) | ||
| 911 | ABORT; | ||
| 912 | if (!EC_POINT_add(group, P, P, Q, ctx)) | ||
| 913 | ABORT; | ||
| 914 | } | ||
| 915 | while (!EC_POINT_is_at_infinity(group, P)); | ||
| 916 | |||
| 917 | if (!EC_POINT_add(group, P, Q, R, ctx)) | ||
| 918 | ABORT; | ||
| 919 | if (!EC_POINT_is_at_infinity(group, P)) | ||
| 920 | ABORT; | ||
| 921 | |||
| 922 | /* Change test based on whether binary point compression is enabled or not. */ | ||
| 923 | #ifdef OPENSSL_EC_BIN_PT_COMP | ||
| 924 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_COMPRESSED, buf, sizeof buf, ctx); | ||
| 925 | if (len == 0) | ||
| 926 | ABORT; | ||
| 927 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) | ||
| 928 | ABORT; | ||
| 929 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) | ||
| 930 | ABORT; | ||
| 931 | fprintf(stdout, "Generator as octet string, compressed form:\n "); | ||
| 932 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | ||
| 933 | #endif | ||
| 934 | |||
| 935 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx); | ||
| 936 | if (len == 0) | ||
| 937 | ABORT; | ||
| 938 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) | ||
| 939 | ABORT; | ||
| 940 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) | ||
| 941 | ABORT; | ||
| 942 | fprintf(stdout, "\nGenerator as octet string, uncompressed form:\n "); | ||
| 943 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | ||
| 944 | |||
| 945 | /* Change test based on whether binary point compression is enabled or not. */ | ||
| 946 | #ifdef OPENSSL_EC_BIN_PT_COMP | ||
| 947 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx); | ||
| 948 | if (len == 0) | ||
| 949 | ABORT; | ||
| 950 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) | ||
| 951 | ABORT; | ||
| 952 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) | ||
| 953 | ABORT; | ||
| 954 | fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); | ||
| 955 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | ||
| 956 | #endif | ||
| 957 | |||
| 958 | fprintf(stdout, "\n"); | ||
| 959 | |||
| 960 | if (!EC_POINT_invert(group, P, ctx)) | ||
| 961 | ABORT; | ||
| 962 | if (0 != EC_POINT_cmp(group, P, R, ctx)) | ||
| 963 | ABORT; | ||
| 964 | |||
| 965 | |||
| 966 | /* Curve K-163 (FIPS PUB 186-2, App. 6) */ | ||
| 967 | CHAR2_CURVE_TEST | ||
| 968 | ( | ||
| 969 | "NIST curve K-163", | ||
| 970 | "0800000000000000000000000000000000000000C9", | ||
| 971 | "1", | ||
| 972 | "1", | ||
| 973 | "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8", | ||
| 974 | "0289070FB05D38FF58321F2E800536D538CCDAA3D9", | ||
| 975 | 1, | ||
| 976 | "04000000000000000000020108A2E0CC0D99F8A5EF", | ||
| 977 | "2", | ||
| 978 | 163, | ||
| 979 | C2_K163 | ||
| 980 | ); | ||
| 981 | |||
| 982 | /* Curve B-163 (FIPS PUB 186-2, App. 6) */ | ||
| 983 | CHAR2_CURVE_TEST | ||
| 984 | ( | ||
| 985 | "NIST curve B-163", | ||
| 986 | "0800000000000000000000000000000000000000C9", | ||
| 987 | "1", | ||
| 988 | "020A601907B8C953CA1481EB10512F78744A3205FD", | ||
| 989 | "03F0EBA16286A2D57EA0991168D4994637E8343E36", | ||
| 990 | "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1", | ||
| 991 | 1, | ||
| 992 | "040000000000000000000292FE77E70C12A4234C33", | ||
| 993 | "2", | ||
| 994 | 163, | ||
| 995 | C2_B163 | ||
| 996 | ); | ||
| 997 | |||
| 998 | /* Curve K-233 (FIPS PUB 186-2, App. 6) */ | ||
| 999 | CHAR2_CURVE_TEST | ||
| 1000 | ( | ||
| 1001 | "NIST curve K-233", | ||
| 1002 | "020000000000000000000000000000000000000004000000000000000001", | ||
| 1003 | "0", | ||
| 1004 | "1", | ||
| 1005 | "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126", | ||
| 1006 | "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3", | ||
| 1007 | 0, | ||
| 1008 | "008000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", | ||
| 1009 | "4", | ||
| 1010 | 233, | ||
| 1011 | C2_K233 | ||
| 1012 | ); | ||
| 1013 | |||
| 1014 | /* Curve B-233 (FIPS PUB 186-2, App. 6) */ | ||
| 1015 | CHAR2_CURVE_TEST | ||
| 1016 | ( | ||
| 1017 | "NIST curve B-233", | ||
| 1018 | "020000000000000000000000000000000000000004000000000000000001", | ||
| 1019 | "000000000000000000000000000000000000000000000000000000000001", | ||
| 1020 | "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD", | ||
| 1021 | "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B", | ||
| 1022 | "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052", | ||
| 1023 | 1, | ||
| 1024 | "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", | ||
| 1025 | "2", | ||
| 1026 | 233, | ||
| 1027 | C2_B233 | ||
| 1028 | ); | ||
| 1029 | |||
| 1030 | /* Curve K-283 (FIPS PUB 186-2, App. 6) */ | ||
| 1031 | CHAR2_CURVE_TEST | ||
| 1032 | ( | ||
| 1033 | "NIST curve K-283", | ||
| 1034 | "0800000000000000000000000000000000000000000000000000000000000000000010A1", | ||
| 1035 | "0", | ||
| 1036 | "1", | ||
| 1037 | "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836", | ||
| 1038 | "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259", | ||
| 1039 | 0, | ||
| 1040 | "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", | ||
| 1041 | "4", | ||
| 1042 | 283, | ||
| 1043 | C2_K283 | ||
| 1044 | ); | ||
| 1045 | |||
| 1046 | /* Curve B-283 (FIPS PUB 186-2, App. 6) */ | ||
| 1047 | CHAR2_CURVE_TEST | ||
| 1048 | ( | ||
| 1049 | "NIST curve B-283", | ||
| 1050 | "0800000000000000000000000000000000000000000000000000000000000000000010A1", | ||
| 1051 | "000000000000000000000000000000000000000000000000000000000000000000000001", | ||
| 1052 | "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5", | ||
| 1053 | "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053", | ||
| 1054 | "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4", | ||
| 1055 | 1, | ||
| 1056 | "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", | ||
| 1057 | "2", | ||
| 1058 | 283, | ||
| 1059 | C2_B283 | ||
| 1060 | ); | ||
| 1061 | |||
| 1062 | /* Curve K-409 (FIPS PUB 186-2, App. 6) */ | ||
| 1063 | CHAR2_CURVE_TEST | ||
| 1064 | ( | ||
| 1065 | "NIST curve K-409", | ||
| 1066 | "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", | ||
| 1067 | "0", | ||
| 1068 | "1", | ||
| 1069 | "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746", | ||
| 1070 | "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B", | ||
| 1071 | 1, | ||
| 1072 | "007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", | ||
| 1073 | "4", | ||
| 1074 | 409, | ||
| 1075 | C2_K409 | ||
| 1076 | ); | ||
| 1077 | |||
| 1078 | /* Curve B-409 (FIPS PUB 186-2, App. 6) */ | ||
| 1079 | CHAR2_CURVE_TEST | ||
| 1080 | ( | ||
| 1081 | "NIST curve B-409", | ||
| 1082 | "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", | ||
| 1083 | "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", | ||
| 1084 | "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F", | ||
| 1085 | "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7", | ||
| 1086 | "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706", | ||
| 1087 | 1, | ||
| 1088 | "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", | ||
| 1089 | "2", | ||
| 1090 | 409, | ||
| 1091 | C2_B409 | ||
| 1092 | ); | ||
| 1093 | |||
| 1094 | /* Curve K-571 (FIPS PUB 186-2, App. 6) */ | ||
| 1095 | CHAR2_CURVE_TEST | ||
| 1096 | ( | ||
| 1097 | "NIST curve K-571", | ||
| 1098 | "80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", | ||
| 1099 | "0", | ||
| 1100 | "1", | ||
| 1101 | "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972", | ||
| 1102 | "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3", | ||
| 1103 | 0, | ||
| 1104 | "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", | ||
| 1105 | "4", | ||
| 1106 | 571, | ||
| 1107 | C2_K571 | ||
| 1108 | ); | ||
| 1109 | |||
| 1110 | /* Curve B-571 (FIPS PUB 186-2, App. 6) */ | ||
| 1111 | CHAR2_CURVE_TEST | ||
| 1112 | ( | ||
| 1113 | "NIST curve B-571", | ||
| 1114 | "80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", | ||
| 1115 | "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", | ||
| 1116 | "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A", | ||
| 1117 | "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19", | ||
| 1118 | "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B", | ||
| 1119 | 1, | ||
| 1120 | "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", | ||
| 1121 | "2", | ||
| 1122 | 571, | ||
| 1123 | C2_B571 | ||
| 1124 | ); | ||
| 1125 | |||
| 1126 | /* more tests using the last curve */ | ||
| 1127 | fprintf(stdout, "infinity tests ..."); | ||
| 1128 | fflush(stdout); | ||
| 1129 | if (!EC_POINT_copy(Q, P)) | ||
| 1130 | ABORT; | ||
| 1131 | if (EC_POINT_is_at_infinity(group, Q)) | ||
| 1132 | ABORT; | ||
| 1133 | /* P := 2P */ | ||
| 1134 | if (!EC_POINT_dbl(group, P, P, ctx)) | ||
| 1135 | ABORT; | ||
| 1136 | if (!EC_POINT_is_on_curve(group, P, ctx)) | ||
| 1137 | ABORT; | ||
| 1138 | /* Q := -P */ | ||
| 1139 | if (!EC_POINT_invert(group, Q, ctx)) | ||
| 1140 | ABORT; | ||
| 1141 | /* R := 2P - P = P */ | ||
| 1142 | if (!EC_POINT_add(group, R, P, Q, ctx)) | ||
| 1143 | ABORT; | ||
| 1144 | /* R := R + Q = P - P = infty */ | ||
| 1145 | if (!EC_POINT_add(group, R, R, Q, ctx)) | ||
| 1146 | ABORT; | ||
| 1147 | if (!EC_POINT_is_at_infinity(group, R)) | ||
| 1148 | ABORT; | ||
| 1149 | fprintf(stdout, " ok\n\n"); | ||
| 1150 | |||
| 1151 | if (ctx) | ||
| 1152 | BN_CTX_free(ctx); | ||
| 1153 | BN_free(p); | ||
| 1154 | BN_free(a); | ||
| 1155 | BN_free(b); | ||
| 1156 | EC_GROUP_free(group); | ||
| 1157 | EC_POINT_free(P); | ||
| 1158 | EC_POINT_free(Q); | ||
| 1159 | EC_POINT_free(R); | ||
| 1160 | BN_free(x); | ||
| 1161 | BN_free(y); | ||
| 1162 | BN_free(z); | ||
| 1163 | BN_free(cof); | ||
| 1164 | |||
| 1165 | if (C2_K163) | ||
| 1166 | EC_GROUP_free(C2_K163); | ||
| 1167 | if (C2_B163) | ||
| 1168 | EC_GROUP_free(C2_B163); | ||
| 1169 | if (C2_K233) | ||
| 1170 | EC_GROUP_free(C2_K233); | ||
| 1171 | if (C2_B233) | ||
| 1172 | EC_GROUP_free(C2_B233); | ||
| 1173 | if (C2_K283) | ||
| 1174 | EC_GROUP_free(C2_K283); | ||
| 1175 | if (C2_B283) | ||
| 1176 | EC_GROUP_free(C2_B283); | ||
| 1177 | if (C2_K409) | ||
| 1178 | EC_GROUP_free(C2_K409); | ||
| 1179 | if (C2_B409) | ||
| 1180 | EC_GROUP_free(C2_B409); | ||
| 1181 | if (C2_K571) | ||
| 1182 | EC_GROUP_free(C2_K571); | ||
| 1183 | if (C2_B571) | ||
| 1184 | EC_GROUP_free(C2_B571); | ||
| 1185 | |||
| 1186 | } | ||
| 1187 | #endif | ||
| 1188 | 774 | ||
| 1189 | static void | 775 | static void |
| 1190 | internal_curve_test(void) | 776 | internal_curve_test(void) |
| @@ -1445,9 +1031,6 @@ main(int argc, char *argv[]) | |||
| 1445 | 1031 | ||
| 1446 | prime_field_tests(); | 1032 | prime_field_tests(); |
| 1447 | puts(""); | 1033 | puts(""); |
| 1448 | #ifndef OPENSSL_NO_EC2M | ||
| 1449 | char2_field_tests(); | ||
| 1450 | #endif | ||
| 1451 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | 1034 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 |
| 1452 | nistp_tests(); | 1035 | nistp_tests(); |
| 1453 | #endif | 1036 | #endif |
