@@ -65,37 +65,6 @@ describe('Paillier', function () {
65
65
expect ( dec_sum ) . to . equal ( 3 ) ;
66
66
} ) ;
67
67
68
- it ( 'should multiply 2 ciphertexts' , async function ( ) {
69
-
70
- const { Paillier, publicKey, privateKey } = await loadFixture ( fixture ) ;
71
- const a : bigint = BigInt ( 2 ) ;
72
- const b : bigint = BigInt ( 5 ) ;
73
- const enc_a : Ciphertext = {
74
- value : ethers . toBeHex ( publicKey . encrypt ( a ) ) ,
75
- } ;
76
- const enc_b : Ciphertext = {
77
- value : ethers . toBeHex ( publicKey . encrypt ( b ) ) ,
78
- } ;
79
-
80
- // Public key
81
- const pubKey : PublicKey = {
82
- n : ethers . toBeHex ( publicKey . n ) ,
83
- g : ethers . toBeHex ( publicKey . g ) ,
84
- } ;
85
-
86
- // bit length will differ to what has been stated in this script.
87
- // if using 256-bit key, bit_length will be 264 as "0x" prefix may have been factored in
88
- // Now lets deploy the contract and test the addition
89
- const enc_prod = await Paillier . mul ( enc_a , enc_b , pubKey ) ;
90
- const enc_prod_int = bigIntConversion . hexToBigint ( enc_prod [ 0 ] ) ;
91
-
92
- // Conversion to int for convenience
93
- const dec_prod = Number ( privateKey . decrypt ( enc_prod_int ) ) ;
94
- console . log ( dec_prod ) ;
95
- // We want dec_prod to equal 10
96
- expect ( dec_prod ) . to . equal ( 10 ) ;
97
- } ) ;
98
-
99
68
it ( 'should add a ciphertext and plaintext' , async function ( ) {
100
69
const { Paillier, publicKey, privateKey } = await loadFixture ( fixture ) ;
101
70
const a : bigint = BigInt ( 1 ) ;
0 commit comments