Commit 8e8a4383 authored by Pavel Tvrdík's avatar Pavel Tvrdík
Browse files

unsgined char -> byte

parent c38a645d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -17,12 +17,12 @@
#ifdef CPU_LITTLE_ENDIAN
#define byteReverse(buf, len)	/* Nothing */
#else
void byteReverse(unsigned char *buf, unsigned longs);
void byteReverse(byte *buf, unsigned longs);

/*
 * Note: this code is harmless on little-endian machines.
 */
void byteReverse(unsigned char *buf, unsigned longs)
void byteReverse(byte *buf, unsigned longs)
{
  u32 t;
  do {
@@ -55,7 +55,7 @@ md5_init(md5_context *ctx)
 * of bytes.
 */
void
md5_update(md5_context *ctx, unsigned char const *buf, unsigned len)
md5_update(md5_context *ctx, byte const *buf, unsigned len)
{
  u32 t;

@@ -72,7 +72,7 @@ md5_update(md5_context *ctx, unsigned char const *buf, unsigned len)

  if (t)
  {
    unsigned char *p = (unsigned char *) ctx->in + t;
    byte *p = (byte *) ctx->in + t;

    t = 64 - t;
    if (len < t)
@@ -110,7 +110,7 @@ byte *
md5_final(md5_context *ctx)
{
  unsigned count;
  unsigned char *p;
  byte *p;

  /* Compute number of bytes mod 64 */
  count = (ctx->bits[0] >> 3) & 0x3F;
@@ -146,7 +146,7 @@ md5_final(md5_context *ctx)
  ((u32 *) ctx->in)[15] = ctx->bits[1];

  md5_transform(ctx->buf, (u32 *) ctx->in);
  byteReverse((unsigned char *) ctx->buf, 4);
  byteReverse((byte *) ctx->buf, 4);

  return (byte*) ctx->buf;
}
+2 −2
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@ typedef struct
{
  u32 buf[4];
  u32 bits[2];
  unsigned char in[64];
  byte in[64];
} md5_context;

void md5_init(md5_context *context);
void md5_update(md5_context *context, unsigned char const *buf, unsigned len);
void md5_update(md5_context *context, byte const *buf, unsigned len);
byte *md5_final(md5_context *context);

void md5_transform(u32 buf[4], u32 const in[16]);
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args)
			if (!(flags & LEFT))
				while (--field_width > 0)
					*str++ = ' ';
			*str++ = (unsigned char) va_arg(args, int);
			*str++ = (byte) va_arg(args, int);
			while (--field_width > 0)
				*str++ = ' ';
			continue;
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ sum1(u32 x)
    32-bit-words. See FIPS 180-2 for details.
 */
static unsigned int
sha256_transform_block(sha256_context *ctx, const unsigned char *data)
sha256_transform_block(sha256_context *ctx, const byte *data)
{
  static const u32 K[64] = {
      0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
@@ -215,7 +215,7 @@ sha256_transform_block(sha256_context *ctx, const unsigned char *data)
#undef R

static unsigned int
sha256_transform(void *ctx, const unsigned char *data, size_t nblks)
sha256_transform(void *ctx, const byte *data, size_t nblks)
{
  sha256_context *hd = ctx;
  unsigned int burn;
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#define SHA256_HEX_SIZE		65
#define SHA256_BLOCK_SIZE 	64

typedef unsigned int sha_transform_fn (void *c, const unsigned char *blks, size_t nblks);
typedef unsigned int sha_transform_fn (void *c, const byte *blks, size_t nblks);

typedef struct {
  u32  h0,h1,h2,h3,h4,h5,h6,h7;
@@ -51,7 +51,7 @@ byte* sha224_final(sha224_context *ctx)
  return sha256_final(ctx);
}

static unsigned int sha256_transform(void *ctx, const unsigned char *data, size_t nblks);
static unsigned int sha256_transform(void *ctx, const byte *data, size_t nblks);

/**
 *	HMAC-SHA256, HMAC-SHA224
Loading