Skip to content

Commit 6b9588e

Browse files
tidying
1 parent 974eb7a commit 6b9588e

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

example/src/main.nr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
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};
63

74
fn main(hash: [u8; 32], signature: RBN2048) {
85
assert(verify_sha256_pkcs1v15(hash, signature, 65537));

lib/src/rsa.nr

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use dep::bignum::{RuntimeBigNum, params::BigNumParams};
1+
use dep::bignum::{params::BigNumParams, RuntimeBigNum};
22

33
/**
44
* @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: [
4444

4545
/**
4646
* @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)
5248
* Rough cost: 2,048 bit RSA: 26,888 gates per verification
5349
* 1,024 bit RSA: 11,983 gates per verification
5450
* A circuit that verifies 1 signature (and does nothing else) will cost ~32k due to initialization costs of lookup tables

0 commit comments

Comments
 (0)