summaryrefslogtreecommitdiff
path: root/lib/md5.c
diff options
context:
space:
mode:
authorRaymond Mao <raymond.mao@linaro.org>2024-05-16 14:11:51 -0700
committerTom Rini <trini@konsulko.com>2024-05-22 08:55:28 -0600
commit0fe031dd722079cd076cc120d45e1711eb108fe3 (patch)
tree7c78ca1599a8ca16d4fea27d53b8a53a6c7a8ddb /lib/md5.c
parent329bb6677bf9cee18d4b87cb067ee832d0bb8e7b (diff)
downloadu-boot-0fe031dd722079cd076cc120d45e1711eb108fe3.tar.gz
u-boot-0fe031dd722079cd076cc120d45e1711eb108fe3.tar.bz2
u-boot-0fe031dd722079cd076cc120d45e1711eb108fe3.zip
md5: Use typedef for MD5 context
Use of typedef is beneficial for porting with other crypto libs without changing the API callers. Secondly, it is for the code consistency with other digest libs. SHA1, SHA256 and SHA512 are all using typedef for their context. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/md5.c')
-rw-r--r--lib/md5.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/md5.c b/lib/md5.c
index faf3f78ab1..34343cf8e2 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -55,7 +55,7 @@ byteReverse(unsigned char *buf, unsigned longs)
* initialization constants.
*/
void
-MD5Init(struct MD5Context *ctx)
+MD5Init(MD5Context *ctx)
{
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
@@ -71,7 +71,7 @@ MD5Init(struct MD5Context *ctx)
* of bytes.
*/
void
-MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+MD5Update(MD5Context *ctx, unsigned char const *buf, unsigned int len)
{
register __u32 t;
@@ -120,7 +120,7 @@ MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
-MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+MD5Final(unsigned char digest[16], MD5Context *ctx)
{
unsigned int count;
unsigned char *p;
@@ -269,7 +269,7 @@ MD5Transform(__u32 buf[4], __u32 const in[16])
void
md5 (unsigned char *input, int len, unsigned char output[16])
{
- struct MD5Context context;
+ MD5Context context;
MD5Init(&context);
MD5Update(&context, input, len);
@@ -286,7 +286,7 @@ void
md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16],
unsigned int chunk_sz)
{
- struct MD5Context context;
+ MD5Context context;
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
const unsigned char *end, *curr;
int chunk;