Open blue-freedom-technologies opened 10 months ago
Closing this issue due the lack of answers from the repository contributors.
Cheers,
ring 0.17 is the first version that has implementations of every algorithm that could work on every target. But, we do have an allowlist of target architectures and target operating systems. I do not know what riscv32imac-esp-espidf
but it looks like riscv32 which has a good chance of working. The main question is whether the getrandom
crate supports that target and if not then we probably need PR #1754 to be merged.
Hi @briansmith ,
thank you for your answer.
getrandom supports the target riscv32imac-esp-espidf with no problem for STD rust embedded apps.
[target.'cfg(all(target_arch = "riscv32imac",target_os = "espidf"))'.dependencies]
getrandom = { git = "https://github.com/rust-random/getrandom.git" }
So, does ring have support for riscv32 ?
The following warnings were emitted during compilation:
warning: ring@0.17.4: cc: error: unrecognized argument in option ‘-mabi=ilp32’
warning: ring@0.17.4: cc: note: valid arguments to ‘-mabi=’ are: ms sysv
warning: ring@0.17.4: cc: error: unrecognized argument in option ‘-mcmodel=medany’
warning: ring@0.17.4: cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
error: failed to run custom build command for `ring v0.17.4`
Caused by:
process didn't exit successfully: `/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/debug/build/ring-ecda5d3cd61702a7/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_4_
OPT_LEVEL = Some("z")
TARGET = Some("riscv32imac-esp-espidf")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_riscv32imac-esp-espidf
CC_riscv32imac-esp-espidf = None
cargo:rerun-if-env-changed=CC_riscv32imac_esp_espidf
CC_riscv32imac_esp_espidf = None
cargo:rerun-if-env-changed=TARGET_CC
TARGET_CC = None
cargo:rerun-if-env-changed=CC
CC = None
RUSTC_LINKER = Some("ldproxy")
cargo:rerun-if-env-changed=CROSS_COMPILE
CROSS_COMPILE = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("a,c,m")
cargo:rerun-if-env-changed=CFLAGS_riscv32imac-esp-espidf
CFLAGS_riscv32imac-esp-espidf = None
cargo:rerun-if-env-changed=CFLAGS_riscv32imac_esp_espidf
CFLAGS_riscv32imac_esp_espidf = None
cargo:rerun-if-env-changed=TARGET_CFLAGS
TARGET_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
running: "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-I" "include" "-I" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/debug/build/ring-436cec22a770a0d7/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-pedantic" "-Wall" "-Wextra" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-g3" "-DNDEBUG" "-o" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/debug/build/ring-436cec22a770a0d7/out/crypto/curve25519/curve25519.o" "-c" "crypto/curve25519/curve25519.c"
cargo:warning=cc: error: unrecognized argument in option ‘-mabi=ilp32’
cargo:warning=cc: note: valid arguments to ‘-mabi=’ are: ms sysv
cargo:warning=cc: error: unrecognized argument in option ‘-mcmodel=medany’
cargo:warning=cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
exit status: 1
--- stderr
error occurred: Command "cc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-I" "include" "-I" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/debug/build/ring-436cec22a770a0d7/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-pedantic" "-Wall" "-Wextra" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-g3" "-DNDEBUG" "-o" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/debug/build/ring-436cec22a770a0d7/out/crypto/curve25519/curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args "cc" did not execute successfully (status code exit status: 1).
warning: build failed, waiting for other jobs to finish...
Cheers,
The following warnings were emitted during compilation:
warning: ring@0.17.4: cc: error: unrecognized argument in option ‘-mabi=ilp32’ warning: ring@0.17.4: cc: note: valid arguments to ‘-mabi=’ are: ms sysv warning: ring@0.17.4: cc: error: unrecognized argument in option ‘-mcmodel=medany’ warning: ring@0.17.4: cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
You need to set TARGET_CC
or equivalent to the C compiler for the target.
See also https://github.com/briansmith/ring/issues/1787 where I describe a bit of what's wrong with getrandom
's implementation on this target.
The following warnings were emitted during compilation:
warning: ring@0.17.4: cc: error: unrecognized argument in option ‘-mabi=ilp32’ warning: ring@0.17.4: cc: note: valid arguments to ‘-mabi=’ are: ms sysv warning: ring@0.17.4: cc: error: unrecognized argument in option ‘-mcmodel=medany’ warning: ring@0.17.4: cc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
You need to set
TARGET_CC
or equivalent to the C compiler for the target.See also #1787 where I describe a bit of what's wrong with
getrandom
's implementation on this target.
Regrading getrandom
I am using getrandom in other places and I have no problems with it. Should I wait for the "in-library DRBG" for this to work with the ring library ?
Regarding the ring library:
I think I am doing something wrong. I have already tried several types of configurations but I am not able to compile the ring crate.
I have the "riscv-gnu-toolchain" with the enable-multilib meaning it would work for both 64-bits and 32 bits.
riscv64-unknown-elf-gcc () 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Do I need some special configuration or flag to be added to the compiler ?
Errors: ->include/ring-core/target.h:63:2: error: #error "Unknown target CPU" ->crypto/curve25519/../internal.h:210:2: error: #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
Configuration
TARGET_CC=/opt/riscv/bin/riscv64-unknown-elf-gcc cargo build --release
The following warnings were emitted during compilation:
warning: ring@0.17.5: In file included from include/ring-core/base.h:74,
warning: ring@0.17.5: from include/ring-core/mem.h:60,
warning: ring@0.17.5: from crypto/curve25519/curve25519.c:22:
warning: ring@0.17.5: include/ring-core/target.h:63:2: error: #error "Unknown target CPU"
warning: ring@0.17.5: 63 | #error "Unknown target CPU"
warning: ring@0.17.5: | ^~~~~
warning: ring@0.17.5: In file included from crypto/curve25519/internal.h:20,
warning: ring@0.17.5: from crypto/curve25519/curve25519.c:24:
warning: ring@0.17.5: crypto/curve25519/../internal.h:210:2: error: #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
warning: ring@0.17.5: 210 | #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
warning: ring@0.17.5: | ^~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:223:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 223 | static inline crypto_word_t value_barrier_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:223:45: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 223 | static inline crypto_word_t value_barrier_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:235:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 235 | static inline crypto_word_t constant_time_msb_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:235:49: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 235 | static inline crypto_word_t constant_time_msb_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:240:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 240 | static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:240:53: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 240 | static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:255:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 255 | static inline crypto_word_t constant_time_is_nonzero_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:255:56: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 255 | static inline crypto_word_t constant_time_is_nonzero_w(crypto_word_t a) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:260:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 260 | static inline crypto_word_t constant_time_eq_w(crypto_word_t a,
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:260:48: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 260 | static inline crypto_word_t constant_time_eq_w(crypto_word_t a,
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:261:48: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 261 | crypto_word_t b) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:268:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 268 | static inline crypto_word_t constant_time_select_w(crypto_word_t mask,
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:268:52: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 268 | static inline crypto_word_t constant_time_select_w(crypto_word_t mask,
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:269:52: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 269 | crypto_word_t a,
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:270:52: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 270 | crypto_word_t b) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:282:46: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 282 | static inline uint8_t constant_time_select_8(crypto_word_t mask, uint8_t a,
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:299:59: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 299 | const crypto_word_t mask) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h: In function 'constant_time_conditional_memcpy':
warning: ring@0.17.5: crypto/curve25519/../internal.h:304:14: warning: implicit declaration of function 'constant_time_select_8' [-Wimplicit-function-declaration]
warning: ring@0.17.5: 304 | out[i] = constant_time_select_8(mask, in[i], out[i]);
warning: ring@0.17.5: | ^~~~~~~~~~~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:304:14: warning: nested extern declaration of 'constant_time_select_8' [-Wnested-externs]
warning: ring@0.17.5: crypto/curve25519/../internal.h: At top level:
warning: ring@0.17.5: crypto/curve25519/../internal.h:313:59: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 313 | const crypto_word_t mask) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h: In function 'constant_time_conditional_memxor':
warning: ring@0.17.5: crypto/curve25519/../internal.h:318:15: warning: implicit declaration of function 'value_barrier_w' [-Wimplicit-function-declaration]
warning: ring@0.17.5: 318 | out[i] ^= value_barrier_w(mask) & in[i];
warning: ring@0.17.5: | ^~~~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:318:15: warning: nested extern declaration of 'value_barrier_w' [-Wnested-externs]
warning: ring@0.17.5: crypto/curve25519/../internal.h: At top level:
warning: ring@0.17.5: crypto/curve25519/../internal.h:350:15: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 350 | static inline crypto_word_t constant_time_declassify_w(crypto_word_t v) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/../internal.h:350:56: error: unknown type name 'crypto_word_t'
warning: ring@0.17.5: 350 | static inline crypto_word_t constant_time_declassify_w(crypto_word_t v) {
warning: ring@0.17.5: | ^~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/curve25519.c: In function 'x25519_ge_scalarmult_small_precomp':
warning: ring@0.17.5: crypto/curve25519/curve25519.c:724:35: warning: implicit declaration of function 'constant_time_eq_w' [-Wimplicit-function-declaration]
warning: ring@0.17.5: 724 | cmov(&e, &multiples[j-1], 1&constant_time_eq_w(index, j));
warning: ring@0.17.5: | ^~~~~~~~~~~~~~~~~~
warning: ring@0.17.5: crypto/curve25519/curve25519.c:724:35: warning: nested extern declaration of 'constant_time_eq_w' [-Wnested-externs]
error: failed to run custom build command for `ring v0.17.5`
Caused by:
process didn't exit successfully: `/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/release/build/ring-e475624193d1286e/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-env-changed=RING_PREGENERATE_ASM
cargo:rustc-env=RING_CORE_PREFIX=ring_core_0_17_5_
OPT_LEVEL = Some("s")
TARGET = Some("riscv32imac-esp-espidf")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_riscv32imac-esp-espidf
CC_riscv32imac-esp-espidf = None
cargo:rerun-if-env-changed=CC_riscv32imac_esp_espidf
CC_riscv32imac_esp_espidf = None
cargo:rerun-if-env-changed=TARGET_CC
TARGET_CC = Some("/opt/riscv/bin/riscv64-unknown-elf-gcc")
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("a,c,m")
cargo:rerun-if-env-changed=CFLAGS_riscv32imac-esp-espidf
CFLAGS_riscv32imac-esp-espidf = None
cargo:rerun-if-env-changed=CFLAGS_riscv32imac_esp_espidf
CFLAGS_riscv32imac_esp_espidf = None
cargo:rerun-if-env-changed=TARGET_CFLAGS
TARGET_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
running: "/opt/riscv/bin/riscv64-unknown-elf-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-I" "include" "-I" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/release/build/ring-5511d174fa612989/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-pedantic" "-Wall" "-Wextra" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-g3" "-DNDEBUG" "-o" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/release/build/ring-5511d174fa612989/out/crypto/curve25519/curve25519.o" "-c" "crypto/curve25519/curve25519.c"
cargo:warning=In file included from include/ring-core/base.h:74,
cargo:warning= from include/ring-core/mem.h:60,
cargo:warning= from crypto/curve25519/curve25519.c:22:
cargo:warning=include/ring-core/target.h:63:2: error: #error "Unknown target CPU"
cargo:warning= 63 | #error "Unknown target CPU"
cargo:warning= | ^~~~~
cargo:warning=In file included from crypto/curve25519/internal.h:20,
cargo:warning= from crypto/curve25519/curve25519.c:24:
cargo:warning=crypto/curve25519/../internal.h:210:2: error: #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
cargo:warning= 210 | #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT"
cargo:warning= | ^~~~~
cargo:warning=crypto/curve25519/../internal.h:223:15: error: unknown type name 'crypto_word_t'
cargo:warning= 223 | static inline crypto_word_t value_barrier_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:223:45: error: unknown type name 'crypto_word_t'
cargo:warning= 223 | static inline crypto_word_t value_barrier_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:235:15: error: unknown type name 'crypto_word_t'
cargo:warning= 235 | static inline crypto_word_t constant_time_msb_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:235:49: error: unknown type name 'crypto_word_t'
cargo:warning= 235 | static inline crypto_word_t constant_time_msb_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:240:15: error: unknown type name 'crypto_word_t'
cargo:warning= 240 | static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:240:53: error: unknown type name 'crypto_word_t'
cargo:warning= 240 | static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:255:15: error: unknown type name 'crypto_word_t'
cargo:warning= 255 | static inline crypto_word_t constant_time_is_nonzero_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:255:56: error: unknown type name 'crypto_word_t'
cargo:warning= 255 | static inline crypto_word_t constant_time_is_nonzero_w(crypto_word_t a) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:260:15: error: unknown type name 'crypto_word_t'
cargo:warning= 260 | static inline crypto_word_t constant_time_eq_w(crypto_word_t a,
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:260:48: error: unknown type name 'crypto_word_t'
cargo:warning= 260 | static inline crypto_word_t constant_time_eq_w(crypto_word_t a,
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:261:48: error: unknown type name 'crypto_word_t'
cargo:warning= 261 | crypto_word_t b) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:268:15: error: unknown type name 'crypto_word_t'
cargo:warning= 268 | static inline crypto_word_t constant_time_select_w(crypto_word_t mask,
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:268:52: error: unknown type name 'crypto_word_t'
cargo:warning= 268 | static inline crypto_word_t constant_time_select_w(crypto_word_t mask,
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:269:52: error: unknown type name 'crypto_word_t'
cargo:warning= 269 | crypto_word_t a,
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:270:52: error: unknown type name 'crypto_word_t'
cargo:warning= 270 | crypto_word_t b) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:282:46: error: unknown type name 'crypto_word_t'
cargo:warning= 282 | static inline uint8_t constant_time_select_8(crypto_word_t mask, uint8_t a,
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:299:59: error: unknown type name 'crypto_word_t'
cargo:warning= 299 | const crypto_word_t mask) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h: In function 'constant_time_conditional_memcpy':
cargo:warning=crypto/curve25519/../internal.h:304:14: warning: implicit declaration of function 'constant_time_select_8' [-Wimplicit-function-declaration]
cargo:warning= 304 | out[i] = constant_time_select_8(mask, in[i], out[i]);
cargo:warning= | ^~~~~~~~~~~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:304:14: warning: nested extern declaration of 'constant_time_select_8' [-Wnested-externs]
cargo:warning=crypto/curve25519/../internal.h: At top level:
cargo:warning=crypto/curve25519/../internal.h:313:59: error: unknown type name 'crypto_word_t'
cargo:warning= 313 | const crypto_word_t mask) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h: In function 'constant_time_conditional_memxor':
cargo:warning=crypto/curve25519/../internal.h:318:15: warning: implicit declaration of function 'value_barrier_w' [-Wimplicit-function-declaration]
cargo:warning= 318 | out[i] ^= value_barrier_w(mask) & in[i];
cargo:warning= | ^~~~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:318:15: warning: nested extern declaration of 'value_barrier_w' [-Wnested-externs]
cargo:warning=crypto/curve25519/../internal.h: At top level:
cargo:warning=crypto/curve25519/../internal.h:350:15: error: unknown type name 'crypto_word_t'
cargo:warning= 350 | static inline crypto_word_t constant_time_declassify_w(crypto_word_t v) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/../internal.h:350:56: error: unknown type name 'crypto_word_t'
cargo:warning= 350 | static inline crypto_word_t constant_time_declassify_w(crypto_word_t v) {
cargo:warning= | ^~~~~~~~~~~~~
cargo:warning=crypto/curve25519/curve25519.c: In function 'x25519_ge_scalarmult_small_precomp':
cargo:warning=crypto/curve25519/curve25519.c:724:35: warning: implicit declaration of function 'constant_time_eq_w' [-Wimplicit-function-declaration]
cargo:warning= 724 | cmov(&e, &multiples[j-1], 1&constant_time_eq_w(index, j));
cargo:warning= | ^~~~~~~~~~~~~~~~~~
cargo:warning=crypto/curve25519/curve25519.c:724:35: warning: nested extern declaration of 'constant_time_eq_w' [-Wnested-externs]
exit status: 1
--- stderr
error occurred: Command "/opt/riscv/bin/riscv64-unknown-elf-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=rv32imac" "-mabi=ilp32" "-mcmodel=medany" "-I" "include" "-I" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/release/build/ring-5511d174fa612989/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-pedantic" "-Wall" "-Wextra" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wenum-compare" "-Wfloat-equal" "-Wformat=2" "-Winline" "-Winvalid-pch" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-Wwrite-strings" "-g3" "-DNDEBUG" "-o" "/home/silveira/bluefreedom/microcontroller/std/prototype-app/target/riscv32imac-esp-espidf/release/build/ring-5511d174fa612989/out/crypto/curve25519/curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args "riscv64-unknown-elf-gcc" did not execute successfully (status code exit status: 1).
warning: build failed, waiting for other jobs to finish...
Hi, @briansmith
Is there any solution for this issue ?
Does Ring support our "riscv32imac-esp-espidf" target ? I have looked in the CI and did not find our target there.
Happy new year, cheers.
For me it fails due to riscv32-esp-elf-gcc
not being supported - same error message.
Issue #1943 is related to this. PR #1944 is taking a step toward getting this working.
Usually I use Ubuntu, and also ring's CI normally runs on UBuntu. It would accelerate the process of supporting this target if somebody could document how to install the toolchain for this target on Ubuntu so that I can test that the build succeeds,
Pointers to other projects that support this target that have GitHub Actions working would also be appreciated.
It would be even better if somebody could submit a PR that modifies mk/{install-build-tools.sh,cargo.sh}
and .github/workflows/ci.yml to add this target to CI, at least so that cargo.sh test --norun
works.
Hello,
I think I am missing a rustflag that is preventing the compiler to finish. If not could someone point myself in the right direction ?
config.toml
Error:
Cheers,