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

relic_pc: gt_exp fails for zero exponent #9

Closed
1gn1t10n opened this issue Feb 18, 2015 · 1 comment
Closed

relic_pc: gt_exp fails for zero exponent #9

1gn1t10n opened this issue Feb 18, 2015 · 1 comment

Comments

@1gn1t10n
Copy link

Context

RELIC version: 1d08528
Configure parameters: -DDEBUG=on -DBENCH=10 -DTESTS=10 -DARITH=gmp -DALLOC=DYNAMIC -DBN_PRECI=8192 -DFP_PRIME=256

Reproduction

diff --git a/test/test_pc.c b/test/test_pc.c
index 041d1b2..7a19b11 100755
--- a/test/test_pc.c
+++ b/test/test_pc.c
@@ -1241,6 +1247,14 @@ int exponentiation(void) {
                        TEST_ASSERT(gt_is_unity(c), end);
                }
                TEST_END;
+
+         TEST_BEGIN("EXTRA gt_exp(a, 0)") {
+                 gt_rand(a);
+                 bn_set_dig(n, 0);
+                 gt_exp(c, a, n);
+                 TEST_ASSERT(gt_is_unity(c), end);
+         }
+         TEST_END;
        }
        CATCH_ANY {
                util_print("FATAL ERROR!\n");

Result: Segmentation fault
Expected result: a^0 == identity element in G_T

@dfaranha
Copy link
Contributor

This specific issue should have been fixed by now!

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

2 participants