Commit Graph

67 Commits

Author SHA1 Message Date
Nick Mathewson 386de7587e hscrypto: Use derive_more, and derive Deref for public keys. 2023-01-25 13:48:40 -05:00
Nick Mathewson fe6575ef98 hscrypto: Revise TimePeriod to account for variable offset.
Previously, the offset was set to 12 hours unconditionally (like the
spec says).  But based on a conversation on tor-dev, it seems that
the offset should actually be 12 times the voting interval.

I'm also opening an MR to change the spec.
2023-01-24 15:04:40 -05:00
Nick Mathewson 108bb72c5e hscrypto: Add documentation for ClientSecretKeys 2023-01-24 13:40:59 -05:00
Nick Mathewson 93cdb0a2c3 Add a note about why we use ExpandedSecretKey for OnionIdSecretKey 2023-01-24 13:40:59 -05:00
Nick Mathewson 00aaf79620 hscrypto: Add our standard clippy warnings
(I have squashed the fixes for these warnings into the earlier
commits in this branch, so it will look like I did everything right
the first time.)
2023-01-24 13:40:59 -05:00
Nick Mathewson f192429442 hscrypto: Implement key blinding.
This implementation was made based on the specification, and then
validated against itself, and against C Tor.
2023-01-24 13:40:59 -05:00
Nick Mathewson 3dfeb5b144 hscrypto: Add an implementation for TimePeriod
This required some API tweaks, which is probably to be expected;
these time periods are a wonky kind of thing.
2023-01-24 13:33:48 -05:00
Nick Mathewson 0a52d90af3 hscrypto: Implement hs_mac. 2023-01-24 13:33:48 -05:00
Nick Mathewson 44e9d31af9 hscrypto: Improve documentation for RendCookie 2023-01-24 13:33:48 -05:00
Nick Mathewson 49afcafadd hscrypto: use a macro to define our byte wrappers too. 2023-01-24 13:33:48 -05:00
Nick Mathewson 7e4ad381a8 hscrypto: Add and use a macro to define all PK types. 2023-01-24 13:33:46 -05:00
Nick Mathewson 36485218c3 hscrypto: A couple of spelling fixes. 2023-01-24 13:32:18 -05:00
Nick Mathewson 23bbf17d38 hscrypto: Associate each type with new name from rend-spec-v3.txt 2023-01-24 13:32:18 -05:00
Nick Mathewson 190f24e66d CircMgr: Draft APIs used to implement onion service clients. 2023-01-24 12:32:21 -05:00
Nick Mathewson f24f8d295c Sketch APIs for the onion service directory ring.
These are a bit complex internally, but the API they present is
pretty simple.  I've left some discussion of points where the design
isn't totally fleshed out, and where we need to look harder at the
spec.

Part of #716.
2023-01-11 09:04:13 -05:00
Nick Mathewson d7abced11f hscrypto: Add several derives
The important addition here is the Copy derives, which affect API
design. I'm applying them to the types that are 32 byte or smaller.
2023-01-11 09:04:12 -05:00
Nick Mathewson 0203634ec5 Create a new tor-hscrypto crate.
This module has types and operations needed in multiple places
for an onion service implementation.  There are a bunch of
TODO hs-crypto comments that we'll need to fill in.
2023-01-06 13:03:50 -05:00