uncrustify as demanded.
[oweals/gnunet.git] / src / include / gnunet_secretsharing_service.h
index 69cfa4514c7bca99e2c14ae6674871e3edf56f92..40c98b857cf6661dab1f7978f9b9f75af7c42adb 100644 (file)
@@ -11,7 +11,7 @@
       WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       Affero General Public License for more details.
-     
+
       You should have received a copy of the GNU Affero General Public License
       along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -60,39 +60,39 @@ extern "C"
  * The q-parameter for ElGamal encryption, a 1024-bit safe prime.
  */
 #define GNUNET_SECRETSHARING_ELGAMAL_P_HEX  \
-      "0x08a347d3d69e8b2dd7d1b12a08dfbccbebf4ca" \
-      "6f4269a0814e158a34312964d946b3ef22882317" \
-      "2bcf30fc08f772774cb404f9bc002a6f66b09a79" \
-      "d810d67c4f8cb3bedc6060e3c8ef874b1b64df71" \
-      "6c7d2b002da880e269438d5a776e6b5f253c8df5" \
-      "6a16b1c7ce58def07c03db48238aadfc52a354a2" \
-      "7ed285b0c1675cad3f3"
+  "0x08a347d3d69e8b2dd7d1b12a08dfbccbebf4ca" \
+  "6f4269a0814e158a34312964d946b3ef22882317" \
+  "2bcf30fc08f772774cb404f9bc002a6f66b09a79" \
+  "d810d67c4f8cb3bedc6060e3c8ef874b1b64df71" \
+  "6c7d2b002da880e269438d5a776e6b5f253c8df5" \
+  "6a16b1c7ce58def07c03db48238aadfc52a354a2" \
+  "7ed285b0c1675cad3f3"
 
 /**
  * The q-parameter for ElGamal encryption,
  * a 1023-bit Sophie Germain prime, q = (p-1)/2
  */
 #define GNUNET_SECRETSHARING_ELGAMAL_Q_HEX  \
-      "0x0451a3e9eb4f4596ebe8d895046fde65f5fa65" \
-      "37a134d040a70ac51a1894b26ca359f79144118b" \
-      "95e7987e047bb93ba65a027cde001537b3584d3c" \
-      "ec086b3e27c659df6e303071e477c3a58db26fb8" \
-      "b63e958016d4407134a1c6ad3bb735af929e46fa" \
-      "b50b58e3e72c6f783e01eda411c556fe2951aa51" \
-      "3f6942d860b3ae569f9"
+  "0x0451a3e9eb4f4596ebe8d895046fde65f5fa65" \
+  "37a134d040a70ac51a1894b26ca359f79144118b" \
+  "95e7987e047bb93ba65a027cde001537b3584d3c" \
+  "ec086b3e27c659df6e303071e477c3a58db26fb8" \
+  "b63e958016d4407134a1c6ad3bb735af929e46fa" \
+  "b50b58e3e72c6f783e01eda411c556fe2951aa51" \
+  "3f6942d860b3ae569f9"
 
 /**
  * The g-parameter for ElGamal encryption,
  * a generator of the unique size q subgroup of Z_p^*
  */
 #define GNUNET_SECRETSHARING_ELGAMAL_G_HEX  \
-      "0x05c00c36d2e822950087ef09d8252994adc4e4" \
-      "8fe3ec70269f035b46063aff0c99b633fd64df43" \
-      "02442e1914c829a41505a275438871f365e91c12" \
-      "3d5303ef9e90f4b8cb89bf86cc9b513e74a72634" \
-      "9cfd9f953674fab5d511e1c078fc72d72b34086f" \
-      "c82b4b951989eb85325cb203ff98df76bc366bba" \
-      "1d7024c3650f60d0da"
+  "0x05c00c36d2e822950087ef09d8252994adc4e4" \
+  "8fe3ec70269f035b46063aff0c99b633fd64df43" \
+  "02442e1914c829a41505a275438871f365e91c12" \
+  "3d5303ef9e90f4b8cb89bf86cc9b513e74a72634" \
+  "9cfd9f953674fab5d511e1c078fc72d72b34086f" \
+  "c82b4b951989eb85325cb203ff98df76bc366bba" \
+  "1d7024c3650f60d0da"
 
 
 
@@ -119,19 +119,17 @@ struct GNUNET_SECRETSHARING_DecryptionHandle;
 /**
  * Public key of a group sharing a secret.
  */
-struct GNUNET_SECRETSHARING_PublicKey
-{
-  uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)];
+struct GNUNET_SECRETSHARING_PublicKey {
+  uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
 };
 
 
 /**
  * Encrypted field element.
  */
-struct GNUNET_SECRETSHARING_Ciphertext
-{
-  uint32_t c1_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)];
-  uint32_t c2_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)];
+struct GNUNET_SECRETSHARING_Ciphertext {
+  uint32_t c1_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
+  uint32_t c2_bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
 };
 
 
@@ -141,12 +139,11 @@ struct GNUNET_SECRETSHARING_Ciphertext
  * Note that we are not operating in GF(2^n), thus not every
  * bit pattern is a valid plain text.
  */
-struct GNUNET_SECRETSHARING_Plaintext
-{
+struct GNUNET_SECRETSHARING_Plaintext {
   /**
    * Value of the message.
    */
-  uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof (uint32_t)];
+  uint32_t bits[GNUNET_SECRETSHARING_ELGAMAL_BITS / 8 / sizeof(uint32_t)];
 };
 
 
@@ -205,15 +202,15 @@ typedef void
  * @param cls closure for @a cb
  */
 struct GNUNET_SECRETSHARING_Session *
-GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                                     unsigned int num_peers,
-                                     const struct GNUNET_PeerIdentity *peers,
-                                     const struct GNUNET_HashCode *session_id,
-                                     struct GNUNET_TIME_Absolute start,
-                                     struct GNUNET_TIME_Absolute deadline,
-                                     unsigned int threshold,
-                                     GNUNET_SECRETSHARING_SecretReadyCallback cb,
-                                     void *cls);
+GNUNET_SECRETSHARING_create_session(const struct GNUNET_CONFIGURATION_Handle *cfg,
+                                    unsigned int num_peers,
+                                    const struct GNUNET_PeerIdentity *peers,
+                                    const struct GNUNET_HashCode *session_id,
+                                    struct GNUNET_TIME_Absolute start,
+                                    struct GNUNET_TIME_Absolute deadline,
+                                    unsigned int threshold,
+                                    GNUNET_SECRETSHARING_SecretReadyCallback cb,
+                                    void *cls);
 
 
 /**
@@ -223,7 +220,7 @@ GNUNET_SECRETSHARING_create_session (const struct GNUNET_CONFIGURATION_Handle *c
  * @param s session to destroy
  */
 void
-GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *s);
+GNUNET_SECRETSHARING_session_destroy(struct GNUNET_SECRETSHARING_Session *s);
 
 
 /**
@@ -240,9 +237,9 @@ GNUNET_SECRETSHARING_session_destroy (struct GNUNET_SECRETSHARING_Session *s);
  * @return #GNUNET_YES on succes, #GNUNET_SYSERR if the message is invalid (invalid range)
  */
 int
-GNUNET_SECRETSHARING_encrypt (const struct GNUNET_SECRETSHARING_PublicKey *public_key,
-                              const struct GNUNET_SECRETSHARING_Plaintext *plaintext,
-                              struct GNUNET_SECRETSHARING_Ciphertext *result_ciphertext);
+GNUNET_SECRETSHARING_encrypt(const struct GNUNET_SECRETSHARING_PublicKey *public_key,
+                             const struct GNUNET_SECRETSHARING_Plaintext *plaintext,
+                             struct GNUNET_SECRETSHARING_Ciphertext *result_ciphertext);
 
 
 /**
@@ -262,13 +259,13 @@ GNUNET_SECRETSHARING_encrypt (const struct GNUNET_SECRETSHARING_PublicKey *publi
  * @return handle to cancel the operation
  */
 struct GNUNET_SECRETSHARING_DecryptionHandle *
-GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg,
-                              struct GNUNET_SECRETSHARING_Share *share,
-                              const struct GNUNET_SECRETSHARING_Ciphertext *ciphertext,
-                              struct GNUNET_TIME_Absolute start,
-                              struct GNUNET_TIME_Absolute deadline,
-                              GNUNET_SECRETSHARING_DecryptCallback decrypt_cb,
-                              void *decrypt_cb_cls);
+GNUNET_SECRETSHARING_decrypt(const struct GNUNET_CONFIGURATION_Handle *cfg,
+                             struct GNUNET_SECRETSHARING_Share *share,
+                             const struct GNUNET_SECRETSHARING_Ciphertext *ciphertext,
+                             struct GNUNET_TIME_Absolute start,
+                             struct GNUNET_TIME_Absolute deadline,
+                             GNUNET_SECRETSHARING_DecryptCallback decrypt_cb,
+                             void *decrypt_cb_cls);
 
 
 /**
@@ -280,7 +277,7 @@ GNUNET_SECRETSHARING_decrypt (const struct GNUNET_CONFIGURATION_Handle *cfg,
  * @param dh to cancel
  */
 void
-GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandle *dh);
+GNUNET_SECRETSHARING_decrypt_cancel(struct GNUNET_SECRETSHARING_DecryptionHandle *dh);
 
 
 /**
@@ -293,7 +290,7 @@ GNUNET_SECRETSHARING_decrypt_cancel (struct GNUNET_SECRETSHARING_DecryptionHandl
  * @return The share, or NULL on error.
  */
 struct GNUNET_SECRETSHARING_Share *
-GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen);
+GNUNET_SECRETSHARING_share_read(const void *data, size_t len, size_t *readlen);
 
 
 /**
@@ -308,21 +305,21 @@ GNUNET_SECRETSHARING_share_read (const void *data, size_t len, size_t *readlen);
  * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure.
  */
 int
-GNUNET_SECRETSHARING_share_write (const struct GNUNET_SECRETSHARING_Share *share,
-                                  void *buf, size_t buflen, size_t *writelen);
+GNUNET_SECRETSHARING_share_write(const struct GNUNET_SECRETSHARING_Share *share,
+                                 void *buf, size_t buflen, size_t *writelen);
 
 
 void
-GNUNET_SECRETSHARING_share_destroy (struct GNUNET_SECRETSHARING_Share *share);
+GNUNET_SECRETSHARING_share_destroy(struct GNUNET_SECRETSHARING_Share *share);
 
 
 int
-GNUNET_SECRETSHARING_plaintext_generate (struct GNUNET_SECRETSHARING_Plaintext *plaintext,
-                                         gcry_mpi_t exponent);
+GNUNET_SECRETSHARING_plaintext_generate(struct GNUNET_SECRETSHARING_Plaintext *plaintext,
+                                        gcry_mpi_t exponent);
 
 int
-GNUNET_SECRETSHARING_plaintext_generate_i (struct GNUNET_SECRETSHARING_Plaintext *plaintext,
-                                           int64_t exponent);
+GNUNET_SECRETSHARING_plaintext_generate_i(struct GNUNET_SECRETSHARING_Plaintext *plaintext,
+                                          int64_t exponent);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */