Skip to content

Commit fbd5b10

Browse files
authored
Merge pull request #376 from Tarsnap/libcperciva-import
Libcperciva import and trivial fixes
2 parents 710793d + 442cf00 commit fbd5b10

File tree

14 files changed

+107
-64
lines changed

14 files changed

+107
-64
lines changed

lib-platform/crypto/crypto_scrypt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
#include "crypto_scrypt.h"
4747

48-
static void (*smix_func)(uint8_t *, size_t, uint64_t, void *, void *) = NULL;
48+
static void (* smix_func)(uint8_t *, size_t, uint64_t, void *, void *) = NULL;
4949

5050
/**
5151
* crypto_scrypt_internal(passwd, passwdlen, salt, saltlen, N, r, p, buf,
@@ -56,7 +56,7 @@ static int
5656
crypto_scrypt_internal(const uint8_t * passwd, size_t passwdlen,
5757
const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t _r, uint32_t _p,
5858
uint8_t * buf, size_t buflen,
59-
void (*smix)(uint8_t *, size_t, uint64_t, void *, void *))
59+
void (* smix)(uint8_t *, size_t, uint64_t, void *, void *))
6060
{
6161
void * B0, * V0, * XY0;
6262
uint8_t * B;
@@ -192,7 +192,7 @@ static struct scrypt_test {
192192
};
193193

194194
static int
195-
testsmix(void (*smix)(uint8_t *, size_t, uint64_t, void *, void *))
195+
testsmix(void (* smix)(uint8_t *, size_t, uint64_t, void *, void *))
196196
{
197197
uint8_t hbuf[TESTLEN];
198198

lib/scryptenc/scryptenc_cpuperf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ getclockdiff(struct timeval * st, double * diffd)
4646
return (1);
4747
*diffd = timeval_diff((*st), en);
4848

49+
/* Success! */
4950
return (0);
5051
}
5152

libcperciva/POSIX/posix-abstract-declarator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ func(int arr[static restrict 1])
99
{
1010

1111
(void)arr; /* UNUSED */
12+
13+
/* Success! */
1214
return (0);
1315
}
1416

@@ -17,5 +19,7 @@ main(void)
1719
{
1820

1921
(void)func; /* UNUSED */
22+
23+
/* Success! */
2024
return (0);
2125
}

libcperciva/POSIX/posix-stat-st_mtim.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ main(void)
88
/* Can we reference st_mtim? */
99
(void)sb.st_mtim.tv_sec;
1010

11+
/* Success! */
1112
return (0);
1213
}

libcperciva/POSIX/posix-trivial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ int
22
main(void)
33
{
44

5+
/* Success! */
56
return (0);
67
}

libcperciva/alg/sha256.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int
140140
hwtest(const uint32_t state[static restrict 8],
141141
const uint8_t block[static restrict 64],
142142
uint32_t W[static restrict 64], uint32_t S[static restrict 8],
143-
void(* func)(uint32_t state[static restrict 8],
143+
void (* func)(uint32_t state[static restrict 8],
144144
const uint8_t block[static restrict 64], uint32_t W[static restrict 64],
145145
uint32_t S[static restrict 8]))
146146
{

libcperciva/cpusupport/Build/cpusupport-ARM-AES.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ main(void)
1717

1818
lanes = vdupq_laneq_u32(lanes, 0);
1919

20+
/* Success! */
2021
return (0);
2122
}

libcperciva/cpusupport/Build/cpusupport-ARM-SHA256.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ main(void)
1212
output = vsha256su0q_u32(w0, w4);
1313
(void)output; /* UNUSED */
1414

15+
/* Success! */
1516
return (0);
1617
}

libcperciva/crypto/crypto_aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static struct aes_test {
6767

6868
/* Test a function against test vectors. */
6969
static int
70-
functest(int(* func)(const uint8_t *, size_t, const uint8_t[16], uint8_t[16]))
70+
functest(int (* func)(const uint8_t *, size_t, const uint8_t[16], uint8_t[16]))
7171
{
7272
struct aes_test * knowngood;
7373
uint8_t ctext[16];

libcperciva/crypto/crypto_aesctr_shared.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ crypto_aesctr_stream_pre_wholeblock(struct crypto_aesctr * stream,
8181
buflen_p, 16 - bytemod, bytemod);
8282
}
8383

84+
/* Success! */
8485
return (0);
8586
}
8687

0 commit comments

Comments
 (0)