-
Notifications
You must be signed in to change notification settings - Fork 26
/
lowmc.c.i
50 lines (46 loc) · 1.27 KB
/
lowmc.c.i
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
/*
* This file is part of the optimized implementation of the Picnic signature scheme.
* See the accompanying documentation for complete details.
*
* The code is provided under the MIT license, see LICENSE for
* more details.
* SPDX-License-Identifier: MIT
*/
#if defined(LOWMC_INSTANCE)
#define N_LOWMC CONCAT(lowmc, CONCAT(IMPL, LOWMC_INSTANCE))
#define SBOX_FUNC CONCAT(sbox, CONCAT(IMPL, LOWMC_INSTANCE))
#if defined(LOWMC_PARTIAL)
#define SBOX(x) sbox_layer_10_uint64(&BLOCK(x, 0)->w64[(LOWMC_N / (sizeof(word) * 8)) - 1])
#include "lowmc_impl_partial.c.i"
#else
#define SBOX(x) SBOX_FUNC(x)
#include "lowmc_impl.c.i"
#endif
#if defined(WITH_ZKBPP)
#undef N_LOWMC
#define N_LOWMC CONCAT(lowmc_store, CONCAT(IMPL, LOWMC_INSTANCE))
#define RECORD_STATE
#if defined(LOWMC_PARTIAL)
#include "lowmc_impl_partial.c.i"
#else
#include "lowmc_impl.c.i"
#endif
#endif
#if defined(WITH_KKW)
#if !defined(LOWMC_PARTIAL)
#undef N_LOWMC
#undef RECORD_STATE
#undef SBOX
#undef SBOX_FUNC
#define SBOX_FUNC CONCAT(sbox_aux, CONCAT(IMPL, LOWMC_INSTANCE))
#define SBOX(x, y, tapes) SBOX_FUNC(x, y, tapes)
#define N_LOWMC CONCAT(lowmc_aux, CONCAT(IMPL, LOWMC_INSTANCE))
#include "lowmc_impl_aux.c.i"
#endif
#endif
#undef N_LOWMC
#undef RECORD_STATE
#undef SBOX
#undef SBOX_FUNC
#endif
// vim: ft=c