Closed xieqiang2020 closed 1 year ago
Ring currently doesn't support s390x. I can't say if it will in the future as that's a decision for @briansmith to make. But you can look at the issue about other platforms like #562 and #389 for information on what would take to add support for new hardware.
Ring currently doesn't support s390x. I can't say if it will in the future as that's a decision for @briansmith to make. But you can look at the issue about other platforms like #562 and #389 for information on what would take to add support for new hardware.
@pietro Thanks. I will have a try.
@pietro: One common issue @briansmith frequently mentions in the other issue trackers is (Travis) CI support for the particular architecture(s). Fortunately Travis CI introduced support for s390x and ppc64le architectures about 6 months ago (in November, 2019). Details are available here: https://blog.travis-ci.com/2019-11-12-multi-cpu-architecture-ibm-power-ibm-z Would it be possible to get a CI readout and see what's still missing? (Brian mentioned that's the typical pathway.) Thanks.
Issue #104 is fixed, so AES-GCM should be working on all platforms where we do not have assembly language AES-GCM in ring. it should work for little-endian s390x. With small changes, which I encourage somebody to do in a PR, it should also work for big-endian s390x. However, I know that Power has something very much line AES-NI, and of course we should add that to ring soon.
PR #996 implements (unoptimized) RSA support for WebAssembly, but also other platforms for which we do not have assembly language GFp_bn_mul_mont, including again s390x.
The s390x architecture is always big endian, so that's simple. While Power processors are bi-endian (can operate in either big endian or little endian, and really do in practice), ppc64le (little endian) is that architecture's most popular mode for Linux nowadays and what Travis CI supports at the moment. Yes, these architectures have lots of hardware assists, although software fallback will still be important. For example, on s390x every main processor core has "CPACF" assists, and "Feature Code 3863" enables the full set of CPACF functions including AES128- and AES256-GCM (z14/LinuxONE II generation processors and higher -- and I think the Hitachi AP10000 has this, too). There's no extra charge for FC 3863 (so it's particularly popular), but unfortunately there are a couple countries that evidently block its importation. :-( So, software fallback it is. There are also quite popular Hardware Security Modules (HSMs) on that architecture ("Crypto Expess"), impressively FIPS 140-2 Level 4 certified, but with the same import restrictions.
Anyway, software fallback will be important, so that's the minimum viable starting point. Anything else you see outstanding for software fallback besides #104 big endian (which also affects MIPS and perhaps others)? And am I understanding correctly that #996 is OK now for s390x and ppc64le as far as you can tell? Thanks.
ECC and ChaCha20-Poly1305 will be the next things.
Would it be possible to at least give a better error message?
The simplest way to improve the error message would be to change the unwrap()
into expect()
like:
diff --git a/build.rs b/build.rs
index d7c8466b2..d5812800d 100644
--- a/build.rs
+++ b/build.rs
@@ -375,7 +375,7 @@ fn build_c_code(target: &Target, pregenerated: PathBuf, out_dir: &Path) {
let &(entry_arch, entry_os, _) = *entry;
entry_arch == &target.arch && is_none_or_equals(entry_os, &target.os)
})
- .unwrap();
+ .expect("Target not supported"));
let use_pregenerated = !target.is_git;
let warnings_are_errors = target.is_git;
I am having the same issue :(
If you can, please give #1037 a try and see if that fixes your problems.
@knarz Seems like this is a workaround. Is ring any less functional on s390x if we implement that work around?
RE that workaround, see PR #1174.
Fixed in 0.17.0.
Hi, I tried to build ring on s390x platform but got error:
From build.xs, line 364:
I searched ASM_TARGETS from build.xs:
It seems the error is due to no s390x support?
My question are:
Thanks
The trace of "cargo build" is as below (RUST_BACKTRACE=1):