Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/223 ensure interface compliance improve implementation #224

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

PropzSaladaz
Copy link
Contributor

@PropzSaladaz PropzSaladaz commented Mar 11, 2025

Description

These changes refer to improving current libBLS codebase regarding:

  1. Usage of TEWrapper classes isntead of libff primitive types. Implementation of new classes: TEbase (has base fields from which any other TEWrapper inherits from), and TEDecryptionShare.
  2. Separation of logic from data - Threshold Encryption logic is now all contained within a single ThresholdEncryption class, instead of being 'scattered' across several different TEWrappers (TEPublicKey, TEPrivateKeyShare, TEDecryptSet, ... ). Easier for end-users to work with the library this way.
    2.1 - Added new functionality to validate a cyphertext against its decyphered plaintext.
  3. Fix AES cipher - It was currently allocating incorrect number of bytes for the output cipher vector. Some messages (with length < 38) were resulting in memory-related errors. It was also allocating more than needed amount of bytes for Initialization Vector (IV).
  4. Change the base flow of encryption/decryption. Now calling encrypt will cipher the plaintext using an AES key by default, and only the AES key will run the threshold encryption stages (decryptShare, VerifyShare, ...)
  5. Serialization of the U field of ciphertext is sent to sgx as hexadecimal instead of double comma-separated string.

Tests

  • Most of the tests were updated to use the new Wrappers
  • Some tests were slightly changed to test different message lengths
  • Some tests were removed - No longer needed due to the changes made
  • Updated te_sample_sgx.cpp to use batching when sending decryption requests to sgx
  • Added a test to test the added cyphertext validation functionality (stress out invalid messages from being accepted)

Fixes #223

@PropzSaladaz PropzSaladaz self-assigned this Mar 11, 2025
@PropzSaladaz PropzSaladaz marked this pull request as draft March 11, 2025 12:17
@PropzSaladaz PropzSaladaz marked this pull request as ready for review March 20, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure Interface Compliance & Improve Implementation
2 participants