#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 {
* 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;
if (t)
{
- unsigned char *p = (unsigned char *) ctx->in + t;
+ byte *p = (byte *) ctx->in + t;
t = 64 - t;
if (len < t)
md5_final(md5_context *ctx)
{
unsigned count;
- unsigned char *p;
+ byte *p;
/* Compute number of bytes mod 64 */
count = (ctx->bits[0] >> 3) & 0x3F;
((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;
}
{
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]);
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;
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,
#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;
#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;
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
* Transform the message W which consists of 16 64-bit-words
*/
static unsigned int
-sha512_transform_block(sha512_state *hd, const unsigned char *data)
+sha512_transform_block(sha512_state *hd, const byte *data)
{
u64 a, b, c, d, e, f, g, h;
u64 w[16];
}
static unsigned int
-sha512_transform(void *context, const unsigned char *data, size_t nblks)
+sha512_transform(void *context, const byte *data, size_t nblks)
{
sha512_context *ctx = context;
unsigned int burn;
return sha512_final(ctx);
}
-static unsigned int sha512_transform(void *context, const unsigned char *data, size_t nblks);
+static unsigned int sha512_transform(void *context, const byte *data, size_t nblks);
/**
* HMAC-SHA512, HMAC-SHA384
ip_addr gw; /* Next hop */
struct iface *iface; /* Outgoing interface */
struct mpnh *next;
- unsigned char weight;
+ byte weight;
};
struct rte_src {
}
static inline struct mpnh *
-new_nexthop(struct ospf_proto *p, ip_addr gw, struct iface *iface, unsigned char weight)
+new_nexthop(struct ospf_proto *p, ip_addr gw, struct iface *iface, byte weight)
{
struct mpnh *nh = lp_alloc(p->nhpool, sizeof(struct mpnh));
nh->gw = gw;
sk_process_cmsg4_ttl(sock *s, struct cmsghdr *cm)
{
if (cm->cmsg_type == IP_RECVTTL)
- s->rcv_ttl = * (unsigned char *) CMSG_DATA(cm);
+ s->rcv_ttl = * (byte *) CMSG_DATA(cm);
}
static inline void