Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bastien Durel
rand
Commits
e1082d01
Verified
Commit
e1082d01
authored
Jul 26, 2019
by
Bastien Durel
Browse files
initialize with /dev/urandom, not /dev/random; test randomness by trying to compress output
parent
adb2a1db
Pipeline
#978
failed with stages
in 1 minute and 38 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
e1082d01
...
...
@@ -12,6 +12,7 @@ build:
# - apt update && apt -y install make
script
:
-
make
-
make test
artifacts
:
paths
:
-
rand
...
...
Makefile
View file @
e1082d01
CFLAGS
=
-O3
LDFLAGS
=
-O3
TESTFILES
=
test.bin test.gz test.bz test.xz
all
:
rand
rand
:
isaac64.o
$(CC)
$(LDLAGS)
-o
$@
$<
isaac64.o
:
isaac64.c
clean
:
rm
-f
*
.o
*
~
rm
-f
*
.o
*
~
$(TESTFILES)
fclean
:
clean
rm
-f
rand
test
:
rand
./rand |
dd
of
=
/dev/null
bs
=
1M
count
=
1000
./rand |
dd
of
=
test.bin
bs
=
1M
count
=
10
@
gzip
-9
< test.bin
>
test.gz
./checksize test.bin test.gz
@
bzip2
-9
< test.bin
>
test.bz
./checksize test.bin test.bz
@
xz
-9
< test.bin
>
test.xz
./checksize test.bin test.xz
rm
-f
$(TESTFILES)
isaac64.c
View file @
e1082d01
...
...
@@ -76,9 +76,9 @@ word flag;
aa
=
bb
=
cc
=
(
ub8
)
0
;
a
=
b
=
c
=
d
=
e
=
f
=
g
=
h
=
0x9e3779b97f4a7c13LL
;
/* the golden ratio */
_rand
=
fopen
(
"/dev/random"
,
"r"
);
_rand
=
fopen
(
"/dev/
u
random"
,
"r"
);
if
(
_rand
==
NULL
)
{
perror
(
"Cannot open /dev/random: "
);
perror
(
"Cannot open /dev/
u
random: "
);
exit
(
1
);
}
fread
(
&
a
,
sizeof
(
ub8
),
1
,
_rand
);
...
...
Write
Preview
Supports
Markdown
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