OPENSSL_RISCVCAP(3ossl)

πŸ’– OPENSSL_RISCVCAP πŸ’– (that's the OPENSSL_RISCVCAP(3ossl) page bestie, section 3, OpenSSL manual)


✨ NAME ✨

OPENSSL_riscvcap β€” the RISC-V processor capabilities vector πŸ¦‹


🌸 SYNOPSIS 🌸

env OPENSSL_riscvcap=... <application>

πŸ’… DESCRIPTION πŸ’…

okay so. libcrypto speaks RISC-V instruction set extensions, and every single one of those extensions gets its own little name in the capabilities vector. cute right?

On Linux, when libcrypto gets initialized, whatever the RISC-V Hardware Probing syscall (hwprobe) hands back gets stored in that vector. Anywhere else? Every capability is just disabled. no cap, that's the whole vibe. πŸ’€

Now β€” the fun part. If you wanna override which instructions your app gets to use, you set the OPENSSL_riscvcap environment variable before you start the application. do it before. not after. πŸ™ˆ

The variable looks like the RISC-V ISA string from the RISC-V Instruction Set Manual. It's case insensitive β€” lowercase, uppercase, doesn't matter, she's flexible πŸ’β€β™€οΈ. BUT (and this is the iconic plot twist) because the environment variable parser inside libcrypto has limits, an extension must be prefixed with an underscore to even be recognizable. And yes, that applies to the Vector extension too.

OPENSSL_riscvcap="rv64gc_v_zba_zbb_zbs..."
⚠️ Heads up bestie: extension implication is currently not implemented. So if you pass "rv64gc_b" as the environment variable, zba/zbb/zbs will not be implied in the capability vector. they simply do not show up. periodt.

Currently only these extensions are recognized:

  • ZBA β€” Address Generation
    • Could be detected using hwprobe for Linux kernel >= 6.5
  • ZBB β€” Basic bit-manipulation
    • Could be detected using hwprobe for Linux kernel >= 6.5
  • ZBC β€” Carry-less multiplication
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZBS β€” Single-bit instructions
    • Could be detected using hwprobe for Linux kernel >= 6.5
  • ZBKB β€” Bit-manipulation for Cryptography
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZBKC β€” Carry-less multiplication for Cryptography
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZBKX β€” Crossbar permutations
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZKND β€” NIST Suite: AES Decryption
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZKNE β€” NIST Suite: AES Encryption
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZKNH β€” NIST Suite: Hash Function Instructions
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZKSED β€” ShangMi Suite: SM4 Block Cipher Instructions
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZKSH β€” ShangMi Suite: SM3 Hash Function Instructions
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZKR β€” Entropy Source Extension
  • ZKT β€” Data Independent Execution Latency
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • V β€” Vector Extension for Application Processors
    • Could be detected using hwprobe for Linux kernel >= 6.5
  • ZVBB β€” Vector Basic Bit-manipulation
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVBC β€” Vector Carryless Multiplication
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKB β€” Vector Cryptography Bit-manipulation
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKG β€” Vector GCM/GMAC
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKNED β€” NIST Suite: Vector AES Block Cipher
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKNHA β€” NIST Suite: Vector SHA-2 Secure Hash
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKNHB β€” NIST Suite: Vector SHA-2 Secure Hash
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKSED β€” ShangMi Suite: SM4 Block Cipher
    • Could be detected using hwprobe for Linux kernel >= 6.8
  • ZVKSH β€” ShangMi Suite: SM3 Secure Hash
    • Could be detected using hwprobe for Linux kernel >= 6.8

🫢 RETURN VALUES 🫢

Not available. that's it. nothing to see here bestie, moving on πŸ’œ


πŸ”₯ EXAMPLES πŸ”₯

Check currently detected capabilities πŸ‘‘

$ openssl info -cpusettings
OPENSSL_riscvcap=RV64GC_ZBA_ZBB_ZBC_ZBS_V vlen:256
πŸ“ Note: the first word in the displayed capabilities is the RISC-V base architecture value, which is derived from the compiler configuration. So it is therefore not overridable by the environment variable. And when the V extension is given, the riscv_vlen value is always displayed β€” there is no way to override the riscv_vlen by the environment variable. it's giving unbothered, immovable, booked and busy πŸ’…

Disables all instruction set extensions:

export OPENSSL_riscvcap="rv64gc"

Only enable the vector extension:

export OPENSSL_riscvcap="rv64gc_v"

Copyright 2024 The OpenSSL Project Authors. All Rights Reserved. 🌈

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page bestie, mwah πŸ’‹ this was OpenSSL 3.5.9, dated 2026-09-29 β€” OPENSSL_RISCVCAP(3ossl), slay, bye πŸŽ€βœ¨

πŸ“¦ where this page comes from