Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
decaf
Commits
9d1f1a1a
Commit
9d1f1a1a
authored
3 weeks ago
by
Johan Pascal
Browse files
Options
Download
Patches
Plain Diff
Modify tests to avoid runtime errors due to null parameters
parent
5aa56819
fix/runtime_errors
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_decaf.cxx
+3
-2
test/test_decaf.cxx
with
3 additions
and
2 deletions
test/test_decaf.cxx
+
3
−
2
View file @
9d1f1a1a
...
...
@@ -148,6 +148,7 @@ static void test_arithmetic() {
for
(
int
i
=
0
;
i
<
NTESTS
*
10
&&
test
.
passing_now
;
i
++
)
{
size_t
sob
=
i
%
(
2
*
Group
::
Scalar
::
SER_BYTES
);
if
(
sob
==
0
)
continue
;
SecureBuffer
xx
=
rng
.
read
(
sob
),
yy
=
rng
.
read
(
sob
),
zz
=
rng
.
read
(
sob
);
...
...
@@ -588,14 +589,14 @@ static void test_eddsa() {
typename
Group
::
Scalar
more_than_size
=
1
;
for
(
int
i
=
0
;
i
<
lg_scalar
;
i
++
)
more_than_size
*=
2
;
for
(
int
i
=
0
;
i
<
NTESTS
&&
test
.
passing_now
;
i
++
)
{
for
(
int
i
=
1
;
i
<
NTESTS
&&
test
.
passing_now
;
i
++
)
{
typename
EdDSA
<
Group
>::
PrivateKey
priv
(
rng
);
typename
EdDSA
<
Group
>::
PublicKey
pub
(
priv
);
SecureBuffer
message
(
i
);
rng
.
read
(
message
);
SecureBuffer
context
(
i
%
25
6
);
SecureBuffer
context
(
i
%
25
5
+
1
);
rng
.
read
(
context
);
SecureBuffer
sig
=
priv
.
sign
(
message
,
context
);
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets