Firmware signature size in bytes for each algorithm, and who needs it
For RSA, the signature is the length in octets of the modulus, so an RSA-2048 signature is 256 octets and an RSA-3072 signature is 384 octets, as set by RFC 8017 (Sections 8.1.1 and 8.2.1). For Ed25519, RFC 8032 gives a 32-octet public key and a 64-octet signature made of R and S, each 32 octets. For LMS, RFC 8554 requires the signature to be exactly 12 + n*(p+1) + m*h bytes, which gives a 1616-byte signature for the H15 parameter set (Table 3 in RFC 8554), and its public key is 56 bytes when m is 32. The MCUboot imgtool documentation lists rsa-2048, rsa-3072, ecdsa-p256 and ed25519 as supported image signing key types, and does not list ecdsa-p384.
The main readers of these figures are embedded teams sizing image headers, bootloader slots and key storage on constrained devices. Each slot must hold the signature, the public key or its hash, and the image itself, so the signature length drives how much flash is reserved for headers. Confirm the exact sizes your bootloader and signing tool expect, since the figures above exclude the container and headers the signing tool adds around the signature.
Before you choose an algorithm, check that the key type you generate matches what the bootloader is configured to verify, because a mismatch will fail verification. The MCUboot imgtool keygen command accepts rsa-2048, rsa-3072, ecdsa-p256 and ed25519 as type values. Ask your bootloader vendor or read the MCUboot imgtool documentation to confirm which types your build supports and how each one is stored.
Signature and public key sizes in octets by algorithm
This table lists the public key and signature sizes, in octets, for the algorithms most often used to sign code and firmware images, including RSA moduli, ECDSA curves encoded as JWS concatenations, the Edwards-curve schemes and the LMS hash-based parameter sets. Where the sources give no figure for a cell, it is left blank, so check the value against the specification or your signing tool before sizing a bootloader or a manifest. The key takeaway is that RSA and LMS signature length grows with the modulus or tree height, while Ed25519 and P-256 stay small enough to fit tight flash budgets.
| Algorithm | Public key (octets) | Signature (octets) | Source |
|---|---|---|---|
| RSA 2048-bit modulus | Not applicable | 256 | RFC 8017, Sections 8.1.1 and 8.2.1 |
| RSA 3072-bit modulus | Not applicable | 384 | RFC 8017, Sections 8.1.1 and 8.2.1 |
| RSA 4096-bit modulus | Not applicable | 512 | RFC 8017, Sections 8.1.1 and 8.2.1 |
| ECDSA P-256 (ES256, JWS concatenation) | Not applicable | 64 | RFC 7518, Section 3.4 |
| ECDSA P-384 (ES384, JWS concatenation) | Not applicable | 96 | RFC 7518, Section 3.4 |
| ECDSA P-521 (ES512, JWS concatenation) | Not applicable | 132 | RFC 7518, Section 3.4 |
| Ed25519 | 32 | 64 | RFC 8032, Sections 5.1.5 and 5.1.6 |
| Ed448 | 57 | 114 | RFC 8032, Sections 5.2.5 and 5.2.6 |
| LMS_SHA256_M32_H15 (single-level HSS) | 56 | 1616 | RFC 8554, Sections 5.4.2 and 6.4 |
What each column means and which document it comes from
Read the signature length column as the size of the signature value itself, the octet string the signing algorithm outputs before any container or header that a tool adds. The public key length column is the size of the key encoding that a verifier needs, not the size of the private key. Each figure on this page traces to a named source: RFC 8017 for RSA, RFC 8032 for Ed25519 and Ed448, RFC 7518 for the ECDSA concatenation used in JWS, RFC 8554 for LMS and LM-OTS, and the MCUboot imgtool documentation for which key types the bootloader accepts. When you size a firmware image, add the header and trailer that your tooling writes around the signature, and confirm that total against the output of your own build, because the sources above do not describe those containers.
RSA signature length is not a fixed number. Under RFC 8017, an RSASSA-PSS or RSASSA-PKCS1-v1_5 signature is an octet string as long as the RSA modulus, so a 2048-bit modulus gives a 256-octet signature and a 3072-bit modulus gives 384 octets. Check the modulus length of the key your bootloader is configured to verify, since the MCUboot key type must match the configured verification key. For ECDSA signatures in JWS, the signature is the concatenation of R and S, so ES512 uses P-521 and each of R and S is 521 bits, giving a 132-octet signature. Those two values are different encodings of different algorithms, so do not compare them without checking which one your signing path actually emits.
Ask the team that ships the firmware to state which algorithm, key type and container format it uses, and to show the resulting signed image size next to the signature figure from this page. For LMS, note that the signature grows with tree height, so the table value depends on the parameter set you deploy, and confirm the parameter set in your own configuration. Where a figure you need is not listed in these sources, the sources do not say, and the reader should confirm the value against the specification or the vendor's documentation for the exact version in use.
Where a 1616-octet LMS signature changes the firmware layout
Signature length sets how much room an image header and its slot need, and it also sets the storage and certificate size of the key that verifies it. The cards below cover the places where these sizes change what a firmware team has to plan for, from the bootloader's header to the bytes kept in key storage.
Image header and slot space in MCUboot
The signature is stored inside the image, so the slot must hold the header, the firmware, and the signature together. Check that your slot size leaves room for the signature length of the algorithm you choose, plus the header the signing tool adds. MCUboot's imgtool supports rsa-2048, rsa-3072, ecdsa-p256 and ed25519 keys, and does not list ecdsa-p384. Confirm the key type matches what the bootloader is configured to verify, because a mismatch fails verification at boot.
imgtool docsThe 56-octet LMS public key
An LMS public key is 56 bytes when the parameter uses a 32-byte hash, which is small enough to store in key storage alongside other keys. The key size stays fixed as the tree grows, so storage planning does not change with the height. Check that your key slot or secure element accepts a 56-byte value, and reserve room for it in the bootloader's key table.
Ed25519 65-octet BIT STRING in X.509
An Ed25519 signature inside an X.509 certificate sits in a BIT STRING of 65 bytes: one byte for unused bits and a 64-byte raw signature with no extra ASN.1 wrapping. Certificate tooling that expects a different encoding will reject the value. Verify that your certificate generator writes the BIT STRING this way before you rely on Ed25519 for the signing chain.
RFC 8410 textLMS signature growth with tree height
An LMS signature length rises with the tree height h, so each step up in height adds bytes to every image you sign. The single-level HSS signature for the H15 set is 1616 bytes, rising to 1776 for H20 and 1936 for H25. Choose the smallest height that covers the number of signatures your signing process needs, and re-check the slot budget whenever that height changes.
RFC 8554 textRSA-3072 signatures on constrained devices
An rsa-3072 signature is 384 octets, which is a smaller value than an LMS signature but still a significant share of a small flash slot. Compare it against the RSA-2048 option at 256 octets, and confirm that the target device has the memory to verify the larger key during boot. Factor the public key size into the bootloader's key storage as well.
RFC 8017 textWhich signing key types MCUboot accepts, and why the type must match
The MCUboot imgtool documentation states that it supports rsa-2048, rsa-3072, ecdsa-p256 and ed25519 keys for signing images, and it does not list ecdsa-p384. If your device firmware plan calls for a P-384 signing key, that key type is not among the options the imgtool documents, so it cannot be generated or used through that path. Plan your signing key type before you build your release pipeline, because changing it later means regenerating keys, reconfiguring the bootloader and re-signing images. Check the MCUboot imgtool documentation at the MCUboot imgtool page for the current list, since the supported set can change between releases.
You generate a signing key with the keygen subcommand, passing an output file and a type value. For example, ./scripts/imgtool.py keygen -k filename.pem -t rsa-2048 creates an RSA 2048 key. The alternative type values are rsa-3072, ecdsa-p256 and ed25519. The -k option names the PEM file that holds the private key, which you must protect like any other signing key. Choose the type that matches the verification side of your build, not the type your team uses elsewhere.
The key type must match what MCUboot is configured to verify. A bootloader built to verify an RSA key will reject an image signed with an ECDSA or Ed25519 key, and the failure appears only when the device tries to boot the signed image. Confirm the signature algorithm in the bootloader configuration against the key you generate, and test the full sign-and-boot path on hardware before release. Signature length also follows the key type: an rsa-2048 signature is 256 octets and an rsa-3072 signature is 384 octets before any container or header the signing tool adds, so the type you choose affects the image size budget on the device.
Figures for RSA, ECDSA, EdDSA and LMS parameter sets
RSA signatures are the same length in octets as the modulus. RFC 8017 states that both RSASSA-PSS and RSASSA-PKCS1-v1_5 produce an octet string of length k, where k is the length in octets of the RSA modulus n. The sources give three figures that embedded teams are likely to use.
- 2048-bit modulus: 256-octet signature.
- 3072-bit modulus: 384-octet signature.
- 4096-bit modulus: 512-octet signature.
- MCUboot support: the imgtool documentation lists
rsa-2048andrsa-3072as supported image signing key types, and does not list 4096-bit keys. - Key generation: the imgtool keygen command accepts
-t rsa-2048or-t rsa-3072, and the key type must match what MCUboot is configured to verify.
The RFC 8017 sizes are the raw signature only. A signed image or container adds headers and metadata on top of them. Confirm the exact image overhead for your MCUboot version in its documentation before you size flash partitions.
ECDSA signatures in JWS are a fixed-length concatenation of R and S. RFC 7518 gives the octet counts for each curve and hash pairing. These are the sizes of the signature value itself, not of any DER encoding, container or header that a firmware tool may add.
- P-256 with SHA-256 (ES256): 64-octet signature.
- P-384 with SHA-384 (ES384): 96-octet signature.
- P-521 with SHA-512 (ES512): 132-octet signature, with R and S each 521 bits.
- MCUboot support: the imgtool documentation lists
ecdsa-p256as a supported key type and does not listecdsa-p384. - Key generation: the keygen command uses
-t ecdsa-p256for this key type, and the type must match the verifier configuration.
The JWS figures come from a different encoding than the one many firmware tools use, so do not assume a P-256 signature in your image is 64 octets. Check the exact field layout your signing tool writes.
EdDSA signatures are built from two fixed-length values, R and S, and the public key length is also fixed. RFC 8032 defines the sizes for each curve, and RFC 8410 defines how the signature is placed in an X.509 certificate.
- Ed25519 public key: 32 octets.
- Ed25519 signature: 64 octets, made of R (32 octets) and S (32 octets).
- Ed448 public key: 57 octets.
- Ed448 signature: 114 octets, made of R (57 octets) and S (57 octets).
- X.509 encoding: RFC 8410 places the raw R and S value in the signature BIT STRING with no extra ASN.1 wrapping. Its Ed25519 example certificate has a 65-byte signature BIT STRING, which is one unused-bits byte plus the 64-byte signature.
- MCUboot support: the imgtool documentation lists
ed25519as a supported key type. The sources supplied here do not list Ed448 for MCUboot, so confirm that before you use it.
The 65-byte BIT STRING is a certificate detail. A raw firmware signature field will not include the unused-bits byte, so compare like with like when you add up overhead.
LMS is a hash-based signature scheme, and its signature size depends on the tree height h. RFC 8554 gives the exact formulas and the sizes of the single-level parameter sets. LMS is a stateful scheme, so a signer must track which one-time keys it has used, and that requirement affects deployment as well as size.
- LM-OTS signature: 1124 bytes for LMOTS_SHA256_N32_W8, from the formula 4 + n*(p+1) with n = 32 and p = 34.
- LMS signature length: exactly 12 + n*(p+1) + m*h bytes, so the size grows with h.
- LMS public key: exactly 24 + m bytes, which is 56 bytes when m is 32.
- Single-level HSS signatures: RFC 8554 Table 3 lists 1616, 1776 and 1936 bytes for the H15, H20 and H25 sets.
- Scope in the sources: the supplied sources do not say which firmware verifiers accept LMS, so confirm support with the verifier vendor before you select these sets.
Because LMS is stateful, a device that signs firmware must persist its state reliably, and a restored backup can reuse a one-time key. Check your signing process against RFC 8554 before you rely on these sizes.
How to use these sizes before you fix a firmware layout
This sequence turns a raw signature length into a total image size that fits the flash slot on your target device. It ends with a signed image that has been verified on hardware and a written container format from the vendor.
Confirm the algorithm and parameter set
Start with the algorithm and key size your bootloader is configured to verify, because the signing tool must produce exactly that type. MCUboot's imgtool documents rsa-2048, rsa-3072, ecdsa-p256 and ed25519 for image signing, and does not list ecdsa-p384, so confirm your configuration against the MCUboot imgtool documentation before choosing a key. The output of this step is one named key type that the bootloader is configured to verify, recorded in your build configuration. If your bootloader is not MCUboot, confirm the supported types with its own documentation.
Look up the raw signature length
Take the raw signature length for that algorithm from the table on this page. For RSA, the signature is the length of the modulus in octets, so rsa-2048 gives 256 octets and rsa-3072 gives 384 octets, per RFC 8017. For Ed25519, the signature is 64 octets, per RFC 8032. Record the number as the baseline before any container is added. The output is a single byte count for the signature alone.
Add the signing tool's container overhead
Run a test signing with the tool you will use in production and compare the resulting image against the raw signature length. The signing tool adds headers, a TLV area, and the public key or key hash, and that overhead is not in the table. Record the difference between the signed image and the raw signature as the container overhead for this key type. The output is a total per-image overhead figure measured from your own tool version, not an estimate.
Check the total against slot and flash sizes
Add the raw signature length and the measured container overhead to your application image size, then compare the sum with the size of the image slot defined in your flash layout. Confirm that the slot holds the signed image with room for any upgrade or swap area your bootloader requires. The output is a yes or no result per slot, along with the remaining headroom in bytes. If the image does not fit, the fix is in the layout or the algorithm choice, not in the signature table.
Test a signed image on the target
Sign a representative image with the chosen key, flash it to the target, and let the bootloader verify it. Confirm that a correctly signed image boots and that a tampered copy is rejected. Repeat the test with the exact key type you intend to ship, since a key type that the tool can sign may still be rejected by a bootloader built for a different type. The output is a boot log or test record showing both outcomes on the target hardware.
Ask the vendor for the container format
Request the exact container format your signing tool emits, including the header layout, the TLV fields, and the byte order of the signature. Ask whether the format matches the version your bootloader verifies, and ask for the version numbers of both. Use the vendor's documentation as the reference and confirm compatibility for the versions you run, rather than assuming a match. The output is a written statement from the vendor that you can keep with the firmware release record.
What these figures do not include
The sizes on this page are raw signature and key lengths taken from the cited documents. They describe the signature value itself, such as the 256-octet output that RFC 8017 gives for a 2048-bit RSA modulus or the 64-octet Ed25519 signature defined in RFC 8032. They do not include the container headers that signing tools add around an image, padding those tools insert to meet alignment or flash-sector requirements, or the certificate wrapping and encoding overhead that surrounds a signature when it is carried in X.509. RFC 8410 shows this clearly: the Ed25519 signature sits in a 65-byte BIT STRING once the unused-bits byte is counted. The MCUboot imgtool documentation covers the image format that its tool produces, so the size of a signed image file will be larger than the signature length alone.
The encoding also changes the number. A JWS ECDSA signature is a fixed-length concatenation of R and S, so ES256 gives 64 octets, while an X.509 ECDSA signature is a DER-encoded SEQUENCE of two integers, which varies in length. The same underlying signing operation can therefore produce different byte counts depending on whether it is carried in a token, a certificate or a firmware container. Do not copy a figure from this page into a bandwidth, buffer or storage budget without first identifying which encoding and container your system uses.
Confirm compatibility for the specific versions you run before you depend on any size. Check which key types your bootloader or verifier is configured to accept. The MCUboot imgtool documentation says the key type must match what MCUboot is configured to verify, and it lists rsa-2048, rsa-3072, ecdsa-p256 and ed25519 without listing ecdsa-p384. Read the exact release notes and configuration for your firmware, library and tool versions, and test a signed image end to end on the target device to measure its real total size.
Questions engineers ask about firmware signature sizes
How big is an Ed25519 signature in bytes?
An Ed25519 signature is 64 octets, made of two 32-octet values, R and S. The public key is 32 octets. RFC 8032 defines both lengths in its sections on key and signature encoding. In X.509 certificates, RFC 8410 places the raw 64-byte value in a BIT STRING with no extra ASN.1 wrapping, so the BIT STRING holds 65 bytes: one unused-bits byte plus the 64-byte signature. The size of the image header or container that your signing tool adds is not covered by these figures. Check the output of your signing tool against the sizes above.
How does an RSA-2048 signature compare with an ECDSA P-256 signature?
An RSA-2048 signature is 256 octets, and an ECDSA P-256 signature with SHA-256 (ES256) is 64 octets. The sources give these as the length of the RSA modulus in octets for RSA, and as the fixed-length concatenation of R and S for ECDSA in JWS (RFC 7518, Section 3.4). The ECDSA figure comes from the JWS encoding, so the length of an ECDSA signature in a firmware container may differ if the signing tool uses a different encoding. Confirm the encoding your tool produces before you size a flash partition. The RSA figure is the raw signature before any container or header that the tool adds (RFC 8017, Sections 8.1.1 and 8.2.1).
Does an LMS signature fit in a single image header?
The sources give the sizes, but they do not say whether a given image header has room for one. RFC 8554 requires an LMS signature to be exactly 12 + n*(p+1) + m*h bytes, so its size depends on the tree height h. The LM-OTS component for LMOTS_SHA256_N32_W8 is 1124 bytes. For single-level HSS, RFC 8554 Table 3 lists signature sizes of 1616, 1776 and 1936 bytes for the H15, H20 and H25 parameter sets. The LMS public key is 56 bytes when m is 32. Compare these figures with the signature field size in your image header and bootloader configuration, and confirm the parameter set your tooling supports.
Which key types does MCUboot support for signing images?
The MCUboot imgtool documentation states that it supports rsa-2048, rsa-3072, ecdsa-p256 and ed25519 keys for signing images. It does not list ecdsa-p384. You generate a key with the imgtool keygen command, for example ./scripts/imgtool.py keygen -k filename.pem -t rsa-2048, and the alternative type values are rsa-3072, ecdsa-p256 and ed25519. The key type must match what MCUboot is configured to verify, so check your bootloader configuration before you generate keys. The imgtool documentation at MCUboot imgtool documentation lists the current options.
How does the RSA modulus length change the signature length?
The signature length equals the length of the RSA modulus in octets. A 2048-bit modulus gives a 256-octet signature, a 3072-bit modulus gives 384 octets, and a 4096-bit modulus gives 512 octets. This rule applies to both RSASSA-PSS and RSASSA-PKCS1-v1_5 (RFC 8017, Sections 2, 8.1.1 and 8.2.1). The rule covers only the raw signature. Container, header and certificate overhead added by your signing tool or PKI is not included, so measure the complete artifact your device verifies before you set partition sizes.
Which signature size should you plan for when you change algorithms?
Plan for the full artifact size, not only the signature length. The raw signature sizes from the sources are 64 octets for Ed25519, 114 octets for Ed448, 256 octets for RSA-2048, 384 octets for RSA-3072, and 1124 bytes for the LM-OTS component of LMS. Each figure is the signature field alone. The public key, certificate and container overhead also take flash space. Compare the total of these elements with the space in your bootloader and image slot configuration, and check the exact output of your signing tool before you change the partition layout.
Where a signed image carries the signature from build to device
The signing tool takes an image and a private key, such as an rsa-2048, ecdsa-p256 or ed25519 key generated with imgtool keygen, and produces a signed image. The raw signature bytes sit in the signed image container, and the tool adds header and trailer overhead around them, so the image grows by more than the signature alone. On the device, MCUboot checks the signature against the public key it is configured with, so the key type at build time must match the key type MCUboot is configured to verify. The sizes of the signature itself depend on the algorithm, as the tables on this page show, and the overhead is set by the signing tool rather than by the algorithm.
The signing tool adds header overhead around the raw signature bytes before MCUboot verifies the image on the device.
How DeployOpen works on this
DeployOpen starts from the signing algorithms and bootloader in use on your devices, then works out the signature length, container overhead and verification constraints for each one. The result is a written scope and a set of size figures you can check against the MCUboot imgtool documentation and the RFCs cited on this page before any firmware is changed.
How we scope
- We confirm which key types your bootloader is configured to verify, such as rsa-2048, rsa-3072, ecdsa-p256 or ed25519.
- We list each signing algorithm in use and the signature length the cited RFCs give for it, so the sizes can be reviewed line by line.
- We agree the scope in writing before work starts, covering which devices, images and signing keys are included.
How we build
- We generate signing keys with the imgtool command for each type in scope and confirm the key type matches the bootloader configuration.
- We sign test images and measure the resulting signature and header overhead against the figures in the tables on this page.
- We check that signed images verify on the target hardware, including the cases where the bootloader rejects a key type it was not built for.
How we hand over
- We deliver a document listing each algorithm, its signature length in octets, and the source that supports each figure.
- We record the key generation steps and the imgtool settings used, so your team can repeat them for future firmware releases.
- We provide a list of the items your team should confirm on its own hardware and tooling versions before production use.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer, which covers new firmware releases and bootloader changes.
- When a bootloader or signing tool version changes, we retest the affected key types and update the size documentation to match.
- Support requests are handled within the scope agreed in writing, and any change to that scope is agreed in writing as well.
Sources and further reading
- RFC 8017: PKCS #1 RSA cryptography specifications version 2.2 ↗
- RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA) ↗
- RFC 7518: JSON Web Algorithms (JWA) ↗
- RFC 8410: Algorithm identifiers for Ed25519, Ed448, X25519 and X448 in X.509 ↗
- MCUboot imgtool documentation ↗
- RFC 8554: Leighton-Micali Hash-Based Signatures ↗

