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

Support different ISAs dynamically at runtime #18

Closed
xhuan28 opened this issue Sep 16, 2022 · 2 comments
Closed

Support different ISAs dynamically at runtime #18

xhuan28 opened this issue Sep 16, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@xhuan28
Copy link
Contributor

xhuan28 commented Sep 16, 2022

Thanks for the library!
Currently, AVX512IFMA support is enabled at compilation time. However, the machine that compiles IPCL usually is not the machine that runs it. Is it possible to select AVX512IFMA enabled or not at runtime. The implementation of oneDNN is a good reference.

@skmono
Copy link
Contributor

skmono commented Sep 16, 2022

@xhuan28 Thanks for suggestion!

Based on your suggestion, we are planning to have two different methods of building the library:

  1. Enable during configuration/compilation for faster build time. This will improve the overall speed of the compilation as it does not build the entire IPP-Crypto library using merged build. Status: WIP
  2. Enable everything and determine during runtime. - This will be implemented after some investigation.

@skmono skmono added the enhancement New feature or request label Sep 16, 2022
skmono pushed a commit that referenced this issue Sep 27, 2022
- Add CMake flag to enable runtime version (IPCL_DETECT_IFMA_RUNTIME)
- Add ```cpu_features``` dependency
- Add manual IFMA disabling with environment variable (IPCL_DISABLE_AVX512IFMA=ON)
skmono pushed a commit that referenced this issue Sep 29, 2022
* Add option to determine AVX512IFMA during runtime (#18)
- Add CMake flag to enable runtime version (```IPCL_DETECT_IFMA_RUNTIME```)
- Add ```cpu_features``` dependency
- Add manual IFMA disabling with environment variable (```IPCL_DISABLE_AVX512IFMA=ON```)
- Updated README to include AVX512IFMA runtime detection option

* Fixed shared library build
- Refactor cmake configurations
- Added example code

* Added build and usage documentation
- Fixed minor typos and updated flag names to be more consistent
- Cleaned up example CMake file

* Added examples documentation
- Build and install instruction
- Linking and compiling instruction
- Usage examples
@skmono
Copy link
Contributor

skmono commented Sep 29, 2022

This is enabled with #23 , by setting IPCL_DETECT_IFMA_RUNTIME flag to ON.

@skmono skmono closed this as completed Sep 29, 2022
skmono pushed a commit that referenced this issue Nov 15, 2022
- applied constant protection to all member functions and needed arguments
- public key member is const in both paillier_prikey and paillier_ops
skmono pushed a commit that referenced this issue Nov 15, 2022
* Code clean/refactor/optimize (#16)

* Paillier key generation: clean/optimize code
- Modify doxygen document
- Change getNormalBN & getDJNBN to static
- Add N_BIT_SIZE_MAX macro definition

* Paillier key operation: clean/optimize code
- Modify doxygen document
- Rewrite function raw_mul

* Paillier public key: clean/optimize code
- Modify doxygen document
- Rewrite function: randIpp32u, getRandom, apply_obfuscator, ippMultiBuffExp, ippMontExp

* Paillier private key: clean/optimize code
- Modify doxygen document
- Rewrite function: decrpytRAW, decrypt, decryptCRT

* Add namespace(ipcl) to Intel Paillier Crypto Lib

* Add const keyword (#18)

- applied constant protection to all member functions and needed arguments
- public key member is const in both paillier_prikey and paillier_ops

* Refactoring (#19)

* Refactoring
- Replaced all pointers and arrays with std::vector - resolves #14
- Changed multi-buffered PaillierEncryptedNumber::raw_mul to return std::vector - resolves #15
- Changed multi-buffered modular exponentation PaillierPublicKey::ippMultiBuffExp to return std::vector - resolves #15
- Applied changes to unit-test and benchmark accordingly
- Applied const keywords to test and benchmark functions for keyPair

* Bug fix on BM_Mul_CTPT_OMP in benchmark

* Updated README - updated unittest_omp per changes to IPCL_ENABLE_OMP flag

* Updated README

* Removed unused header

* Add util function/macro (#24)

* Add util function/macro

* Minor modifications
- Changed PARALLEL_PROCESS_NUM to IPCL_CRYPTO_MB_SIZE
- Replaced BigNum macros (BITSIZE_WORD and BITSIZE_DWORD) with functions in BigNum

Co-authored-by: Sejun Kim <sejun.kim@intel.com>

* Updated readme (#25)

* Add support for multi cpu architecture (#28)

* Add support for multi cpu architecture(i.e. when cpu doesn't support avx512 instructions)

* OpenMP enabling cleanup

* Skmono/decrypt raw refactoring (#29)

* Modified decryptRAW to use m_pubkey->ippMultiBuffExp
* Replaced "avx512" with "avx512ifma" - mbx_exp_mb8 works only with ifma instructions
* Removed testing code

* Renamed OMP compiler flag to IPCL_USE_OMP

* Renamed ippMultiBuffExp and ippMontExp
- ippMultiBuffExp -> ippMBModExp
- ippMontExp -> ippSBModExp
- put both multi and single buffered mod exp to private
- only expose ippModExp that will take care of any modular exponentiation

* bugfix - updated remaining ippMontExp

Co-authored-by: Sejun Kim <sejun.kim@intel.com>

* Updated README on flags (#32)

* Updated README (#36)

* Fix decryptRAW incorrect result issue (#37)

* Added support for Ipp8u vector retrieval of BigNumber for QAT integration (#38)

* Move Mod Exp to seperate file (#39)

* Move modular exponentation to seperate file
* Remove unused function IPP_invert

Co-authored-by: Pengfei Zhao <pengfei.zhao@intel.com>
skmono pushed a commit that referenced this issue Nov 15, 2022
* initial release

* Update CODEOWNERS (#1)

* Minor updates (#4)

* Minor updates
- Updated contributors
- Added code of conduct
- Updated CI/CD

* ModExp function: remove padding & code clean (#6)

- Remove padding operation in ippsModExp function
- Let ippsMBModExp function support modulus of different bit size(in one vector)
- Code clean

* ippsModExp & unittests: corner case fix (#7)

* Improve RNG security (#9)

* Fix insecure prng (#3)
- Add RDSEED and RDRAND instruction check in compile time
- Prioritize RDSEED/RDRAND based RNG to produce random big number

* Add RNG support for non-RDRAND, non-RDSEED systems (#5)
- Use IPP-Crypto pseudo random number generator if none of those instructions are supported

* Removing seed setup and replacing rng function for PrimeGen_BN (#8)
- Remove seed setup for prime number generator
- Add support to TRNGen_RDSEED and PRNGen_RDRAND for prime number generator

Co-authored-by: Pengfei Zhao <pengfei.zhao@intel.com>

* Refactor apply obfuscator (#10)

- Refactor apply_obfuscator
- minor typo fix

* Update ipp-crypto version to use ippcp_2021.6 (#12)

- Minor update to use IPP-Crypto v2021.6

* 13 errors building installing questions about docs (#15)

* Minor fixes
- Fix gbenchmark build error on other platforms
- Fixed IPCLTargets typo
- Update version to 1.1.4

* Update to 1.1.4 (#17) (#20)

* Improve RNG security (#9)
* Fix insecure prng (#3)
- Add RDSEED and RDRAND instruction check in compile time
- Prioritize RDSEED/RDRAND based RNG to produce random big number
* Add RNG support for non-RDRAND, non-RDSEED systems (#5)
- Use IPP-Crypto pseudo random number generator if none of those instructions are supported
* Removing seed setup and replacing rng function for PrimeGen_BN (#8)
- Remove seed setup for prime number generator
- Add support to TRNGen_RDSEED and PRNGen_RDRAND for prime number generator

* Refactor apply obfuscator (#10)
- Refactor apply_obfuscator
- minor typo fix

* Update version for 1.1.4
* Update ipp-crypto version to use ippcp_2021.6 (#12)
- Minor update to use IPP-Crypto v2021.6

* 13 errors building installing questions about docs (#15)
* Minor fixes
- Fix gbenchmark build error on other platforms
- Fixed IPCLTargets typo
- Update version to 1.1.4

Co-authored-by: Pengfei Zhao <pengfei.zhao@intel.com>

* Add ipcl.hpp public header & cleanup ipcl/CMakeLists.txt (#22)

* Cleanup ipcl/CMakeLists.txt
* Refactor header - rename keygen.hpp with ipcl.hpp, use it as public header
* Unit test & benchmark: replace header files with public header - ipcl.hpp

* Improve installation and support runtime IFMA detection (#23)

* Add option to determine AVX512IFMA during runtime (#18)
- Add CMake flag to enable runtime version (```IPCL_DETECT_IFMA_RUNTIME```)
- Add ```cpu_features``` dependency
- Add manual IFMA disabling with environment variable (```IPCL_DISABLE_AVX512IFMA=ON```)
- Updated README to include AVX512IFMA runtime detection option

* Fixed shared library build
- Refactor cmake configurations
- Added example code

* Added build and usage documentation
- Fixed minor typos and updated flag names to be more consistent
- Cleaned up example CMake file

* Added examples documentation
- Build and install instruction
- Linking and compiling instruction
- Usage examples

* Fixed typo in root README (#24)

Co-authored-by: Pengfei Zhao <pengfei.zhao@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants