Skip to content

Commit 943e8d0

Browse files
committed
naming is hard
1 parent 4a231f7 commit 943e8d0

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/aws_encryption_sdk/internal/crypto/authentication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from cryptography.hazmat.primitives.asymmetric import ec
2020
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
2121

22-
from aws_encryption_sdk.internal.utils import verify_interface
22+
from aws_encryption_sdk.internal.utils import verify_ec_interface
2323

2424
from ...exceptions import NotSupportedError
2525
from .elliptic_curve import (
@@ -48,7 +48,7 @@ def __init__(self, algorithm, key):
4848

4949
def _set_signature_type(self):
5050
"""Ensures that the algorithm signature type is a known type and sets a reference value."""
51-
if not verify_interface(self.algorithm):
51+
if not verify_ec_interface(self.algorithm):
5252
raise NotSupportedError("Unsupported signing algorithm info")
5353
return ec.EllipticCurve
5454

src/aws_encryption_sdk/internal/crypto/elliptic_curve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed, decode_dss_signature, encode_dss_signature
2121
from cryptography.utils import int_from_bytes, int_to_bytes
2222

23-
from aws_encryption_sdk.internal.utils import verify_interface
23+
from aws_encryption_sdk.internal.utils import verify_ec_interface
2424

2525
from ...exceptions import NotSupportedError
2626
from ..str_ops import to_bytes
@@ -185,6 +185,6 @@ def generate_ecc_signing_key(algorithm):
185185
:returns: Generated signing key
186186
:raises NotSupportedError: if signing algorithm is not supported on this platform
187187
"""
188-
if not verify_interface(algorithm):
188+
if not verify_ec_interface(algorithm):
189189
raise NotSupportedError("Unsupported signing algorithm info")
190190
return ec.generate_private_key(curve=algorithm.signing_algorithm_info(), backend=default_backend())

src/aws_encryption_sdk/internal/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def source_data_key_length_check(source_data_key, algorithm):
166166
)
167167

168168

169-
def verify_interface(algorithm):
169+
def verify_ec_interface(algorithm):
170170
"""Validates that the provided EllipticCurve Algorithm is correctly implemented by
171171
checking if it implements both of the abstract methods from the EllipticCurve
172172
abstract class.

test/unit/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import aws_encryption_sdk.identifiers
2121
import aws_encryption_sdk.internal.utils
2222
from aws_encryption_sdk.exceptions import InvalidDataKeyError, SerializationError, UnknownIdentityError
23-
from aws_encryption_sdk.internal.defaults import MAX_FRAME_SIZE
24-
from aws_encryption_sdk.internal.utils import verify_interface
23+
from aws_encryption_sdk.internal.defaults import MAX_FRAME_SIZE, MESSAGE_ID_LENGTH
24+
from aws_encryption_sdk.internal.utils import verify_ec_interface
2525
from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, MasterKeyInfo, RawDataKey
2626

2727
from .test_values import VALUES
@@ -49,7 +49,7 @@ def test_verify_interface(patch_ec):
4949
mock_algorithm_info.return_value.key_size = True
5050
_algorithm = MagicMock(signing_algorithm_info=mock_algorithm_info)
5151

52-
implemented = verify_interface(algorithm=_algorithm)
52+
implemented = verify_ec_interface(algorithm=_algorithm)
5353

5454
assert implemented is True
5555

0 commit comments

Comments
 (0)