/* J.H. Park Inner-product encryption under standard assumptions - Des. Codes Cryptogr. (2011) 58:235–257 Implemented on Type-3 pairing Compile with modules as specified below For MR_PAIRING_CP curve cl /O2 /GX ipe.cpp cp_pair.cpp zzn2.cpp big.cpp zzn.cpp ecn.cpp miracl.lib For MR_PAIRING_MNT curve cl /O2 /GX ipe.cpp mnt_pair.cpp zzn6a.cpp ecn3.cpp zzn3.cpp zzn2.cpp big.cpp zzn.cpp ecn.cpp miracl.lib For MR_PAIRING_BN curve cl /O2 /GX ipe.cpp bn_pair.cpp zzn12a.cpp ecn2.cpp zzn4.cpp zzn2.cpp big.cpp zzn.cpp ecn.cpp miracl.lib For MR_PAIRING_KSS curve cl /O2 /GX ipe.cpp kss_pair.cpp zzn18.cpp zzn6.cpp ecn3.cpp zzn3.cpp big.cpp zzn.cpp ecn.cpp miracl.lib For MR_PAIRING_BLS curve cl /O2 /GX ipe.cpp bls_pair.cpp zzn24.cpp zzn8.cpp zzn4.cpp zzn2.cpp ecn4.cpp big.cpp zzn.cpp ecn.cpp miracl.lib */ #include #include //********* choose just one of these pairs ********** //#define MR_PAIRING_CP // AES-80 security //#define AES_SECURITY 80 //#define MR_PAIRING_MNT // AES-80 security //#define AES_SECURITY 80 #define MR_PAIRING_BN // AES-128 or AES-192 security #define AES_SECURITY 128 //#define AES_SECURITY 192 //#define MR_PAIRING_KSS // AES-192 security //#define AES_SECURITY 192 //#define MR_PAIRING_BLS // AES-256 security //#define AES_SECURITY 256 //********************************************* #include "pairing_3.h" #define n 10 // number of attributes // generate v[i] such that x.v=0 (dot product) void inner_product(Big *x,Big *v,Big& order) { Big prod=0; for (int i=0;iIOBASE=256; M=(char *)"message"; // to be encrypted cout << "Message to be encrypted= " << M << endl; mip->IOBASE=16; pfc.random(s1); pfc.random(s2); pfc.random(s3); pfc.random(s4); for (i=0;iIOBASE=256; cout << "Decrypted message= " << M << endl; return 0; }