OPENSSL_RISCVCAP(3SSL)

πŸ’– OPENSSL_RISCVCAP πŸ’–

okay bestie, welcome to OPENSSL_riscvcap(3SSL), aka the page in the OpenSSL manual all about the RISC-V processor capabilities vector. no cap, it's shorter than it looks. let's go πŸ¦‹


✨ NAME ✨

OPENSSL_riscvcap β€” the RISC-V processor capabilities vector 🌈


✨ SYNOPSIS ✨

env OPENSSL_riscvcap=... <application>

✨ DESCRIPTION ✨

so like, libcrypto supports RISC-V instruction set extensions, periodt. each one of those extensions gets its own little name in the capabilities vector πŸ‘‘

on Linux, when libcrypto initializes, whatever the RISC-V Hardware Probing syscall (hwprobe) hands back gets stored in the vector. on anything else? every single capability is disabled. it's giving nothing. πŸ’€

but bestie, you can override the set of instructions an application gets to see β€” just set the OPENSSL_riscvcap environment variable before you start the application 🫢

this env var is lowkey similar to the RISC-V ISA string from the RISC-V Instruction Set Manual, and it's case insensitive (iconic of it). BUT β€” because the environment variable parser inside libcrypto has limits, an extension has to be prefixed with an underscore to be recognizable. yes, this applies to the Vector extension too πŸ™ˆ

 OPENSSL_riscvcap="rv64gc_v_zba_zbb_zbs..."
⚠️ heads up: extension implication is currently not implemented. so if you pass "rv64gc_b" as the environment variable, zba/zbb/zbs would not get implied in the capability vector. no freebies, fr fr.

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, that's the section 😭


✨ EXAMPLES ✨

okay so first, checking what capabilities are currently detected πŸ”

$ 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, and it's derived from the compiler configuration β€” which means it is not overridable by the environment variable, bestie. 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 either. it is what it is πŸ’…

disables all instruction set extensions (going full minimalist, we love a clean slate) πŸŽ€

export OPENSSL_riscvcap="rv64gc"

only enable the vector extension (main character energy only) ⭐

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>.


that's the whole page babes 🫢 this was version 4.0.3, dated 2026-09-29, and yes it's giving OpenSSL energy the entire time. go forth and configure ur RISC-V extensions, u absolute icon πŸ‘‘πŸ’–βœ¨

πŸ“¦ where this page comes from