Changed module name from otp to twofactor.
diff --git a/cryptography/hazmat/primitives/otp/__init__.py b/cryptography/hazmat/primitives/twofactor/__init__.py
similarity index 100%
rename from cryptography/hazmat/primitives/otp/__init__.py
rename to cryptography/hazmat/primitives/twofactor/__init__.py
diff --git a/cryptography/hazmat/primitives/otp/hotp.py b/cryptography/hazmat/primitives/twofactor/hotp.py
similarity index 100%
rename from cryptography/hazmat/primitives/otp/hotp.py
rename to cryptography/hazmat/primitives/twofactor/hotp.py
diff --git a/docs/hazmat/primitives/index.rst b/docs/hazmat/primitives/index.rst
index 9121d15..5199d49 100644
--- a/docs/hazmat/primitives/index.rst
+++ b/docs/hazmat/primitives/index.rst
@@ -14,4 +14,4 @@
rsa
constant-time
interfaces
- otp
+ twofactor
diff --git a/docs/hazmat/primitives/otp.rst b/docs/hazmat/primitives/twofactor.rst
similarity index 91%
rename from docs/hazmat/primitives/otp.rst
rename to docs/hazmat/primitives/twofactor.rst
index ad2c856..2b811e1 100644
--- a/docs/hazmat/primitives/otp.rst
+++ b/docs/hazmat/primitives/twofactor.rst
@@ -1,18 +1,17 @@
.. hazmat::
-One Time Password
-=================
+Two-factor Authentication
+=========================
-.. currentmodule:: cryptography.hazmat.primitives.otp
+.. currentmodule:: cryptography.hazmat.primitives.twofactor
-This module contains algorithms for generating and verifying one
-time passwords.
+This module contains algorithms related to two-factor authentication.
Currently, it contains an algorithm for generating and verifying
one time password values based on Hash-based message authentication
codes (HMAC).
-.. currentmodule:: cryptography.hazmat.primitives.otp.hotp
+.. currentmodule:: cryptography.hazmat.primitives.twofactor.hotp
.. class:: HOTP(key, length, backend)
@@ -27,7 +26,7 @@
>>> import os
>>> from cryptography.hazmat.backends import default_backend
- >>> from cryptography.hazmat.primitives.otp.hotp import HOTP
+ >>> from cryptography.hazmat.primitives.twofactor.hotp import HOTP
>>> key = b"12345678901234567890"
>>> hotp = HOTP(key, 6, backend=default_backend())
diff --git a/tests/hazmat/primitives/otp/__init__.py b/tests/hazmat/primitives/twofactor/__init__.py
similarity index 100%
rename from tests/hazmat/primitives/otp/__init__.py
rename to tests/hazmat/primitives/twofactor/__init__.py
diff --git a/tests/hazmat/primitives/otp/test_hotp.py b/tests/hazmat/primitives/twofactor/test_hotp.py
similarity index 97%
rename from tests/hazmat/primitives/otp/test_hotp.py
rename to tests/hazmat/primitives/twofactor/test_hotp.py
index 2641cb9..25dd694 100644
--- a/tests/hazmat/primitives/otp/test_hotp.py
+++ b/tests/hazmat/primitives/twofactor/test_hotp.py
@@ -16,7 +16,7 @@
import pytest
from cryptography.exceptions import InvalidToken
-from cryptography.hazmat.primitives.otp.hotp import HOTP
+from cryptography.hazmat.primitives.twofactor.hotp import HOTP
from cryptography.hazmat.primitives import hashes
from tests.utils import load_vectors_from_file, load_nist_vectors