From 65d054d1a9b8b122096d7994fc2fe675c06f423f Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 27 Nov 2014 10:29:59 -1000 Subject: add decode_rfc6979_signature helper for DSA/ECDSA --- docs/hazmat/primitives/asymmetric/utils.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/hazmat/primitives/asymmetric/utils.rst (limited to 'docs/hazmat/primitives/asymmetric/utils.rst') diff --git a/docs/hazmat/primitives/asymmetric/utils.rst b/docs/hazmat/primitives/asymmetric/utils.rst new file mode 100644 index 00000000..9749b6d1 --- /dev/null +++ b/docs/hazmat/primitives/asymmetric/utils.rst @@ -0,0 +1,16 @@ +.. hazmat:: + +Asymmetric Utilities +==================== + +.. currentmodule:: cryptography.hazmat.primitives.asymmetric.utils + + +.. function:: decode_rfc6979_signature(signature) + + Takes in :rfc:`6979` signatures generated by the DSA/ECDSA signers and + returns a tuple ``(r, s)``. + + :param bytes signature: The signature to decode. + + :returns: The decoded tuple ``(r, s)``. -- cgit v1.2.3 From aa7dacaf53e150d9d6e58224c46b88214f2957df Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 27 Nov 2014 10:40:12 -1000 Subject: add encode_rfc6979_signature and refactor tests to use it --- docs/hazmat/primitives/asymmetric/utils.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/hazmat/primitives/asymmetric/utils.rst') diff --git a/docs/hazmat/primitives/asymmetric/utils.rst b/docs/hazmat/primitives/asymmetric/utils.rst index 9749b6d1..6b348801 100644 --- a/docs/hazmat/primitives/asymmetric/utils.rst +++ b/docs/hazmat/primitives/asymmetric/utils.rst @@ -14,3 +14,13 @@ Asymmetric Utilities :param bytes signature: The signature to decode. :returns: The decoded tuple ``(r, s)``. + +.. function:: encode_rfc6979_signature(r, s) + + Creates an :rfc:`6979` byte string from raw signature values. + + :param int r: The raw signature value ``r``. + + :param int s: The raw signature value ``s``. + + :return bytes: The encoded signature. -- cgit v1.2.3