emp-toolkit
utils_ec.h File Reference
#include <relic/relic.h>
#include "block.h"
#include "hash.h"
#include "utils_ec.hpp"

Go to the source code of this file.

Macros

#define ECC_PACK   false
 
#define BIT_LEN   128
 
#define EB_SIZE   65
 
#define __batch(func, ...)
 
#define __batch2(func)
 
#define __batch3(func)
 

Typedefs

typedef eb_t eb_tpl[2]
 
typedef bn_t bn_tpl[2]
 

Functions

 __batch (eb_new)
 
 __batch (eb_free)
 
 __batch (bn_new)
 
 __batch (bn_free)
 
 __batch2 (eb_mul)
 
 __batch2 (eb_mul_fix)
 
 __batch2 (eb_sub)
 
 __batch2 (eb_add)
 
 __batch3 (bn_mul)
 
 __batch3 (bn_sub)
 
 __batch3 (bn_add)
 
void bn_to_block (block *b, const bn_t bn)
 
void block_to_bn (bn_t bn, const block *b)
 
void initialize_relic ()
 
block KDF (eb_t in)
 

Macro Definition Documentation

§ __batch

#define __batch (   func,
  ... 
)
Value:
template <typename H, typename... T> void func##l(H p, T... t) {\
func(p,##__VA_ARGS__);\
func##l(t...);\
}\
template <typename H> void func##l(H p) {\
func(p,##__VA_ARGS__);\
}

§ __batch2

#define __batch2 (   func)
Value:
template <typename H1, typename H2, typename H3> void func##_norm(H1 h1, H2 h2, H3 h3) {\
func(h1, h2, h3);\
eb_norm(h1, h1);\
}\

§ __batch3

#define __batch3 (   func)
Value:
template <typename H1, typename H2, typename H3, typename H4> void func##_mod(H1 h1, H2 h2, H3 h3, H4 h4) {\
func(h1, h2, h3);\
bn_mod(h1, h1, h4);\
}\

§ BIT_LEN

#define BIT_LEN   128

§ EB_SIZE

#define EB_SIZE   65

§ ECC_PACK

#define ECC_PACK   false

Typedef Documentation

§ bn_tpl

typedef bn_t bn_tpl[2]

§ eb_tpl

typedef eb_t eb_tpl[2]

Function Documentation

§ __batch() [1/4]

__batch ( eb_new  )

§ __batch() [2/4]

__batch ( eb_free  )

§ __batch() [3/4]

__batch ( bn_new  )

§ __batch() [4/4]

__batch ( bn_free  )

§ __batch2() [1/4]

__batch2 ( eb_mul  )

§ __batch2() [2/4]

__batch2 ( eb_mul_fix  )

§ __batch2() [3/4]

__batch2 ( eb_sub  )

§ __batch2() [4/4]

__batch2 ( eb_add  )

§ __batch3() [1/3]

__batch3 ( bn_mul  )

§ __batch3() [2/3]

__batch3 ( bn_sub  )

§ __batch3() [3/3]

__batch3 ( bn_add  )

§ block_to_bn()

void block_to_bn ( bn_t  bn,
const block b 
)
inline

§ bn_to_block()

void bn_to_block ( block b,
const bn_t  bn 
)
inline

§ initialize_relic()

void initialize_relic ( )
inline

§ KDF()

block KDF ( eb_t  in)
inline