-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a CCT-DOIT test group that contains the normal CCT tests in the success condition and the failure condition as well as DOIT-specific tests in the failure condition. The DOIT-specific tests use the two non-DOIT instructions ROL and XCHG. Reusing the CCT tests required making their main functions "export" to make sure they are kept at the later compiler passes where DOIT checking needs to be done.
- Loading branch information
Showing
11 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
fn add_H_L_L(#secret reg u64 x, #public reg u64 ya) -> #public reg u64 { | ||
export fn add_H_L_L(#secret reg u64 x, #public reg u64 ya) -> #public reg u64 { | ||
|
||
reg u64 t; | ||
|
||
t = x + ya; | ||
t = t; | ||
|
||
return t; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This is CT in the ordinary sense, but not DOIT as ROL is not DOIT. | ||
export fn rol(#secret reg u32 x) -> #secret reg u32 { | ||
_, _, x = #ROL_32(x, 5); | ||
return x; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This is CT in the ordinary sense, but not DOIT as XCHG is not DOIT. | ||
export fn xchange(#secret reg u32 a, #secret reg u32 b) -> #secret reg u32, #secret reg u32 { | ||
a, b = #XCHG_32(a, b); | ||
return a, b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn foo(#public reg u64 r) -> #flex reg u64 { | ||
export fn foo(#public reg u64 r) -> #flex reg u64 { | ||
return r; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn load(#poly=l1 reg u64 x) -> reg u64 { | ||
export fn load(#poly=l1 reg u64 x) -> reg u64 { | ||
|
||
reg u64 t; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn mem3(#secret reg u64 p, reg u64 x) { | ||
export fn mem3(#secret reg u64 p, reg u64 x) { | ||
reg u64 r; | ||
|
||
[p] = x; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn add(#public reg u64 p, #secret reg u64 s) -> reg u64 { | ||
export fn add(#public reg u64 p, #secret reg u64 s) -> reg u64 { | ||
p += s; | ||
return p; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn foo(#public reg u64 r) -> #strict reg u64 { | ||
export fn foo(#public reg u64 r) -> #strict reg u64 { | ||
return r; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters