Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
98efe78d
Commit
98efe78d
authored
Mar 10, 2018
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New program eccparams.
parent
be5b2eda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
ChangeLog
ChangeLog
+5
-0
Makefile.in
Makefile.in
+4
-0
eccparams.c
eccparams.c
+38
-0
No files found.
ChangeLog
View file @
98efe78d
2018-03-10 Niels Möller <nisse@lysator.liu.se>
* eccparams.c (main): New program, to list parameter alternatives
for Pippenger's algorithm.
2018-02-20 Niels Möller <nisse@lysator.liu.se>
* testsuite/cmac-test.c (test_cmac_hash): Deallocate ctx properly.
...
...
Makefile.in
View file @
98efe78d
...
...
@@ -305,6 +305,10 @@ eccdata$(EXEEXT_FOR_BUILD): eccdata.c mini-gmp.c mini-gmp.h
$(CC_FOR_BUILD)
`
test
-f
eccdata.c
||
echo
'
$(srcdir)
/'
`
eccdata.c
\
-o
eccdata
$(EXEEXT_FOR_BUILD)
eccparams$(EXEEXT_FOR_BUILD)
:
eccparams.c
$(CC_FOR_BUILD)
`
test
-f
eccparams.c
||
echo
'
$(srcdir)
/'
`
eccparams.c
\
-o
eccparams
$(EXEEXT_FOR_BUILD)
# desCore rules
# It seems using $(srcdir)/ doesn't work with GNU make 3.79.1
# des_headers = $(srcdir)/rotors.h $(srcdir)/keymap.h
...
...
eccparams.c
0 → 100644
View file @
98efe78d
#include <stdio.h>
#include <stdlib.h>
int
main
(
int
argc
,
char
**
argv
)
{
unsigned
bits
;
unsigned
max
;
unsigned
c
;
if
(
argc
<
3
)
{
usage:
fprintf
(
stderr
,
"Usage: %s: exp-bits max-entries
\n
"
,
argv
[
0
]);
return
EXIT_FAILURE
;
}
bits
=
atoi
(
argv
[
1
]);
if
(
bits
<
2
)
goto
usage
;
max
=
atoi
(
argv
[
2
]);
if
(
max
<
2
)
goto
usage
;
for
(
c
=
3
;
(
1
<<
c
)
<=
max
;
c
++
)
{
unsigned
b
;
for
(
b
=
1
;;
b
++
)
{
unsigned
s
=
(
1
<<
c
)
*
b
;
unsigned
k
;
if
(
s
>
max
)
break
;
k
=
(
bits
+
(
c
*
b
)
-
1
)
/
(
c
*
b
);
printf
(
"k = %2u, c = %2u, S = %3u, T = %3u (%3u A + %2u D)
\n
"
,
k
,
c
,
s
,
(
b
+
1
)
*
k
,
b
*
k
,
k
);
}
}
return
0
;
}
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