94 karma · joined September 28, 2013
notes: https://phlip9.com/notes
twitter: https://twitter.com/phlip9
[1] https://github.com/tokio-rs/loom [2] https://github.com/awslabs/shuttle
programs.eza = {
enable = true;
# In list view, include a column with each file's git status.
git = true;
};
programs.bash.shellAliases = {
ks = "eza";
sl = "eza";
l = "eza";
ls = "eza";
ll = "eza -l";
la = "eza -a";
lt = "eza --tree";
lla = "eza -la";
};What are your plans for cross-compilation or heavy package customization? One of nixpkgs coolest party tricks imo is that you can just change the stdenv and get a musl static binary or cross-compiled binary.
(1) the tillitis CA certifies your TKey device platform. You can now trust that it's running a specific firmware version with some platform pubkey.
(2) Your custom software is running and derives a keypair from it's derived secret + program binary hash.
(3) Somehow your custom software's pubkey gets locally certified by the platform's pubkey from (1). (not sure what this looks like w/ the TKey)
You now have a chain of trust from (1) the tillitis CA -> (3) the TKey device platform pubkey @ some specific firmware version -> (2) your custom software pubkey @ some specific version.
Now that we have a trusted pubkey for our service, I would open a secure channel to it via Noise IK or something (https://noiseexplorer.com/patterns/IK/). The TKey platform definitely looks a bit anemic so getting this working might be a challenge...
Wonder how well it compares with fastmod [0]? That's what I've been using for large scale codemods/refactors. ripgrep is ofc insanely fast so ripgrep+ren would probably fare favorably.
Rust's `cargo bench` "winzorizes" the benchmark samples before computing summary statistics (incl. the mean).
https://github.com/rust-lang/rust/blob/master/library/test/s...
For context: the ring repo's been a bit inactive lately and the v0.17 release looked like it stalled out. Thankfully there's been a burst of activity in the past several weeks so I'm feeling a lot better.
Then from another outer function, you can't call the effectful function unless the outer function also declares those same side-effects (or you provide handlers for them).
This way you can easily isolate non-determinism and I/O to the top-level part of your program, while keeping the interior business logic pure.
The "first-class effects" part is what lets you easily compose effects and inject custom handlers. Ideally in a way that's more ergonomic than juggling with Monad type system Jenga.
ex: for an integer (u32, u64, u128), you can test "all at once" whether any byte == 0, or any nibble == 0, etc... like: [0]
fn u32_any_byte_eqz(x: u32) -> bool {
let t = x.wrapping_sub(0x0101_0101);
let u = !x & 0x8080_8080;
let v = t & u;
v != 0
}
which generates pretty compact assembly: example::u32_any_byte_eqz:
lea eax, [rdi - 16843009]
andn eax, edi, eax
test eax, -2139062144
setne al
ret
even more powerful, you can test whether any byte `b` is in the range `m < b < n` "all at once", where `0 <= m <= 127` and `0 <= n <= 128`. [1] fn u32_has_byte_between(x: u32, m: u32, n: u32) -> bool {
let mask = 0x0101_0101;
let s = mask * 127;
let y = mask * 128;
let w = mask * (127 + n);
let t = mask * (127 - m);
let u = x & s;
let z = (w - u) & (!x) & (u + t) & y;
z != 0
}
by changing the mask you can also select which bytes/nibbles you care about.i've used these to pretty great effect when writing a montecarlo tree search. you just need some care to tightly bit-pack the core structs, then you're golden.
[0]: https://phlip9.com/notes/performance/bit%20hacks/#any-byte-0 [1]: https://phlip9.com/notes/performance/bit%20hacks/#any-byte-b...
OTOH, secure enclaves like SGX are convenient since the overhead's not bad, you can run the enclave as a networked service, make HTTPS connections, sample randomness via RDRAND, etc...
Do you think zkapps might have similar capabilities in the future? I'm not sure the analogy works all that well in blockchain land, but perhaps more as a virtual software-only enclave or something?
It's not super clear to me how you would sample private randomness, or perform remote attestation, or prevent replay attacks without a remote trusted storage.
I also remember even the best proof systems seemed to have like 100x prover overhead on CPU + memory usage, but that was a few years ago. Have things gotten better recently?
# Why is CRLite able to compress so much data?
Bloom filters are probabilistic data structures with an error rate due to data collisions. However, if you know the whole range of data that might be tested against the filter, you can compute all the false positives and build another layer to resolve those. Then you keep going until there are no more false positives. In practice, this happens in 25 to 30 layers, which results in substantial compression.
EDIT: Is there any risk of filter blow up (think 1000's of layers) if a CA did a mass revocation (maybe some root key leak)?[0] https://github.com/mozilla/crlite/wiki#why-is-crlite-able-to...
The example given in the paper is a LinArray (https://github.com/idris-lang/Idris2/blob/main/libs/contrib/...). Unfortunately, as the community discovered, a user can "leak" a non-linear binding outside of the `newArray` constructor (which is what attempts to enforce linearity for all bindings). With multiple unrestricted handles, a user can accidentally double-free for instance. (https://github.com/idris-lang/Idris2/issues/613)
The fundamental issue in this case is that linearity in QTT is a property of the parameter bindings and _not_ the type itself, meaning we can't easily express linearity as a _global_ property of the type.
On the other hand, only affecting the parameter bindings makes it really easy to use runtime-erased/comptime stuff without reimplementing a bunch of common types as runtime- and comptime-only versions.
ATS chooses the other path and makes linearity and runtime-erasure a part of the type (not without paying a hefty syntactic cost however).
At least in theory. IIRC, a number of side channel attacks are exploitable on Intel SGX, so the adversary could leak secrets but not tamper with execution.