- 26 10月, 2023 40 次提交
-
-
由 Phoebe Chen 提交于
Support zvbb-zvkned based rvv AES-128/192/256-CTR encryption. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
This patch supports SHA-512, SHA-512/224, SHA-512/256 on platforms with vlen greater than 128, Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
Keep SHA-256 constant values in registers to save the loading time. Move the constant loading for sha256 into a separate subroutine. By creating a dedicated sub routine for loading sha256 constants, the code can be made more modular and easier to modify in the future. Relaxing the SHA256 constraint, zvknhb also supports SHA256. Simplify the H and mask initialization flows. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Jerry Shih 提交于
Use rvv and zvbb extensions for CHACHA20 cipher. Signed-off-by: NJerry Shih <jerry.shih@sifive.com> Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
To enhance test coverage for AES-CBC mode, we provided longer additional test patterns for AES-CBC testing. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
Replace old CBC implementation with optimized AES-128/192/256-CBC in this patch. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
To accelerate the performance of the AES-128/192/256-CBC block cipher encryption, we used the vaesz, vaesem and vaesef instructions, which implement a single round of AES encryption. Similarly, to optimize the performance of AES-128/192/256-CBC block cipher decryption, we have utilized the vaesz, vaesdm, and vaesdf instructions, which facilitate a single round of AES decryption. Furthermore, we optimize the key and initialization vector (IV) step by keeping the rounding key in vector registers. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Jerry Shih 提交于
https://github.com/riscv/riscv-crypto/blob/c8ddeb7e64a3444dda0438316af1238aeed72041/doc/vector/riscv-crypto-vector-zvkb.adoc Create `RISCV_HAS_ZVKB()` macro. Use zvkb for SM4 instead of zvbb. Use zvkb for ghash instead of zvbb. We could just use the zvbb's subset `zvkb` for flexibility. Signed-off-by: NJerry Shih <jerry.shih@sifive.com> Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
Interleave key loading and aes decrypt computing for single block aes. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
Interleave key loading and aes encrypt computing for single block aes. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
Added helper functions and opcode encoding functions in riscv.pm perl module to avoid pointless code duplication. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Phoebe Chen 提交于
Changed "mutiple" to "multiple" for improved clarity and correctness. Signed-off-by: NPhoebe Chen <phoebe.chen@sifive.com> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Ard Biesheuvel 提交于
Even though the RISC-V vector instructions only support AES-128 and AES-256 for key generation, the round instructions themselves can easily be used to implement AES-192 too - we just need to fallback to the generic key generation routines in this case. Note that the vector instructions use the encryption key schedule (but in reverse order) so we need to generate the encryption key schedule even when doing decryption using the vector instructions. Signed-off-by: NArd Biesheuvel <ardb@google.com> Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Charalampos Mitrodimas 提交于
The upcoming RISC-V vector crypto extensions feature a Zvksh extension, that provides SM3-specific istructions. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NCharalampos Mitrodimas <charalampos.mitrodimas@vrull.eu> Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Christoph Müllner 提交于
The upcoming RISC-V vector crypto extensions feature a Zvksed extension, that provides SM4-specific instructions. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Charalampos Mitrodimas 提交于
The upcoming RISC-V vector crypto extensions feature a Zvknhb extension, that provides sha512-specific istructions. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NCharalampos Mitrodimas <charalampos.mitrodimas@vrull.eu> Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Charalampos Mitrodimas 提交于
Currently, architectures have to decide if they want the C code or an arch-specific implementation. Let's add a macro, that allows to keep the C code even if SHA512_ASM is defined (but rename it from sha512_block_data_order to sha512_block_data_order_c). The macro INCLUDE_C_SHA512 can be used by architectures, that want the C code as fallback code. Signed-off-by: NCharalampos Mitrodimas <charalampos.mitrodimas@vrull.eu> Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Charalampos Mitrodimas 提交于
The upcoming RISC-V vector crypto extensions feature a Zvknha extension, that provides sha256-specific instructions. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NCharalampos Mitrodimas <charalampos.mitrodimas@vrull.eu> Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Charalampos Mitrodimas 提交于
Currently, architectures have to decide if they want the C code or an arch-specific implementation. Let's add a macro, that allows to keep the C code even if SHA256_ASM is defined (but rename it from sha256_block_data_order to sha256_block_data_order_c). The macro INCLUDE_C_SHA256 can be used by architectures, that want the C code as fallback code. Signed-off-by: NCharalampos Mitrodimas <charalampos.mitrodimas@vrull.eu> Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Christoph Müllner 提交于
The upcoming RISC-V vector crypto extensions provide the Zvkned extension, that provides a AES-specific instructions. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Christoph Müllner 提交于
The upcoming RISC-V vector crypto extensions feature a Zvkg extension, that provides a vghmac.vv instruction. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Christoph Müllner 提交于
The RISC-V vector crypto extensions features a Zvbc extension that provides a carryless multiplication ('vclmul.vv') instruction. This patch provides an implementation that utilizes this extension if available. Tested on QEMU and no regressions observed. Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Christoph Müllner 提交于
The RISC-V vector extension comes with an implementation-defined number of bits per vector register (VLEN), which can be read out at run-time using the CSR 'vlenb' (which returns VLEN/8) followed by a multiplication by 8 (to convert bytes to bits). This patch introduces a RISC-V capability 'V' to specify the availability of the vector extension. If this extension is found at run-time, then we read out VLEN as described above and cache it. Caching ensures that we only read the CSR once at startup. This is necessary because reading out CSR can be expensive (e.g. if CSR readout is implemented using trap-and-emulate). Follow-up patches can make use of VLEN and chose the best strategy based on the available length of the vector registers. Signed-off-by: NChristoph Müllner <christoph.muellner@vrull.eu> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21923)
-
由 Damian Hobson-Garcia 提交于
Calling X509_NAME_print_ex with XN_FLAG_COMPAT falls back to calling X509_NAME_print(). The obase parameter to X509_NAME_print() is not used, so setting it to a different value has no effect. Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NTodd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19963)
-
由 Damian Hobson-Garcia 提交于
Similar to the bug fixed in 02db7354 (Fix bug in X509_print_ex). The error return value from X509_NAME_print_ex() is different depending on whether the flags are XN_FLAG_COMPAT or not. Apply a similar fix to what was done for X509_print_ex here as well. Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NTodd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19963)
-
由 Damian Hobson-Garcia 提交于
The X509_FLAG_COMPAT constant is defined as a value of the X509_print_ex() cflags argument, and so it should not be used to compare against values for use with X509_NAME_print flags. Use XN_FLAG_COMPAT, which has the same value, instead. Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NTodd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19963)
-
由 Daiki Ueno 提交于
While RFC 5705 implies that the maximum length of context for exporters to be 65535 bytes as the length is embedded in uint16, the current implementation enforces much smaller limit, which is less than 1024 bytes. This removes the restriction by dynamically allocating memory. Signed-off-by: NDaiki Ueno <dueno@redhat.com> Reviewed-by: NTodd Short <todd.short@me.com> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22465)
-
由 Matthias St. Pierre 提交于
Reviewed-by: NMatt Caswell <matt@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NTom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22450)
-
由 atishkov 提交于
Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22470)
-
由 atishkov 提交于
ssl_lib: added pointer SSL and SSL_CONNECTION check to NULL before dereferencing it in ossl_ctrl_internal() Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22470)
-
由 atishkov 提交于
ssl_lib: added pointer SSL and SSL_CONNECTION check to NULL before dereferencing it in ossl_ctrl_internal() Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22470)
-
由 atishkov 提交于
Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22470)
-
由 Todd Short 提交于
Fix #22367 Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22383)
-
由 trigpolynom 提交于
Replace the random suffix with a counter, to make the build reproducible. Fixes #20954 Reviewed-by: NRichard Levitte <levitte@openssl.org> Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: NTom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22415)
-
由 Tomas Mraz 提交于
Test case amended from code initially written by Bernd Edlinger. Fixes #21110 Reviewed-by: NDmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22421)
-
由 James Muir 提交于
Reviewed-by: NRichard Levitte <levitte@openssl.org> Reviewed-by: NMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22446)
-
由 Khem Raj 提交于
GCC toolchains on linux are not able to build libcrypto without linking to libatomic as it does not have all needed atomics implemented as intrinsics Fixes errors like | ld: ./libcrypto.so: undefined reference to `__atomic_is_lock_free' CLA: trivial Signed-off-by: NKhem Raj <raj.khem@gmail.com> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22460)
-
由 Alexey Fofanov 提交于
Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> Reviewed-by: NHugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22504) (cherry picked from commit f0d88b4d070426493749cfd6b657e42dc3c2f5dd)
-
由 Hugo Landau 提交于
Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NTim Hudson <tjh@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22487)
-
由 Hugo Landau 提交于
Reviewed-by: NTomas Mraz <tomas@openssl.org> Reviewed-by: NTim Hudson <tjh@openssl.org> Reviewed-by: NPaul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22487)
-