randombit / botan-rs

:shrimp: Rust cryptography library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support no_std

randombit opened this issue · comments

We can get the C types via libc, which supports no_std.

This requires removing use of Vec which would be a major change in API but probably worthwhile overall.

Good first step would be to just support no_std within botan-sys, which just requires using the libc types.

Think the trick is to implement no_std compatible APIs that write to/read from slices, and then in situations when std is available implement the current API on top of the no_std implementations.

FFI CString requires libstd so I think we are SOL here

Some hope of progress in rust-lang/rust#46736

Alternatively can DIY it ala https://gitlab.com/worr/rcstring/blob/master/src/lib.rs