libtc  20160415
Threshold Cryptography functions library
Classes | Macros | Functions
tc_internal.h File Reference
#include <stddef.h>
#include "tc.h"

Go to the source code of this file.

Classes

struct  public_key
 Structure that represents a standard RSA public key. Used to verify signatures. More...
 
struct  key_metainfo
 Structure that represents the data about a key share, including its public key. More...
 
struct  key_share
 Structure that represents one key share, to be used to generate a signature share. More...
 
struct  signature_share
 Structure that represents a signature share, to be joined generating a standard RSA signatures. More...
 

Macros

#define TC_GET_OCTETS(z, bcount, op)   mpz_import(z, bcount, 1, 1, 0, 0, op)
 
#define TC_TO_OCTETS(count, op)   mpz_export(NULL, count, 1, 1, 0, 0, op)
 
#define TC_ID_TO_INDEX(id)   (id-1)
 
#define TC_MPZ_TO_BYTES(bytes, z)   do { bytes_t * b = (bytes); size_t * len = (size_t*)&b->data_len; b->data = TC_TO_OCTETS(len, z); } while(0)
 
#define TC_BYTES_TO_MPZ(z, bytes)   do { const bytes_t * __b = (bytes); size_t len = __b->data_len; mpz_import(z, len, 1, 1, 0, 0, __b->data); } while(0)
 

Functions

void * alloc (size_t size)
 
public_key_ttc_init_public_key ()
 
key_metainfo_ttc_init_key_metainfo (uint16_t k, uint16_t l)
 
signature_share_ttc_init_signature_share ()
 
key_share_ttc_init_key_share ()
 
key_share_t ** tc_init_key_shares (key_metainfo_t *info)
 

Macro Definition Documentation

#define TC_BYTES_TO_MPZ (   z,
  bytes 
)    do { const bytes_t * __b = (bytes); size_t len = __b->data_len; mpz_import(z, len, 1, 1, 0, 0, __b->data); } while(0)

Definition at line 42 of file tc_internal.h.

#define TC_GET_OCTETS (   z,
  bcount,
  op 
)    mpz_import(z, bcount, 1, 1, 0, 0, op)

Definition at line 36 of file tc_internal.h.

#define TC_ID_TO_INDEX (   id)    (id-1)

Definition at line 38 of file tc_internal.h.

#define TC_MPZ_TO_BYTES (   bytes,
 
)    do { bytes_t * b = (bytes); size_t * len = (size_t*)&b->data_len; b->data = TC_TO_OCTETS(len, z); } while(0)

Definition at line 40 of file tc_internal.h.

#define TC_TO_OCTETS (   count,
  op 
)    mpz_export(NULL, count, 1, 1, 0, 0, op)

Definition at line 37 of file tc_internal.h.

Function Documentation

void* alloc ( size_t  size)

Definition at line 9 of file structs_init.c.

key_metainfo_t* tc_init_key_metainfo ( uint16_t  k,
uint16_t  l 
)

Definition at line 90 of file structs_init.c.

key_share_t* tc_init_key_share ( )

Definition at line 145 of file structs_init.c.

key_share_t** tc_init_key_shares ( key_metainfo_t info)

Definition at line 154 of file structs_init.c.

public_key_t* tc_init_public_key ( )

Definition at line 75 of file structs_init.c.

signature_share_t* tc_init_signature_share ( )

Definition at line 180 of file structs_init.c.