summaryrefslogtreecommitdiff
path: root/crates/tor-llcrypto/src/util
Commit message (Collapse)AuthorAgeFilesLines
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* llcrypto: Use up-to-date name for a clippy lint.Nick Mathewson2023-11-301-2/+1
|
* Remove RngCompatExt.Nick Mathewson2023-11-291-250/+0
| | | | | | | | | | This code was needed with the old version of dalek-cryptography, which wasn't compatible with up-to-date versions of the `rand` crate(s). But now that we've upgraded, we can drop this. (We could have left it around and deprecated it, but we are already making a breaking change to tor-llcrypto by upgrading dalek-cryptography.)
* Convert to the latest versions of dalek-cryptographyNick Mathewson2023-11-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes that we have to adjust for are as follows: * In x25519-dalek: * `StaticSecret` is now behind a feature. * `StaticSecret::new` is deprecated in favor of `StaticSecret::random_from_rng`. * StaticSecret no longer does its own clamping. * In ed25519-dalek: * `SecretKey` has (in effect) been renamed to `SigningKey`. The name `SecretKey` is now an alias for `[u8; 32]`. * `SigningKey` is effectively a keypair, since it contains a public key as well. * `PublicKey` has been renamed to `VerifyingKey`. * The functions to extract a signing key and verifying key have been renamed as you might expect. * `ExpandedSecretKey` has been moved to `hasmat` and no longer implements `sign`. * `ExpanededSecretKey` now has as its elements a scalar and a hash prefix. * Various functions that took `&[u8]` now take `&[u8; N]`. * We no longer need a wrapper for older versions of rand. There is a single test in tor-keymgr that does not pass. I've marked it as ignore for now, in hopes that @gabi-250 can help me figure it out. This closes #808. There are several changes I want to make before we merge, however. They are marked with TODO DALEK.
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-232-0/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-102-0/+2
|
* llcrypto: add another warning to ct_lookup.Nick Mathewson2023-06-161-2/+3
|
* Lower tor-proto::util::ct::lookup to tor-llcryptoNick Mathewson2023-06-161-0/+66
| | | | | | | | This is mostly code movement; you may want to review it with `--color-moved`. I'm doing this so we can also use the function in netdoc for looking up hsdesc authentication.
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-241-1/+1
| | | | | | | | | | | | | | This introduces the `NetdocBuilder` trait described in `netdoc-builder.md` and a new `tor-netdoc::doc::hsdesc::build` module, which exports the `HsDescBuilder`. Hidden services will use `HsDescBuilder` to build and encode hidden service descriptors. There are several TODOs in the code that I'm planning to address separately. Partially addresses #745. Signed-off-by: Gabriela Moldovan <[email protected]>
* Suppress a renamed-lint lint.Nick Mathewson2023-03-101-1/+2
| | | | | | | The derive_hash_xor_eq lint was renamed in 1.68, but we can't use it under its new name, since we still need to support back to 1.60. Instead, we suppress the warning about the lint being renamed.
* llcrypto: Derive zeroize for CtByteArray.Nick Mathewson2023-02-071-1/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* Merge branch 'test-lints' into 'main'eta2023-01-061-0/+8
|\ | | | | | | | | Add test lint blocks to all "mod test" See merge request tpo/core/arti!937
| * test lint blocks: Add many many automaticallyIan Jackson2022-12-121-0/+8
| | | | | | | | | | This is precisely the result of running the rune in maint/adhoc-add-lint-blocks.
* | Add a new "CtByteArray" type, and use it in Id types.Nick Mathewson2023-01-051-0/+123
|/ | | | | | This type provides a common implementation for types that are implemented as arrays of bytes that should only be compared with constant-time comparisons.
* Update `rsa` dependency (and use `x25519-dalek` prerelease)eta2022-07-061-7/+10
| | | | | | | | | | | | | | - arti#448 and arti!607 highlight an issue with upgrading `rsa`: namely, the `x25519-dalek` version previously used has a hard dependency on `zeroize` 1.3, which creates a dependency conflict. - However, `x25519-dalek` version `2.0.0-pre.1` relaxes this dependency. Reviewing the changelogs, it doesn't look like that version is substantially different from the current one at all, so it should be safe to use despite the "prerelease" tag. - The new `x25519-dalek` version also bumps `rand_core`, which means we don't have to use the RNG compat wrapper in `tor-llcrypto` as much. closes arti#448
* Use testing_rng() in tests throughout our crates.Nick Mathewson2022-06-021-2/+3
| | | | | | This only affects uses of thread_rng(), and affects them all more or less indiscriminately. One test does not work with ARTI_TEST_PRNG=deterministic; the next commit will fix it.
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-2/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Idle hacking: Get 90% coverage in tor-llcryptoNick Mathewson2021-12-021-0/+112
| | | | | | | For this one I just wrote some "are things completely broken" tests for the rand_compat wrappers. These won't detect subtle biases in the RNGs! They'll only let you know if the wrappers have screwed up in some way that always sets a given bit to 1 or 0.
* add semicolons if nothing returnedDaniel Eades2021-11-251-2/+2
|
* Typo fixesNick Mathewson2021-09-091-1/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+123
This will cause some pain for now, but now is really the best time to do this kind of thing.