BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
qcmdpc.h
Go to the documentation of this file.
1 /*
2 This file is part of BitPunch
3 Copyright (C) 2015 Frantisek Uhrecky <frantisek.uhrecky[what here]gmail.com>
4 Copyright (C) 2015 Andrej Gulyas <andrej.guly[what here]gmail.com>
5 
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef BPU_QCMDPC_H
21 #define BPU_QCMDPC_H
22 
23 #include <bitpunch/config.h>
24 #include <bitpunch/code/codectx.h>
25 #include <bitpunch/math/gf2.h>
26 #include <bitpunch/debugio.h>
27 
28 /************************************************
29 DECODE PARAMS
30 ************************************************/
31 
32 // universal
33 #define BPU_QCMDPC_PARAM_MAX_ITER 10
34 
35 // decode1 alg
36 #define BPU_QCMDPC_PARAM_DELTA 5
37 
38 // decode2 alg
39 #define BPU_QCMDPC_PARAM_DELTA_B 0
40 #define BPU_QCMDPC_MAX_B_VALUES 5
41 
42 #ifdef BPU_CONF_ENCRYPTION
43 
50 int BPU_mecsQcmdpcEncode(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const struct _BPU_T_Code_Ctx *ctx);
51 #endif
52 
53 #ifdef BPU_CONF_DECRYPTION
54 
61 int BPU_mecsQcmdpcDecrypt(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const struct _BPU_T_Code_Ctx *ctx);
62 
75 int BPU_mecsQcmdpcDecode1(BPU_T_GF2_Vector *error_vec, const BPU_T_GF2_Vector *cipher_text, int delta, const struct _BPU_T_Code_Ctx *ctx);
76 
88 int BPU_mecsQcmdpcDecode2(BPU_T_GF2_Vector *error_vec, const BPU_T_GF2_Vector *cipher_text, const struct _BPU_T_Code_Ctx *ctx);
89 
97 void BPU_mecsQcmdpcCalcSyndrom(BPU_T_GF2_Vector *syndrom, const BPU_T_GF2_Vector *cipher_text, const struct _BPU_T_Code_Ctx *ctx);
98 #endif
99 
100 #ifdef BPU_CONF_KEY_GEN
101 
108 
118 #endif
119 
120 #endif // BPU_QCMDPC_H
int BPU_mecsQcmdpcDecode1(BPU_T_GF2_Vector *error_vec, const BPU_T_GF2_Vector *cipher_text, int delta, const struct _BPU_T_Code_Ctx *ctx)
Definition: qcmdpc.c:110
int BPU_mecsQcmdpcTestGHmatrices(const BPU_T_GF2_QC_Matrix *G, const BPU_T_GF2_Sparse_Qc_Matrix *H)
Definition: qcmdpc.c:413
int BPU_mecsQcmdpcDecode2(BPU_T_GF2_Vector *error_vec, const BPU_T_GF2_Vector *cipher_text, const struct _BPU_T_Code_Ctx *ctx)
Definition: qcmdpc.c:175
int BPU_mecsQcmdpcEncode(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const struct _BPU_T_Code_Ctx *ctx)
Definition: qcmdpc.c:23
void BPU_mecsQcmdpcCalcSyndrom(BPU_T_GF2_Vector *syndrom, const BPU_T_GF2_Vector *cipher_text, const struct _BPU_T_Code_Ctx *ctx)
Definition: qcmdpc.c:231
int BPU_mecsQcmdpcGenKeys(BPU_T_Code_Ctx *ctx)
Definition: qcmdpc.c:247
int BPU_mecsQcmdpcDecrypt(BPU_T_GF2_Vector *out, const BPU_T_GF2_Vector *in, const struct _BPU_T_Code_Ctx *ctx)
Definition: qcmdpc.c:65