Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobdigest
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-blobdigest
Commits
7fe8ce98
Commit
7fe8ce98
authored
Dec 10, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generalize the uint32 context member
parent
67400fc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
vmod_blobdigest.c
src/vmod_blobdigest.c
+3
-3
vmod_blobdigest.h
src/vmod_blobdigest.h
+1
-1
No files found.
src/vmod_blobdigest.c
View file @
7fe8ce98
...
@@ -101,7 +101,7 @@ init(const enum algorithm hash, hash_ctx * const hctx)
...
@@ -101,7 +101,7 @@ init(const enum algorithm hash, hash_ctx * const hctx)
{
{
switch
(
hash
)
{
switch
(
hash
)
{
case
CRC32
:
case
CRC32
:
hctx
->
crc32
=
0
;
hctx
->
uint32
[
0
]
=
0
;
break
;
break
;
case
MD5
:
case
MD5
:
rhash_md5_init
(
&
hctx
->
md5
);
rhash_md5_init
(
&
hctx
->
md5
);
...
@@ -144,7 +144,7 @@ update(const enum algorithm hash, hash_ctx *restrict const hctx,
...
@@ -144,7 +144,7 @@ update(const enum algorithm hash, hash_ctx *restrict const hctx,
{
{
switch
(
hash
)
{
switch
(
hash
)
{
case
CRC32
:
case
CRC32
:
hctx
->
crc32
=
rhash_get_crc32
(
hctx
->
crc32
,
msg
,
len
);
hctx
->
uint32
[
0
]
=
rhash_get_crc32
(
hctx
->
uint32
[
0
]
,
msg
,
len
);
break
;
break
;
case
MD5
:
case
MD5
:
rhash_md5_update
(
&
hctx
->
md5
,
msg
,
len
);
rhash_md5_update
(
&
hctx
->
md5
,
msg
,
len
);
...
@@ -179,7 +179,7 @@ final(const enum algorithm hash, hash_ctx *restrict const hctx,
...
@@ -179,7 +179,7 @@ final(const enum algorithm hash, hash_ctx *restrict const hctx,
{
{
switch
(
hash
)
{
switch
(
hash
)
{
case
CRC32
:
case
CRC32
:
be32_copy
(
result
,
0
,
&
hctx
->
crc32
,
sizeof
(
uint32_t
));
be32_copy
(
result
,
0
,
&
hctx
->
uint32
[
0
]
,
sizeof
(
uint32_t
));
break
;
break
;
case
MD5
:
case
MD5
:
rhash_md5_final
(
&
hctx
->
md5
,
result
);
rhash_md5_final
(
&
hctx
->
md5
,
result
);
...
...
src/vmod_blobdigest.h
View file @
7fe8ce98
...
@@ -52,7 +52,7 @@ enum scope {
...
@@ -52,7 +52,7 @@ enum scope {
};
};
typedef
union
hash_ctx
{
typedef
union
hash_ctx
{
uint32_t
crc32
;
uint32_t
uint32
[
2
]
;
md5_ctx
md5
;
md5_ctx
md5
;
sha1_ctx
sha1
;
sha1_ctx
sha1
;
sha256_ctx
sha224
;
sha256_ctx
sha224
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment