<div dir="ltr"><div dir="ltr"></div><div>I am looking for a minimal secure boot scheme, with 128 bit security level. The target device has a 16bit CPU, RAM in the KBytes range and the code size is critical (this is supposed to go in ROM and its already full...).</div><div>What I am considering so far:</div><div>- Generate an RSA2048 key pair</div><div>   - d: private exponent</div><div>   - n: modulus</div><div>   - e: public exponent<br></div>- store n and e in the ROM<div>- at build time:</div><div>   - digest = sha256 over the code<div>   - sig = mod_exp(digest,d,n)</div><div>   - append sig to code<br></div></div><div>- at boot:</div><div>   - get code and sig</div><div>   - digest = sha256 over code</div><div>   - expectetd = mod_exp(sig,e,n)</div><div>   - launch code only if digest == expected</div><div><br></div><div>Any issue with that ?<br></div><div><br></div><div>Now I am wondering if I need:</div><div>   - e larger than 3 ? if yes what is the sensible minimum ? I am inclined to set e=11 to get (digest<span class="gmail-nowrap"> power e) > n but I do not have really clear argument for that.</span> <br></div><div>   - padding the digest before the mod_exp</div><div><br></div><div>I will be the only one knowing the private key and I won't sign any third party code, so chosen plaintext attacks are not a worry.</div><div>I am not concerned by attacks where the same thing is signed by multiple keys either.<br></div><div><br></div><div>Sebastien<br></div><div><br></div></div>