aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-llcrypto/src/pk/rsa.rs
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-1/+1
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* tor-llcrypto: Add RsaIdentity::to_bytes()Clara Engler2026-04-231-0/+5
| | | | | | | | | | This commit adds .to_bytes() to RsaIdentity which is similar to .as_bytes() except that it returns the RsaIdentity as a byte array. We are going to need this at a few places in tor-dirserver. The naming was inspired from x25519-dalek which has similar .as_bytes() and .to_bytes() methods. Besides, copying 20 bytes shall be okay and it avoids having to write ugly try_into() constructs.
* llcrypto: Depend on tor-memquota-cost, not tor-memquota.Nick Mathewson2026-02-021-1/+1
|
* tor-llcrypto: Add `RsaIdentity::as_hex_upper`Clara Engler2026-01-151-0/+6
| | | | | | | | | | This commit adds the method `as_hex_upper(&self) -> String` to `RsaIdentity`, which returns the `RsaIdentity` as a hexadecimal string in uppercase. Although this type already implements `ToString`, this result is unsuitable for working with consensuses because they neither contain a `$` prefix, nor are encoded in lowercase.
* Lay foundations for RSA keys in keystore.Wesley Aptekar-Cassels2025-09-301-0/+14
| | | | | | This currently can't be used due to upstream limitations in the ssh_key crate, which will be removed likely in the next release. In the meantime, we can put in all the groundwork.
* tor-llcrypto: Add more comments about implementation of RSA sign function.Wesley Aptekar-Cassels2025-09-101-2/+3
|
* tor-llcrypto: Add note about key size to RSA KeyPair::generate.Wesley Aptekar-Cassels2025-09-101-0/+4
|
* tor-llcrypto: Rename rsa::PrivateKey to rsa::KeyPair.Wesley Aptekar-Cassels2025-09-081-5/+5
| | | | As discussed with gabi on IRC today.
* tor-key-forge: Add RSA key types.Wesley Aptekar-Cassels2025-09-081-3/+42
| | | | | | | Some things I'm still considering here: * We may want to define a tor_llcrypto::pk::rsa::Signature newtype. * We likely want to rename tor_llcrypto::pk::rsa::PrivateKey to RsaKeypair.
* Rename "memquota" feature to "memquota-memcost" when it's just HasMemoryCost ↵Ian Jackson2024-10-161-1/+5
| | | | (fmt)
* Rename "memquota" feature to "memquota-memcost" when it's just HasMemoryCostIan Jackson2024-10-161-2/+2
| | | | It's not documented anywhere ATM. I will do that in a followup MR.
* Some HasMemoryCost impls in tor-llcryptoIan Jackson2024-10-021-0/+4
|
* tor-llcrypto: replace simple_asn1 dependency with der_parserMorgan2024-09-281-18/+16
|
* tor-llcrypto: remove use of arrayrefNick Mathewson2023-06-011-8/+3
|
* update rsa to 0.9.xtrinity-1686a2023-05-081-5/+4
|
* Upgrade to latest rsa crate.Nick Mathewson2023-01-201-1/+1
|
* llcrypto: fix a comment.Nick Mathewson2023-01-061-1/+1
| | | | This described the wrong type of key.
* llcrypto: clarify meaning of "Identity".Nick Mathewson2023-01-061-5/+10
| | | | | | | | | | The `Ed25519Identity` and `RsaIdentity` types are not precisely always used as relay identifiers: they are more generally used as _key_ identifiers. This will become relevant as `RsaIdentity` is used for authority keys (as in authorities' VoterInfo blocks), and as `Ed25519Identity` is used as the identifier behind an onion service key.
* Add a new "CtByteArray" type, and use it in Id types.Nick Mathewson2023-01-051-21/+14
| | | | | | This type provides a common implementation for types that are implemented as arrays of bytes that should only be compared with constant-time comparisons.
* llcrypto: Make key id types Redactable.Nick Mathewson2022-11-281-0/+12
|
* Fix a bunch of "needless borrow" warnings on nightlyNick Mathewson2022-11-181-1/+1
| | | | | It looks like, despite a few false starts, they've got this warning right; there weren't any false positives.
* Upgrade rsa to 0.7. Closes #613.Nick Mathewson2022-11-101-1/+1
|
* Add a new constant-time is_zero() check for RsaIdentityNick Mathewson2022-09-201-0/+11
| | | | | | | | | | | | | There are some places in the protocol where we have an all-zero RSA identity that does not truly represent a key, but rather represents an absent or unknown key. For these, it's better to use `RsaIdentity::is_zero` instead of manually checking for a set of zero bytes: it expresses the intent better, and ensures that the operation is constant-time. I am deliberately not introducing a more general IsZero trait here, or implementing is_zero for anything else: This is the only one we seem to need right now. We can generalize it later if we have to.
* Stop deriving Zeroize for RsaIdentity.Nick Mathewson2022-08-011-2/+1
| | | | These are not secret.
* Update `rsa` dependency (and use `x25519-dalek` prerelease)eta2022-07-061-1/+1
| | | | | | | | | | | | | | - 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
* Add a from_hex method for RsaIdentity.Nick Mathewson2022-03-041-3/+12
| | | | | | | | | | | | | We perform this operation in a bunch of places, and most of them use hex::decode(). That's not great, since hex::decode() has to do heap allocation. This implementation uses hex::decode_to_slice(), which should be faster. (In the future we might choose to use one of the faster hex implementations, but I'm hoping that this change will be sufficient to get hex decoding out of our profiles.) Part of #377.
* tor-llcrypto: Replace a tiny bit of code duplication with a callIan Jackson2022-03-021-1/+1
| | | | No functional change.
* Resolve roughly half of the XXXXs.Nick Mathewson2021-12-061-4/+3
| | | | | | | | We want to only use TODO in the codebase for non-blockers, and open tickets for anything that is a bigger blocker than a TODO. These XXXXs seem like definite non-blockers to me. Part of arti#231.
* Fix a few typos.Nick Mathewson2021-11-241-1/+1
| | | | Also fix some commonwealth spellings that had slipped in.
* Improve some documentation linksNick Mathewson2021-10-291-2/+2
| | | | | | | | | Instead of putting a fully qualified name in the text, in most cases we should just use the short name of the type or function we're referring to. In other words, instead of saying [`crate::module::Foo`], we should typically say [`Foo`](crate::module::Foo).
* Implement ConstantTimeEq for key ids.Nick Mathewson2021-10-011-2/+8
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+278
This will cause some pain for now, but now is really the best time to do this kind of thing.