Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • R ring
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-osredox-os
  • ring
  • Merge requests
  • !3

Update curve25519.c to allow for compiling on GCC

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Amy requested to merge amyipdev/ring:redox-unix-0.13.5 into redox-unix-0.13.5 Aug 09, 2021
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

On GCC, a compiler error occurs due to a mismatch between curve25519.c and internal.h. The function prototypes use a[32] and *s, respectively, whereas the functions themselves reverse this (*a, s[32]). This patch updates the function signatures to match their prototypes.

Error from compilation:

--- stderr
  third_party/fiat/curve25519.c:1877:61: error: argument 2 of type ‘const uint8_t *’ {aka ‘const unsigned char *’} declared as a pointer [-Werror=array-parameter=]
   1877 | void GFp_x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) {
        |                                              ~~~~~~~~~~~~~~~^
  In file included from third_party/fiat/curve25519.c:43:
  third_party/fiat/internal.h:129:60: note: previously declared as an array ‘const uint8_t[32]’ {aka ‘const unsigned char[32]’}
    129 | void GFp_x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]);
        |                                              ~~~~~~~~~~~~~~^~~~~
  third_party/fiat/curve25519.c:3013:36: error: argument 1 of type ‘uint8_t[32]’ {aka ‘unsigned char[32]’} with mismatched bound [-Werror=array-parameter=]
   3013 | void GFp_x25519_fe_tobytes(uint8_t s[32], const fe *h) {
        |                            ~~~~~~~~^~~~~
  In file included from third_party/fiat/curve25519.c:43:
  third_party/fiat/internal.h:124:37: note: previously declared as ‘uint8_t *’ {aka ‘unsigned char *’}
    124 | void GFp_x25519_fe_tobytes(uint8_t *s, const fe *h);
        |                            ~~~~~~~~~^
  cc1: all warnings being treated as errors
  thread 'main' panicked at 'execution failed', /home/amy/.cargo/git/checkouts/ring-673443d3342e1630/e10e9b8/build.rs:644:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: redox-unix-0.13.5