Format code
diff --git a/include/bls.h.in b/include/bls.h.in
index 40d59ff..2e0bd91 100644
--- a/include/bls.h.in
+++ b/include/bls.h.in
@@ -40,7 +40,7 @@
#define BFS_ZZZ MODBYTES_XXX /**< BLS Field Size */
#define BLS_OK 0 /**< Function completed without error */
-#define BLS_FAIL 41 /**< Invalid signature */
+#define BLS_FAIL 41 /**< Invalid signature */
#define BLS_INVALID_G1 42 /**< Not a valid G1 point on the curve */
#define BLS_INVALID_G2 43 /**< Not a valid G2 point on the curve */
@@ -95,7 +95,7 @@
*
@param k Threshold
@param n Number of shares
- @param RNG Pointer to a cryptographically secure random number generator
+ @param RNG Pointer to a cryptographically secure random number generator
@param X X values
@param Y Y values. Valid BLS secret keys
@param SKI Input secret key to be shared. Ignored if set to NULL
diff --git a/src/utils.c b/src/utils.c
index cc533ce..5e120a0 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -88,11 +88,11 @@
unsigned char ch;
for (size_t i = 0; i < src_len && i< dst_len/2; i++)
{
- ch=src[i];
- uint8_t res = ch / 16;
- uint8_t mod = ch % 16;
- dst[i*2] = hexadecimals[res];
- dst[(i*2)+1] = hexadecimals[mod];
+ ch=src[i];
+ uint8_t res = ch / 16;
+ uint8_t mod = ch % 16;
+ dst[i*2] = hexadecimals[res];
+ dst[(i*2)+1] = hexadecimals[mod];
}
}
@@ -132,7 +132,8 @@
void generateRandom(csprng *RNG,octet *randomValue)
{
int i;
- for (i=0; i<randomValue->len; i++) {
+ for (i=0; i<randomValue->len; i++)
+ {
randomValue->val[i] = RAND_byte(RNG);
}
}
diff --git a/test/test_aes_decrypt.c b/test/test_aes_decrypt.c
index 34d1b53..c8c2bce 100644
--- a/test/test_aes_decrypt.c
+++ b/test/test_aes_decrypt.c
@@ -153,7 +153,8 @@
l1 = strlen(linePtr)-1;
IVLen = l1/2;
IV = (char*) malloc (IVLen);
- if (IV==NULL) {
+ if (IV==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
diff --git a/test/test_aes_encrypt.c b/test/test_aes_encrypt.c
index 8668a4e..7d9e836 100644
--- a/test/test_aes_encrypt.c
+++ b/test/test_aes_encrypt.c
@@ -152,7 +152,8 @@
l1 = strlen(linePtr)-1;
IVLen = l1/2;
IV = (char*) malloc (IVLen);
- if (IV==NULL) {
+ if (IV==NULL)
+ {
exit(EXIT_FAILURE);
fclose(fp);
}
@@ -172,7 +173,8 @@
l1 = strlen(linePtr)-1;
PLAINTEXTLen = l1/2;
PLAINTEXT = (char*) malloc(PLAINTEXTLen);
- if (PLAINTEXT==NULL) {
+ if (PLAINTEXT==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -192,7 +194,8 @@
// Allocate memory
l1 = strlen(linePtr);
CIPHERTEXT1 = (char*) malloc(PLAINTEXTLen+1);
- if (CIPHERTEXT1==NULL) {
+ if (CIPHERTEXT1==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
diff --git a/test/test_big_consistency_XXX.c.in b/test/test_big_consistency_XXX.c.in
index 3cb69af..c342447 100644
--- a/test/test_big_consistency_XXX.c.in
+++ b/test/test_big_consistency_XXX.c.in
@@ -59,14 +59,14 @@
exit(EXIT_FAILURE);
}
- /* Testing coping and equal function */
+ /* Testing copying and equal function */
BIG_XXX_random(F,&rng);
BIG_XXX_random(DF,&rng);
BIG_XXX_copy(G,F);
BIG_XXX_dcopy(DG,DF);
if(BIG_XXX_comp(G,F) | BIG_XXX_dcomp(DG,DF))
{
- printf("ERROR testing coping and equal BIG_XXX\n");
+ printf("ERROR testing copying and equal BIG_XXX\n");
exit(EXIT_FAILURE);
}
diff --git a/test/test_ecdh_ZZZ.c.in b/test/test_ecdh_ZZZ.c.in
index 1250718..a8d4d41 100644
--- a/test/test_ecdh_ZZZ.c.in
+++ b/test/test_ecdh_ZZZ.c.in
@@ -150,7 +150,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
dIUT = (char*) malloc (l2);
- if (dIUT==NULL) {
+ if (dIUT==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -207,7 +208,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
ZIUT = (char*) malloc (l2);
- if (ZIUT==NULL) {
+ if (ZIUT==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
diff --git a/test/test_ecdsa_keypair_ZZZ.c.in b/test/test_ecdsa_keypair_ZZZ.c.in
index e1f3245..b2b85d6 100644
--- a/test/test_ecdsa_keypair_ZZZ.c.in
+++ b/test/test_ecdsa_keypair_ZZZ.c.in
@@ -89,7 +89,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
d = (char*) malloc (l2);
- if (d==NULL) {
+ if (d==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
diff --git a/test/test_ecdsa_sign_ZZZ.c.in b/test/test_ecdsa_sign_ZZZ.c.in
index 6cb5b5f..6089754 100644
--- a/test/test_ecdsa_sign_ZZZ.c.in
+++ b/test/test_ecdsa_sign_ZZZ.c.in
@@ -121,7 +121,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
Msg = (char*) malloc (l2);
- if (Msg==NULL) {
+ if (Msg==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -145,7 +146,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
d = (char*) malloc (l2);
- if (d==NULL) {
+ if (d==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -199,7 +201,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
k = (char*) malloc (l2);
- if (k==NULL) {
+ if (k==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -223,7 +226,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
R = (char*) malloc (l2);
- if (R==NULL) {
+ if (R==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -247,7 +251,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
S = (char*) malloc (l2);
- if (S==NULL) {
+ if (S==NULL)
+ {
exit(EXIT_FAILURE);
}
// S binary value
diff --git a/test/test_ecdsa_verify_ZZZ.c.in b/test/test_ecdsa_verify_ZZZ.c.in
index 0ec3829..d766a65 100644
--- a/test/test_ecdsa_verify_ZZZ.c.in
+++ b/test/test_ecdsa_verify_ZZZ.c.in
@@ -114,7 +114,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
Msg = (char*) malloc (l2);
- if (Msg==NULL) {
+ if (Msg==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -168,7 +169,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
R = (char*) malloc (l2);
- if (R==NULL) {
+ if (R==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}
@@ -192,7 +194,8 @@
l1 = strlen(linePtr)-1;
l2 = l1/2;
S = (char*) malloc (l2);
- if (S==NULL) {
+ if (S==NULL)
+ {
fclose(fp);
exit(EXIT_FAILURE);
}