|
| 1 | +# [RustCrypto]: CPU Intrinsics |
| 2 | + |
| 3 | +[![Crate][crate-image]][crate-link] |
| 4 | +[![Docs][docs-image]][docs-link] |
| 5 | +![Apache 2.0/MIT Licensed][license-image] |
| 6 | +![MSRV][rustc-image] |
| 7 | +[![Build Status][build-image]][build-link] |
| 8 | + |
| 9 | +High-level wrappers for architecture-specific CPU intrinsics which are not |
| 10 | +yet provided via [`core::arch`], implemented using inline assembly. |
| 11 | + |
| 12 | +[Documentation] |
| 13 | + |
| 14 | +## About |
| 15 | + |
| 16 | +Certain CPU instructions which are important for cryptographic applications |
| 17 | +are difficult to emit from LLVM due to various complicating factors. |
| 18 | + |
| 19 | +This crate provides high-level architecture-specific wrappers for these |
| 20 | +instructions built on stable inline assembly. No attempts at abstraction |
| 21 | +are made, just raw access to specific CPU instructions which are guaranteed |
| 22 | +to be emitted verbatim and not optimized away or otherwise rewritten by the |
| 23 | +compiler. |
| 24 | + |
| 25 | +## Supported Instructions |
| 26 | + |
| 27 | +### `x86` (32-bit) |
| 28 | + |
| 29 | +- `cmovz` (a.k.a. `cmove`) |
| 30 | +- `cmovnz` (a.k.a. `cmovne`) |
| 31 | + |
| 32 | +### `x86_64` |
| 33 | + |
| 34 | +- `cmovz` (a.k.a. `cmove`) |
| 35 | +- `cmovnz` (a.k.a. `cmovne`) |
| 36 | + |
| 37 | +## Minimum Supported Rust Version |
| 38 | + |
| 39 | +Rust **1.59** or newer. |
| 40 | + |
| 41 | +In the future, we reserve the right to change MSRV (i.e. MSRV is out-of-scope |
| 42 | +for this crate's SemVer guarantees), however when we do it will be accompanied by |
| 43 | +a minor version bump. |
| 44 | + |
| 45 | +## License |
| 46 | + |
| 47 | +Licensed under either of: |
| 48 | + |
| 49 | +* [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) |
| 50 | +* [MIT license](http://opensource.org/licenses/MIT) |
| 51 | + |
| 52 | +at your option. |
| 53 | + |
| 54 | +### Contribution |
| 55 | + |
| 56 | +Unless you explicitly state otherwise, any contribution intentionally submitted |
| 57 | +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be |
| 58 | +dual licensed as above, without any additional terms or conditions. |
| 59 | + |
| 60 | +[//]: # (badges) |
| 61 | + |
| 62 | +[crate-image]: https://img.shields.io/crates/v/crypto-intrinsics.svg |
| 63 | +[crate-link]: https://crates.io/crates/crypto-intrinsics |
| 64 | +[docs-image]: https://docs.rs/crypto-intrinsics/badge.svg |
| 65 | +[docs-link]: https://docs.rs/crypto-intrinsics/ |
| 66 | +[license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg |
| 67 | +[rustc-image]: https://img.shields.io/badge/rustc-1.51+-blue.svg |
| 68 | +[build-image]: https://github.com/RustCrypto/utils/actions/workflows/crypto-intrinsics.yml/badge.svg |
| 69 | +[build-link]: https://github.com/RustCrypto/utils/actions/workflows/crypto-intrinsics.yml |
| 70 | + |
| 71 | +[//]: # (general links) |
| 72 | + |
| 73 | +[RustCrypto]: https://github.com/RustCrypto |
| 74 | +[Documentation]: https://docs.rs/crypto-intrinsics |
| 75 | +[`core::arch`]: https://doc.rust-lang.org/core/arch/index.html |
0 commit comments