forked from dstebila/rlwekex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rlwe.h
36 lines (26 loc) · 1.05 KB
/
rlwe.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
/* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* See LICENSE for complete information.
*/
#ifndef _RLWE_H_
#define _RLWE_H_
#include <stdint.h>
#include "fft.h"
void sample_ct(uint32_t *s);
void sample(uint32_t *s);
void round2_ct(uint64_t *out, const uint32_t *in);
void round2(uint64_t *out, const uint32_t *in);
/* We assume that e contains two random bits in the two
* least significant positions. */
uint64_t dbl(const uint32_t in, int32_t e);
void crossround2_ct(uint64_t *out, const uint32_t *in);
void crossround2(uint64_t *out, const uint32_t *in);
void rec_ct(uint64_t *out, const uint32_t *w, const uint64_t *b);
void rec(uint64_t *out, const uint32_t *w, const uint64_t *b);
void key_gen(uint32_t *out, const uint32_t *a, const uint32_t *s, const uint32_t *e, FFT_CTX *ctx);
#endif /* _RLWE_H_ */