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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! This crate contains macros to support the sunscreen compiler.
extern crate proc_macro;
/**
* Allows you to `#[derive(Typename)]`.
*/
/**
* Specifies a function to be an [`fhe_program`](macro@fhe_program). An [`fhe_program`](macro@fhe_program) has any number of inputs that impl the
* `FheType` trait and returns either a single type implementing `FheType` or a tuple of
* types implementing `FheType`.
*
* This function gets run by the compiler to build up the [`fhe_program`](macro@fhe_program) you specify and does not
* directly or eagerly perform homomorphic operations.
*
* # Parameters
* * `scheme` (required): Designates the scheme this [`fhe_program`](macro@fhe_program) uses. Today, this must be `"bfv"`.
*
* # Examples
* ```rust,ignore
* # use sunscreen::{fhe_program, types::{bfv::Signed, Cipher}, Params, Context};
*
* #[fhe_program(scheme = "bfv")]
* fn multiply_add(
* a: Cipher<Signed>,
* b: Cipher<Signed>,
* c: Cipher<Signed>
* ) -> Cipher<Signed> {
* a * b + c
* }
* ```
*
* ```rust,ignore
* # use sunscreen::{fhe_program, types::{bfv::Signed, Cipher}, Params, Context};
*
* #[fhe_program(scheme = "bfv")]
* fn multi_out(
* a: Cipher<Signed>,
* b: Cipher<Signed>,
* c: Cipher<Signed>
* ) -> (Cipher<Signed>, Cipher<Signed>) {
* (a + b, b + c)
* }
* ```
*/
/**
* Specifies a function to be a ZKP program. TODO: docs.
*/