Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL changed "BN_zero" causing error #17

Open
bbosch-d opened this issue Nov 9, 2022 · 0 comments
Open

OpenSSL changed "BN_zero" causing error #17

bbosch-d opened this issue Nov 9, 2022 · 0 comments

Comments

@bbosch-d
Copy link

bbosch-d commented Nov 9, 2022

Hi, when I try to install bplib on Ubuntu 22.04, I get this error:

      bplib/src/bp_fp2.c: In function ‘FP2_zero’:
      bplib/src/bp_fp2.c:111:9: error: invalid use of void expression
        111 |     if (!BN_zero(a->f[0]) || !BN_zero(a->f[1]))
            |         ^
      bplib/src/bp_fp2.c:111:30: error: invalid use of void expression
        111 |     if (!BN_zero(a->f[0]) || !BN_zero(a->f[1]))
            |                              ^
      error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
      [end of output]

I searched for this problem online and it seems that OpenSSL changed the behavior of BN_zero which no longer returns a success integer. They essentially changed BN_zero to do what BN_zero_ex used to do.

For an ultra quick fix I changed the following and it seems to work:

index 6d7d1c7..062dd32 100644
--- a/bplib/src/bp_fp2.c
+++ b/bplib/src/bp_fp2.c
@@ -108,8 +108,9 @@ void FP2_clear_free(FP2 *a)
 
 int FP2_zero(FP2 *a)
 {
-    if (!BN_zero(a->f[0]) || !BN_zero(a->f[1]))
-        return 0;
+    BN_zero(a->f[0]);
+    BN_zero(a->f[1]);
+
     return 1;
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant