![]() |
emp-toolkit
|
#include "block.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <openssl/sha.h>
Go to the source code of this file.
Classes | |
struct | garble_gate |
struct | garble_fixed_wire |
struct | garble_circuit |
Macros | |
#define | GARBLE_OK 0 |
#define | GARBLE_ERR -1 |
Enumerations | |
enum | garble_type_e { GARBLE_TYPE_STANDARD, GARBLE_TYPE_HALFGATES, GARBLE_TYPE_PRIVACY_FREE } |
enum | garble_gate_type_e { GARBLE_GATE_ZERO = 0, GARBLE_GATE_ONE = 15, GARBLE_GATE_AND = 8, GARBLE_GATE_OR = 14, GARBLE_GATE_XOR = 6, GARBLE_GATE_NOT = 5, GARBLE_GATE_EMPTY = -1 } |
enum | garble_fixed_wire_e { GARBLE_FIXED_WIRE_ZERO = 0, GARBLE_FIXED_WIRE_ONE = 1 } |
Functions | |
size_t | garble_table_size (const garble_circuit *gc) |
int | garble_new (garble_circuit *gc, uint64_t n, uint64_t m, garble_type_e type) |
void | garble_delete (garble_circuit *gc) |
int | garble_garble (garble_circuit *gc, const block *input_labels, block *output_labels) |
void | garble_hash (const garble_circuit *gc, unsigned char hash[SHA_DIGEST_LENGTH]) |
int | garble_check (garble_circuit *gc, const unsigned char hash[SHA_DIGEST_LENGTH]) |
block | garble_create_delta (void) |
void | garble_create_input_labels (block *labels, uint64_t n, block *delta, bool privacyfree) |
int | garble_eval (const garble_circuit *gc, const block *input_labels, block *output_labels, bool *outputs) |
void | garble_extract_labels (block *extracted_labels, const block *labels, const bool *bits, uint64_t n) |
int | garble_map_outputs (const block *output_labels, const block *map, bool *vals, uint64_t m) |
int | garble_circuit_to_file (garble_circuit *gc, char *fname) |
int | garble_circuit_from_file (garble_circuit *gc, char *fname) |
size_t | garble_size (const garble_circuit *gc, bool wires) |
int | garble_save (const garble_circuit *gc, FILE *f, bool wires) |
int | garble_load (garble_circuit *gc, FILE *f, bool wires) |
int | garble_to_buffer (const garble_circuit *gc, char *buf, bool wires) |
int | garble_from_buffer (garble_circuit *gc, const char *buf, bool wires) |
#define GARBLE_ERR -1 |
#define GARBLE_OK 0 |
enum garble_fixed_wire_e |
enum garble_gate_type_e |
enum garble_type_e |
int garble_check | ( | garble_circuit * | gc, |
const unsigned char | hash[SHA_DIGEST_LENGTH] | ||
) |
int garble_circuit_from_file | ( | garble_circuit * | gc, |
char * | fname | ||
) |
int garble_circuit_to_file | ( | garble_circuit * | gc, |
char * | fname | ||
) |
block garble_create_delta | ( | void | ) |
void garble_delete | ( | garble_circuit * | gc | ) |
int garble_eval | ( | const garble_circuit * | gc, |
const block * | input_labels, | ||
block * | output_labels, | ||
bool * | outputs | ||
) |
void garble_extract_labels | ( | block * | extracted_labels, |
const block * | labels, | ||
const bool * | bits, | ||
uint64_t | n | ||
) |
int garble_from_buffer | ( | garble_circuit * | gc, |
const char * | buf, | ||
bool | wires | ||
) |
int garble_garble | ( | garble_circuit * | gc, |
const block * | input_labels, | ||
block * | output_labels | ||
) |
void garble_hash | ( | const garble_circuit * | gc, |
unsigned char | hash[SHA_DIGEST_LENGTH] | ||
) |
int garble_load | ( | garble_circuit * | gc, |
FILE * | f, | ||
bool | wires | ||
) |
int garble_new | ( | garble_circuit * | gc, |
uint64_t | n, | ||
uint64_t | m, | ||
garble_type_e | type | ||
) |
int garble_save | ( | const garble_circuit * | gc, |
FILE * | f, | ||
bool | wires | ||
) |
size_t garble_size | ( | const garble_circuit * | gc, |
bool | wires | ||
) |
|
inline |
int garble_to_buffer | ( | const garble_circuit * | gc, |
char * | buf, | ||
bool | wires | ||
) |