RIOT-OS / RIOT

RIOT - The friendly OS for IoT
https://riot-os.org
GNU Lesser General Public License v2.1
4.92k stars 1.98k forks source link

pkg_libhydrogen tests fail / update libhydrogen #18508

Closed chrysn closed 1 year ago

chrysn commented 2 years ago

Description

The libhydrogen tests fail with scary errors on recent GCC:

/home/chrysn/git/RIOT/build/pkg/libhydrogen/impl/sign.h:104:5: error: ‘hydro_x25519_core’ accessing 160 bytes in a region of size 32 [-Werror=stringop-overflow=]
  104 |     hydro_x25519_core(&xs[2], sig, hydro_x25519_BASE_POINT, 0);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chrysn/git/RIOT/build/pkg/libhydrogen/impl/sign.h:104:5: note: referencing argument 1 of type ‘hydro_x25519_limb_t[5][8]’
 {aka ‘unsigned int[5][8]’}
/home/chrysn/git/RIOT/build/pkg/libhydrogen/impl/sign.h:104:5: note: referencing argument 2 of type ‘const uint8_t[32]’ {aka ‘const unsigned char[32]’}
/home/chrysn/git/RIOT/build/pkg/libhydrogen/impl/x25519.h:251:1: note: in a call to function ‘hydro_x25519_core’
  251 | hydro_x25519_core(hydro_x25519_fe xs[5], const uint8_t scalar[hydro_x25519_BYTES],
      | ^~~~~~~~~~~~~~~~~

Steps to reproduce the issue

Issue references

This is fixed upstream in https://github.com/jedisct1/libhydrogen/issues/123 -- and the patch that closes it indicates that it's "purely cosmetic" (ie. ignoring the errors, as an old compiler would do it, does no harm).

Backport status

will need to be evaluated based on the amount of upstream changes; if excessive, a patch could be backported (but that'd need to happen before the update hits the master branch). For now I plan to list that as known issues; tagging as "needs backport" still to keep track.

maribu commented 1 year ago

fe428c370bdbdc173fcabb08c79c55a37cdc0352 fixed this