-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Description
I think any calculation MOD 1 should always return 0, or is this a special case?
#include <relic_conf.h>
#include <relic.h>
int main(void)
{
if ( core_init() != RLC_OK ) abort();
bn_t A, B, C, R;
bn_null(A); bn_new(A);
bn_null(B); bn_new(B);
bn_null(C); bn_new(C);
bn_null(R); bn_new(R);
{
const char* s = "1";
/* noret */ bn_read_str(A, s, strlen(s), 10);
}
{
const char* s = "0";
/* noret */ bn_read_str(B, s, strlen(s), 10);
}
{
const char* s = "1";
/* noret */ bn_read_str(C, s, strlen(s), 10);
}
/* noret */ bn_mxp(R, A, B, C);
int outsize = bn_size_str(R, 10);
char* s2 = malloc(outsize);
/* noret */ bn_write_str(s2, outsize, R, 10);
printf("%s\n", s2);
free(s2);
bn_free(A);
bn_free(B);
bn_free(C);
bn_free(R);
return 0;
}
Metadata
Metadata
Assignees
Labels
No labels