DataSource.encapsulate_single_message() --> DataSource.encrypt_message()

pull/584/head
David Núñez 2018-12-03 11:31:13 +01:00
parent bb0de18dac
commit 4ab7ad1252
6 changed files with 8 additions and 8 deletions

View File

@ -119,7 +119,7 @@ for counter, plaintext in enumerate(finnegans_wake):
# single passage from James Joyce's Finnegan's Wake.
# The matter of whether encryption makes the passage more or less readable
# is left to the reader to determine.
single_passage_ciphertext, _signature = enciro.encapsulate_single_message(plaintext)
single_passage_ciphertext, _signature = enciro.encrypt_message(plaintext)
data_source_public_key = bytes(enciro.stamp)
del enciro

View File

@ -143,7 +143,7 @@ for counter, plaintext in enumerate(finnegans_wake):
# single passage from James Joyce's Finnegan's Wake.
# The matter of whether encryption makes the passage more or less readable
# is left to the reader to determine.
message_kit, _signature = data_source.encapsulate_single_message(plaintext)
message_kit, _signature = data_source.encrypt_message(plaintext)
# The DataSource will want to be able to be verified by Bob, so it leaves
# its Public Key somewhere.

View File

@ -35,9 +35,9 @@ class DataSource:
self.stamp = signing_power.get_signature_stamp()
self.label = label
def encapsulate_single_message(self,
message: bytes
) -> Tuple[UmbralMessageKit, Signature]:
def encrypt_message(self,
message: bytes
) -> Tuple[UmbralMessageKit, Signature]:
message_kit, signature = encrypt_and_sign(self.policy_pubkey,
plaintext=message,
signer=self.stamp)

View File

@ -90,7 +90,7 @@ def test_bob_joins_policy_and_retrieves(federated_alice,
)
plaintext = b"What's your approach? Mississippis or what?"
message_kit, _signature = data_source.encapsulate_single_message(plaintext)
message_kit, _signature = data_source.encrypt_message(plaintext)
alices_verifying_key = federated_alice.stamp.as_umbral_pubkey()

View File

@ -248,7 +248,7 @@ def test_alice_can_decrypt(federated_alice):
label=label)
message = b"boring test message"
message_kit, signature = data_source.encapsulate_single_message(message=message)
message_kit, signature = data_source.encrypt_message(message=message)
cleartext = federated_alice.verify_from(stranger=data_source,
message_kit=message_kit,

View File

@ -296,7 +296,7 @@ def capsule_side_channel(enacted_federated_policy):
signing_keypair=SigningKeypair(),
label=enacted_federated_policy.label
)
message_kit, _signature = data_source.encapsulate_single_message(b"Welcome to the flippering.")
message_kit, _signature = data_source.encrypt_message(b"Welcome to the flippering.")
return message_kit, data_source