Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
md5toc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
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
Anders Blomdell
md5toc
Commits
99f46a60
Commit
99f46a60
authored
2 months ago
by
Super User
Browse files
Options
Downloads
Patches
Plain Diff
New style function declarations
parent
e0eec9b6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
md5.c
+16
-23
16 additions, 23 deletions
md5.c
md5toc.spec.template
+2
-0
2 additions, 0 deletions
md5toc.spec.template
with
18 additions
and
23 deletions
md5.c
+
16
−
23
View file @
99f46a60
...
@@ -53,8 +53,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
...
@@ -53,8 +53,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
/* Initialize structure containing state of computation.
/* Initialize structure containing state of computation.
(RFC 1321, 3.3: Step 3) */
(RFC 1321, 3.3: Step 3) */
void
void
md5_init_ctx
(
ctx
)
md5_init_ctx
(
struct
md5_ctx
*
ctx
)
struct
md5_ctx
*
ctx
;
{
{
ctx
->
A
=
0x67452301
;
ctx
->
A
=
0x67452301
;
ctx
->
B
=
0xefcdab89
;
ctx
->
B
=
0xefcdab89
;
...
@@ -71,9 +70,8 @@ md5_init_ctx (ctx)
...
@@ -71,9 +70,8 @@ md5_init_ctx (ctx)
IMPORTANT: On some systems it is required that RESBUF is correctly
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
aligned for a 32 bits value. */
void
*
void
*
md5_read_ctx
(
ctx
,
resbuf
)
md5_read_ctx
(
const
struct
md5_ctx
*
ctx
,
const
struct
md5_ctx
*
ctx
;
void
*
resbuf
)
void
*
resbuf
;
{
{
((
md5_uint32
*
)
resbuf
)[
0
]
=
SWAP
(
ctx
->
A
);
((
md5_uint32
*
)
resbuf
)[
0
]
=
SWAP
(
ctx
->
A
);
((
md5_uint32
*
)
resbuf
)[
1
]
=
SWAP
(
ctx
->
B
);
((
md5_uint32
*
)
resbuf
)[
1
]
=
SWAP
(
ctx
->
B
);
...
@@ -89,9 +87,8 @@ md5_read_ctx (ctx, resbuf)
...
@@ -89,9 +87,8 @@ md5_read_ctx (ctx, resbuf)
IMPORTANT: On some systems it is required that RESBUF is correctly
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
aligned for a 32 bits value. */
void
*
void
*
md5_finish_ctx
(
ctx
,
resbuf
)
md5_finish_ctx
(
struct
md5_ctx
*
ctx
,
struct
md5_ctx
*
ctx
;
void
*
resbuf
)
void
*
resbuf
;
{
{
/* Take yet unprocessed bytes into account. */
/* Take yet unprocessed bytes into account. */
md5_uint32
bytes
=
ctx
->
buflen
;
md5_uint32
bytes
=
ctx
->
buflen
;
...
@@ -120,9 +117,8 @@ md5_finish_ctx (ctx, resbuf)
...
@@ -120,9 +117,8 @@ md5_finish_ctx (ctx, resbuf)
resulting message digest number will be written into the 16 bytes
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
beginning at RESBLOCK. */
int
int
md5_stream
(
stream
,
resblock
)
md5_stream
(
FILE
*
stream
,
FILE
*
stream
;
void
*
resblock
)
void
*
resblock
;
{
{
/* Important: BLOCKSIZE must be a multiple of 64. */
/* Important: BLOCKSIZE must be a multiple of 64. */
#define BLOCKSIZE 4096
#define BLOCKSIZE 4096
...
@@ -177,10 +173,9 @@ md5_stream (stream, resblock)
...
@@ -177,10 +173,9 @@ md5_stream (stream, resblock)
output yields to the wanted ASCII representation of the message
output yields to the wanted ASCII representation of the message
digest. */
digest. */
void
*
void
*
md5_buffer
(
buffer
,
len
,
resblock
)
md5_buffer
(
const
char
*
buffer
,
const
char
*
buffer
;
size_t
len
,
size_t
len
;
void
*
resblock
)
void
*
resblock
;
{
{
struct
md5_ctx
ctx
;
struct
md5_ctx
ctx
;
...
@@ -196,10 +191,9 @@ md5_buffer (buffer, len, resblock)
...
@@ -196,10 +191,9 @@ md5_buffer (buffer, len, resblock)
void
void
md5_process_bytes
(
buffer
,
len
,
ctx
)
md5_process_bytes
(
const
void
*
buffer
,
const
void
*
buffer
;
size_t
len
,
size_t
len
;
struct
md5_ctx
*
ctx
)
struct
md5_ctx
*
ctx
;
{
{
/* When we already have some bits in our internal buffer concatenate
/* When we already have some bits in our internal buffer concatenate
both inputs first. */
both inputs first. */
...
@@ -254,10 +248,9 @@ md5_process_bytes (buffer, len, ctx)
...
@@ -254,10 +248,9 @@ md5_process_bytes (buffer, len, ctx)
It is assumed that LEN % 64 == 0. */
It is assumed that LEN % 64 == 0. */
void
void
md5_process_block
(
buffer
,
len
,
ctx
)
md5_process_block
(
const
void
*
buffer
,
const
void
*
buffer
;
size_t
len
,
size_t
len
;
struct
md5_ctx
*
ctx
)
struct
md5_ctx
*
ctx
;
{
{
md5_uint32
correct_words
[
16
];
md5_uint32
correct_words
[
16
];
const
md5_uint32
*
words
=
buffer
;
const
md5_uint32
*
words
=
buffer
;
...
...
This diff is collapsed.
Click to expand it.
md5toc.spec.template
+
2
−
0
View file @
99f46a60
...
@@ -5,6 +5,8 @@ Summary: A simple utility to create a TOC of a directory
...
@@ -5,6 +5,8 @@ Summary: A simple utility to create a TOC of a directory
License: GPLv3
License: GPLv3
Source0: http://control.lth.se/md5toc.tar
Source0: http://control.lth.se/md5toc.tar
%undefine source_date_epoch_from_changelog
#BuildRequires: libattr-devel
#BuildRequires: libattr-devel
BuildRequires: gcc
BuildRequires: gcc
...
...
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