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

Error while building liboqs with "-DDILITHIUM_USE_AES" enabled #1484

Closed
kamlesh0hrs opened this issue May 27, 2023 · 1 comment
Closed

Error while building liboqs with "-DDILITHIUM_USE_AES" enabled #1484

kamlesh0hrs opened this issue May 27, 2023 · 1 comment

Comments

@kamlesh0hrs
Copy link

Getting error when trying to build liboqs for dilithium5 with -DDILITHIUM_USE_AES enabled.

To Reproduce
Steps to reproduce the behavior:
1. Modify src/sig/dilithium/CMakeLists.txt file to enable DILITHIUM_USE_AES

            diff --git a/src/sig/dilithium/CMakeLists.txt b/src/sig/dilithium/CMakeLists.txt          
            index b992392b..7c14b103 100644
            --- a/src/sig/dilithium/CMakeLists.txt
            +++ b/src/sig/dilithium/CMakeLists.txt
            @@ -59,7 +59,7 @@ endif()
            if(OQS_ENABLE_SIG_dilithium_5)
              add_library(dilithium_5_ref OBJECT sig_dilithium_5.c pqcrystals-dilithium_dilithium5_ref/ntt.c pqcrystals- 
               dilithium_dilithium5_ref/packing.c pqcrystals-dilithium_dilithium5_ref/poly.c pqcrystals- 
               dilithium_dilithium5_ref/polyvec.c pqcrystals-dilithium_dilithium5_ref/reduce.c pqcrystals- 
               dilithium_dilithium5_ref/rounding.c pqcrystals-dilithium_dilithium5_ref/sign.c pqcrystals- 
               dilithium_dilithium5_ref/symmetric-shake.c)
            -    target_compile_options(dilithium_5_ref PUBLIC -DDILITHIUM_MODE=5 -DDILITHIUM_RANDOMIZED_SIGNING)
           +    target_compile_options(dilithium_5_ref PUBLIC -DDILITHIUM_MODE=5 -DDILITHIUM_RANDOMIZED_SIGNING  -DDILITHIUM_USE_AES)
                target_include_directories(dilithium_5_ref PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqcrystals-dilithium_dilithium5_ref)
                target_include_directories(dilithium_5_ref PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
                target_compile_options(dilithium_5_ref PUBLIC -DDILITHIUM_MODE=5 -DDILITHIUM_RANDOMIZED_SIGNING)
  1. Run build command
    cmake -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -S . -B _build -DBUILD_SHARED_LIBS=ON -DOPENSSL_ROOT_DIR=$OPENSSLINSTALL -DCMAKE_BUILD_TYPE=Debug

Error:
Scanning dependencies of target oqs
[ 94%] Building C object src/CMakeFiles/oqs.dir/kem/kem.c.o
[ 94%] Building C object src/CMakeFiles/oqs.dir/sig/sig.c.o
[ 95%] Linking C shared library ../lib/liboqs.so
[ 95%] Built target oqs
Scanning dependencies of target speed_sig
[ 95%] Building C object tests/CMakeFiles/speed_sig.dir/speed_sig.c.o
[ 96%] Linking C executable speed_sig
/usr/bin/ld: ../lib/liboqs.so.0.8.0-dev: undefined reference to pqcrystals_dilithium5_ref_verify' /usr/bin/ld: ../lib/liboqs.so.0.8.0-dev: undefined reference to pqcrystals_dilithium5_ref_keypair'
/usr/bin/ld: ../lib/liboqs.so.0.8.0-dev: undefined reference to pqcrystals_dilithium5aes_ref_dilithium_aes256ctr_init' /usr/bin/ld: ../lib/liboqs.so.0.8.0-dev: undefined reference to pqcrystals_dilithium5_ref_signature'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/speed_sig.dir/build.make:85: tests/speed_sig] Error 1
make[1]: *** [CMakeFiles/Makefile2:1665: tests/CMakeFiles/speed_sig.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

liboqs - master-dev
openssl - 3.2-dev

Could you please help if I am doing it the right way, or am i missing something?

Thanks,
Kamlesh

@dstebila
Copy link
Member

dstebila commented Jun 1, 2023

We no longer support the Dilithium AES variants (see #1417). While there are apparently still macros for DILITHIUM_USE_AES in the upstream code that we use to implement Dilithium, it is an unsupported build option for liboqs.

@dstebila dstebila closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
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

No branches or pull requests

2 participants