SEAL库 测试效率(例6之6_performance解析)

源码链接
测试环境:Ubuntu18.04(4G内存)仅供个人参考

BFV方案测试:

> Run performance test (1 ~ 4) or go back (0): 1

+--------------------------------------------------------------------------+
|         BFV Performance Test with Degrees: 4096, 8192, and 16384         |
+--------------------------------------------------------------------------+
/
| Encryption parameters :
|   scheme: BFV
|   poly_modulus_degree: 4096
|   coeff_modulus size: 109 (36 + 36 + 37) bits
|   plain_modulus: 786433
\

Generating secret/public keys: Done
Generating relinearization keys: Done [40452 microseconds]
Generating Galois keys: Done [654524 microseconds]
Running tests .......... Done

Average batch: 306 microseconds
Average unbatch: 344 microseconds
Average encrypt: 16512 microseconds
Average decrypt: 4626 microseconds
Average add: 105 microseconds
Average multiply: 32113 microseconds
Average multiply plain: 3717 microseconds
Average square: 23584 microseconds
Average relinearize: 5984 microseconds
Average rotate rows one step: 6928 microseconds
Average rotate rows random: 27202 microseconds
Average rotate columns: 5740 microseconds

/
| Encryption parameters :
|   scheme: BFV
|   poly_modulus_degree: 8192
|   coeff_modulus size: 218 (43 + 43 + 44 + 44 + 44) bits
|   plain_modulus: 786433
\

Generating secret/public keys: Done
Generating relinearization keys: Done [102710 microseconds]
Generating Galois keys: Done [2244533 microseconds]
Running tests .......... Done

Average batch: 652 microseconds
Average unbatch: 1241 microseconds
Average encrypt: 53493 microseconds
Average decrypt: 9874 microseconds
Average add: 363 microseconds
Average multiply: 112522 microseconds
Average multiply plain: 13358 microseconds
Average square: 87401 microseconds
Average relinearize: 34168 microseconds
Average rotate rows one step: 35682 microseconds
Average rotate rows random: 132116 microseconds
Average rotate columns: 30449 microseconds

/
| Encryption parameters :
|   scheme: BFV
|   poly_modulus_degree: 16384
|   coeff_modulus size: 438 (48 + 48 + 48 + 49 + 49 + 49 + 49 + 49 + 49) bits
|   plain_modulus: 786433
\

Generating secret/public keys: Done
Generating relinearization keys: Done [916445 microseconds]
Generating Galois keys: Done [76919978 microseconds]
Running tests .......... Done

Average batch: 1779 microseconds
Average unbatch: 1804 microseconds
Average encrypt: 235507 microseconds
Average decrypt: 88642 microseconds
Average add: 1564 microseconds
Average multiply: 720379 microseconds
Average multiply plain: 49921 microseconds
Average square: 377147 microseconds
Average relinearize: 191836 microseconds
Average rotate rows one step: 184836 microseconds
Average rotate rows random: 1020038 microseconds
Average rotate columns: 190563 microseconds


+---------------------------------------------------------------------------+

CKKS方案测试:

|         CKKS Performance Test with Degrees: 4096, 8192, and 16384         |
+---------------------------------------------------------------------------+
/
| Encryption parameters :
|   scheme: CKKS
|   poly_modulus_degree: 4096
|   coeff_modulus size: 109 (36 + 36 + 37) bits
\

Generating secret/public keys: Done
Generating relinearization keys: Done [117409 microseconds]
Generating Galois keys: Done [1894958 microseconds]
Running tests .......... Done

Average encode: 1937 microseconds
Average decode: 2330 microseconds
Average encrypt: 24080 microseconds
Average decrypt: 315 microseconds
Average add: 92 microseconds
Average multiply: 1144 microseconds
Average multiply plain: 368 microseconds
Average square: 5509 microseconds
Average relinearize: 6236 microseconds
Average rescale: 1473 microseconds
Average rotate vector one step: 5940 microseconds
Average rotate vector random: 22261 microseconds
Average complex conjugate: 5652 microseconds

/
| Encryption parameters :
|   scheme: CKKS
|   poly_modulus_degree: 8192
|   coeff_modulus size: 218 (43 + 43 + 44 + 44 + 44) bits
\

Generating secret/public keys: Done
Generating relinearization keys: Done [499569 microseconds]
Generating Galois keys: Done [3733892 microseconds]
Running tests .......... Done

Average encode: 8647 microseconds
Average decode: 16921 microseconds
Average encrypt: 43059 microseconds
Average decrypt: 1486 microseconds
Average add: 407 microseconds
Average multiply: 6693 microseconds
Average multiply plain: 1298 microseconds
Average square: 4010 microseconds
Average relinearize: 30653 microseconds
Average rescale: 6675 microseconds
Average rotate vector one step: 30767 microseconds
Average rotate vector random: 114574 microseconds
Average complex conjugate: 30956 microseconds

/
| Encryption parameters :
|   scheme: CKKS
|   poly_modulus_degree: 16384
|   coeff_modulus size: 438 (48 + 48 + 48 + 49 + 49 + 49 + 49 + 49 + 49) bits
\

Generating secret/public keys: Done
Generating relinearization keys: Done [1088457 microseconds]
Generating Galois keys: Done [22277024 microseconds]
Running tests .......... Done

Average encode: 27103 microseconds
Average decode: 47760 microseconds
Average encrypt: 98209 microseconds
Average decrypt: 6050 microseconds
Average add: 1340 microseconds
Average multiply: 16429 microseconds
Average multiply plain: 4661 microseconds
Average square: 10427 microseconds
Average relinearize: 172130 microseconds
Average rescale: 23506 microseconds
Average rotate vector one step: 180945 microseconds
Average rotate vector random: 747069 microseconds
Average complex conjugate: 158042 microseconds

你可能感兴趣的:(同态加密)