-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 📦 Add cryptography package - Demotes hypothesis and typish to dev package * ✨Replace ElGamal with RSA for Auxiliary Key * 🐛Missing TearDown in Decryption tests * 📝Update Documentation for Auxiliary Encrypt/Decrypt override
- Loading branch information
1 parent
2d45b50
commit 5bd36dc
Showing
10 changed files
with
388 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from typing import Callable, Optional, NamedTuple | ||
|
||
from .types import GUARDIAN_ID | ||
|
||
MESSAGE = str | ||
PUBLIC_KEY = str | ||
SECRET_KEY = str | ||
ENCRYPTED_MESSAGE = str | ||
|
||
|
||
class AuxiliaryKeyPair(NamedTuple): | ||
"""A tuple of a secret key and public key.""" | ||
|
||
secret_key: SECRET_KEY | ||
"""The secret or private key""" | ||
public_key: PUBLIC_KEY | ||
|
||
|
||
class AuxiliaryPublicKey(NamedTuple): | ||
"""A tuple of auxiliary public key and owner information""" | ||
|
||
owner_id: GUARDIAN_ID | ||
""" | ||
The unique identifier of the guardian | ||
""" | ||
|
||
sequence_order: int | ||
""" | ||
The sequence order of the auxiliary public key (usually the guardian's sequence order) | ||
""" | ||
|
||
key: PUBLIC_KEY | ||
""" | ||
A string representation of the Auxiliary public key. | ||
It is up to the external `AuxiliaryEncrypt` function to know how to parse this value | ||
""" | ||
|
||
|
||
AuxiliaryEncrypt = Callable[[MESSAGE, PUBLIC_KEY], Optional[ENCRYPTED_MESSAGE]] | ||
"""A callable type that represents the auxiliary encryption scheme.""" | ||
|
||
AuxiliaryDecrypt = Callable[[ENCRYPTED_MESSAGE, SECRET_KEY], Optional[MESSAGE]] | ||
"""A callable type that represents the auxiliary decryption scheme.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.