Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
llvm-watermarker
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
llvm-watermarker
Commits
8fd05c4a
Commit
8fd05c4a
authored
Dec 09, 2018
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separete global option definitions.
parent
38ac18ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
BlockWatermarkPass.cpp
src/nykk/pass/BlockWatermarkPass.cpp
+2
-9
Opts.hpp
src/nykk/pass/Opts.hpp
+17
-0
No files found.
src/nykk/pass/BlockWatermarkPass.cpp
View file @
8fd05c4a
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include <llvm/Support/raw_ostream.h>
#include <llvm/Support/raw_ostream.h>
#include "../PermutationTable.hpp"
#include "../PermutationTable.hpp"
#include "Opts.hpp"
namespace
namespace
{
{
...
@@ -49,14 +50,6 @@ namespace
...
@@ -49,14 +50,6 @@ namespace
llvm
::
cl
::
init
(
RangeOptValue
<
std
::
size_t
>
{
7
}),
llvm
::
cl
::
init
(
RangeOptValue
<
std
::
size_t
>
{
7
}),
};
};
const
llvm
::
cl
::
opt
<
int
>
watermark_opt
{
"watermark"
,
llvm
::
cl
::
desc
(
"Watermark (32bit)"
),
llvm
::
cl
::
value_desc
(
"watermark"
),
llvm
::
cl
::
Required
,
};
/**
/**
* @brief Watermarking pass by code layout methods.
* @brief Watermarking pass by code layout methods.
*/
*/
...
@@ -156,7 +149,7 @@ namespace
...
@@ -156,7 +149,7 @@ namespace
for
(;
block_index
+
partition
<=
blocks
.
size
();
block_index
+=
partition
)
for
(;
block_index
+
partition
<=
blocks
.
size
();
block_index
+=
partition
)
{
{
// Part of watermark to embed.
// Part of watermark to embed.
const
auto
data
=
(
watermark_opt
>>
bit_pos_
)
&
bit_mask
;
const
auto
data
=
(
nykk
::
pass
::
watermark_opt
>>
bit_pos_
)
&
bit_mask
;
// Shuffles each `partition` blocks.
// Shuffles each `partition` blocks.
for
(
std
::
size_t
i
=
0
;
i
<
partition
;
i
++
)
for
(
std
::
size_t
i
=
0
;
i
<
partition
;
i
++
)
...
...
src/nykk/pass/Opts.hpp
0 → 100644
View file @
8fd05c4a
#ifndef INCLUDE_NYKK_PASS_OPTS_HPP
#define INCLUDE_NYKK_PASS_OPTS_HPP
#include <llvm/Support/CommandLine.h>
namespace
nykk
::
pass
{
const
llvm
::
cl
::
opt
<
int
>
watermark_opt
{
"watermark"
,
llvm
::
cl
::
desc
(
"Watermark (32bit)"
),
llvm
::
cl
::
value_desc
(
"watermark"
),
llvm
::
cl
::
Required
,
};
}
#endif
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