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

error: initializer element is not constant #39

Open
Arinerron opened this issue Sep 9, 2017 · 0 comments
Open

error: initializer element is not constant #39

Arinerron opened this issue Sep 9, 2017 · 0 comments

Comments

@Arinerron
Copy link

Trying to test it out by compiling the sample code, but I get an error:

test.c:4:8: error: initializer element is not constant
 struct NtruEncParams params = NTRU_DEFAULT_PARAMS_128_BITS; /*see section "Parameter Sets" below*/
        ^
test.c:7:1: error: expected identifier or ‘(’ beforeifif (ntru_rand_init(&rand_ctx_def, &rng_def) != NTRU_SUCCESS)
 ^
test.c:10:1: error: expected identifier or ‘(’ beforeifif (ntru_gen_key_pair(&params, &kp, &rand_ctx_def) != NTRU_SUCCESS)
 ^

the sample code is

#include "ntru.h"

/* key generation */
struct NtruEncParams params = NTRU_DEFAULT_PARAMS_128_BITS; /*see section "Parameter Sets" below*/
NtruRandGen rng_def = NTRU_RNG_DEFAULT;
NtruRandContext rand_ctx_def;
if (ntru_rand_init(&rand_ctx_def, &rng_def) != NTRU_SUCCESS)
    printf("rng fail\n");
NtruEncKeyPair kp;
if (ntru_gen_key_pair(&params, &kp, &rand_ctx_def) != NTRU_SUCCESS)
    printf("keygen fail\n");

Any idea of what to do?

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