diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-10-27 16:47:55 +0900 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-10-27 20:35:13 +0900 |
commit | 13d4e74b13832b495ddfdff043376144d8ada66a (patch) | |
tree | 8100b54337d32b0442c9ff1315e24e1f64b0a58c /docs/hazmat | |
parent | e4150bcc07fb2c68e3c860c31766b4282bba8740 (diff) | |
download | cryptography-13d4e74b13832b495ddfdff043376144d8ada66a.tar.gz cryptography-13d4e74b13832b495ddfdff043376144d8ada66a.tar.bz2 cryptography-13d4e74b13832b495ddfdff043376144d8ada66a.zip |
modify approach to use EllipticCurvePublicNumbers methods
Diffstat (limited to 'docs/hazmat')
-rw-r--r-- | docs/hazmat/primitives/asymmetric/ec.rst | 32 | ||||
-rw-r--r-- | docs/hazmat/primitives/asymmetric/utils.rst | 45 |
2 files changed, 32 insertions, 45 deletions
diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst index 90e73711..c1619dd0 100644 --- a/docs/hazmat/primitives/asymmetric/ec.rst +++ b/docs/hazmat/primitives/asymmetric/ec.rst @@ -122,6 +122,37 @@ Elliptic Curve Signature Algorithms :returns: A new instance of a :class:`EllipticCurvePublicKey` provider. + .. method:: encode_point() + + .. versionadded:: 1.1 + + Encodes an elliptic curve point to a byte string as described in + `SEC 1 v2.0`_ section 2.3.3. This method only supports uncompressed + points. + + :return bytes: The encoded point. + + .. classmethod:: from_encoded_point(curve, data) + + .. versionadded:: 1.1 + + Decodes a byte string as described in `SEC 1 v2.0`_ section 2.3.3 and + returns an :class:`EllipticCurvePublicNumbers`. This method only + supports uncompressed points. + + :param curve: An + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve` + instance. + + :param bytes data: The serialized point byte string. + + :returns: An :class:`EllipticCurvePublicNumbers` instance. + + :raises ValueError: Raised on invalid point type or data length. + + :raises TypeError: Raised when curve is not an + :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`. + Elliptic Curve Key Exchange algorithm ------------------------------------- @@ -478,3 +509,4 @@ Key Interfaces .. _`ECDSA`: https://en.wikipedia.org/wiki/ECDSA .. _`EdDSA`: https://en.wikipedia.org/wiki/EdDSA .. _`forward secrecy`: https://en.wikipedia.org/wiki/Forward_secrecy +.. _`SEC 1 v2.0`: http://www.secg.org/sec1-v2.pdf diff --git a/docs/hazmat/primitives/asymmetric/utils.rst b/docs/hazmat/primitives/asymmetric/utils.rst index 79d14dae..07883598 100644 --- a/docs/hazmat/primitives/asymmetric/utils.rst +++ b/docs/hazmat/primitives/asymmetric/utils.rst @@ -28,48 +28,3 @@ Asymmetric Utilities :param int s: The raw signature value ``s``. :return bytes: The encoded signature. - -.. function:: encode_ec_point(curve, x, y) - - .. versionadded:: 1.1 - - Encodes an elliptic curve point to a byte string as described in - `SEC 1 v2.0`_ section 2.3.3. This function only supports uncompressed - points. - - :param curve: An - :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve` - instance. - - :param int x: The x value of the point. - - :param int y: The y value of the point. - - :return bytes: The encoded point. - - :raises TypeError: Raised when curve is not an - :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`. - -.. function:: decode_ec_point(key_length, data) - - .. versionadded:: 1.1 - - Decodes a byte string as described in `SEC 1 v2.0`_ section 2.3.3 to the - ``x`` and ``y`` integer values. This function only supports uncompressed - points. - - :param curve: An - :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve` - instance. - - :param bytes data: The serialized point byte string. - - :returns: The decoded tuple ``(x, y)``. - - :raises ValueError: Raised on invalid point type or data length. - - :raises TypeError: Raised when curve is not an - :class:`~cryptography.hazmat.primitives.asymmetric.ec.EllipticCurve`. - - -.. _`SEC 1 v2.0`: http://www.secg.org/sec1-v2.pdf |