Dev Diary 02/10/2018
- forked a rust implementation of the Ryƫ floating point printing algorithm and modified the formatting to implement the ssb legacy float signing format. Most of the work was renaming the crate and modifying the tests. https://github.com/ssbrs/ryu
- implemented a serializer for json-encoded legacy messages, supporting both the signing format and whitespace-less compact output for replication: https://github.com/ssbrs/legacy-msg/blob/master/src/json/ser.rs
- this was the hard part of the whole legacy message stuff
- decided I won't implement legacy (De)Serialize for std types, and I won't provide derive Macros for these traits. The legacy format should only be used for verification/cypherlink computation of old messages, and that is done through a generic Value type.
- wasted a few hours trying to reuse the serde_json parser
- started implementing a json parser. At least that minimizes dependencies and gives us full control that the parser does indeed recognize ECMA-404 (minus numbers that are invalid for ssb), the popular rust json parsers don't even bother specifying which standard they implement...
Next goals:
- finish the json parser
- implement Deserialize on the legacy Value types
- implement legacy encoding, hash computation and length checking in rust
- use afl on the rust implementation to generate test cases
- check whether the js implementation behaves the same way on those test cases, iterate until they match
- specify legacy metadata
- implement legacy metadata
- hook everything together for message verification
Bonus goal:
- js bindings to the verification function