Use spec names for keys etc., not keyword names
While reviewing !999 (merged), I was frequently confused by the discrepancy between netdoc document keywords, and the official names for information (as defined elsewhere in the spec). (Context: torspec#187.)
Because in Rust the names of struct fields often end up driving the names of local variables, this meant that cryptographic keys, nonces, protocol elements, and so on, were named in the code after the document keyword rather than after their proper official name.
This is not particularly helpful, especially since the same piece of information is often introduced by different netdoc keywords in different contexts.
IMO we should switch to using the official names (kp_hs_desc_enc
, say) even in structs representing network documents, rather than names derived from the netdoc keywords. This would relegate the keyword to the doc comment, sadly. But it would mean that the meat of the code would always be referring to a key by its official name, not by some random phrase that happened to be used by the netdoc spec author for that particular key in that particular place.
I don't think we can do this until @nickm's !999 (merged) is merged.