Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jaak Ristioja
OpenLDAP
Commits
e3d164d1
Commit
e3d164d1
authored
25 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
Simplify and speed up a bit by removing CHAR64LONG16.
parent
a2d948f9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/liblutil/sha1.c
+9
-11
9 additions, 11 deletions
libraries/liblutil/sha1.c
with
9 additions
and
11 deletions
libraries/liblutil/sha1.c
+
9
−
11
View file @
e3d164d1
...
...
@@ -36,13 +36,13 @@
* I got the idea of expanding during the round function from SSLeay
*/
#if BYTE_ORDER == LITTLE_ENDIAN
# define blk0(i) (block
->l
[i] = (rol(block
->l
[i],24)&0xFF00FF00) \
|(rol(block
->l
[i],8)&0x00FF00FF))
# define blk0(i) (block[i] = (rol(block[i],24)&0xFF00FF00) \
|(rol(block[i],8)&0x00FF00FF))
#else
# define blk0(i) block
->l
[i]
# define blk0(i) block[i]
#endif
#define blk(i) (block
->l
[i&15] = rol(block
->l
[(i+13)&15]^block
->l
[(i+8)&15] \
^block
->l
[(i+2)&15]^block
->l
[i&15],1))
#define blk(i) (block[i&15] = rol(block[(i+13)&15]^block[(i+8)&15] \
^block[(i+2)&15]^block[i&15],1))
/*
* (R0+R1), R2, R3, R4 are the different operations (rounds) used in SHA1
...
...
@@ -61,16 +61,14 @@ void
lutil_SHA1Transform
(
uint32
*
state
,
const
unsigned
char
*
buffer
)
{
uint32
a
,
b
,
c
,
d
,
e
;
typedef
union
char64long16_u
{
unsigned
char
c
[
64
];
u_int
l
[
16
];
}
CHAR64LONG16
;
/* Assumes u_int is 32 bits and char 8 bits.
* I don't know why uint32 isn't used (or what the difference is). */
#ifdef SHA1HANDSOFF
CHAR64LONG16
block
[
1
];
u_int
block
[
1
6
];
(
void
)
memcpy
(
block
,
buffer
,
64
);
#else
CHAR64LONG16
*
block
=
(
CHAR64LONG16
*
)
buffer
;
u_int
*
block
=
(
u_int
*
)
buffer
;
#endif
/* Copy context->state[] to working vars */
...
...
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