-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/dsc-rsa
- Loading branch information
Showing
30 changed files
with
247 additions
and
151 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
13 changes: 13 additions & 0 deletions
13
circuits/circuits/tests/utils/ecdsa/test_brainpoolP512r1.circom
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,13 @@ | ||
pragma circom 2.1.9; | ||
|
||
include "../../../utils/crypto/signature/ecdsa/ecdsaVerifier.circom"; | ||
|
||
template VerifyBrainpoolP384r1Sha384() { | ||
signal input signature[2 * 8]; | ||
signal input pubKey[2 * 8]; | ||
signal input hashParsed[512]; | ||
|
||
EcdsaVerifier(29, 64, 8)(signature, pubKey, hashParsed); | ||
} | ||
|
||
component main = VerifyBrainpoolP384r1Sha384(); |
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,13 @@ | ||
pragma circom 2.1.9; | ||
|
||
include "../../../utils/crypto/signature/ecdsa/ecdsaVerifier.circom"; | ||
|
||
template VerifyP256Sha256() { | ||
signal input signature[2 * 4]; | ||
signal input pubKey[2 * 4]; | ||
signal input hashParsed[256]; | ||
|
||
EcdsaVerifier(8, 64, 4)(signature, pubKey, hashParsed); | ||
} | ||
|
||
component main = VerifyP256Sha256(); |
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,13 @@ | ||
pragma circom 2.1.9; | ||
|
||
include "../../../utils/crypto/signature/ecdsa/ecdsaVerifier.circom"; | ||
|
||
template VerifyP384r1Sha384() { | ||
signal input signature[2 * 6]; | ||
signal input pubKey[2 * 6]; | ||
signal input hashParsed[384]; | ||
|
||
EcdsaVerifier(9, 64, 6)(signature, pubKey, hashParsed); | ||
} | ||
|
||
component main = VerifyP384r1Sha384(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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,34 @@ | ||
// NOTE: this circuit is unaudited and should not be used in production | ||
/// @title SplitBytesToWords | ||
/// @notice split an array of bytes into an array of words | ||
/// @notice useful for casting a message or modulus before RSA verification | ||
/// @param l: number of bytes in the input array | ||
/// @param n: number of bits in a word | ||
/// @param k: number of words | ||
/// @input in: array of bytes | ||
/// @output out: array of words | ||
template SplitBytesToWords (l,n,k) { | ||
signal input in[l]; | ||
signal output out[k]; | ||
|
||
component num2bits[l]; | ||
for (var i = 0 ; i < l ; i++){ | ||
num2bits[i] = Num2Bits(8); | ||
num2bits[i].in <== in[i]; | ||
} | ||
component bits2num[k]; | ||
for (var i = 0 ; i < k ; i++){ | ||
bits2num[i] = Bits2Num(n); | ||
for(var j = 0 ; j < n ; j++){ | ||
if(i*n + j >= 8 * l){ | ||
bits2num[i].in[j] <== 0; | ||
} | ||
else{ | ||
bits2num[i].in[j] <== num2bits[l - (( i * n + j) \ 8) - 1].out[ ((i * n + j) % 8)]; | ||
} | ||
} | ||
} | ||
for( var i = 0 ; i< k ; i++){ | ||
out[i] <== bits2num[i].out; | ||
} | ||
} |
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
Oops, something went wrong.