« first day (3439 days earlier)      last day (341 days later) » 

12:23 AM
The good news on mbedTLS keeps coming, not only do we now have a real/nontrivial diffie-hellman implementation...but it adds the missing feature of choosing your custom private key size which was a TBD in Saphir (the public key size has to match the modulus/base).
It's a peer-reviewed, embedded-targeting, present-day-sync'd, modular library...where dependency control between the components is being carefully managed so that wanting one feature doesn't bring everything else in--and the features that are there are able to use common parts wherever they can. The code is clear to read and documented. It builds in ANSI C. We couldn't ask for much more in this department.
 
 
3 hours later…
3:24 AM
@HostileForksaysdonttrustSE You forgot eminently trustworthy.
 
@MarkI Well, certainly beats "code copied off the internet that somebody anonymously wrote where the only reason it was used is because it had low dependencies"
 
@HostileForksaysdonttrustSE I was thinking about adding zero-dependencies because you didn't mention it explicitly either but I knew anything else would be a non-starter for you (and for us).
 
I'd actually say it's almost sort of fun to be ripping out the other stuff and putting this in. Maybe fun in the way that getting a new mop head, or keys to the toner cartridge cabinet is fun... but.
But it does pay to have stuck with it and kept upgrading the crypt/libRebol interaction over time, keeping a model for how these routines would work. It just gets a little better each iteration.
A lot of patterns for DEBIN are consuming bits out of a binary series and advancing it. I'm wondering if the best way to go about this is with multiple return values.
value: debin [be + 4] binary  ; expects binary to be *exactly* 4 long, else errors
value: debin [be +] binary  ; uses size of binary to imply size of decode

; Decode first 4 bytes of binary and store in value, allow binary to be longer
; Set next-position to binary skipped by 4
[value next-position]: debin [be + 4] binary

; Decode first 4 bytes of binary into value, allowing binary to be longer
; but don't set any new position--blank just indicates you know it's too long
[value _]: debin [be + 4] binary
^-- that's the kind of odd-but-slick thing I'd like to see be possible. I like it better than DEBIN/NEXT or whatever...and you see there's some awareness of error handling leaking in regarding how many slots are on the left, and what's in them.
This is an outgrowth of my hey we can already do multi-returns with enfix! realization, and I'm still mulling it. The big thing is whether it's worth it to go further and be prescriptive and systemize it so that everyone doesn't invent their own wild west ideas.
But the wild west ideas may be a good place to start prototyping--as we start figuring out what features are just too good to pass up and which ones are turkeys. This one looks really nice to me.
But wanting DEBIN to maybe just be a ENCODE with a "BE" codec that is parameterized by block kind of raises the issue of why this shouldn't be some wild thing...and that multi-return values are something the system gets its hands in. If ENCODE is agnostic (like "I can return anything!") then the tunneling of all this isn't something you can do with enfix like I'm proposing. It has to be a formal convention if some encoders return multiple return values and others don't.
I think the long and short of it is that in the main evaluator, we take [x y]: ... for multi-return and forget the idea of [x y]: [1 2] being x=>1 and y=>2 because it's a "SET-BLOCK!" and that's what "SET of a BLOCK! did historically". That idea has sailed for me, and I want multiple returns of the nature I describe...where there's some intelligence of the callee about how many slots the caller wants so it can tune calculations/errors.
Speaking of ENCODE... I started wondering if the ENBASE/DEBASE stuff (which confused me) should be ENCODE 'BASE64 "whatever"... but the semantic question we get is "does ENCODE always return a BINARY!, and DECODE always take a BINARY!"
Because people were wanting base64 back as a string. But now with UTF-8 everywhere, even if the base64 encoder made a binary, you can just AS TEXT! it if you know it's text and it's not like you lost much...it's relatively efficient. Very efficient if you were willing to lock the encoding as utf-8 binary when returning it.
 
 
8 hours later…
11:41 AM
@HostileForksaysdonttrustSE Bin makes me think of the trashbin, to debin is saving something out of the trash.
 
 
10 hours later…
9:56 PM
Trying to follow at least half-decent practice today by writing tests for the updated mbedTLS version of DH key exchange. It's interesting how much of a challenge it has been to really understand what your degrees of freedom are--and when things work on accident vs. not. People aren't very clear about what it is that won't work mechanically vs. won't work because it's not secure.
 
10:07 PM
"won't work because it's not secure" => e.g. appears to do the advertised goal, but is bad because you didn't get the crypto benefit. This seems to me to be a pretty good opportunity to give people an ergonomic cryptography playset that gives better feedback.
A safe prime is a prime number of the form 2p + 1, where p is also a prime. (Conversely, the prime p is a Sophie Germain prime.) The first few safe primes are 5, 7, 11, 23, 47, 59, 83, 107, 167, 179, 227, 263, 347, 359, 383, 467, 479, 503, 563, 587, 719, 839, 863, 887, 983, 1019, 1187, 1283, 1307, 1319, 1367, 1439, 1487, 1523, 1619, 1823, 1907, ... (sequence A005385 in the OEIS)With the exception of 7, a safe prime q is of the form 6k − 1 or, equivalently, q ≡ 5 (mod 6) — as is p > 3 (c.f. Sophie Germain prime, second paragraph). Similarly, with the exception of 5, a safe prime q is of the form...
Why not by default check to make sure you are using a safe prime as the modulus in DH exchange, for example? If you don't want to pay for the check, say DH-GENERATE-KEYPAIR/UNCHECKED and it gets skipped. But it would be nice to have a bunch of safety nets as you tinker.
The primality checks are going to be heuristic and imperfect when you're dealing with 4096-bit numbers--of course--but you can engineer down the odds pretty fast to error rates like 2^-80, and that's more than good enough for experimenting. In fact I think when you're designing the protocols it would be nice if you didn't have the screen all filled up with 4096-bit numbers and you could try it out with much shorter things just to see it work.
 
11:13 PM
Somewhat painfully, travis-ci.org migrated all their open source repos to travis-ci.com ... and there's a mandatory expiry of legacy integration services. Which is what it is. But the problem is just how many of the migration buttons stick or don't work or leave your repo in some limbo.
I managed to get metaeducation/ren-c to migrate but couldn't for the life of me figure out any voodoo to get hostilefork/rebol to move. Wound up having to delete it and create hostilefork/ren-c. There were no issues and some negligible wiki pages from the very start of Ren-C. I moved one: "How Rebol Borrows Code"
 
11:51 PM
OMG
Do they reckon that since everyone is in lockdown they have time to fix all these problems they are causing?
 

« first day (3439 days earlier)      last day (341 days later) »