Skip to content

Commit 85725ce

Browse files
committed
autoformat
1 parent 54a59ae commit 85725ce

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

test_vector_handlers/src/awses_test_vectors/manifests/full_message/encrypt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ def from_file(cls, input_file):
205205
tests = {}
206206
for name, scenario in raw_manifest["tests"].items():
207207
try:
208-
tests[name] = MessageEncryptionTestScenario.from_scenario(scenario=scenario, keys=keys, plaintexts=plaintexts)
208+
tests[name] = MessageEncryptionTestScenario.from_scenario(
209+
scenario=scenario, keys=keys, plaintexts=plaintexts
210+
)
209211
except NotImplementedError:
210212
continue
211213
return cls(version=raw_manifest["manifest"]["version"], keys=keys, plaintexts=plaintexts, tests=tests)

test_vector_handlers/src/awses_test_vectors/manifests/master_key.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
# 'rsa/oaep-mgf1/sha384': WrappingAlgorithm.RSA_OAEP_SHA384_MGF1,
5555
# 'rsa/oaep-mgf1/sha512': WrappingAlgorithm.RSA_OAEP_SHA512_MGF1,
5656
}
57-
_NOT_YET_IMPLEMENTED = {'rsa/oaep-mgf1/sha384', 'rsa/oaep-mgf1/sha512'}
57+
_NOT_YET_IMPLEMENTED = {"rsa/oaep-mgf1/sha384", "rsa/oaep-mgf1/sha512"}
5858
_RAW_ENCRYPTION_KEY_TYPE = {
5959
"symmetric": EncryptionKeyType.SYMMETRIC,
6060
"private": EncryptionKeyType.PRIVATE,
@@ -93,14 +93,10 @@ def __attrs_post_init__(self):
9393

9494
if self.type_name == "raw":
9595
if None in (self.provider_id, self.encryption_algorithm):
96-
raise ValueError(
97-
"Provider ID and encryption algorithm are both required for raw keys"
98-
)
96+
raise ValueError("Provider ID and encryption algorithm are both required for raw keys")
9997

10098
if self.encryption_algorithm == "rsa" and self.padding_algorithm is None:
101-
raise ValueError(
102-
"Padding algorithm is required for raw RSA keys"
103-
)
99+
raise ValueError("Padding algorithm is required for raw RSA keys")
104100

105101
if self.padding_algorithm == "oaep-mgf1" and self.padding_hash is None:
106102
raise ValueError('Padding hash must be specified if padding algorithm is "oaep-mgf1"')
@@ -149,7 +145,7 @@ def _wrapping_algorithm(self, key_bits):
149145
key_spec_name = "/".join(key_spec_values)
150146

151147
if key_spec_name in _NOT_YET_IMPLEMENTED:
152-
raise NotImplementedError("Key spec \"{}\" is not yet available.")
148+
raise NotImplementedError('Key spec "{}" is not yet available.')
153149

154150
return _RAW_WRAPPING_KEY_ALGORITHMS[key_spec_name]
155151

0 commit comments

Comments
 (0)