pairing.c File Reference

Pairing implementation. More...

#include <limits.h>
#include "epid/common/math/pairing.h"
#include "epid/common/math/bignum-internal.h"
#include "epid/common/math/finitefield-internal.h"
#include "epid/common/math/ecgroup-internal.h"
#include "epid/common/math/pairing-internal.h"
#include "epid/common/memory.h"
#include "ext/ipp/include/ippcp.h"
#include "ext/ipp/include/ippcpepid.h"

Data Structures

struct  FqElemDat
 Data for element in Fq. More...
 
struct  Fq2ElemDat
 Data for element in Fq2. More...
 
struct  Fq6ElemDat
 Data for element in Fq2^3. More...
 
struct  Fq12ElemDat
 Data for element in Fq2^3^2. More...
 

Macros

#define BREAK_ON_IPP_ERROR(sts, ret)
 Handle Ipp Errors with Break. More...
 
#define RETURN_ON_IPP_ERROR(sts)
 Handle Ipp Errors with Return. More...
 
#define BREAK_ON_EPID_ERROR(ret)
 Handle SDK Error with Break. More...
 

Functions

EpidStatus NewPairingState (EcGroup const *ga, EcGroup const *gb, FiniteField *ff, BigNumStr const *t, bool neg, PairingState **ps)
 Constructs a new Pairing State. More...
 
void DeletePairingState (PairingState **ps)
 Frees a previously allocated by PairingState. More...
 
EpidStatus Pairing (PairingState *ps, FfElement *d, EcPoint const *a, EcPoint const *b)
 Computes an Optimal Ate Pairing for two parameters. More...
 

Detailed Description

Pairing implementation.

Macro Definition Documentation

#define BREAK_ON_EPID_ERROR (   ret)
Value:
if (kEpidNoErr != (ret)) { \
break; \
}
no error
Definition: errors.h:41

Handle SDK Error with Break.

#define BREAK_ON_IPP_ERROR (   sts,
  ret 
)
Value:
{ \
IppStatus temp_sts = (sts); \
if (ippStsNoErr != temp_sts) { \
if (ippStsContextMatchErr == temp_sts) { \
(ret) = kEpidMathErr; \
} else { \
(ret) = kEpidBadArgErr; \
} \
break; \
} \
}
internal math error
Definition: errors.h:53
incorrect arg to function
Definition: errors.h:50

Handle Ipp Errors with Break.

#define RETURN_ON_IPP_ERROR (   sts)
Value:
{ \
IppStatus temp_sts = (sts); \
if (ippStsNoErr != temp_sts) { \
if (ippStsContextMatchErr == temp_sts) { \
return kEpidMathErr; \
} else { \
return kEpidBadArgErr; \
} \
} \
}
internal math error
Definition: errors.h:53
incorrect arg to function
Definition: errors.h:50

Handle Ipp Errors with Return.