made the service more resilient against out of order and simply incorrect messages
[oweals/gnunet.git] / src / scalarproduct / scalarproduct.h
index 18e782ac0b488e3d45049992264729fb7a591f98..d476ae8ff735c94ef2826200a152a5da3314ed1f 100644 (file)
@@ -48,6 +48,11 @@ extern "C"
  */
 #define PAILLIER_ELEMENT_LENGTH (2*KEYBITS/8 +1)
 
+/**
+ * Maximum count of elements we can put into a multipart message
+ */
+#define MULTIPART_ELEMENT_CAPACITY ((GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct GNUNET_SCALARPRODUCT_multipart_message)) / PAILLIER_ELEMENT_LENGTH)
+    
 /**
  * Log an error message at log-level 'level' that indicates
  * a failure of the command 'cmd' with the message given