Skip to content

Commit 5ab94c6

Browse files
committed
return plaintext and ciphertext for ease of verification
1 parent 64fa02d commit 5ab94c6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

performance_tests/src/aws_encryption_sdk_performance_tests/keyrings/aws_kms_keyring.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ def encrypt_using_keyring(
5959
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
6060
)
6161

62-
_, _ = client.encrypt(
62+
ciphertext_data, _ = client.encrypt(
6363
source=plaintext_data,
6464
keyring=keyring
6565
)
6666

67+
return ciphertext_data
68+
6769

6870
def decrypt_using_keyring(
6971
ciphertext_data: bytes,
@@ -81,7 +83,9 @@ def decrypt_using_keyring(
8183
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
8284
)
8385

84-
_, _ = client.decrypt(
86+
decrypted_plaintext_data, _ = client.decrypt(
8587
source=ciphertext_data,
8688
keyring=keyring
8789
)
90+
91+
return decrypted_plaintext_data

performance_tests/src/aws_encryption_sdk_performance_tests/master_key_providers/aws_kms_key_provider.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ def encrypt_using_key_provider(
4242
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
4343
)
4444

45-
_, _ = client.encrypt(
45+
ciphertext_data, _ = client.encrypt(
4646
source=plaintext_data,
4747
key_provider=key_provider
4848
)
4949

50+
return ciphertext_data
51+
5052

5153
def decrypt_using_key_provider(
5254
ciphertext_data: bytes,
@@ -64,7 +66,9 @@ def decrypt_using_key_provider(
6466
commitment_policy=CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT
6567
)
6668

67-
_, _ = client.decrypt(
69+
decrypted_plaintext_data, _ = client.decrypt(
6870
source=ciphertext_data,
6971
key_provider=key_provider
7072
)
73+
74+
return decrypted_plaintext_data

0 commit comments

Comments
 (0)