Commit 17a0035a authored by Pavel Tvrdík's avatar Pavel Tvrdík
Browse files

SHA: Fixing small bugs and code style

Thanks to Ondrej Zajicek
parent c23cd84e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#ifndef _BIRD_SHA1_H
#define _BIRD_SHA1_H
#ifndef _BIRD_SHA1_H_
#define _BIRD_SHA1_H_

#include "sysdep/config.h"

@@ -83,4 +83,4 @@ byte *sha1_hmac_final(sha1_hmac_context *hd); /** Terminate the HMAC and ret
#define SHA1_HEX_SIZE 41 	/** Buffer length for a string containing SHA1 in hexadecimal format. **/
#define SHA1_BLOCK_SIZE 64 	/** SHA1 splits input to blocks of this size. **/

#endif
#endif /* _BIRD_SHA1_H_ */
+4 −4
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#ifndef _BIRD_SHA256_H
#define _BIRD_SHA256_H
#ifndef _BIRD_SHA256_H_
#define _BIRD_SHA256_H_

#define SHA256_SIZE 		32
#define SHA256_HEX_SIZE		65
@@ -28,7 +28,7 @@ typedef struct {
typedef sha256_context sha224_context;

void sha256_init(sha256_context *ctx);
void sha256_init(sha224_context *ctx);
void sha224_init(sha224_context *ctx);

void sha256_update(sha256_context *ctx, const byte *in_buf, size_t in_len);
void sha224_update(sha224_context *ctx, const byte *in_buf, size_t in_len)
@@ -42,4 +42,4 @@ byte* sha224_final(sha224_context *ctx)
  return sha256_final(ctx);
}

#endif
#endif /* _BIRD_SHA256_H_ */
+3 −3
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#ifndef SHA256_HMAC_H
#define SHA256_HMAC_H
#ifndef _BIRD_SHA256_HMAC_H_
#define _BIRD_SHA256_HMAC_H_

#define SHA256_SIZE 		32
#define SHA256_HEX_SIZE		65
@@ -34,4 +34,4 @@ void sha256_hmac_init(sha256_hmac_context *ctx, const void *key, size_t keylen);
void sha256_hmac_update(sha256_hmac_context *ctx, const void *buf, size_t buflen);
const byte *sha256_hmac_final(sha256_hmac_context *ctx);

#endif /* SHA256_HMAC_H */
#endif /* _BIRD_SHA256_HMAC_H_ */