Commit graph

21 commits

Author SHA1 Message Date
bunnie
67fc21fbdd harmonize hosted mode selection, but retain an explicit hosted flag
In general, hosted mode is assumed "by default" if the target
is not Xous. This allows packages to be built cleanly on command
lines that don't know to pass a --feature flag to specify a target.

However, an explicit "hosted" flag is still retained so that we
can confirm the build system intent. This saves us from the failure
mode that we thought we were building for target A, but accidentally
ommitted the flag, and instead we've been silently building for
"hosted" mode without any warning. The main consumer of the "hosted"
flag is now just the build.rs script inside of the utralib.
2022-10-25 17:21:02 +08:00
bunnie
4e40ae6c5d move from target selectors to feature selectors for back-ends
This will allow for e.g. xous on riscv32-imac but not a precursor
target, for example: by using feature selectors we get to have
a bigger range of targets that we support, such as for implementations
that haven't been upstreamed or have official target-triples.

The downsides are:

- patch override libraries don't absorb feature flags. so, for
example, the AES crate that is used to patch other crates won't
be aware of the target features without modifying the referencing
crates.

- features are normally meant to be additive, but target features
are mutually exclusive. The mutex is enforced by a check in
utralib that throws a panic on build if two targets are accidentally
selected at the same time.
2022-10-02 02:56:44 +08:00
bunnie
ec5d61e678 add comment on test 2022-06-08 04:35:04 +08:00
bunnie
7db4db2701 fix ECDH error
was missing the FIDO-required sha256 hash after ECDH key exchange
2022-06-08 04:33:09 +08:00
bunnie
5812cef8f3 add standard features to the config & fixup code paths that broke 2022-06-01 14:15:49 +08:00
bunnie
d995912a97 fix remaining crypto tests 2022-06-01 04:14:57 +08:00
bunnie
3647c38cb0 fix ecdh tests 2022-06-01 03:41:58 +08:00
bunnie
01a10ee709 fix tests so that they are runnable 2022-06-01 03:11:26 +08:00
bunnie
dd9aa25516 remove unused trait 2022-05-31 02:24:35 +08:00
bunnie
d4244b28af remove custom aes256 implementation 2022-05-31 00:41:13 +08:00
bunnie
a407f7e80d remove now-defunct custom elliptic curve implementation 2022-05-31 00:35:01 +08:00
bunnie
22181422b2 add ecdsa port first cut
this one is very iffy, but once we can run tests it should
chase out all the questions about which APIs go where.
2022-05-31 00:33:11 +08:00
bunnie
58ab2a059e add ecdh calls to "official" p256 crate 2022-05-30 18:52:12 +08:00
bunnie
f2ebfd88f4 patch sha2 to Xous implementation 2022-05-30 16:04:54 +08:00
bunnie
723b230a39 that was a long walk for a drink of water: cbc encryption
Woo? we have CBC encryption using Rust's most favored AES library
now.

I have a feeling I'm going to be re-doing all of this once they
decide to finally take GenericArray out back and shoot it....
2022-05-30 15:36:00 +08:00
bunnie
764a8ad195 partial progress on CBC porting.
man this GenericArray shit is so annoying.
2022-05-30 13:46:09 +08:00
bunnie
e84e378ef2 partial progress on aes integration
need to retrench and update AES crate to support some APIs
that allow for CBC modes
2022-05-29 20:35:11 +08:00
bunnie
0b1768115a retrench and try a new strategy for porting crypto libraries 2022-05-29 13:59:06 +08:00
bunnie
844543f72d beginning of ecdsa port...need to resolve rand_core dependency
*everoyne* is relying on rand_core, a later version, that uses
a "getrandom" thing that tries to make the call for random
number generators generic.

I mean, it's kind of cool, but, it's also sort of a libc
non-pure-rust nightmare because basically it always delegates
to a C-style API for a variety of platforms.

Next step is to see if we can't...patch...getrandom to point
to a much simplified, xous-only version that is 100% pure Rust.
2022-05-28 23:38:23 +08:00
bunnie
2da0f0b812 some progess porting ctap to Xous 2022-05-28 18:19:52 +08:00
bunnie
9e1e80f089 organize the vault app, trim some things, get a dummy build going 2022-05-28 16:12:08 +08:00