File tree 2 files changed +4
-11
lines changed
2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 1
- use dep::bignum::params::BigNumParams ;
2
- use dep::bignum::RuntimeBigNum ;
3
-
4
- use dep::rsa::rsa::verify_sha256_pkcs1v15 ;
5
- use dep::rsa::types::RBN2048 ;
1
+ use dep::bignum:: {params::BigNumParams , RuntimeBigNum };
2
+ use dep::rsa:: {rsa:: verify_sha256_pkcs1v15 , types::RBN2048 };
6
3
7
4
fn main (hash : [u8 ; 32 ], signature : RBN2048 ) {
8
5
assert (verify_sha256_pkcs1v15 (hash , signature , 65537 ));
Original file line number Diff line number Diff line change 1
- use dep::bignum:: {RuntimeBigNum , params::BigNumParams };
1
+ use dep::bignum:: {params::BigNumParams , RuntimeBigNum };
2
2
3
3
/**
4
4
* @brief Compare a recovered byte hash from an RSA signature to the original message hash
@@ -44,11 +44,7 @@ fn compare_signature_sha256<let N: u32>(padded_sha256_hash: [u8; N], msg_hash: [
44
44
45
45
/**
46
46
* @brief Verify an RSA signature generated via the pkcs1v15 signature scheme.
47
- * @details The fourth function parameter is required to define the value of `NBytes`
48
- * when converting a BigNum into a byte array, the number of bytes is required and currently cannot be inferred.
49
- * Once numeric generics can be derived by applying operations to other numeric generics the need for this will go away.
50
- *
51
- * @note The exponent `e` can be either 65537 or 3 (i.e. the most common values in use for RSA)
47
+ * @note The `exponent` can be either 65537 or 3 (i.e. the most common values in use for RSA)
52
48
* Rough cost: 2,048 bit RSA: 26,888 gates per verification
53
49
* 1,024 bit RSA: 11,983 gates per verification
54
50
* A circuit that verifies 1 signature (and does nothing else) will cost ~32k due to initialization costs of lookup tables
You can’t perform that action at this time.
0 commit comments