diff options
author | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2023-05-30 12:32:57 +0200 |
---|---|---|
committer | Wiktor Kwapisiewicz <wiktor@metacode.biz> | 2023-06-06 11:23:29 +0200 |
commit | afad47bcb023fbcdbe67d5f0343fb32bfcf917f4 (patch) | |
tree | 3592694e02f85655da770e5d22f3dfa86856655c /openpgp/src/crypto/mpi.rs | |
parent | f5f9b14a304321816526c30ce98edbd6535df9c4 (diff) |
openpgp: Deprecate `types::Curve::len`.
- It does the same as `types::Curve::bits` (modulo the return type).
- Update `types::Curve::bits` documentation as well as a NEWS entry.
- Since it only returns the number of bits that is basically static
the `Result` return code is not needed (see [#966].
- Fixes https://gitlab.com/sequoia-pgp/sequoia/-/issues/988 but does
not remove `field_size` as it is useful in a small number of places.
- Related: https://gitlab.com/sequoia-pgp/sequoia/-/issues/765
[#966]: https://gitlab.com/sequoia-pgp/sequoia/-/issues/966
Diffstat (limited to 'openpgp/src/crypto/mpi.rs')
-rw-r--r-- | openpgp/src/crypto/mpi.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openpgp/src/crypto/mpi.rs b/openpgp/src/crypto/mpi.rs index fa27beb7..b0223460 100644 --- a/openpgp/src/crypto/mpi.rs +++ b/openpgp/src/crypto/mpi.rs @@ -216,7 +216,7 @@ impl MPI { => { // Length of one coordinate in bytes, rounded up. - let coordinate_length = (curve.len()? + 7) / 8; + let coordinate_length = curve.field_size()?; // Check length of Q. let expected_length = |