-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor existing SHA512 proofs to allow multiple architecture
- Loading branch information
Showing
53 changed files
with
378 additions
and
1,277 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: 'AWS-LC Formal Verification SAW Proofs' | ||
description: 'Check SAW proofs to verify AWS-LC against Cryptol specs' | ||
runs: | ||
using: 'docker' | ||
image: '../../../Dockerfile.saw_aarch64' |
File renamed without changes.
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
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 was deleted.
Oops, something went wrong.
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,3 +1,7 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
:l SHA384rec.cry | ||
|
||
:l SHA384recEquiv.cry | ||
:prove processBlock_Common_equiv | ||
|
||
:l SHA384rec.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,24 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module SHA384recEquiv where | ||
|
||
import Primitive::Keyless::Hash::SHA384 as SHA384 | ||
import SHA384rec as SHA384rec | ||
import Array | ||
import Common::ByteArray | ||
|
||
type WordArray = Array[64][64] | ||
type w = SHA384rec::w | ||
|
||
// Proving the NSym processBlock_Common_rec is equivalent to cryptol-specs processBlock_Common | ||
property processBlock_Common_equiv (H : [8*w]) (Mi : [16][w]) = | ||
join (SHA384::processBlock_Common (split H) Mi) == SHA384rec::processBlock_Common_rec H w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 | ||
where [w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15] = Mi | ||
|
||
// This property could not be proved nor checked due to Cryptol's lack of support for loops and Arrays | ||
// Manual inspection is required | ||
property processBlocks_equiv (H : [8*w]) (data : ByteArray) (data2 : WordArray) (n : [64]) = | ||
// This lemma lacks a hypothesis about the equivalence between data and data2 | ||
// This hypothesis requires quantifiers | ||
(join (SHA384::processBlocks (split H) data 0 n)) == (SHA384rec::processBlocks_rec H n data2) |
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,3 +1,7 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
:l SHA512recEquiv.cry | ||
:prove processBlock_Common_equiv | ||
|
||
:l SHA512rec.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,24 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module SHA512recEquiv where | ||
|
||
import Primitive::Keyless::Hash::SHA512 as SHA512 | ||
import SHA512rec as SHA512rec | ||
import Array | ||
import Common::ByteArray | ||
|
||
type WordArray = Array[64][64] | ||
type w = SHA512rec::w | ||
|
||
// Proving the NSym processBlock_Common_rec is equivalent to cryptol-specs processBlock_Common | ||
property processBlock_Common_equiv (H : [8*w]) (Mi : [16][w]) = | ||
join (SHA512::processBlock_Common (split H) Mi) == SHA512rec::processBlock_Common_rec H w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 | ||
where [w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15] = Mi | ||
|
||
// This property could not be proved nor checked due to Cryptol's lack of support for loops and Arrays | ||
// Manual inspection is required | ||
property processBlocks_equiv (H : [8*w]) (data : ByteArray) (data2 : WordArray) (n : [64]) = | ||
// This lemma lacks a hypothesis about the equivalence between data and data2 | ||
// This hypothesis requires quantifiers | ||
(join (SHA512::processBlocks (split H) data 0 n)) == (SHA512rec::processBlocks_rec H n data2) |
Oops, something went wrong.