Skip to content

Commit 6a02655

Browse files
committedMar 14, 2025··
remove commented code
1 parent 6f24b88 commit 6a02655

6 files changed

+0
-86
lines changed
 

‎threshold_encryption/TEDecryptSet.cpp

-37
Original file line numberDiff line numberDiff line change
@@ -49,43 +49,6 @@ void TEDecryptSet::addDecryptShare( TEDecryptionShare _share ) {
4949
}
5050
}
5151

52-
// std::string TEDecryptSet::merge( const libBLS::Ciphertext& cyphertext ) {
53-
// libBLS::TE::checkCypher( cyphertext );
54-
55-
// if ( decrypts.size() < requiredSigners ) {
56-
// throw libBLS::ThresholdUtils::IsNotWellFormed( "Not enough elements to decrypt message"
57-
// );
58-
// }
59-
60-
// libBLS::TE te( *this );
61-
62-
// std::vector< std::pair< libff::alt_bn128_G2, size_t > > decrypted;
63-
// for ( auto&& share : decrypts ) {
64-
// decrypted.push_back( share );
65-
// }
66-
67-
// auto res = te.CombineShares( cyphertext, decrypted );
68-
69-
// was_merged = true;
70-
71-
// return res;
72-
// }
73-
74-
std::vector< uint8_t > TEDecryptSet::mergeIntoAESKey() {
75-
libBLS::TE te( *this );
76-
77-
std::vector< std::pair< libff::alt_bn128_G2, size_t > > decrypted;
78-
for ( auto&& share : decrypts ) {
79-
decrypted.push_back( share );
80-
}
81-
82-
auto res = te.CombineSharesIntoAESKey( decrypted );
83-
84-
mergeStatus = MergeStatus::ALREADY_MERGED;
85-
86-
return res;
87-
}
88-
8952
size_t TEDecryptSet::size() const {
9053
return decrypts.size();
9154
}

‎threshold_encryption/TEDecryptSet.h

-11
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ class TEDecryptSet : public TEBase {
5757

5858
void addDecryptShare( TEDecryptionShare _share );
5959

60-
61-
/**
62-
* @brief Merges the decrypted shares from this DecryptSet with the given ciphertext
63-
* @param ciphertext The encrypted text to be merged with decryption shares
64-
* @return The final decrypted message as a string
65-
* @throw ThresholdEcryptionError if merge operation fails or insufficient valid shares
66-
*/
67-
// std::string merge( const libBLS::Ciphertext& ciphertext );
68-
69-
std::vector< uint8_t > mergeIntoAESKey();
70-
7160
size_t size() const;
7261

7362
bool canMerge() const;

‎threshold_encryption/TEPrivateKeyShare.cpp

-16
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,6 @@ TEPrivateKeyShare::TEPrivateKeyShare( libff::alt_bn128_Fr _skey_share, size_t _s
5353
}
5454
}
5555

56-
// TEDecryptionShare TEPrivateKeyShare::getDecryptionShare( libBLS::Ciphertext& cipher ) {
57-
// libBLS::TE::checkCypher( cipher );
58-
59-
// libBLS::TE te( *this );
60-
61-
// libff::alt_bn128_G2 decryption_share = te.getDecryptionShare( cipher, privateKey );
62-
63-
// if ( decryption_share.is_zero() || !decryption_share.is_well_formed() ) {
64-
// throw libBLS::ThresholdUtils::IsNotWellFormed( "zero decrypt" );
65-
// }
66-
67-
// TEDecryptionShare share(signerIndex, decryption_share);
68-
69-
// return share;
70-
// }
71-
7256
std::string TEPrivateKeyShare::toString() const {
7357
return libBLS::ThresholdUtils::fieldElementToString( privateKey, 10 );
7458
}

‎threshold_encryption/TEPrivateKeyShare.h

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ class TEPrivateKeyShare : public TEBase {
4242
TEPrivateKeyShare( libff::alt_bn128_Fr _skey_share, size_t _signerIndex,
4343
size_t _requiredSigners, size_t _totalSigners );
4444

45-
// TEDecryptionShare getDecryptionShare( libBLS::Ciphertext& cipher );
46-
4745
static std::pair< std::shared_ptr< std::vector< std::shared_ptr< TEPrivateKeyShare > > >,
4846
std::shared_ptr< TEPublicKey > >
4947
generateSampleKeys( size_t _requiredSigners, size_t _totalSigners );

‎threshold_encryption/TEPublicKey.cpp

-18
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,6 @@ TEPublicKey::TEPublicKey( libff::alt_bn128_G2 _pkey, size_t _requiredSigners, si
7676
}
7777
}
7878

79-
// libBLS::Ciphertext TEPublicKey::encrypt( std::shared_ptr< std::string > mes_ptr ) {
80-
// libBLS::TE te( requiredSigners, totalSigners );
81-
82-
// if ( mes_ptr == nullptr ) {
83-
// throw libBLS::ThresholdUtils::IncorrectInput( "Message is null" );
84-
// }
85-
86-
// if ( mes_ptr->length() != 64 ) {
87-
// throw libBLS::ThresholdUtils::IncorrectInput( "Message length is not equal to 64" );
88-
// }
89-
90-
// libBLS::Ciphertext cypher = te.getCiphertext( *mes_ptr, PublicKey );
91-
// libBLS::TE::checkCypher( cypher );
92-
93-
// return std::make_tuple(
94-
// std::get< 0 >( cypher ), std::get< 1 >( cypher ), std::get< 2 >( cypher ) );
95-
// }
96-
9779
std::shared_ptr< std::vector< std::string > > TEPublicKey::toString() {
9880
return std::make_shared< std::vector< std::string > >(
9981
libBLS::ThresholdUtils::G2ToString( PublicKey ) );

‎threshold_encryption/TEPublicKey.h

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ class TEPublicKey : public TEBase {
4242

4343
std::shared_ptr< std::vector< std::string > > toString();
4444

45-
// libBLS::Ciphertext encrypt( std::shared_ptr< std::string > message );
46-
4745
libff::alt_bn128_G2 getPublicKeyRaw() const;
4846
};
4947

0 commit comments

Comments
 (0)
Please sign in to comment.