Files
alkane-os/vendor/sha2/tests/mod.rs
T
x ad31cfbafa Vendor flare-ui v0.2.9 and prove the schema-driven UI in an image
Spike, not the final UI: it answers whether flare-ui can drive Alkane OS's
on-box pages, and what it costs.

What works:

- schema/alkane-bb.json authors the sidebar as data (3 sections, 14 tabs);
- src/bin/ui-spike.rs renders it through flare_ui::nav + flare_ui::shell, so
  the unified sidebar, ordering and surface filtering come from the schema
  rather than from hand-written HTML;
- the render uses the shared bf- design tokens, the same ones the rest of the
  suite uses.

Size, measured rather than assumed (armv7, release, stripped):

  ui-baseline   323 KiB   (maud + serde_json, no flare-ui)
  ui-spike      771 KiB   (flare-ui + wschema + sha2)
  marginal      448 KiB

Vendoring: third-party/flare-ui is the full v0.2.9 tree pinned in
flare-ui/flare-ui.lock (a partial archive does not compile, since the crate
include_str!s assets from dash-editor/). vendor/ is re-generated as a cargo
directory source with the new registry dependencies (maud, sha2, typenum,
digest, generic-array, block-buffer, crypto-common, cfg-if, etc.) so the build
still works offline. third-party/README.md records how to re-pin.
2026-11-04 14:06:25 -06:00

36 lines
1.1 KiB
Rust

use digest::dev::{feed_rand_16mib, fixed_reset_test};
use digest::new_test;
use hex_literal::hex;
use sha2::{Digest, Sha224, Sha256, Sha384, Sha512, Sha512_224, Sha512_256};
new_test!(sha224_main, "sha224", Sha224, fixed_reset_test);
new_test!(sha256_main, "sha256", Sha256, fixed_reset_test);
new_test!(sha512_224_main, "sha512_224", Sha512_224, fixed_reset_test);
new_test!(sha512_256_main, "sha512_256", Sha512_256, fixed_reset_test);
new_test!(sha384_main, "sha384", Sha384, fixed_reset_test);
new_test!(sha512_main, "sha512", Sha512, fixed_reset_test);
#[test]
fn sha256_rand() {
let mut h = Sha256::new();
feed_rand_16mib(&mut h);
assert_eq!(
h.finalize()[..],
hex!("45f51fead87328fe837a86f4f1ac0eb15116ab1473adc0423ef86c62eb2320c7")[..]
);
}
#[test]
#[rustfmt::skip]
fn sha512_rand() {
let mut h = Sha512::new();
feed_rand_16mib(&mut h);
assert_eq!(
h.finalize()[..],
hex!("
9084d75a7c0721541d737b6171eb465dc9ba08a119a182a8508484aa27a176cd
e7c2103b108393eb024493ced4aac56be6f57222cac41b801f11494886264997
")[..]
);
}