Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
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
Wim Lewis
nettle
Commits
e2da8384
Commit
e2da8384
authored
13 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
salsa20_set_iv: Deleted size argument.
parent
588e0e8f
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
ChangeLog
+7
-0
7 additions, 0 deletions
ChangeLog
nettle-internal.c
+1
-1
1 addition, 1 deletion
nettle-internal.c
salsa20.c
+1
-3
1 addition, 3 deletions
salsa20.c
salsa20.h
+1
-2
1 addition, 2 deletions
salsa20.h
testsuite/salsa20-test.c
+8
-9
8 additions, 9 deletions
testsuite/salsa20-test.c
with
18 additions
and
15 deletions
ChangeLog
+
7
−
0
View file @
e2da8384
2012-03-31 Niels Möller <nisse@lysator.liu.se>
2012-03-31 Niels Möller <nisse@lysator.liu.se>
* salsa20.c: (salsa20_set_iv): Deleted size argument, only one
size allowed.
* nettle-internal.c (salsa20_set_key_hack): Updated salsa20_set_iv
call.
* testsuite/salsa20-test.c (test_salsa20): Deleted iv_length
argument, updated all calls.
* salsa20.h (SALSA20_BLOCK_SIZE): New constant.
* salsa20.h (SALSA20_BLOCK_SIZE): New constant.
(_SALSA20_INPUT_LENGTH): New constant.
(_SALSA20_INPUT_LENGTH): New constant.
* salsa20.c: Use these constants.
* salsa20.c: Use these constants.
...
...
This diff is collapsed.
Click to expand it.
nettle-internal.c
+
1
−
1
View file @
e2da8384
...
@@ -84,7 +84,7 @@ salsa20_set_key_hack(void *ctx, unsigned length, const uint8_t *key)
...
@@ -84,7 +84,7 @@ salsa20_set_key_hack(void *ctx, unsigned length, const uint8_t *key)
{
{
static
const
uint8_t
iv
[
SALSA20_IV_SIZE
];
static
const
uint8_t
iv
[
SALSA20_IV_SIZE
];
salsa20_set_key
(
ctx
,
length
,
key
);
salsa20_set_key
(
ctx
,
length
,
key
);
salsa20_set_iv
(
ctx
,
SALSA20_IV_SIZE
,
iv
);
salsa20_set_iv
(
ctx
,
iv
);
}
}
/* Claim zero block size, to classify as a stream cipher. */
/* Claim zero block size, to classify as a stream cipher. */
...
...
This diff is collapsed.
Click to expand it.
salsa20.c
+
1
−
3
View file @
e2da8384
...
@@ -128,10 +128,8 @@ salsa20_set_key(struct salsa20_ctx *ctx,
...
@@ -128,10 +128,8 @@ salsa20_set_key(struct salsa20_ctx *ctx,
}
}
void
void
salsa20_set_iv
(
struct
salsa20_ctx
*
ctx
,
unsigned
length
,
const
uint8_t
*
iv
)
salsa20_set_iv
(
struct
salsa20_ctx
*
ctx
,
const
uint8_t
*
iv
)
{
{
assert
(
length
==
SALSA20_IV_SIZE
);
ctx
->
input
[
6
]
=
U8TO32_LITTLE
(
iv
+
0
);
ctx
->
input
[
6
]
=
U8TO32_LITTLE
(
iv
+
0
);
ctx
->
input
[
7
]
=
U8TO32_LITTLE
(
iv
+
4
);
ctx
->
input
[
7
]
=
U8TO32_LITTLE
(
iv
+
4
);
ctx
->
input
[
8
]
=
0
;
ctx
->
input
[
8
]
=
0
;
...
...
This diff is collapsed.
Click to expand it.
salsa20.h
+
1
−
2
View file @
e2da8384
...
@@ -68,8 +68,7 @@ salsa20_set_key(struct salsa20_ctx *ctx,
...
@@ -68,8 +68,7 @@ salsa20_set_key(struct salsa20_ctx *ctx,
unsigned
length
,
const
uint8_t
*
key
);
unsigned
length
,
const
uint8_t
*
key
);
void
void
salsa20_set_iv
(
struct
salsa20_ctx
*
ctx
,
salsa20_set_iv
(
struct
salsa20_ctx
*
ctx
,
const
uint8_t
*
iv
);
unsigned
length
,
const
uint8_t
*
iv
);
void
void
salsa20_crypt
(
struct
salsa20_ctx
*
ctx
,
salsa20_crypt
(
struct
salsa20_ctx
*
ctx
,
...
...
This diff is collapsed.
Click to expand it.
testsuite/salsa20-test.c
+
8
−
9
View file @
e2da8384
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
static
void
static
void
test_salsa20
(
unsigned
key_length
,
test_salsa20
(
unsigned
key_length
,
const
uint8_t
*
key
,
const
uint8_t
*
key
,
unsigned
iv_length
,
const
uint8_t
*
iv
,
const
uint8_t
*
iv
,
unsigned
length
,
unsigned
length
,
const
uint8_t
*
cleartext
,
const
uint8_t
*
cleartext
,
...
@@ -14,7 +13,7 @@ test_salsa20(unsigned key_length,
...
@@ -14,7 +13,7 @@ test_salsa20(unsigned key_length,
uint8_t
*
data
=
xalloc
(
length
);
uint8_t
*
data
=
xalloc
(
length
);
salsa20_set_key
(
&
ctx
,
key_length
,
key
);
salsa20_set_key
(
&
ctx
,
key_length
,
key
);
salsa20_set_iv
(
&
ctx
,
iv_length
,
iv
);
salsa20_set_iv
(
&
ctx
,
iv
);
salsa20_crypt
(
&
ctx
,
length
,
data
,
cleartext
);
salsa20_crypt
(
&
ctx
,
length
,
data
,
cleartext
);
if
(
!
MEMEQ
(
length
,
data
,
ciphertext
))
if
(
!
MEMEQ
(
length
,
data
,
ciphertext
))
...
@@ -29,7 +28,7 @@ test_salsa20(unsigned key_length,
...
@@ -29,7 +28,7 @@ test_salsa20(unsigned key_length,
FAIL
();
FAIL
();
}
}
salsa20_set_key
(
&
ctx
,
key_length
,
key
);
salsa20_set_key
(
&
ctx
,
key_length
,
key
);
salsa20_set_iv
(
&
ctx
,
iv_length
,
iv
);
salsa20_set_iv
(
&
ctx
,
iv
);
salsa20_crypt
(
&
ctx
,
length
,
data
,
data
);
salsa20_crypt
(
&
ctx
,
length
,
data
,
data
);
if
(
!
MEMEQ
(
length
,
data
,
cleartext
))
if
(
!
MEMEQ
(
length
,
data
,
cleartext
))
...
@@ -53,35 +52,35 @@ test_main(void)
...
@@ -53,35 +52,35 @@ test_main(void)
/* http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/verified.test-vectors?logsort=rev&rev=210&view=markup */
/* http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/verified.test-vectors?logsort=rev&rev=210&view=markup */
test_salsa20
(
HL
(
"80000000 00000000 00000000 00000000"
),
test_salsa20
(
HL
(
"80000000 00000000 00000000 00000000"
),
H
L
(
"00000000 00000000"
),
H
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
H
(
"4DFA5E48 1DA23EA0"
));
H
(
"4DFA5E48 1DA23EA0"
));
test_salsa20
(
HL
(
"00000000 00000000 00000000 00000000"
),
test_salsa20
(
HL
(
"00000000 00000000 00000000 00000000"
),
H
L
(
"80000000 00000000"
),
H
(
"80000000 00000000"
),
HL
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
H
(
"B66C1E44 46DD9557"
));
H
(
"B66C1E44 46DD9557"
));
test_salsa20
(
HL
(
"0053A6F94C9FF24598EB3E91E4378ADD"
),
test_salsa20
(
HL
(
"0053A6F94C9FF24598EB3E91E4378ADD"
),
H
L
(
"0D74DB42A91077DE"
),
H
(
"0D74DB42A91077DE"
),
HL
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
H
(
"05E1E7BE B697D999"
));
H
(
"05E1E7BE B697D999"
));
test_salsa20
(
HL
(
"80000000 00000000 00000000 00000000"
test_salsa20
(
HL
(
"80000000 00000000 00000000 00000000"
"00000000 00000000 00000000 00000000"
),
"00000000 00000000 00000000 00000000"
),
H
L
(
"00000000 00000000"
),
H
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
H
(
"E3BE8FDD 8BECA2E3"
));
H
(
"E3BE8FDD 8BECA2E3"
));
test_salsa20
(
HL
(
"00000000 00000000 00000000 00000000"
test_salsa20
(
HL
(
"00000000 00000000 00000000 00000000"
"00000000 00000000 00000000 00000000"
),
"00000000 00000000 00000000 00000000"
),
H
L
(
"80000000 00000000"
),
H
(
"80000000 00000000"
),
HL
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
H
(
"2ABA3DC45B494700"
));
H
(
"2ABA3DC45B494700"
));
test_salsa20
(
HL
(
"0053A6F94C9FF24598EB3E91E4378ADD"
test_salsa20
(
HL
(
"0053A6F94C9FF24598EB3E91E4378ADD"
"3083D6297CCF2275C81B6EC11467BA0D"
),
"3083D6297CCF2275C81B6EC11467BA0D"
),
H
L
(
"0D74DB42A91077DE"
),
H
(
"0D74DB42A91077DE"
),
HL
(
"00000000 00000000"
),
HL
(
"00000000 00000000"
),
H
(
"F5FAD53F 79F9DF58"
));
H
(
"F5FAD53F 79F9DF58"
));
...
...
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