Skip to content

PPC32 acceleration (for certain cryptographic primitives) #532

@tarcieri

Description

@tarcieri

Foreword: I can understand reluctance to add support for "exotic" platforms, and I'd personally class PPC32 as an "exotic" platform.. I agree supporting a wide range of legacy platforms has complexified and harmed the agility of e.g. OpenSSL in the past. I wholly admit I have purely selfish aims here, and perhaps if I didn't I would be against this sort of thing.

PPC32 is presently used in, as far as I can tell, a reasonable amount of deployed network gear (something confirmed to me by repeatedly asking people "why should we care about PPC32 anymore?"). My personal interest is in the Thales nShield platform.

I can't claim to have done a thorough evaluation of this, but from what I can tell ample Perl scripts exist in OpenSSL which generate PPC32 ASM implementations, but support for these architectures seems to have been dropped from BoringSSL.

Is it worth supporting optimized assembly implementations PPC32? Having wrangled some of OpenSSL's assembly into the general ring hash function framework and tested it on my particular PPC32 platform, I noted a 5X performance advantage over https://github.com/DaGenix/rust-crypto/blob/master/src/sha2.rs on the same platform. I have done no more testing than that.

Rust-proper classes PPC32 as a "Tier 2" platform. This means test failures on these platforms are blocking, and Mozilla performs releases for PPC32. That said, actually exploring running Rust on a PPC32 test box (G4 Mac Mini) I quickly encountered some catastrophic cargo failures. This was fixed by changing the Rust build system to target powerpc instead of power4 (rust-lang/rust#41080). Even after this was corrected, I'm still experiencing problems building Rust code natively on PPC32. Cross-compiling works fine.

The specific algorithm I'd like to have PPC32 acceleration for at the moment is SHA-512. AES acceleration might be nice as well. (Note: My particular platform provides hardware acceleration for both of these primitives, however it requires using a batch-oriented asynchronous message protocol and pipelining operations for efficiency. I'd like to avoid that in the short term)

I'd be interested in immediately contributing PPC32 acceleration for SHA-512, which I think I mostly have ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions