Skip to content

Ensure that all crates are #![no_std] #49

Description

@ounsworth

Might be a duplicate of #14

The work here is to circle back to the earlier crates:

  • sha2
  • sha3
  • hmac
  • hkdf
  • rng

and add #![no_std] to the top of their lib.rs, see what breaks.

I suspect the things that will break will be of the flavour:

fn do something(..) -> Vec<u8>;

some of those will be able to convert to -> [u8; LEN] for some obvious choice of parametrized constant LEN (like the size of the hash function), but some of them might really need to be -> Vec<u8> in which case we should leave them but establish a pattern for guarding them with a cargo feature so that they compile out when building in no_std

Something like:

#[cfg(feature = "alloc")]
fn do something(..) -> Vec<u8>;

or maybe we want all crates to have a feature "std" as suggested here

#![no_std]

#[cfg(feature = "std")]
fn do something(..) -> Vec<u8>;

and add [features] std = [] (probably default = ["std"]) to Cargo.toml for all crates that use it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomershelp wantedCould be picked up by anyone in the communityrefactorThis task is primarily about performing a code refactor

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions