Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSH
lsh
Commits
013cd24c
Commit
013cd24c
authored
Aug 28, 2011
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
(md5_digest): Use _nettle_write_le32.
Rev: nettle/md5.c:1.2
parent
ce0c2106
Branches
cmac-layout
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
nettle/md5.c
+3
-25
3 additions, 25 deletions
nettle/md5.c
with
3 additions
and
25 deletions
nettle/md5.c
+
3
−
25
View file @
013cd24c
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include
"md5.h"
#include
"md5.h"
#include
"macros.h"
#include
"macros.h"
#include
"nettle-write.h"
static
void
static
void
md5_final
(
struct
md5_ctx
*
ctx
);
md5_final
(
struct
md5_ctx
*
ctx
);
...
@@ -98,33 +99,10 @@ md5_digest(struct md5_ctx *ctx,
...
@@ -98,33 +99,10 @@ md5_digest(struct md5_ctx *ctx,
unsigned
length
,
unsigned
length
,
uint8_t
*
digest
)
uint8_t
*
digest
)
{
{
unsigned
i
;
unsigned
words
;
unsigned
leftover
;
assert
(
length
<=
MD5_DIGEST_SIZE
);
assert
(
length
<=
MD5_DIGEST_SIZE
);
md5_final
(
ctx
);
md5_final
(
ctx
);
_nettle_write_le32
(
length
,
digest
,
ctx
->
digest
);
words
=
length
/
4
;
leftover
=
length
%
4
;
/* Little endian order */
for
(
i
=
0
;
i
<
words
;
i
++
,
digest
+=
4
)
LE_WRITE_UINT32
(
digest
,
ctx
->
digest
[
i
]);
if
(
leftover
)
{
uint32_t
word
;
unsigned
j
;
assert
(
i
<
_MD5_DIGEST_LENGTH
);
/* Still least significant byte first. */
for
(
word
=
ctx
->
digest
[
i
],
j
=
0
;
j
<
leftover
;
j
++
,
word
>>=
8
)
digest
[
j
]
=
word
&
0xff
;
}
md5_init
(
ctx
);
md5_init
(
ctx
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment