Skip to content

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

@HUERSAN

Description

@HUERSAN

#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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions