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

Used Big. h and SSP_ Pair. cpp, unable to print "Success",please give some advises,thanks #126

Open
HUERSAN opened this issue Aug 23, 2023 · 0 comments

Comments

@HUERSAN
Copy link

HUERSAN commented Aug 23, 2023

#include
//security define
#define AES_SECURITY 128
#define MR_PAIRING_SSP
#include "pairing_1.h"
#include "big.h"
using namespace std;
extern "C"
{
#include "miracl.h"
#include "mirdef.h"
}
int main()
{
miracl* mip = mirsys(5000, 16);
mip->IOBASE = 16;
PFC pfc(AES_SECURITY);
//Big mod=pfc.mod;
Big m = get_modulus();
G1 P;
pfc.random(P);
Big a;
pfc.random(a);
G1 aP = pfc.mult(P, a);//aP
Big in_a = inverse(a, m);
Big b;
pfc.random(b);
Big in_b = inverse(b, m);//b-1
G1 abP = pfc.mult(aP, b);//aP
b=abP
G1 ab_bP = pfc.mult(abP, in_b);//abP*b-1=aP
if (aP == ab_bP)
{
cout << "Success!" << endl;
}
return 0;
}

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