-
Notifications
You must be signed in to change notification settings - Fork 76
saw-remote-api/feat/saw llvm tweaks #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
80cd1b4
saw-remote-api: use new saw.llvm python bindings
0b67bdf
saw-remote-apiP WIP HMAC SAW proof using python frontend
683b655
saw-remote-api: WIP HMAC save: struct values support added, minimal s…
24aa820
WIP: Translation of drbg example from saw script to python/saw api (a…
dagit ca7304a
saw-remote-api/chore: move in-progress python proofs
49b0eb7
fix: saw-remote-api use mkDefaultApp from Argo
aa13acd
Merge branch 'master' into saw-remote-api/feat/saw-llvm-tweaks
82c36fa
Merge branch 'master' into saw-remote-api/feat/saw-llvm-tweaks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule argo
updated
15 files
+1 −0 | argo/argo.cabal | |
+124 −61 | argo/src/Argo.hs | |
+7 −7 | argo/src/Argo/DefaultMain.hs | |
+5 −5 | argo/src/Argo/Doc/Protocol.hs | |
+391 −135 | argo/src/Argo/ServerState.hs | |
+5 −5 | argo/src/Argo/Socket.hs | |
+186 −32 | file-echo-api/README.rst | |
+7 −1 | file-echo-api/file-echo-api/Main.hs | |
+138 −1 | file-echo-api/src/FileEchoServer.hs | |
+362 −154 | file-echo-api/test-scripts/file-echo-tests.py | |
+0 −1 | file-echo-api/test/Test.hs | |
+32 −13 | python/argo/connection.py | |
+1 −1 | python/argo/interaction.py | |
+124 −122 | python/saw/llvm.py | |
+60 −0 | python/saw/llvm_types.py |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
72 changes: 72 additions & 0 deletions
72
saw-remote-api/test-scripts/in-progress/HMAC/spec/HMAC.cry
This file contains hidden or 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,72 @@ | ||
//////////////////////////////////////////////////////////////// | ||
// Copyright 2016 Galois, Inc. All Rights Reserved | ||
// | ||
// Authors: | ||
// Aaron Tomb : atomb@galois.com | ||
// Nathan Collins : conathan@galois.com | ||
// Joey Dodds : jdodds@galois.com | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"). | ||
// You may not use this file except in compliance with the License. | ||
// A copy of the License is located at | ||
// | ||
// http://aws.amazon.com/apache2.0 | ||
// | ||
// or in the "license" file accompanying this file. This file is distributed | ||
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
//////////////////////////////////////////////////////////////// | ||
|
||
module HMAC where | ||
|
||
import SHA256 | ||
|
||
//////// Functional version //////// | ||
|
||
hmacSHA256 : {pwBytes, msgBytes} | ||
(fin pwBytes, fin msgBytes | ||
, 32 >= width msgBytes | ||
, 64 >= width (8*pwBytes) | ||
, 64 >= width (8 * (64 + msgBytes)) | ||
) => [pwBytes][8] -> [msgBytes][8] -> [256] | ||
hmacSHA256 = hmac `{blockLength=64} SHA256 SHA256 SHA256 | ||
|
||
kinit : { pwBytes, blockLength, digest } | ||
( fin pwBytes, fin blockLength, fin digest ) | ||
=> ([pwBytes][8] -> [8*digest]) | ||
-> [pwBytes][8] | ||
-> [blockLength][8] | ||
kinit hash key = | ||
if `pwBytes > (`blockLength : [max (width pwBytes) (width blockLength)]) | ||
then take `{blockLength} (split (hash key) # (zero : [blockLength][8])) | ||
else take `{blockLength} (key # (zero : [blockLength][8])) | ||
|
||
// Due to limitations of the type system we must accept two | ||
// separate arguments (both aledgedly the same) for two | ||
// separate length inputs. | ||
hmac : { msgBytes, pwBytes, digest, blockLength } | ||
( fin pwBytes, fin digest, fin blockLength ) | ||
=> ([blockLength + msgBytes][8] -> [8*digest]) | ||
-> ([blockLength + digest][8] -> [8*digest]) | ||
-> ([pwBytes][8] -> [8*digest]) | ||
-> [pwBytes][8] | ||
-> [msgBytes][8] | ||
-> [digest*8] | ||
hmac hash hash2 hash3 key message = hash2 (okey # internal) | ||
where | ||
ks : [blockLength][8] | ||
ks = kinit hash3 key | ||
okey = [k ^ 0x5C | k <- ks] | ||
ikey = [k ^ 0x36 | k <- ks] | ||
internal = split (hash (ikey # message)) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.