summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_gf2m.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/bn/bn_gf2m.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c
index 8a4dc20ad9..68a5faa52d 100644
--- a/src/lib/libcrypto/bn/bn_gf2m.c
+++ b/src/lib/libcrypto/bn/bn_gf2m.c
@@ -444,7 +444,7 @@ int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p
444 bn_check_top(a); 444 bn_check_top(a);
445 bn_check_top(b); 445 bn_check_top(b);
446 bn_check_top(p); 446 bn_check_top(p);
447 if ((arr = (int *)OPENSSL_malloc(sizeof(int) * max)) == NULL) goto err; 447 if ((arr = (int *)malloc(sizeof(int) * max)) == NULL) goto err;
448 ret = BN_GF2m_poly2arr(p, arr, max); 448 ret = BN_GF2m_poly2arr(p, arr, max);
449 if (!ret || ret > max) 449 if (!ret || ret > max)
450 { 450 {
@@ -454,7 +454,7 @@ int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p
454 ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx); 454 ret = BN_GF2m_mod_mul_arr(r, a, b, arr, ctx);
455 bn_check_top(r); 455 bn_check_top(r);
456err: 456err:
457 if (arr) OPENSSL_free(arr); 457 if (arr) free(arr);
458 return ret; 458 return ret;
459 } 459 }
460 460
@@ -500,7 +500,7 @@ int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
500 500
501 bn_check_top(a); 501 bn_check_top(a);
502 bn_check_top(p); 502 bn_check_top(p);
503 if ((arr = (int *)OPENSSL_malloc(sizeof(int) * max)) == NULL) goto err; 503 if ((arr = (int *)malloc(sizeof(int) * max)) == NULL) goto err;
504 ret = BN_GF2m_poly2arr(p, arr, max); 504 ret = BN_GF2m_poly2arr(p, arr, max);
505 if (!ret || ret > max) 505 if (!ret || ret > max)
506 { 506 {
@@ -510,7 +510,7 @@ int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
510 ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx); 510 ret = BN_GF2m_mod_sqr_arr(r, a, arr, ctx);
511 bn_check_top(r); 511 bn_check_top(r);
512err: 512err:
513 if (arr) OPENSSL_free(arr); 513 if (arr) free(arr);
514 return ret; 514 return ret;
515 } 515 }
516 516
@@ -861,7 +861,7 @@ int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p
861 bn_check_top(a); 861 bn_check_top(a);
862 bn_check_top(b); 862 bn_check_top(b);
863 bn_check_top(p); 863 bn_check_top(p);
864 if ((arr = (int *)OPENSSL_malloc(sizeof(int) * max)) == NULL) goto err; 864 if ((arr = (int *)malloc(sizeof(int) * max)) == NULL) goto err;
865 ret = BN_GF2m_poly2arr(p, arr, max); 865 ret = BN_GF2m_poly2arr(p, arr, max);
866 if (!ret || ret > max) 866 if (!ret || ret > max)
867 { 867 {
@@ -871,7 +871,7 @@ int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p
871 ret = BN_GF2m_mod_exp_arr(r, a, b, arr, ctx); 871 ret = BN_GF2m_mod_exp_arr(r, a, b, arr, ctx);
872 bn_check_top(r); 872 bn_check_top(r);
873err: 873err:
874 if (arr) OPENSSL_free(arr); 874 if (arr) free(arr);
875 return ret; 875 return ret;
876 } 876 }
877 877
@@ -919,7 +919,7 @@ int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
919 int *arr=NULL; 919 int *arr=NULL;
920 bn_check_top(a); 920 bn_check_top(a);
921 bn_check_top(p); 921 bn_check_top(p);
922 if ((arr = (int *)OPENSSL_malloc(sizeof(int) * max)) == NULL) goto err; 922 if ((arr = (int *)malloc(sizeof(int) * max)) == NULL) goto err;
923 ret = BN_GF2m_poly2arr(p, arr, max); 923 ret = BN_GF2m_poly2arr(p, arr, max);
924 if (!ret || ret > max) 924 if (!ret || ret > max)
925 { 925 {
@@ -929,7 +929,7 @@ int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
929 ret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx); 929 ret = BN_GF2m_mod_sqrt_arr(r, a, arr, ctx);
930 bn_check_top(r); 930 bn_check_top(r);
931err: 931err:
932 if (arr) OPENSSL_free(arr); 932 if (arr) free(arr);
933 return ret; 933 return ret;
934 } 934 }
935 935
@@ -1037,7 +1037,7 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *
1037 int *arr=NULL; 1037 int *arr=NULL;
1038 bn_check_top(a); 1038 bn_check_top(a);
1039 bn_check_top(p); 1039 bn_check_top(p);
1040 if ((arr = (int *)OPENSSL_malloc(sizeof(int) * 1040 if ((arr = (int *)malloc(sizeof(int) *
1041 max)) == NULL) goto err; 1041 max)) == NULL) goto err;
1042 ret = BN_GF2m_poly2arr(p, arr, max); 1042 ret = BN_GF2m_poly2arr(p, arr, max);
1043 if (!ret || ret > max) 1043 if (!ret || ret > max)
@@ -1048,7 +1048,7 @@ int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *
1048 ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx); 1048 ret = BN_GF2m_mod_solve_quad_arr(r, a, arr, ctx);
1049 bn_check_top(r); 1049 bn_check_top(r);
1050err: 1050err:
1051 if (arr) OPENSSL_free(arr); 1051 if (arr) free(arr);
1052 return ret; 1052 return ret;
1053 } 1053 }
1054 1054