[sw, rom_ext_signer] use Mundane exponent and modulus getters

This change removes the dummy implementation of exponent and modulus
getters, and uses the mundane API instead.

Signed-off-by: Silvestrs Timofejevs <silvestrst@lowrisc.org>
diff --git a/sw/host/rom_ext_image_tools/signer/Cargo.lock b/sw/host/rom_ext_image_tools/signer/Cargo.lock
index dd2fe80..483c0b1 100644
--- a/sw/host/rom_ext_image_tools/signer/Cargo.lock
+++ b/sw/host/rom_ext_image_tools/signer/Cargo.lock
@@ -71,9 +71,9 @@
 
 [[package]]
 name = "mundane"
-version = "0.4.3"
+version = "0.4.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25e675fddc3f33a2926843ec693a65848755d1cf0e3f299c6afd3a7fc0048700"
+checksum = "9e0fa854bb6ab697baa4b14bf0ea911a9eeb95b2f3dc98192df9ea4fc79d097c"
 dependencies = [
  "goblin",
 ]
diff --git a/sw/host/rom_ext_image_tools/signer/Cargo.toml b/sw/host/rom_ext_image_tools/signer/Cargo.toml
index f21464a..9ed2af8 100644
--- a/sw/host/rom_ext_image_tools/signer/Cargo.toml
+++ b/sw/host/rom_ext_image_tools/signer/Cargo.toml
@@ -29,5 +29,5 @@
 rom_ext_image = { path = "image" }
 
 [dependencies.mundane]
-version = "0.4.3"
+version = "0.4.4"
 features = ["rsa-pkcs1v15"]
diff --git a/sw/host/rom_ext_image_tools/signer/src/main.rs b/sw/host/rom_ext_image_tools/signer/src/main.rs
index 32a83bf..0fa34f0 100644
--- a/sw/host/rom_ext_image_tools/signer/src/main.rs
+++ b/sw/host/rom_ext_image_tools/signer/src/main.rs
@@ -40,16 +40,20 @@
     // Update "signed" manifest fields.
     image.update_static_fields(&config);
 
-    let exponent = &signature_key_public_exponent_le();
-    image.update_exponent_field(exponent);
-
-    let modulus = &signature_key_modulus_le();
-    image.update_modulus_field(modulus);
-
     // Convert ASN.1 DER private key into Mundane RsaPrivKey.
     let private_key =
         RsaPrivKey::parse_from_der(&private_key_der).expect("Failed to parse private key!");
 
+    let mut exponent = private_key.public_exponent_be();
+    // Encode public key components in little-endian byte order.
+    exponent.reverse();
+    image.update_exponent_field(&exponent);
+
+    let mut modulus = private_key.public_modulus_be();
+    // Encode public key components in little-endian byte order.
+    modulus.reverse();
+    image.update_modulus_field(&modulus);
+
     // Produce the signature from concatenated system_state_value,
     // device_usage_value and the portion of the "signed" portion of the image.
     let image_sign_data = image.data_to_sign();
@@ -71,20 +75,6 @@
     image.write_file();
 }
 
-/// Generate a dummy signature key public exponent.
-///
-/// Eventually this value will be obtained from the private key.
-fn signature_key_public_exponent_le() -> Vec<u8> {
-    vec![0xA5; 1]
-}
-
-/// Generate a dummy signature key modulus.
-///
-/// Eventually this value will be obtained from the private key.
-fn signature_key_modulus_le() -> Vec<u8> {
-    vec![0xA5; 384]
-}
-
 /// Generates the device usage value.
 ///
 /// This value is extrapolated from the ROM_EXT manifest usage_constraints