Support multiple ABEnc adapters with varying schemes#254
Merged
jakinyele merged 1 commit intoJHUISI:devfrom Sep 9, 2020
Merged
Support multiple ABEnc adapters with varying schemes#254jakinyele merged 1 commit intoJHUISI:devfrom
jakinyele merged 1 commit intoJHUISI:devfrom
Conversation
When instantiating multiple HybridABEnc adapters with varying ABEnc schemes, the last ABEnc scheme overwrites the keygen/encrypt/decrypt functions for all other adapters.
Small test case:
>>> from charm.toolbox.pairinggroup import PairingGroup
>>> from charm.schemes.abenc.abenc_bsw07 import CPabe_BSW07
>>> from charm.schemes.abenc.abenc_waters09 import CPabe09
>>> from charm.adapters.abenc_adapt_hybrid import HybridABEnc
>>> group = PairingGroup("SS512")
>>> bsw07 = CPabe_BSW07(group)
>>> mpk, mk = bsw07.setup()
>>> waters09 = CPabe09(group)
>>> hyb_bsw07 = HybridABEnc(bsw07, group)
>>> hyb_bsw07.encrypt(mpk, b"foo", "A AND B")
{'c1': ... } # Correct result
>>> hyb_waters09 = HybridABEnc(waters09, group)
>>> hyb_bsw07.encrypt(mpk, b"foo", "A AND B")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/Charm_Crypto-0.50-py3.6-linux-x86_64.egg/charm/adapters/abenc_adapt_hybrid.py", line 38, in encrypt
c1 = abenc.encrypt(pk, key, object)
File "/usr/local/lib/python3.6/dist-packages/Charm_Crypto-0.50-py3.6-linux-x86_64.egg/charm/schemes/abenc/abenc_waters09.py", line 69, in encrypt
C_tilde = (pk['e(gg)^alpha'] ** s) * M
KeyError: 'e(gg)^alpha'
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When instantiating multiple HybridABEnc adapters with varying ABEnc schemes, the last ABEnc scheme overwrites the keygen/encrypt/decrypt functions for all other adapters.
Small test case: