From ca18d6e706d9dcb37dddf480eb6ab0cc52bdc2a3 Mon Sep 17 00:00:00 2001 From: Weiqi <weltch1997@gmail.com> Date: Tue, 14 Nov 2023 21:42:41 -0500 Subject: [PATCH] Dmytro's dark magic --- Dockerfile | 4 ++-- include/asym_field.h | 7 ++----- include/asym_group.h | 7 ++----- include/helper.h | 7 ++----- include/hnsw.h | 5 +---- include/ipre.h | 7 ++----- include/sym_field.h | 7 ++----- include/sym_group.h | 5 +---- include/sym_matrix.h | 7 ++----- include/sym_vector.h | 7 ++----- 10 files changed, 18 insertions(+), 45 deletions(-) diff --git a/Dockerfile b/Dockerfile index 340f23a..a4ecb22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN mkdir -p relic-target-sym WORKDIR "/home/relic-0.6.0/relic-target-sym" RUN cmake -DLABEL=sym .. RUN ../preset/gmp-pbc-ss1536.sh ../ -RUN make -w +RUN make RUN make install # Library installation, install the asymmetric curve. @@ -31,7 +31,7 @@ RUN mkdir -p relic-target-asym WORKDIR "/home/relic-0.6.0/relic-target-asym" RUN cmake -DLABEL=asym .. RUN ../preset/gmp-pbc-bn254.sh ../ -RUN make -w +RUN make RUN make install # Copy the files over to working directory. diff --git a/include/asym_field.h b/include/asym_field.h index c932030..6eba2b5 100644 --- a/include/asym_field.h +++ b/include/asym_field.h @@ -1,5 +1,4 @@ -#ifndef PPANN_ASYM_FIELD_H -#define PPANN_ASYM_FIELD_H +#pragma once #include <gmp.h> @@ -32,6 +31,4 @@ ZP_ASYM zp_inv(ZP_ASYM x); int zp_cmp(ZP_ASYM x, ZP_ASYM y); -int zp_cmp_int(ZP_ASYM x, int y); - -#endif //PPANN_ASYM_FIELD_H +int zp_cmp_int(ZP_ASYM x, int y); \ No newline at end of file diff --git a/include/asym_group.h b/include/asym_group.h index 9278d8a..45b1c93 100644 --- a/include/asym_group.h +++ b/include/asym_group.h @@ -1,5 +1,4 @@ -#ifndef PPANN_ASYM_GROUP_H -#define PPANN_ASYM_GROUP_H +#pragma once #include "asym_field.h" @@ -17,6 +16,4 @@ void g2_mul(g2_asym r, g2_asym x, ZP_ASYM y); void gt_raise(gt_asym r, gt_asym x, ZP_ASYM y); -void bp_map(gt_asym r, g1_asym x, g2_asym y); - -#endif //PPANN_ASYM_GROUP_H \ No newline at end of file +void bp_map(gt_asym r, g1_asym x, g2_asym y); \ No newline at end of file diff --git a/include/helper.h b/include/helper.h index ae2291c..9fc23b1 100644 --- a/include/helper.h +++ b/include/helper.h @@ -1,5 +1,4 @@ -#ifndef PPANN_HELPER_H -#define PPANN_HELPER_H +#pragma once #include <cstdio> #include <cstring> @@ -13,6 +12,4 @@ int *ivecs_read(const char *file_path, size_t *d_out, size_t *n_out); int *float_to_int(const float *data, size_t size); -Item *encrypt_data(const int *data, Key key, size_t d, size_t n); - -#endif //PPANN_HELPER_H \ No newline at end of file +Item *encrypt_data(const int *data, Key key, size_t d, size_t n); \ No newline at end of file diff --git a/include/hnsw.h b/include/hnsw.h index 8626601..fcd6da7 100644 --- a/include/hnsw.h +++ b/include/hnsw.h @@ -1,5 +1,4 @@ -#ifndef PPANN_HNSW_H -#define PPANN_HNSW_H +#pragma once #include <set> #include <random> @@ -61,5 +60,3 @@ struct HNSWGraph { vector<int> searchLayer(Item &q, int ep, int ef, int lc); }; - -#endif //PPANN_HNSW_H diff --git a/include/ipre.h b/include/ipre.h index 542f16f..65695b9 100644 --- a/include/ipre.h +++ b/include/ipre.h @@ -1,5 +1,4 @@ -#ifndef PPANN_IPRE_H -#define PPANN_IPRE_H +#pragma once #include "sym_vector.h" #include "sym_matrix.h" @@ -25,6 +24,4 @@ Key setup(int size); Ct enc(Key key, const int *message, int size); -int eval(Key key, Ct x, Ct y, int size, int bound); - -#endif //PPANN_IPRE_H \ No newline at end of file +int eval(Key key, Ct x, Ct y, int size, int bound); \ No newline at end of file diff --git a/include/sym_field.h b/include/sym_field.h index 59206c9..b4dc474 100644 --- a/include/sym_field.h +++ b/include/sym_field.h @@ -1,5 +1,4 @@ -#ifndef PPANN_SYM_FIELD_H -#define PPANN_SYM_FIELD_H +#pragma once #include <gmp.h> @@ -32,6 +31,4 @@ ZP_SYM zp_inv(ZP_SYM x); int zp_cmp(ZP_SYM x, ZP_SYM y); -int zp_cmp_int(ZP_SYM x, int y); - -#endif //PPANN_SYM_FIELD_H \ No newline at end of file +int zp_cmp_int(ZP_SYM x, int y); \ No newline at end of file diff --git a/include/sym_group.h b/include/sym_group.h index 14bfe7c..95a3ca7 100644 --- a/include/sym_group.h +++ b/include/sym_group.h @@ -1,5 +1,4 @@ -#ifndef PPANN_SYM_GROUP_H -#define PPANN_SYM_GROUP_H +#pragma once #include "sym_field.h" @@ -13,5 +12,3 @@ void g_mul(g_sym r, g_sym x, ZP_SYM y); void gt_raise(gt_sym r, gt_sym x, ZP_SYM y); void bp_map(g_sym a, g_sym b, gt_sym r); - -#endif //PPANN_SYM_GROUP_H \ No newline at end of file diff --git a/include/sym_matrix.h b/include/sym_matrix.h index fb31d61..5e330ae 100644 --- a/include/sym_matrix.h +++ b/include/sym_matrix.h @@ -1,5 +1,4 @@ -#ifndef PPANN_SYM_MATRIX_H -#define PPANN_SYM_MATRIX_H +#pragma once #include "sym_field.h" @@ -19,6 +18,4 @@ zp_mat matrix_merge(zp_mat x, zp_mat y, int row, int col_x, int col_y); zp_mat matrix_multiply(zp_mat x, zp_mat y, int row_x, int row_y, int col_y, bn_t modular); -zp_mat matrix_inverse(zp_mat x, int size, bn_t modular); - -#endif //PPANN_SYM_MATRIX_H \ No newline at end of file +zp_mat matrix_inverse(zp_mat x, int size, bn_t modular); \ No newline at end of file diff --git a/include/sym_vector.h b/include/sym_vector.h index 4f016e3..8bd92e8 100644 --- a/include/sym_vector.h +++ b/include/sym_vector.h @@ -1,5 +1,4 @@ -#ifndef PPANN_SYM_VECTOR_H -#define PPANN_SYM_VECTOR_H +#pragma once #include "sym_field.h" #include "sym_group.h" @@ -17,6 +16,4 @@ zp_vec vector_add(zp_vec a, zp_vec b, int size); g_vec vector_raise(g_sym base, zp_vec x, int size); -void inner_product(gt_sym r, g_vec a, g_vec b, int size); - -#endif //PPANN_SYM_VECTOR_H \ No newline at end of file +void inner_product(gt_sym r, g_vec a, g_vec b, int size); \ No newline at end of file -- GitLab