-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaccess.h
46 lines (40 loc) · 1.48 KB
/
access.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* access.h
*
* Created on: 13.03.2012
* Author: michaelbrenner
*/
#ifndef ACCESS_H_
#define ACCESS_H_
#include "kit.h"
#include "integer-fhe.h"
#include <stdio.h>
#include <time.h>
#define RUNS 10
#define WORD_SIZE 11
#define DATA_BITS 8
#define ADR_BITS 5
// ROWS = 2^ADR_BITS
#define ROWS 32
#define READ 1
#define WRITE 0
int access_array_noises[RUNS][ROWS*WORD_SIZE];
int access_reg_noises[RUNS];
_fhe_int* access_array;
_fhe_int* access_rowselect;
int *access_array_noise;
clock_t accessr_thr0(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y);
clock_t accessr_thr1(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y);
clock_t accessr_thr2(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y);
clock_t accessr_thr3(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y);
clock_t accessr(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_pk_t pk,fhe_sk_t sk);
clock_t accessr0(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_int_t *row,fhe_pk_t pk,fhe_sk_t sk);
clock_t accessr1(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_int_t *row,fhe_pk_t pk,fhe_sk_t sk);
clock_t accessw(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_pk_t pk,fhe_sk_t sk);
void access_init(int rows,int cols,fhe_pk_t pk);
void access_clear(int rows,int cols);
void access_dump(int rows,int cols,fhe_sk_t sk);
void access_set(fhe_int_t m,int i,fhe_pk_t pk);
_fhe_int* vec_init(int size);
void vec_clear(_fhe_int *vec,int size);
#endif /* ACCESS_H_ */