summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/sha1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/sha1.cpp')
-rw-r--r--src/lib/util/sha1.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/util/sha1.cpp b/src/lib/util/sha1.cpp
index 700c691622e..f1f00a60310 100644
--- a/src/lib/util/sha1.cpp
+++ b/src/lib/util/sha1.cpp
@@ -31,15 +31,15 @@
#include <stdlib.h>
#include <string.h>
-static unsigned int READ_UINT32(const UINT8* data)
+static unsigned int READ_UINT32(const uint8_t* data)
{
- return ((UINT32)data[0] << 24) |
- ((UINT32)data[1] << 16) |
- ((UINT32)data[2] << 8) |
- ((UINT32)data[3]);
+ return ((uint32_t)data[0] << 24) |
+ ((uint32_t)data[1] << 16) |
+ ((uint32_t)data[2] << 8) |
+ ((uint32_t)data[3]);
}
-static void WRITE_UINT32(unsigned char* data, UINT32 val)
+static void WRITE_UINT32(unsigned char* data, uint32_t val)
{
data[0] = (val >> 24) & 0xFF;
data[1] = (val >> 16) & 0xFF;
@@ -154,7 +154,7 @@ sha1_init(struct sha1_ctx *ctx)
Note that this function destroys the data area */
/**
- * @fn static void sha1_transform(UINT32 *state, UINT32 *data)
+ * @fn static void sha1_transform(uint32_t *state, uint32_t *data)
*
* @brief Sha 1 transform.
*
@@ -163,9 +163,9 @@ sha1_init(struct sha1_ctx *ctx)
*/
static void
-sha1_transform(UINT32 *state, UINT32 *data)
+sha1_transform(uint32_t *state, uint32_t *data)
{
- UINT32 A, B, C, D, E; /* Local vars */
+ uint32_t A, B, C, D, E; /* Local vars */
/* Set up first buffer and local data buffer */
A = state[0];
@@ -268,7 +268,7 @@ sha1_transform(UINT32 *state, UINT32 *data)
}
/**
- * @fn static void sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
+ * @fn static void sha1_block(struct sha1_ctx *ctx, const uint8_t *block)
*
* @brief Sha 1 block.
*
@@ -277,9 +277,9 @@ sha1_transform(UINT32 *state, UINT32 *data)
*/
static void
-sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
+sha1_block(struct sha1_ctx *ctx, const uint8_t *block)
{
- UINT32 data[SHA1_DATA_LENGTH];
+ uint32_t data[SHA1_DATA_LENGTH];
int i;
/* Update block count */
@@ -294,7 +294,7 @@ sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
}
/**
- * @fn void sha1_update(struct sha1_ctx *ctx, unsigned length, const UINT8 *buffer)
+ * @fn void sha1_update(struct sha1_ctx *ctx, unsigned length, const uint8_t *buffer)
*
* @brief Sha 1 update.
*
@@ -305,7 +305,7 @@ sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
void
sha1_update(struct sha1_ctx *ctx,
- unsigned length, const UINT8 *buffer)
+ unsigned length, const uint8_t *buffer)
{
if (ctx->index)
{ /* Try to fill partial block */
@@ -350,7 +350,7 @@ sha1_update(struct sha1_ctx *ctx,
void
sha1_final(struct sha1_ctx *ctx)
{
- UINT32 data[SHA1_DATA_LENGTH];
+ uint32_t data[SHA1_DATA_LENGTH];
int i;
int words;
@@ -391,7 +391,7 @@ sha1_final(struct sha1_ctx *ctx)
}
/**
- * @fn void sha1_digest(const struct sha1_ctx *ctx, unsigned length, UINT8 *digest)
+ * @fn void sha1_digest(const struct sha1_ctx *ctx, unsigned length, uint8_t *digest)
*
* @brief Sha 1 digest.
*
@@ -403,7 +403,7 @@ sha1_final(struct sha1_ctx *ctx)
void
sha1_digest(const struct sha1_ctx *ctx,
unsigned length,
- UINT8 *digest)
+ uint8_t *digest)
{
unsigned i;
unsigned words;
@@ -419,7 +419,7 @@ sha1_digest(const struct sha1_ctx *ctx,
if (leftover)
{
- UINT32 word;
+ uint32_t word;
unsigned j = leftover;
assert(i < _SHA1_DIGEST_LENGTH);