diff --git a/README.rst b/README.rst index 4393e36..6a4bb95 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ sophiegermain ============= -Pure-Python library that provides a selection of `Sophie Germain primes `__. +Pure-Python library that provides a selection of `Sophie Germain primes `__ that are organized by representation size. |pypi| |readthedocs| |actions| |coveralls| @@ -22,6 +22,10 @@ Pure-Python library that provides a selection of `Sophie Germain primes `__. In such cases, it is often useful to choose a Sophie Germain or safe prime based on the range of values (*i.e.*, `congruence classes of integers `__ or `finite field `__ elements) that an instantiation of a protocol must accommodate. This library provides immediate access to the smallest Sophie Germain prime for each possible binary representation length (up to and including 1025 bits). + Installation and Usage ---------------------- This library is available as a `package on PyPI `__: diff --git a/pyproject.toml b/pyproject.toml index 68681b6..6649abe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,8 @@ name = "sophiegermain" version = "0.1.0" description = """\ - Pure-Python library that provides a selection of Sophie Germain primes. + Pure-Python library that provides a selection of Sophie Germain primes + that are organized by representation size. """ license = {text = "MIT"} authors = [ diff --git a/src/sophiegermain/sophiegermain.py b/src/sophiegermain/sophiegermain.py index 9a4ed85..cbb36c3 100644 --- a/src/sophiegermain/sophiegermain.py +++ b/src/sophiegermain/sophiegermain.py @@ -1,5 +1,6 @@ """ -Pure-Python library that provides a selection of Sophie Germain primes. +Pure-Python library that provides a selection of Sophie Germain primes +that are organized by representation size. """ # pylint: disable=too-many-lines from __future__ import annotations @@ -1036,8 +1037,9 @@ def sophiegermain(bit_length: int) -> int: """ - Return the smallest Sophie Germain prime that can be represented using - the specified number of bits. + Return the smallest + `Sophie Germain prime `__ + the representation of which requires the specified number of bits. >>> sophiegermain(2) 2 @@ -1052,8 +1054,8 @@ def sophiegermain(bit_length: int) -> int: >>> sophiegermain(1025).bit_length() 1025 - The result returned by :obj:`sophiegermain` can always be represented - using the specified number of bits. + The result returned by :obj:`sophiegermain` can be represented using the + specified number of bits. >>> all([sophiegermain(k).bit_length() == k for k in range(2, 1026)]) True