Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
b2273e1e
Unverified
Commit
b2273e1e
authored
Aug 31, 2023
by
Kent Kostelac
Committed by
GitHub
Aug 31, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mouse07410:vlm_master' into develop
parents
62842afb
208d9edd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
.gitignore
.gitignore
+1
-0
skeletons/asn_random_fill.c
skeletons/asn_random_fill.c
+10
-5
skeletons/converter-example.c
skeletons/converter-example.c
+5
-0
No files found.
.gitignore
View file @
b2273e1e
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
*.trs
*.trs
*.core
*.core
.tmp.*
.tmp.*
*.exe
# Generated by `autoreconf`
# Generated by `autoreconf`
config/
config/
...
...
skeletons/asn_random_fill.c
View file @
b2273e1e
...
@@ -42,17 +42,22 @@ asn_random_between(intmax_t lb, intmax_t rb) {
...
@@ -42,17 +42,22 @@ asn_random_between(intmax_t lb, intmax_t rb) {
uintmax_t
range
=
asn__intmax_range
(
lb
,
rb
);
uintmax_t
range
=
asn__intmax_range
(
lb
,
rb
);
uintmax_t
value
=
0
;
uintmax_t
value
=
0
;
uintmax_t
got_entropy
=
0
;
uintmax_t
got_entropy
=
0
;
(
void
)
intmax_max
;
(
void
)
intmax_max
;
assert
(
RAND_MAX
>
0xffffff
);
/* Seen 7ffffffd! */
int
max
=
0xffffff
;
#ifdef __WIN32__
max
=
RAND_MAX
-
1
;
#endif
assert
(
RAND_MAX
>
max
);
/* Seen 7ffffffd! */
assert
(
range
<
intmax_max
);
assert
(
range
<
intmax_max
);
for
(;
got_entropy
<
range
;)
{
for
(;
got_entropy
<
range
;)
{
got_entropy
=
(
got_entropy
<<
24
)
|
0xffffff
;
got_entropy
=
(
got_entropy
<<
24
)
|
max
;
#ifdef HAVE_RANDOM
#ifdef HAVE_RANDOM
value
=
(
value
<<
24
)
|
(
random
()
%
0xffffff
);
value
=
(
value
<<
24
)
|
(
random
()
%
max
);
#else
#else
value
=
(
value
<<
24
)
|
(
rand
()
%
0xffffff
);
value
=
(
value
<<
24
)
|
(
rand
()
%
max
);
#endif
#endif
}
}
...
...
skeletons/converter-example.c
View file @
b2273e1e
...
@@ -70,6 +70,11 @@ static void junk_bytes_with_probability(uint8_t *, size_t, double prob);
...
@@ -70,6 +70,11 @@ static void junk_bytes_with_probability(uint8_t *, size_t, double prob);
#define RANDOPT "R:"
#define RANDOPT "R:"
static
ssize_t
random_max_size
=
0
;
/* Size of the random data */
static
ssize_t
random_max_size
=
0
;
/* Size of the random data */
#if defined(__WIN32__) && defined(JUNKTEST)
#define random rand
#define srandom srand
#endif
#if !defined(__FreeBSD__) && !(defined(__APPLE__) && defined(__MACH__))
#if !defined(__FreeBSD__) && !(defined(__APPLE__) && defined(__MACH__))
static
void
static
void
srandomdev
(
void
)
{
srandomdev
(
void
)
{
...
...
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