-
Notifications
You must be signed in to change notification settings - Fork 716
/
Copy pathevaluator.h
83 lines (49 loc) · 3.67 KB
/
evaluator.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
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
80
81
82
83
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
///////////////////////////////////////////////////////////////////////////
//
// This API is provided as a simple interface for Microsoft SEAL library
// that can be PInvoked by .Net code.
//
///////////////////////////////////////////////////////////////////////////
#include "seal/c/defines.h"
#include <stdint.h>
SEAL_C_FUNC Evaluator_Create(void *context, void **evaluator);
SEAL_C_FUNC Evaluator_Destroy(void *thisptr);
SEAL_C_FUNC Evaluator_Negate(void *thisptr, void *encrypted, void *destination);
SEAL_C_FUNC Evaluator_Add(void *thisptr, void *encrypted1, void *encrypted2, void *destination);
SEAL_C_FUNC Evaluator_AddMany(void *thisptr, uint64_t count, void **encrypteds, void *destination);
SEAL_C_FUNC Evaluator_AddPlain(void *thisptr, void *encrypted, void *plain, void *destination);
SEAL_C_FUNC Evaluator_Sub(void *thisptr, void *encrypted1, void *encrypted2, void *destination);
SEAL_C_FUNC Evaluator_SubPlain(void *thisptr, void *encrypted, void *plain, void *destination);
SEAL_C_FUNC Evaluator_Multiply(void *thisptr, void *encrypted1, void *encrypted2, void *destination, void *pool);
SEAL_C_FUNC Evaluator_MultiplyMany(
void *thisptr, uint64_t count, void **encrypteds, void *relin_keys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_MultiplyPlain(void *thisptr, void *encrypted, void *plain, void *destination, void *pool);
SEAL_C_FUNC Evaluator_Square(void *thisptr, void *encrypted, void *destination, void *pool);
SEAL_C_FUNC Evaluator_Relinearize(void *thisptr, void *encrypted, void *relinKeys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ModSwitchToNext1(void *thisptr, void *encrypted, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ModSwitchTo1(void *thisptr, void *encrypted, uint64_t *parms_id, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ModSwitchToNext2(void *thisptr, void *plain, void *destination);
SEAL_C_FUNC Evaluator_ModSwitchTo2(void *thisptr, void *plain, uint64_t *parms_id, void *destination);
SEAL_C_FUNC Evaluator_RescaleToNext(void *thisptr, void *encrypted, void *destination, void *pool);
SEAL_C_FUNC Evaluator_RescaleTo(void *thisptr, void *encrypted, uint64_t *parms_id, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ModReduceToNext(void *thisptr, void *encrypted, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ModReduceTo(void *thisptr, void *encrypted, uint64_t *parms_id, void *destination, void *pool);
SEAL_C_FUNC Evaluator_Exponentiate(
void *thisptr, void *encrypted, uint64_t exponent, void *relin_keys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_TransformToNTT1(
void *thisptr, void *plain, uint64_t *parms_id, void *destination_ntt, void *pool);
SEAL_C_FUNC Evaluator_TransformToNTT2(void *thisptr, void *encrypted, void *destination_ntt);
SEAL_C_FUNC Evaluator_TransformFromNTT(void *thisptr, void *encrypted_ntt, void *destination);
SEAL_C_FUNC Evaluator_ApplyGalois(
void *thisptr, void *encrypted, uint32_t galois_elt, void *galois_keys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_RotateRows(
void *thisptr, void *encrypted, int steps, void *galoisKeys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_RotateColumns(void *thisptr, void *encrypted, void *galois_keys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_RotateVector(
void *thisptr, void *encrypted, int steps, void *galois_keys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ComplexConjugate(
void *thisptr, void *encrypted, void *galois_keys, void *destination, void *pool);
SEAL_C_FUNC Evaluator_ContextUsingKeyswitching(void *thisptr, bool *using_keyswitching);