Commit 581c239f6eb4810f51c8cca45bd3daffde89ae37

Guillem Jover 2011-05-29T04:46:28

Remove __bounded__ GCC attribute This is a BSD specific extension to GCC, and as such not widely available elsewhere.

diff --git a/include/md4.h b/include/md4.h
index 36ab1d9..c0eaac5 100644
--- a/include/md4.h
+++ b/include/md4.h
@@ -30,23 +30,14 @@ typedef struct MD4Context {
 
 __BEGIN_DECLS
 void	 MD4Init(MD4_CTX *);
-void	 MD4Update(MD4_CTX *, const u_int8_t *, size_t)
-		__attribute__((__bounded__(__string__,2,3)));
+void	 MD4Update(MD4_CTX *, const u_int8_t *, size_t);
 void	 MD4Pad(MD4_CTX *);
-void	 MD4Final(u_int8_t [MD4_DIGEST_LENGTH], MD4_CTX *)
-		__attribute__((__bounded__(__minbytes__,1,MD4_DIGEST_LENGTH)));
-void	 MD4Transform(u_int32_t [4], const u_int8_t [MD4_BLOCK_LENGTH])
-		__attribute__((__bounded__(__minbytes__,1,4)))
-		__attribute__((__bounded__(__minbytes__,2,MD4_BLOCK_LENGTH)));
-char	*MD4End(MD4_CTX *, char *)
-		__attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
-char	*MD4File(const char *, char *)
-		__attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
-char	*MD4FileChunk(const char *, char *, off_t, off_t)
-		__attribute__((__bounded__(__minbytes__,2,MD4_DIGEST_STRING_LENGTH)));
-char	*MD4Data(const u_int8_t *, size_t, char *)
-		__attribute__((__bounded__(__string__,1,2)))
-		__attribute__((__bounded__(__minbytes__,3,MD4_DIGEST_STRING_LENGTH)));
+void	 MD4Final(u_int8_t [MD4_DIGEST_LENGTH], MD4_CTX *);
+void	 MD4Transform(u_int32_t [4], const u_int8_t [MD4_BLOCK_LENGTH]);
+char	*MD4End(MD4_CTX *, char *);
+char	*MD4File(const char *, char *);
+char	*MD4FileChunk(const char *, char *, off_t, off_t);
+char	*MD4Data(const u_int8_t *, size_t, char *);
 __END_DECLS
 
 #endif /* _MD4_H_ */
diff --git a/include/md5.h b/include/md5.h
index f412e38..6e04815 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -29,23 +29,14 @@ typedef struct MD5Context {
 
 __BEGIN_DECLS
 void	 MD5Init(MD5_CTX *);
-void	 MD5Update(MD5_CTX *, const u_int8_t *, size_t)
-		__attribute__((__bounded__(__string__,2,3)));
+void	 MD5Update(MD5_CTX *, const u_int8_t *, size_t);
 void	 MD5Pad(MD5_CTX *);
-void	 MD5Final(u_int8_t [MD5_DIGEST_LENGTH], MD5_CTX *)
-		__attribute__((__bounded__(__minbytes__,1,MD5_DIGEST_LENGTH)));
-void	 MD5Transform(u_int32_t [4], const u_int8_t [MD5_BLOCK_LENGTH])
-		__attribute__((__bounded__(__minbytes__,1,4)))
-		__attribute__((__bounded__(__minbytes__,2,MD5_BLOCK_LENGTH)));
-char	*MD5End(MD5_CTX *, char *)
-		__attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH)));
-char	*MD5File(const char *, char *)
-		__attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH)));
-char	*MD5FileChunk(const char *, char *, off_t, off_t)
-		__attribute__((__bounded__(__minbytes__,2,MD5_DIGEST_STRING_LENGTH)));
-char	*MD5Data(const u_int8_t *, size_t, char *)
-		__attribute__((__bounded__(__string__,1,2)))
-		__attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH)));
+void	 MD5Final(u_int8_t [MD5_DIGEST_LENGTH], MD5_CTX *);
+void	 MD5Transform(u_int32_t [4], const u_int8_t [MD5_BLOCK_LENGTH]);
+char	*MD5End(MD5_CTX *, char *);
+char	*MD5File(const char *, char *);
+char	*MD5FileChunk(const char *, char *, off_t, off_t);
+char	*MD5Data(const u_int8_t *, size_t, char *);
 __END_DECLS
 
 #endif /* _MD5_H_ */
diff --git a/include/rmd160.h b/include/rmd160.h
index 7e31d64..d7829ed 100644
--- a/include/rmd160.h
+++ b/include/rmd160.h
@@ -40,23 +40,14 @@ typedef struct RMD160Context {
 
 __BEGIN_DECLS
 void	 RMD160Init(RMD160_CTX *);
-void	 RMD160Transform(u_int32_t [5], const u_int8_t [RMD160_BLOCK_LENGTH])
-		__attribute__((__bounded__(__minbytes__,1,5)))
-		__attribute__((__bounded__(__minbytes__,2,RMD160_BLOCK_LENGTH)));
-void	 RMD160Update(RMD160_CTX *, const u_int8_t *, size_t)
-		__attribute__((__bounded__(__string__,2,3)));
+void	 RMD160Transform(u_int32_t [5], const u_int8_t [RMD160_BLOCK_LENGTH]);
+void	 RMD160Update(RMD160_CTX *, const u_int8_t *, size_t);
 void	 RMD160Pad(RMD160_CTX *);
-void	 RMD160Final(u_int8_t [RMD160_DIGEST_LENGTH], RMD160_CTX *)
-		__attribute__((__bounded__(__minbytes__,1,RMD160_DIGEST_LENGTH)));
-char	*RMD160End(RMD160_CTX *, char *)
-		__attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH)));
-char	*RMD160File(const char *, char *)
-		__attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH)));
-char	*RMD160FileChunk(const char *, char *, off_t, off_t)
-		__attribute__((__bounded__(__minbytes__,2,RMD160_DIGEST_STRING_LENGTH)));
-char	*RMD160Data(const u_int8_t *, size_t, char *)
-		__attribute__((__bounded__(__string__,1,2)))
-		__attribute__((__bounded__(__minbytes__,3,RMD160_DIGEST_STRING_LENGTH)));
+void	 RMD160Final(u_int8_t [RMD160_DIGEST_LENGTH], RMD160_CTX *);
+char	*RMD160End(RMD160_CTX *, char *);
+char	*RMD160File(const char *, char *);
+char	*RMD160FileChunk(const char *, char *, off_t, off_t);
+char	*RMD160Data(const u_int8_t *, size_t, char *);
 __END_DECLS
 
 #endif  /* _RMD160_H */
diff --git a/include/sha1.h b/include/sha1.h
index a63535e..dafaf65 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -24,22 +24,13 @@ typedef struct {
 __BEGIN_DECLS
 void SHA1Init(SHA1_CTX *);
 void SHA1Pad(SHA1_CTX *);
-void SHA1Transform(u_int32_t [5], const u_int8_t [SHA1_BLOCK_LENGTH])
-	__attribute__((__bounded__(__minbytes__,1,5)))
-	__attribute__((__bounded__(__minbytes__,2,SHA1_BLOCK_LENGTH)));
-void SHA1Update(SHA1_CTX *, const u_int8_t *, size_t)
-	__attribute__((__bounded__(__string__,2,3)));
-void SHA1Final(u_int8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *)
-	__attribute__((__bounded__(__minbytes__,1,SHA1_DIGEST_LENGTH)));
-char *SHA1End(SHA1_CTX *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH)));
-char *SHA1File(const char *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH)));
-char *SHA1FileChunk(const char *, char *, off_t, off_t)
-	__attribute__((__bounded__(__minbytes__,2,SHA1_DIGEST_STRING_LENGTH)));
-char *SHA1Data(const u_int8_t *, size_t, char *)
-	__attribute__((__bounded__(__string__,1,2)))
-	__attribute__((__bounded__(__minbytes__,3,SHA1_DIGEST_STRING_LENGTH)));
+void SHA1Transform(u_int32_t [5], const u_int8_t [SHA1_BLOCK_LENGTH]);
+void SHA1Update(SHA1_CTX *, const u_int8_t *, size_t);
+void SHA1Final(u_int8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *);
+char *SHA1End(SHA1_CTX *, char *);
+char *SHA1File(const char *, char *);
+char *SHA1FileChunk(const char *, char *, off_t, off_t);
+char *SHA1Data(const u_int8_t *, size_t, char *);
 __END_DECLS
 
 #define HTONDIGEST(x) do {                                              \
diff --git a/include/sha2.h b/include/sha2.h
index 3f8337e..f08ef79 100644
--- a/include/sha2.h
+++ b/include/sha2.h
@@ -65,54 +65,33 @@ typedef struct _SHA2_CTX {
 __BEGIN_DECLS
 void SHA256Init(SHA2_CTX *);
 void SHA256Transform(u_int32_t state[8], const u_int8_t [SHA256_BLOCK_LENGTH]);
-void SHA256Update(SHA2_CTX *, const u_int8_t *, size_t)
-	__attribute__((__bounded__(__string__,2,3)));
+void SHA256Update(SHA2_CTX *, const u_int8_t *, size_t);
 void SHA256Pad(SHA2_CTX *);
-void SHA256Final(u_int8_t [SHA256_DIGEST_LENGTH], SHA2_CTX *)
-	__attribute__((__bounded__(__minbytes__,1,SHA256_DIGEST_LENGTH)));
-char *SHA256End(SHA2_CTX *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH)));
-char *SHA256File(const char *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH)));
-char *SHA256FileChunk(const char *, char *, off_t, off_t)
-	__attribute__((__bounded__(__minbytes__,2,SHA256_DIGEST_STRING_LENGTH)));
-char *SHA256Data(const u_int8_t *, size_t, char *)
-	__attribute__((__bounded__(__string__,1,2)))
-	__attribute__((__bounded__(__minbytes__,3,SHA256_DIGEST_STRING_LENGTH)));
+void SHA256Final(u_int8_t [SHA256_DIGEST_LENGTH], SHA2_CTX *);
+char *SHA256End(SHA2_CTX *, char *);
+char *SHA256File(const char *, char *);
+char *SHA256FileChunk(const char *, char *, off_t, off_t);
+char *SHA256Data(const u_int8_t *, size_t, char *);
 
 void SHA384Init(SHA2_CTX *);
 void SHA384Transform(u_int64_t state[8], const u_int8_t [SHA384_BLOCK_LENGTH]);
-void SHA384Update(SHA2_CTX *, const u_int8_t *, size_t)
-	__attribute__((__bounded__(__string__,2,3)));
+void SHA384Update(SHA2_CTX *, const u_int8_t *, size_t);
 void SHA384Pad(SHA2_CTX *);
-void SHA384Final(u_int8_t [SHA384_DIGEST_LENGTH], SHA2_CTX *)
-	__attribute__((__bounded__(__minbytes__,1,SHA384_DIGEST_LENGTH)));
-char *SHA384End(SHA2_CTX *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH)));
-char *SHA384File(const char *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH)));
-char *SHA384FileChunk(const char *, char *, off_t, off_t)
-	__attribute__((__bounded__(__minbytes__,2,SHA384_DIGEST_STRING_LENGTH)));
-char *SHA384Data(const u_int8_t *, size_t, char *)
-	__attribute__((__bounded__(__string__,1,2)))
-	__attribute__((__bounded__(__minbytes__,3,SHA384_DIGEST_STRING_LENGTH)));
+void SHA384Final(u_int8_t [SHA384_DIGEST_LENGTH], SHA2_CTX *);
+char *SHA384End(SHA2_CTX *, char *);
+char *SHA384File(const char *, char *);
+char *SHA384FileChunk(const char *, char *, off_t, off_t);
+char *SHA384Data(const u_int8_t *, size_t, char *);
 
 void SHA512Init(SHA2_CTX *);
 void SHA512Transform(u_int64_t state[8], const u_int8_t [SHA512_BLOCK_LENGTH]);
-void SHA512Update(SHA2_CTX *, const u_int8_t *, size_t)
-	__attribute__((__bounded__(__string__,2,3)));
+void SHA512Update(SHA2_CTX *, const u_int8_t *, size_t);
 void SHA512Pad(SHA2_CTX *);
-void SHA512Final(u_int8_t [SHA512_DIGEST_LENGTH], SHA2_CTX *)
-	__attribute__((__bounded__(__minbytes__,1,SHA512_DIGEST_LENGTH)));
-char *SHA512End(SHA2_CTX *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH)));
-char *SHA512File(const char *, char *)
-	__attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH)));
-char *SHA512FileChunk(const char *, char *, off_t, off_t)
-	__attribute__((__bounded__(__minbytes__,2,SHA512_DIGEST_STRING_LENGTH)));
-char *SHA512Data(const u_int8_t *, size_t, char *)
-	__attribute__((__bounded__(__string__,1,2)))
-	__attribute__((__bounded__(__minbytes__,3,SHA512_DIGEST_STRING_LENGTH)));
+void SHA512Final(u_int8_t [SHA512_DIGEST_LENGTH], SHA2_CTX *);
+char *SHA512End(SHA2_CTX *, char *);
+char *SHA512File(const char *, char *);
+char *SHA512FileChunk(const char *, char *, off_t, off_t);
+char *SHA512Data(const u_int8_t *, size_t, char *);
 __END_DECLS
 
 #endif /* _SHA2_H */