diff options
author | Hubert Kario <hubert@kario.pl> | 2022-06-25 16:00:21 +0200 |
---|---|---|
committer | Hubert Kario <hkario@redhat.com> | 2022-07-08 14:30:24 +0200 |
commit | 51512716f23f84bc8dd69b11e1d6387c5613ac8c (patch) | |
tree | da017d99f9be231d561ac72f662af9e5c30de7a0 | |
parent | f08f04dba896dbf12b8fc51920195783f8f3b96a (diff) | |
download | ecdsa-51512716f23f84bc8dd69b11e1d6387c5613ac8c.tar.gz |
ec arithmetic additions
-rw-r--r-- | docs/source/ec_arithmetic.rst | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/source/ec_arithmetic.rst b/docs/source/ec_arithmetic.rst index b7abaaf..36d0ad4 100644 --- a/docs/source/ec_arithmetic.rst +++ b/docs/source/ec_arithmetic.rst @@ -47,10 +47,16 @@ code: .. tip:: You can also use :py:class:`~ecdsa.curves.Curve` to get the curve - parameters from a PEM or DER file. Or use the + parameters from a PEM or DER file. You can also use + :py:func:`~ecdsa.curves.curve_by_name` to get a curve by specifying its + name. + Or use the :py:func:`~ecdsa.curves.find_curve` to get a curve by specifying its ASN.1 object identifier (OID). +Affine coordinates +------------------ + After taking hold of curve parameters you can create a point on the curve. The :py:class:`~ecdsa.ellipticcurve.Point` uses affine coordinates, i.e. the :math:`x` and :math:`y` from the curve equation directly. @@ -82,6 +88,8 @@ methods of the object: print("x: {0}, y: {1}".format(point_c.x(), point_c.y())) +Projective coordinates +---------------------- When using the Jacobi coordinates, the point is defined by 3 integers, which are related to the :math:`x` and :math:`y` in the following way: @@ -123,3 +131,7 @@ the regular implementation: point_c = point_a + point_b print("x: {0}, y: {1}".format(point_c.x(), point_c.y())) + +All the other operations, like scalar multiplication or point addition work +on projective points the same as with affine representation, but they +are much more effective computationally. |