summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-21 15:46:20 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-21 15:46:20 +0000
commit2746b131aa482ac17c94bc6b82e58dbcc1b752cf (patch)
tree87e50c57bc8458b0809c280ab5d00042d1102925 /src/include
parent05db4ba46ae1ca6143bb9b432d1e05e69eddd263 (diff)
downloadskalibs-2746b131aa482ac17c94bc6b82e58dbcc1b752cf.tar.xz
Types fix: librandom, libstdcrypto
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/md5.h11
-rw-r--r--src/include/skalibs/random.h13
-rw-r--r--src/include/skalibs/rc4.h4
-rw-r--r--src/include/skalibs/sha1.h13
-rw-r--r--src/include/skalibs/sha256.h13
-rw-r--r--src/include/skalibs/sha512.h3
-rw-r--r--src/include/skalibs/surf.h9
7 files changed, 36 insertions, 30 deletions
diff --git a/src/include/skalibs/md5.h b/src/include/skalibs/md5.h
index c5d61a8..5e31b1f 100644
--- a/src/include/skalibs/md5.h
+++ b/src/include/skalibs/md5.h
@@ -3,19 +3,20 @@
#ifndef MD5_H
#define MD5_H
-#include <skalibs/uint32.h>
+#include <sys/types.h>
+#include <stdint.h>
typedef struct MD5Schedule MD5Schedule, *MD5Schedule_ref ;
struct MD5Schedule
{
- uint32 buf[4] ;
- uint32 bits[2] ;
+ uint32_t buf[4] ;
+ uint32_t bits[2] ;
unsigned char in[64] ;
} ;
-#define MD5_INIT() { .buf = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL }, .bits = { 0, 0 }, .in = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" }
+#define MD5_INIT() { .buf = { 0x67452301U, 0xefcdab89U, 0x98badcfeU, 0x10325476U }, .bits = { 0, 0 }, .in = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" }
extern void md5_init (MD5Schedule *) ;
-extern void md5_update (MD5Schedule *, char const *, unsigned int) ;
+extern void md5_update (MD5Schedule *, char const *, size_t) ;
extern void md5_final (MD5Schedule *, char * /* 16 chars */) ;
#endif
diff --git a/src/include/skalibs/random.h b/src/include/skalibs/random.h
index 893b50f..254a1c0 100644
--- a/src/include/skalibs/random.h
+++ b/src/include/skalibs/random.h
@@ -3,7 +3,8 @@
#ifndef RANDOM_H
#define RANDOM_H
-#include <skalibs/uint32.h>
+#include <sys/types.h>
+#include <stdint.h>
#include <skalibs/stralloc.h>
extern void random_makeseed (char *) ; /* fills 160 bytes */
@@ -12,10 +13,10 @@ extern int random_init (void) ;
extern void random_finish (void) ;
extern unsigned char random_char (void) ;
-extern void random_string (char *, unsigned int) ;
-extern uint32 random_uint32 (uint32) ;
-extern void random_name (char *, unsigned int) ;
-extern void random_unsort (char *, unsigned int, unsigned int) ;
-extern int random_sauniquename (stralloc *, unsigned int) ;
+extern void random_string (char *, size_t) ;
+extern uint32_t random_uint32 (uint32_t) ;
+extern void random_name (char *, size_t) ;
+extern void random_unsort (char *, size_t, size_t) ;
+extern int random_sauniquename (stralloc *, size_t) ;
#endif
diff --git a/src/include/skalibs/rc4.h b/src/include/skalibs/rc4.h
index 6bb8062..44ce20b 100644
--- a/src/include/skalibs/rc4.h
+++ b/src/include/skalibs/rc4.h
@@ -13,7 +13,7 @@ struct RC4Schedule
unsigned char x, y ;
} ;
-extern void rc4_init (RC4Schedule *, char const *, unsigned int) ;
-extern void rc4 (RC4Schedule *, char const *, char *, unsigned int) ;
+extern void rc4_init (RC4Schedule *, char const *, size_t) ;
+extern void rc4 (RC4Schedule *, char const *, char *, size_t) ;
#endif
diff --git a/src/include/skalibs/sha1.h b/src/include/skalibs/sha1.h
index be252ba..2d41275 100644
--- a/src/include/skalibs/sha1.h
+++ b/src/include/skalibs/sha1.h
@@ -3,20 +3,21 @@
#ifndef SHA1_H
#define SHA1_H
-#include <skalibs/uint32.h>
+#include <sys/types.h>
+#include <stdint.h>
typedef struct SHA1Schedule SHA1Schedule, *SHA1Schedule_ref ;
struct SHA1Schedule
{
- uint32 buf[5] ;
- uint32 bits[2] ;
- uint32 in[16] ;
+ uint32_t buf[5] ;
+ uint32_t bits[2] ;
+ uint32_t in[16] ;
unsigned int b ;
} ;
-#define SHA1_INIT() { .buf = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 }
+#define SHA1_INIT() { .buf = { 0x67452301U, 0xefcdab89U, 0x98badcfeU, 0x10325476U, 0xc3d2e1f0U }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 }
extern void sha1_init (SHA1Schedule *) ;
-extern void sha1_update (SHA1Schedule *, char const *, unsigned int) ;
+extern void sha1_update (SHA1Schedule *, char const *, size_t) ;
extern void sha1_final (SHA1Schedule *, char * /* 20 chars */) ;
#endif
diff --git a/src/include/skalibs/sha256.h b/src/include/skalibs/sha256.h
index 3675211..8ef7d0b 100644
--- a/src/include/skalibs/sha256.h
+++ b/src/include/skalibs/sha256.h
@@ -10,20 +10,21 @@
#ifndef SHA256_H
#define SHA256_H
-#include <skalibs/uint32.h>
+#include <sys/types.h>
+#include <stdint.h>
typedef struct SHA256Schedule_s SHA256Schedule, *SHA256Schedule_ref ;
struct SHA256Schedule_s
{
- uint32 buf[8] ; /* The eight chaining variables */
- uint32 bits[2] ; /* Count number of message bits */
- uint32 in[16] ; /* Data being fed in */
+ uint32_t buf[8] ; /* The eight chaining variables */
+ uint32_t bits[2] ; /* Count number of message bits */
+ uint32_t in[16] ; /* Data being fed in */
unsigned int b ; /* Our position within the 512 bits (always between 0 and 63) */
} ;
-#define SHA256_INIT() { .buf = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 }
+#define SHA256_INIT() { .buf = { 0x6a09e667U, 0xbb67ae85U, 0x3c6ef372U, 0xa54ff53aU, 0x510e527fU, 0x9b05688cU, 0x1f83d9abU, 0x5be0cd19U }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 }
extern void sha256_init (SHA256Schedule *) ;
-extern void sha256_update (SHA256Schedule *, char const *, unsigned int) ;
+extern void sha256_update (SHA256Schedule *, char const *, size_t) ;
extern void sha256_final (SHA256Schedule *, char *digest) ;
#endif
diff --git a/src/include/skalibs/sha512.h b/src/include/skalibs/sha512.h
index eddb4ed..9d098be 100644
--- a/src/include/skalibs/sha512.h
+++ b/src/include/skalibs/sha512.h
@@ -3,6 +3,7 @@
#ifndef SHA512_H
#define SHA512_H
+#include <sys/types.h>
#include <skalibs/uint64.h>
typedef struct SHA512Schedule_s SHA512Schedule, *SHA512Schedule_ref ;
@@ -15,7 +16,7 @@ struct SHA512Schedule_s
#define SHA512_INIT() { .len = 0, .h = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL } }
extern void sha512_init (SHA512Schedule *) ;
-extern void sha512_update (SHA512Schedule *, char const *, unsigned int) ;
+extern void sha512_update (SHA512Schedule *, char const *, size_t) ;
extern void sha512_final (SHA512Schedule *, char *digest) ;
#endif
diff --git a/src/include/skalibs/surf.h b/src/include/skalibs/surf.h
index aae21e8..99408ca 100644
--- a/src/include/skalibs/surf.h
+++ b/src/include/skalibs/surf.h
@@ -3,13 +3,14 @@
#ifndef SKALIBS_SURF_H
#define SKALIBS_SURF_H
-#include <skalibs/uint32.h>
+#include <sys/types.h>
+#include <stdint.h>
typedef struct SURFSchedule SURFSchedule, *SURFSchedule_ref, **SURFSchedule_ref_ref ;
struct SURFSchedule
{
- uint32 seed[32] ;
- uint32 in[12] ;
+ uint32_t seed[32] ;
+ uint32_t in[12] ;
char out[32] ;
unsigned int pos ;
} ;
@@ -17,6 +18,6 @@ struct SURFSchedule
#define SURFSCHEDULE_ZERO { .seed = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .out = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", .pos = 32 }
extern void surf_init (SURFSchedule *, char const *) ; /* 160 chars */
-extern void surf (SURFSchedule *, char *, unsigned int) ;
+extern void surf (SURFSchedule *, char *, size_t) ;
#endif