Skip to content
/ RSA Public
forked from RustCrypto/RSA

RSA implementation in pure Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kaidokert/RSA

 
 

RustCrypto: RSA (No-Heap Fork)

This repo is a fork of the RustCrypto RSA crate

What's Different?

This fork is a proof of concept focused on removing heap usage and allocations. It's written for environments where memory constraints are tight, such as embedded systems or no_std contexts.

Key Features

  • No heap allocations: All operations run entirely on the stack.
  • Public Key Functions: Only public key operations like signature verification and encryption are implemented so far.
  • Pluggable BigInt: The BigInt implementation is swappable. It’s a type parameter in the RsaPublicKey<T>, where T must implement num_traits::PrimInt and some additional traits.

What's Missing?

  • Private Key Operations: Private key functions (like signing and decryption) are stubbed out.
  • A lot of tests: Most of the tests from original are stubbed out, as they rely on PEM key decoding functions that need heap.
  • No expectation of security: Only signature verification is probably okay to use.

Why This Fork?

It's a proof of concept to try how compact a RSA implementation can become. Currently tested on Cortex-M0, fitting into about 8Kb code space and requiring about 3kB stack at the minimum.

About

RSA implementation in pure Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.9%
  • Shell 0.1%