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
162d599a
Commit
162d599a
authored
Mar 10, 2018
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make eccdata warn about poor parameters.
parent
98efe78d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
ChangeLog
ChangeLog
+3
-0
eccdata.c
eccdata.c
+15
-3
No files found.
ChangeLog
View file @
162d599a
2018-03-10 Niels Möller <nisse@lysator.liu.se>
* eccdata.c (ecc_table_size): New helper function.
(ecc_pippenger_precompute): Display warning for poor parameters.
* eccparams.c (main): New program, to list parameter alternatives
for Pippenger's algorithm.
...
...
eccdata.c
View file @
162d599a
...
...
@@ -611,18 +611,30 @@ ecc_curve_init (struct ecc_curve *ecc, unsigned bit_size)
ecc
->
bit_size
=
bit_size
;
}
static
unsigned
ecc_table_size
(
unsigned
bits
,
unsigned
k
,
unsigned
c
)
{
unsigned
p
=
(
bits
+
k
-
1
)
/
k
;
unsigned
M
=
(
p
+
c
-
1
)
/
c
;
return
M
;
}
static
void
ecc_pippenger_precompute
(
struct
ecc_curve
*
ecc
,
unsigned
k
,
unsigned
c
)
{
unsigned
p
=
(
ecc
->
bit_size
+
k
-
1
)
/
k
;
unsigned
M
=
(
p
+
c
-
1
)
/
c
;
unsigned
M
=
ecc_table_size
(
ecc
->
bit_size
,
k
,
c
);
unsigned
i
,
j
;
if
(
M
==
ecc_table_size
(
ecc
->
bit_size
,
k
-
1
,
c
))
fprintf
(
stderr
,
"warn: Parameters k = %u, c = %d are suboptimal, could use smaller k
\n
"
,
k
,
c
);
ecc
->
pippenger_k
=
k
;
ecc
->
pippenger_c
=
c
;
ecc
->
table_size
=
M
<<
c
;
ecc
->
table
=
ecc_alloc
(
ecc
->
table_size
);
/* Compute the first 2^c entries */
ecc_set_zero
(
&
ecc
->
table
[
0
]);
ecc_set
(
&
ecc
->
table
[
1
],
&
ecc
->
g
);
...
...
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