more rework of the logics
[oweals/gnunet.git] / src / scalarproduct / scalarproduct.h
index 5d6b82a35bcd75c803f3ca0f331e623abd2313b3..9304c0c7ee002280747de6dd6e4046580f02af0c 100644 (file)
 extern "C"
 {
 #endif
+///////////////////////////////////////////////////////////////////////////////
+//                      Defines
+///////////////////////////////////////////////////////////////////////////////
+/**
+ * Length of the key used for encryption
+ */
+#define KEYBITS 2048
+
+/**
+ * When performing our crypto, we may add two encrypted values with each 
+ * a maximal length of GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH.
+ * thus we can receive a slightly longer element (+1 byte)
+ */
+#define PAILLIER_ELEMENT_LENGTH (2*KEYBITS/8 +1)
+
+/**
+ * Log an error message at log-level 'level' that indicates
+ * a failure of the command 'cmd' with the message given
+ * by gcry_strerror(rc).
+ */
+#define LOG_GCRY(level, cmd, rc) do { LOG(level, _("`%s' failed at %s:%d with error: %s\n"), cmd, __FILE__, __LINE__, gcry_strerror(rc)); } while(0)
 
 ///////////////////////////////////////////////////////////////////////////////
 //                     Scalar Product Message Types