RSA-2048 Signatures
How It Works
Cairo Structs
use garaga::signatures::rsa::{
RSA2048PublicKey,
RSA2048SignatureWithHint,
is_valid_rsa2048_signature_assuming_encoded_message,
};
use garaga::definitions::{RSA2048Chunks, RSA2048ReductionWitness};
/// RSA-2048 public key (the modulus n)
struct RSA2048PublicKey {
modulus: RSA2048Chunks, // 6 chunks × 4 × u96 = 24 felt252
}
/// Core signature data
struct RSA2048Signature {
signature: RSA2048Chunks, // s: the RSA signature
expected_message: RSA2048Chunks, // m: the expected encoded message
}
/// Signature bundled with 17 reduction witnesses
struct RSA2048SignatureWithHint {
signature: RSA2048Signature,
reductions_hint: Span<felt252>, // 17 × (quotient + remainder) = 17 × 48 = 816 felt252
}Usage Example
Calldata Generation
Calldata Layout
Section
Elements
Description
Full SHA-256 Verification
SHA-256 Calldata Generation
SHA-256 Calldata Layout
Section
Elements
Description
PKCS#1 v1.5 Encoding
Performance
Scheme
Sierra Gas
Last updated
Was this helpful?