Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
08fb48f5
Commit
08fb48f5
authored
Jan 05, 2019
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup Random::die_on_error.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
ded2bdf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
random.cc
src/random.cc
+11
-0
random.hh
src/random.hh
+2
-11
No files found.
src/random.cc
View file @
08fb48f5
...
...
@@ -115,6 +115,17 @@ Random::operator()()
return
uint64_from_buffer
(
&
cipher_text
[
0
]);
}
void
Random
::
die_on_error
(
const
char
*
func
,
gcry_error_t
error
)
{
if
(
error
)
{
fprintf
(
stderr
,
"%s failed: %s/%s
\n
"
,
func
,
gcry_strsource
(
error
),
gcry_strerror
(
error
));
exit
(
1
);
/* can't recover here */
}
}
void
Random
::
set_global_test_key
(
uint64_t
key
)
{
...
...
src/random.hh
View file @
08fb48f5
...
...
@@ -17,18 +17,9 @@ public:
};
private
:
gcry_cipher_hd_t
aes_ctr_cipher
;
void
die_on_error
(
const
char
*
func
,
gcry_error_t
error
)
{
if
(
error
)
{
fprintf
(
stderr
,
"%s failed: %s/%s
\n
"
,
func
,
gcry_strsource
(
error
),
gcry_strerror
(
error
));
exit
(
1
);
/* can't recover here */
}
}
std
::
vector
<
unsigned
char
>
get_start_counter
(
uint64_t
seed
,
Stream
stream
);
void
die_on_error
(
const
char
*
func
,
gcry_error_t
error
);
public
:
Random
(
uint64_t
seed
,
Stream
stream
);
~
Random
();
...
...
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