Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-21fa
project05b
Commits
79bba4b6
Commit
79bba4b6
authored
4 years ago
by
Caleb C. Sander
Browse files
Options
Download
Email Patches
Plain Diff
Make secret a byte array to avoid warnings
parent
f6947447
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/stage3.h
+2
-2
include/stage3.h
include/stage4.h
+3
-3
include/stage4.h
with
5 additions
and
5 deletions
+5
-5
include/stage3.h
View file @
79bba4b6
const
char
SECRET
[]
=
"CLOCK"
;
const
uint8_t
SECRET
[]
=
"CLOCK"
;
static
inline
char
access_secret
(
size_t
i
)
{
static
inline
uint8_t
access_secret
(
size_t
i
)
{
return
SECRET
[
i
];
return
SECRET
[
i
];
}
}
This diff is collapsed.
Click to expand it.
include/stage4.h
View file @
79bba4b6
const
char
SECRET
[]
=
"CACHE"
;
const
uint8_t
SECRET
[]
=
"CACHE"
;
static
inline
void
cache_secret
(
void
)
{
static
inline
void
cache_secret
(
void
)
{
volatile
const
char
*
secret
=
SECRET
;
volatile
const
uint8_t
*
secret
=
SECRET
;
while
(
*
secret
!=
'\0'
)
{
while
(
*
secret
!=
'\0'
)
{
secret
++
;
secret
++
;
}
}
}
}
static
inline
char
access_secret
(
size_t
i
)
{
static
inline
uint8_t
access_secret
(
size_t
i
)
{
*
(
volatile
uint8_t
*
)
(
i
<<
16
|
0xFFFF
);
*
(
volatile
uint8_t
*
)
(
i
<<
16
|
0xFFFF
);
return
SECRET
[
i
];
return
SECRET
[
i
];
}
}
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help