-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes #796. It also fixes the @bboston7's example on #883, but not the original example in #883. The issue there is that `asdf` function generates a constraint only involving the module parameter. Normally we don't try to solve constraint that don't mention a schema's parameters, because they can always be solved "later", and hopefully with more things instantiated. The weird thing in this case is that the schema adds *local" constraint to the module parameters, but we end up ignoring these.
- Loading branch information
Showing
11 changed files
with
59 additions
and
4 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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Issue796 = Issue796_Sig where | ||
|
||
parameter | ||
type _k: # | ||
|
||
type Key = [8 * _k] | ||
type Block = [64] | ||
type RoundKey = [64] | ||
|
||
aux : RoundKey -> Block -> Block | ||
aux RK P = zero | ||
|
||
// key_schedule : Key -> RoundKey | ||
key_schedule K = zero | ||
where | ||
_ = [ groupBy`{4} K ] | ||
|
||
// encrypt_block : Key -> Block -> Block | ||
encrypt_block key pt = aux (key_schedule key) pt |
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,7 @@ | ||
module Issue796_Sig where | ||
|
||
parameter | ||
type Key: * | ||
type Block: * | ||
|
||
encrypt_block: Key -> Block -> Block |
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,6 @@ | ||
module Issue883 where | ||
|
||
import Issue883_Impl | ||
|
||
zeros : [4][8] | ||
zeros = getZeros |
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,3 @@ | ||
module Issue883_Impl = Issue883_Sig where | ||
|
||
type w = 32 |
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,8 @@ | ||
module Issue883_Sig where | ||
|
||
parameter | ||
type w : # | ||
type constraint (fin w) | ||
|
||
getZeros : [w/8][8] | ||
getZeros = split`{each=8} zero |
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 @@ | ||
:load Issue796.cry |
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,4 @@ | ||
Loading module Cryptol | ||
Loading module Cryptol | ||
Loading module Issue796_Sig | ||
Loading module Issue796 |
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 @@ | ||
:load Issue883.cry |
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 @@ | ||
Loading module Cryptol | ||
Loading module Cryptol | ||
Loading module Issue883_Sig | ||
Loading module Issue883_Impl | ||
Loading module Issue883 |