Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pintos_forked_resit
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s2-alsaloumi
Pintos_forked_resit
Commits
002e38c0
Commit
002e38c0
authored
1 year ago
by
h2-addad
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
d76d87c5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tests/vm/child-linear.c
+36
-0
36 additions, 0 deletions
src/tests/vm/child-linear.c
with
36 additions
and
0 deletions
src/tests/vm/child-linear.c
0 → 100644
+
36
−
0
View file @
002e38c0
/* Child process of page-parallel.
Encrypts 1 MB of zeros, then decrypts it, and ensures that
the zeros are back. */
#include
<string.h>
#include
"tests/arc4.h"
#include
"tests/lib.h"
#include
"tests/main.h"
const
char
*
test_name
=
"child-linear"
;
#define SIZE (1024 * 1024)
static
char
buf
[
SIZE
];
int
main
(
int
argc
,
char
*
argv
[])
{
const
char
*
key
=
argv
[
argc
-
1
];
struct
arc4
arc4
;
size_t
i
;
/* Encrypt zeros. */
arc4_init
(
&
arc4
,
key
,
strlen
(
key
));
arc4_crypt
(
&
arc4
,
buf
,
SIZE
);
/* Decrypt back to zeros. */
arc4_init
(
&
arc4
,
key
,
strlen
(
key
));
arc4_crypt
(
&
arc4
,
buf
,
SIZE
);
/* Check that it's all zeros. */
for
(
i
=
0
;
i
<
SIZE
;
i
++
)
if
(
buf
[
i
]
!=
'\0'
)
fail
(
"byte %zu != 0"
,
i
);
return
0x42
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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