mupq / pqm4

Post-quantum crypto library for the ARM Cortex-M4
284 stars 72 forks source link

Build failed #343

Closed hungrydonkey closed 3 months ago

hungrydonkey commented 4 months ago

Env

OS: Manjaro x86_64 6.9.2-1-MANJARO arm-none-eabi-gcc: 14.1.0

Compilation error

The output of make -j4 PLATFORM=stm32f4discovery:

GEN     obj/.config.mk
make -C /home/sca/Program/projects/pqm4/libopencm3 lib/stm32/f4
  GENHDR  stm32/f3
  GENHDR  stm32/f1
  GENHDR  stm32/f0
  GENHDR  stm32/f2
  GENHDR  stm32/f4
  GENHDR  stm32/f7
  GENHDR  stm32/l0
  GENHDR  stm32/l1
  GENHDR  stm32/l4
  GENHDR  stm32/g0
  GENHDR  stm32/g4
  GENHDR  stm32/h7
  GENHDR  gd32/f1x0
  GENHDR  lpc13xx
  GENHDR  lpc17xx
  GENHDR  lpc43xx/m4
  GENHDR  lpc43xx/m0
  GENHDR  lm3s
  GENHDR  msp432/e4
  GENHDR  efm32/tg
  GENHDR  efm32/g
  GENHDR  efm32/lg
  GENHDR  efm32/gg
  GENHDR  efm32/hg
  GENHDR  efm32/wg
  GENHDR  efm32/ezr32wg
  GENHDR  nrf/51
  GENHDR  nrf/52
  GENHDR  sam/3a
  GENHDR  sam/3n
  GENHDR  sam/3s
  GENHDR  sam/3u
  GENHDR  sam/3x
  GENHDR  sam/4l
  GENHDR  sam/d
  GENHDR  vf6xx
  GENHDR  swm050
  GENHDR  pac55xx
  BUILD   lib/stm32/f4
  CC      adc_common_v1.c
  CC      adc_common_v1_multi.c
  CC      can.c
  CC      adc_common_f47.c
  CC      crc_common_all.c
  CC      crypto_common_f24.c
  CC      crypto.c
  CC      dac_common_all.c
  CC      dac_common_v1.c
  CC      dcmi_common_f47.c
  CC      desig_common_all.c
  CC      desig_common_v1.c
  CC      dma_common_f24.c
  CC      dma2d_common_f47.c
  CC      dsi_common_f47.c
  CC      exti_common_all.c
  CC      flash.c
  CC      flash_common_all.c
  CC      flash_common_f.c
  CC      flash_common_f24.c
  CC      flash_common_idcache.c
  CC      fmc_common_f47.c
  CC      gpio_common_all.c
  CC      gpio_common_f0234.c
  CC      hash_common_f24.c
  CC      i2c_common_v1.c
  CC      iwdg_common_all.c
  CC      lptimer_common_all.c
  CC      ltdc_common_f47.c
  CC      pwr_common_v1.c
  CC      pwr.c
  CC      rcc_common_all.c
  CC      rcc.c
  CC      rng_common_v1.c
  CC      rtc_common_l1f024.c
  CC      rtc.c
  CC      spi_common_all.c
  CC      spi_common_v1.c
  CC      spi_common_v1_frf.c
  CC      timer_common_all.c
  CC      timer_common_f0234.c
  CC      timer_common_f24.c
  CC      usart_common_all.c
  CC      usart_common_f124.c
  CC      quadspi_common_v1.c
  CC      usb.c
  CC      usb_standard.c
  CC      usb_control.c
  CC      usb_msc.c
  CC      usb_hid.c
  CC      usb_audio.c
  CC      usb_cdc.c
  CC      usb_midi.c
  CC      usb_dwc_common.c
  CC      usb_f107.c
  CC      usb_f207.c
  CC      mac.c
  CC      phy.c
  CC      mac_stm32fxx7.c
  CC      phy_ksz80x1.c
  CC      vector.c
  CC      systick.c
  CC      scb.c
  CC      nvic.c
  CC      assert.c
  CC      sync.c
  CC      dwt.c
  AR      libopencm3_stm32f4.a
  CC      elf/crypto_kem_kyber768_m4fstack_test.elf
  CC      elf/crypto_kem_kyber768_m4fstack_speed.elf
  CC      elf/crypto_kem_kyber768_m4fstack_hashing.elf
  CC      elf/crypto_kem_kyber768_m4fstack_stack.elf
  CC      elf/crypto_kem_kyber768_m4fstack_testvectors.elf
  CC      elf/crypto_kem_kyber768_m4fspeed_test.elf
  CC      elf/crypto_kem_kyber768_m4fspeed_speed.elf
  CC      elf/crypto_kem_kyber768_m4fspeed_hashing.elf
  CC      elf/crypto_kem_kyber768_m4fspeed_stack.elf
  CC      elf/crypto_kem_kyber768_m4fspeed_testvectors.elf
  CC      elf/crypto_kem_kyber512_m4fstack_test.elf
  CC      elf/crypto_kem_kyber512_m4fstack_speed.elf
  CC      elf/crypto_kem_kyber512_m4fstack_hashing.elf
  CC      elf/crypto_kem_kyber512_m4fstack_stack.elf
  CC      elf/crypto_kem_kyber512_m4fstack_testvectors.elf
  CC      elf/crypto_kem_kyber512_m4fspeed_test.elf
  CC      elf/crypto_kem_kyber512_m4fspeed_speed.elf
  CC      elf/crypto_kem_kyber512_m4fspeed_hashing.elf
  CC      elf/crypto_kem_kyber512_m4fspeed_stack.elf
  CC      elf/crypto_kem_kyber512_m4fspeed_testvectors.elf
  CC      elf/crypto_kem_bikel3_m4f_test.elf
  CC      elf/crypto_kem_bikel3_m4f_speed.elf
  CC      elf/crypto_kem_bikel3_m4f_hashing.elf
  CC      elf/crypto_kem_bikel3_m4f_stack.elf
  CC      elf/crypto_kem_bikel3_m4f_testvectors.elf
  CC      elf/crypto_kem_kyber1024_m4fstack_test.elf
  CC      elf/crypto_kem_kyber1024_m4fstack_speed.elf
  CC      elf/crypto_kem_kyber1024_m4fstack_hashing.elf
  CC      elf/crypto_kem_kyber1024_m4fstack_stack.elf
  CC      elf/crypto_kem_kyber1024_m4fstack_testvectors.elf
  CC      elf/crypto_kem_kyber1024_m4fspeed_test.elf
  CC      elf/crypto_kem_kyber1024_m4fspeed_speed.elf
  CC      elf/crypto_kem_kyber1024_m4fspeed_hashing.elf
  CC      elf/crypto_kem_kyber1024_m4fspeed_stack.elf
  CC      elf/crypto_kem_kyber1024_m4fspeed_testvectors.elf
  CC      elf/crypto_kem_bikel1_m4f_test.elf
  CC      elf/crypto_kem_bikel1_m4f_speed.elf
  CC      elf/crypto_kem_bikel1_m4f_hashing.elf
  CC      elf/crypto_kem_bikel1_m4f_stack.elf
  CC      elf/crypto_kem_bikel1_m4f_testvectors.elf
  CC      elf/mupq_crypto_kem_bikel3_opt_test.elf
  CC      elf/mupq_crypto_kem_bikel3_opt_speed.elf
  CC      elf/mupq_crypto_kem_bikel3_opt_hashing.elf
  CC      elf/mupq_crypto_kem_bikel3_opt_stack.elf
  CC      elf/mupq_crypto_kem_bikel3_opt_testvectors.elf
  CC      elf/mupq_crypto_kem_bikel1_opt_test.elf
  CC      elf/mupq_crypto_kem_bikel1_opt_speed.elf
  CC      elf/mupq_crypto_kem_bikel1_opt_hashing.elf
  CC      elf/mupq_crypto_kem_bikel1_opt_stack.elf
  CC      elf/mupq_crypto_kem_bikel1_opt_testvectors.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber768_clean_test.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber768_clean_speed.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber768_clean_hashing.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber768_clean_stack.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber768_clean_testvectors.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber512_clean_test.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber512_clean_speed.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber512_clean_hashing.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber512_clean_stack.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber512_clean_testvectors.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-256_clean_test.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-256_clean_speed.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-256_clean_hashing.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-256_clean_stack.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-256_clean_testvectors.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber1024_clean_test.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber1024_clean_speed.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber1024_clean_hashing.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber1024_clean_stack.elf
  CC      elf/mupq_pqclean_crypto_kem_kyber1024_clean_testvectors.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-128_clean_test.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-128_clean_speed.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-128_clean_hashing.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-128_clean_stack.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-128_clean_testvectors.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-192_clean_test.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-192_clean_speed.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-192_clean_hashing.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-192_clean_stack.elf
  CC      elf/mupq_pqclean_crypto_kem_hqc-192_clean_testvectors.elf
  CC      elf/crypto_sign_dilithium2_m4f_test.elf
  CC      elf/crypto_sign_dilithium2_m4f_speed.elf
  CC      elf/crypto_sign_dilithium2_m4f_hashing.elf
  CC      elf/crypto_sign_dilithium2_m4f_stack.elf
  CC      elf/crypto_sign_dilithium2_m4f_testvectors.elf
  CC      elf/crypto_sign_dilithium2_m4fstack_test.elf
  CC      elf/crypto_sign_dilithium2_m4fstack_speed.elf
  CC      elf/crypto_sign_dilithium2_m4fstack_hashing.elf
  CC      elf/crypto_sign_dilithium2_m4fstack_stack.elf
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_keypair':
crypto_sign/dilithium2/m4fstack/sign.c:40:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
   40 |   uint8_t *tr          = &data.tr;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_signature':
crypto_sign/dilithium2/m4fstack/sign.c:161:19: warning: passing argument 1 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                   ^~~
In file included from crypto_sign/dilithium2/m4fstack/sign.c:10:
crypto_sign/dilithium2/m4fstack/stack.h:37:30: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   37 | void unpack_sk_stack(uint8_t rho[SEEDBYTES],
      |                      ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:24: warning: passing argument 2 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                        ^~
crypto_sign/dilithium2/m4fstack/stack.h:38:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   38 |                uint8_t tr[TRBYTES],
      |                ~~~~~~~~^~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:28: warning: passing argument 3 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                            ^~~
crypto_sign/dilithium2/m4fstack/stack.h:39:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   39 |                uint8_t key[SEEDBYTES],
      |                ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_verify':
crypto_sign/dilithium2/m4fstack/sign.c:346:24: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[192]' {aka 'unsigned char (*)[192]'} [-Wincompatible-pointer-types]
  346 |   uint8_t *w1_packed = &w1_packed_comp.w1_packed;
      |                        ^
crypto_sign/dilithium2/m4fstack/sign.c:347:21: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[768]' {aka 'unsigned char (*)[768]'} [-Wincompatible-pointer-types]
  347 |   uint8_t *wcomp  = &w1_packed_comp.wcomp;
      |                     ^
crypto_sign/dilithium2/m4fstack/sign.c:353:20: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[68]' {aka 'unsigned char (*)[68]'} [-Wincompatible-pointer-types]
  353 |   uint8_t *ccomp = &ccomp_mu.ccomp;
      |                    ^
crypto_sign/dilithium2/m4fstack/sign.c:354:18: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
  354 |   uint8_t *mu  = &ccomp_mu.mu;
      |                  ^
crypto_sign/dilithium2/m4fstack/sign.c:364:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[80]' {aka 'unsigned char (*)[80]'} [-Wincompatible-pointer-types]
  364 |   uint8_t *hint_ones   = &shake_hint.hint_ones;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c:366:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[32]' {aka 'unsigned char (*)[32]'} [-Wincompatible-pointer-types]
  366 |   uint8_t *c2          = &shake_hint.c2;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_keypair':
crypto_sign/dilithium2/m4fstack/sign.c:40:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
   40 |   uint8_t *tr          = &data.tr;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_signature':
crypto_sign/dilithium2/m4fstack/sign.c:161:19: warning: passing argument 1 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                   ^~~
In file included from crypto_sign/dilithium2/m4fstack/sign.c:10:
crypto_sign/dilithium2/m4fstack/stack.h:37:30: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   37 | void unpack_sk_stack(uint8_t rho[SEEDBYTES],
      |                      ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:24: warning: passing argument 2 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                        ^~
crypto_sign/dilithium2/m4fstack/stack.h:38:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   38 |                uint8_t tr[TRBYTES],
      |                ~~~~~~~~^~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:28: warning: passing argument 3 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                            ^~~
crypto_sign/dilithium2/m4fstack/stack.h:39:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   39 |                uint8_t key[SEEDBYTES],
      |                ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_verify':
crypto_sign/dilithium2/m4fstack/sign.c:346:24: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[192]' {aka 'unsigned char (*)[192]'} [-Wincompatible-pointer-types]
  346 |   uint8_t *w1_packed = &w1_packed_comp.w1_packed;
      |                        ^
crypto_sign/dilithium2/m4fstack/sign.c:347:21: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[768]' {aka 'unsigned char (*)[768]'} [-Wincompatible-pointer-types]
  347 |   uint8_t *wcomp  = &w1_packed_comp.wcomp;
      |                     ^
crypto_sign/dilithium2/m4fstack/sign.c:353:20: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[68]' {aka 'unsigned char (*)[68]'} [-Wincompatible-pointer-types]
  353 |   uint8_t *ccomp = &ccomp_mu.ccomp;
      |                    ^
crypto_sign/dilithium2/m4fstack/sign.c:354:18: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
  354 |   uint8_t *mu  = &ccomp_mu.mu;
      |                  ^
crypto_sign/dilithium2/m4fstack/sign.c:364:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[80]' {aka 'unsigned char (*)[80]'} [-Wincompatible-pointer-types]
  364 |   uint8_t *hint_ones   = &shake_hint.hint_ones;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c:366:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[32]' {aka 'unsigned char (*)[32]'} [-Wincompatible-pointer-types]
  366 |   uint8_t *c2          = &shake_hint.c2;
      |                          ^
make: *** [mupq/mk/schemes.mk:149: elf/crypto_sign_dilithium2_m4fstack_test.elf] Error 1
make: *** Waiting for unfinished jobs....
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_keypair':
crypto_sign/dilithium2/m4fstack/sign.c:40:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
   40 |   uint8_t *tr          = &data.tr;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_signature':
crypto_sign/dilithium2/m4fstack/sign.c:161:19: warning: passing argument 1 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                   ^~~
In file included from crypto_sign/dilithium2/m4fstack/sign.c:10:
crypto_sign/dilithium2/m4fstack/stack.h:37:30: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   37 | void unpack_sk_stack(uint8_t rho[SEEDBYTES],
      |                      ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:24: warning: passing argument 2 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                        ^~
crypto_sign/dilithium2/m4fstack/stack.h:38:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   38 |                uint8_t tr[TRBYTES],
      |                ~~~~~~~~^~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:28: warning: passing argument 3 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                            ^~~
crypto_sign/dilithium2/m4fstack/stack.h:39:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   39 |                uint8_t key[SEEDBYTES],
      |                ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_verify':
crypto_sign/dilithium2/m4fstack/sign.c:346:24: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[192]' {aka 'unsigned char (*)[192]'} [-Wincompatible-pointer-types]
  346 |   uint8_t *w1_packed = &w1_packed_comp.w1_packed;
      |                        ^
crypto_sign/dilithium2/m4fstack/sign.c:347:21: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[768]' {aka 'unsigned char (*)[768]'} [-Wincompatible-pointer-types]
  347 |   uint8_t *wcomp  = &w1_packed_comp.wcomp;
      |                     ^
crypto_sign/dilithium2/m4fstack/sign.c:353:20: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[68]' {aka 'unsigned char (*)[68]'} [-Wincompatible-pointer-types]
  353 |   uint8_t *ccomp = &ccomp_mu.ccomp;
      |                    ^
crypto_sign/dilithium2/m4fstack/sign.c:354:18: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
  354 |   uint8_t *mu  = &ccomp_mu.mu;
      |                  ^
crypto_sign/dilithium2/m4fstack/sign.c:364:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[80]' {aka 'unsigned char (*)[80]'} [-Wincompatible-pointer-types]
  364 |   uint8_t *hint_ones   = &shake_hint.hint_ones;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c:366:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[32]' {aka 'unsigned char (*)[32]'} [-Wincompatible-pointer-types]
  366 |   uint8_t *c2          = &shake_hint.c2;
      |                          ^
make: *** [mupq/mk/schemes.mk:149: elf/crypto_sign_dilithium2_m4fstack_speed.elf] Error 1
make: *** [mupq/mk/schemes.mk:149: elf/crypto_sign_dilithium2_m4fstack_hashing.elf] Error 1
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_keypair':
crypto_sign/dilithium2/m4fstack/sign.c:40:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
   40 |   uint8_t *tr          = &data.tr;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_signature':
crypto_sign/dilithium2/m4fstack/sign.c:161:19: warning: passing argument 1 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                   ^~~
In file included from crypto_sign/dilithium2/m4fstack/sign.c:10:
crypto_sign/dilithium2/m4fstack/stack.h:37:30: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   37 | void unpack_sk_stack(uint8_t rho[SEEDBYTES],
      |                      ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:24: warning: passing argument 2 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                        ^~
crypto_sign/dilithium2/m4fstack/stack.h:38:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   38 |                uint8_t tr[TRBYTES],
      |                ~~~~~~~~^~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c:161:28: warning: passing argument 3 of 'unpack_sk_stack' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  161 |   unpack_sk_stack(rho, tr, key, sk);
      |                            ^~~
crypto_sign/dilithium2/m4fstack/stack.h:39:24: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'const uint8_t *' {aka 'const unsigned char *'}
   39 |                uint8_t key[SEEDBYTES],
      |                ~~~~~~~~^~~~~~~~~~~~~~
crypto_sign/dilithium2/m4fstack/sign.c: In function 'crypto_sign_verify':
crypto_sign/dilithium2/m4fstack/sign.c:346:24: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[192]' {aka 'unsigned char (*)[192]'} [-Wincompatible-pointer-types]
  346 |   uint8_t *w1_packed = &w1_packed_comp.w1_packed;
      |                        ^
crypto_sign/dilithium2/m4fstack/sign.c:347:21: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[768]' {aka 'unsigned char (*)[768]'} [-Wincompatible-pointer-types]
  347 |   uint8_t *wcomp  = &w1_packed_comp.wcomp;
      |                     ^
crypto_sign/dilithium2/m4fstack/sign.c:353:20: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[68]' {aka 'unsigned char (*)[68]'} [-Wincompatible-pointer-types]
  353 |   uint8_t *ccomp = &ccomp_mu.ccomp;
      |                    ^
crypto_sign/dilithium2/m4fstack/sign.c:354:18: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[64]' {aka 'unsigned char (*)[64]'} [-Wincompatible-pointer-types]
  354 |   uint8_t *mu  = &ccomp_mu.mu;
      |                  ^
crypto_sign/dilithium2/m4fstack/sign.c:364:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[80]' {aka 'unsigned char (*)[80]'} [-Wincompatible-pointer-types]
  364 |   uint8_t *hint_ones   = &shake_hint.hint_ones;
      |                          ^
crypto_sign/dilithium2/m4fstack/sign.c:366:26: error: initialization of 'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type 'uint8_t (*)[32]' {aka 'unsigned char (*)[32]'} [-Wincompatible-pointer-types]
  366 |   uint8_t *c2          = &shake_hint.c2;
      |                          ^
make: *** [mupq/mk/schemes.mk:149: elf/crypto_sign_dilithium2_m4fstack_stack.elf] Error 1
rpls commented 4 months ago

I guess that might be a compiler issue, we haven't tested things with GCC 14. Maybe its more strict with pointer types.

hungrydonkey commented 4 months ago

Adding -Wno-incompatible-pointer-types to the mupq/mk/config.mk solves this problem. A better way is to improve the source code of dilithium_m4fstack.

mkannwischer commented 3 months ago

We are commonly testing and benchmarking with the GNU Arm toolchain. They haven't released the gcc14 toolchain yet, so we haven't yet tested it. I briefly tried it with arm-none-eabi-gcc 14.1.0 from the arch package manger https://archlinux.org/packages/extra/x86_64/arm-none-eabi-gcc/, but that causes other problems that I don't have time to look into right now. I guess we'll wait until Arm releases the new toolchain later this year.

Feel free to open a PR to change the Dilithium sources and we'll happily merge it.