Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
a2c59ede
Commit
a2c59ede
authored
Jun 15, 2001
by
Niels Möller
Browse files
* src/blowfish.c: nettle updates.
* src/serpent.c: Likewise. Rev: src/serpent.c:1.5
parent
f478fb61
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/serpent.c
View file @
a2c59ede
...
...
@@ -38,7 +38,7 @@
(name serpent_instance)
(super crypto_instance)
(vars
(ctx . "
SERPENT_context
")))
(ctx . "
struct serpent_ctx
")))
*/
static
void
...
...
@@ -47,8 +47,7 @@ do_serpent_encrypt(struct crypto_instance *s,
{
CAST
(
serpent_instance
,
self
,
s
);
FOR_BLOCKS
(
length
,
src
,
dst
,
SERPENT_BLOCKSIZE
)
serpent_encrypt
(
&
self
->
ctx
,
src
,
dst
);
serpent_encrypt
(
&
self
->
ctx
,
length
,
dst
,
src
);
}
static
void
...
...
@@ -57,8 +56,7 @@ do_serpent_decrypt(struct crypto_instance *s,
{
CAST
(
serpent_instance
,
self
,
s
);
FOR_BLOCKS
(
length
,
src
,
dst
,
SERPENT_BLOCKSIZE
)
serpent_decrypt
(
&
self
->
ctx
,
src
,
dst
);
serpent_decrypt
(
&
self
->
ctx
,
length
,
dst
,
src
);
}
static
struct
crypto_instance
*
...
...
@@ -72,7 +70,7 @@ make_serpent_instance(struct crypto_algorithm *algorithm, int mode,
?
do_serpent_encrypt
:
do_serpent_decrypt
);
serpent_set
up
(
&
self
->
ctx
,
algorithm
->
key_size
,
key
);
serpent_set
_key
(
&
self
->
ctx
,
algorithm
->
key_size
,
key
);
return
(
&
self
->
super
);
}
...
...
@@ -82,10 +80,10 @@ make_serpent_algorithm(UINT32 key_size)
{
NEW
(
crypto_algorithm
,
algorithm
);
assert
(
key_size
>=
SERPENT_MIN_KEYSIZE
);
assert
(
key_size
<=
SERPENT_MAX_KEYSIZE
);
assert
(
key_size
>=
SERPENT_MIN_KEY
_
SIZE
);
assert
(
key_size
<=
SERPENT_MAX_KEY
_
SIZE
);
algorithm
->
block_size
=
SERPENT_BLOCKSIZE
;
algorithm
->
block_size
=
SERPENT_BLOCK
_
SIZE
;
algorithm
->
key_size
=
key_size
;
algorithm
->
iv_size
=
0
;
algorithm
->
make_crypt
=
make_serpent_instance
;
...
...
@@ -94,10 +92,10 @@ make_serpent_algorithm(UINT32 key_size)
}
struct
crypto_algorithm
serpent128_algorithm
=
{
STATIC_HEADER
,
SERPENT_BLOCKSIZE
,
16
,
0
,
make_serpent_instance
};
{
STATIC_HEADER
,
SERPENT_BLOCK
_
SIZE
,
16
,
0
,
make_serpent_instance
};
struct
crypto_algorithm
serpent192_algorithm
=
{
STATIC_HEADER
,
SERPENT_BLOCKSIZE
,
24
,
0
,
make_serpent_instance
};
{
STATIC_HEADER
,
SERPENT_BLOCK
_
SIZE
,
24
,
0
,
make_serpent_instance
};
struct
crypto_algorithm
serpent256_algorithm
=
{
STATIC_HEADER
,
SERPENT_BLOCKSIZE
,
32
,
0
,
make_serpent_instance
};
{
STATIC_HEADER
,
SERPENT_BLOCK
_
SIZE
,
32
,
0
,
make_serpent_instance
};
Write
Preview
Supports
Markdown
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