OPENSSL_S390XCAP(3ossl)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 15.1

✨ OPENSSL_S390XCAP(3ossl) ✨

Okay bestie, so this page is literally all about OPENSSL_s390xcap β€” that's the IBM z processor capabilities vector. No cap, that's the whole vibe. It's giving "main character energy" for mainframe crypto, and I'm obsessed. πŸ’…


✨ SYNOPSIS ✨

Here's how you actually run it:

env OPENSSL_s390xcap=... <application>

✨ DESCRIPTION ✨

Okay so, libcrypto supports all these z/Architecture instruction set extensions. These extensions are denoted by individual bits in the capabilities vector. When libcrypto is initialized, the bits returned by the STFLE instruction and by the QUERY functions are stored in the vector. Periodt.

To change the set of instructions available to an application, you can set the OPENSSL_s390xcap environment variable before you start the application. After initialization, the capability vector is ANDed bitwise with a mask which is derived from the environment variable. (Yes, literally bitwise AND, not a vibe check. An actual bitwise operation. Slay.)

The environment variable is a semicolon-separated list of tokens which is processed from left to right (whitespace is ignored):

OPENSSL_s390xcap="<tok1>;<tok2>;..."

There are four types of tokens:

  • <string> β€” The name of a processor generation. A bit in the environment variable's mask is set to one if and only if the specified processor generation implements the corresponding instruction set extension. Possible values are z900, z990, z9, z10, z196, zEC12, z13, z14, z15, and z16. (Like a little processor generation name-drop. Iconic.)
  • <string>:<mask>:<mask> β€” The name of an instruction followed by two 64-bit masks. The part of the environment variable's mask corresponding to the specified instruction is set to the specified 128-bit mask. Possible values are kimd, klmd, km, kmc, kmac, kmctr, kmo, kmf, prno, kma, pcc and kdsa.
  • stfle:<mask>:<mask>:<mask> β€” Store-facility-list-extended (stfle) followed by three 64-bit masks. The part of the environment variable's mask corresponding to the stfle instruction is set to the specified 192-bit mask.
  • nocex β€” Deactivate modular exponentiation and CRT operation offloading to Crypto Express Adapters. (Like, turn off the offloading. Done.)

The 64-bit masks are specified in hexadecimal notation. The 0x prefix is optional. Prefix a mask with a tilde, ~, to denote a bitwise NOT operation. (That's the "nah, flip it" vibe.)

The following is a list of significant bits for each instruction. Colon rows separate the individual 64-bit masks. The bit numbers in the first column are consistent with [1], that is, 0 denotes the leftmost bit and the numbering is continuous across 64-bit mask boundaries.

stfle

  • Bit # 17, Mask 1<<46 β€” message-security assist
  • Bit # 25, Mask 1<<38 β€” store-clock-fast facility

  • Bit # 76, Mask 1<<51 β€” message-security assist extension 3
  • Bit # 77, Mask 1<<50 β€” message-security assist extension 4
  • Bit # 86, Mask 1<<41 β€” message-security-assist extension 12

  • Bit # 129, Mask 1<<62 β€” vector facility
  • Bit # 134, Mask 1<<57 β€” vector packed decimal facility
  • Bit # 135, Mask 1<<56 β€” vector enhancements facility 1
  • Bit # 146, Mask 1<<45 β€” message-security assist extension 8
  • Bit # 155, Mask 1<<36 β€” message-security assist extension 9

kimd

  • Bit # 1, Mask 1<<62 β€” KIMD-SHA-1
  • Bit # 2, Mask 1<<61 β€” KIMD-SHA-256
  • Bit # 3, Mask 1<<60 β€” KIMD-SHA-512
  • Bit # 32, Mask 1<<31 β€” KIMD-SHA3-224
  • Bit # 33, Mask 1<<30 β€” KIMD-SHA3-256
  • Bit # 34, Mask 1<<29 β€” KIMD-SHA3-384
  • Bit # 35, Mask 1<<28 β€” KIMD-SHA3-512
  • Bit # 36, Mask 1<<27 β€” KIMD-SHAKE-128
  • Bit # 37, Mask 1<<26 β€” KIMD-SHAKE-256

  • Bit # 65, Mask 1<<62 β€” KIMD-GHASH

klmd

  • Bit # 32, Mask 1<<31 β€” KLMD-SHA3-224
  • Bit # 33, Mask 1<<30 β€” KLMD-SHA3-256
  • Bit # 34, Mask 1<<29 β€” KLMD-SHA3-384
  • Bit # 35, Mask 1<<28 β€” KLMD-SHA3-512
  • Bit # 36, Mask 1<<27 β€” KLMD-SHAKE-128
  • Bit # 37, Mask 1<<26 β€” KLMD-SHAKE-256

km

  • Bit # 18, Mask 1<<45 β€” KM-AES-128
  • Bit # 19, Mask 1<<44 β€” KM-AES-192
  • Bit # 20, Mask 1<<43 β€” KM-AES-256
  • Bit # 50, Mask 1<<13 β€” KM-XTS-AES-128
  • Bit # 52, Mask 1<<11 β€” KM-XTS-AES-256

  • Bit # 82, Mask 1<<45 β€” KM-XTS-AES-128-MSA10
  • Bit # 84, Mask 1<<43 β€” KM-XTS-AES-256-MSA10

kmc

  • Bit # 18, Mask 1<<45 β€” KMC-AES-128
  • Bit # 19, Mask 1<<44 β€” KMC-AES-192
  • Bit # 20, Mask 1<<43 β€” KMC-AES-256

kmac

  • Bit # 18, Mask 1<<45 β€” KMAC-AES-128
  • Bit # 19, Mask 1<<44 β€” KMAC-AES-192
  • Bit # 20, Mask 1<<43 β€” KMAC-AES-256

  • Bit # 112, Mask 1<<15 β€” KMAC-SHA-224
  • Bit # 113, Mask 1<<14 β€” KMAC-SHA-256
  • Bit # 114, Mask 1<<13 β€” KMAC-SHA-384
  • Bit # 115, Mask 1<<12 β€” KMAC-SHA-512

kmctr

There are literally no bits listed here. Just a colon row. The vibe is "nothing to see here, bestie." 🫢


kmo

  • Bit # 18, Mask 1<<45 β€” KMO-AES-128
  • Bit # 19, Mask 1<<44 β€” KMO-AES-192
  • Bit # 20, Mask 1<<43 β€” KMO-AES-256

kmf

  • Bit # 18, Mask 1<<45 β€” KMF-AES-128
  • Bit # 19, Mask 1<<44 β€” KMF-AES-192
  • Bit # 20, Mask 1<<43 β€” KMF-AES-256

prno

No bits listed. Just a colon. It's giving minimalism. πŸ’€


kma

  • Bit # 18, Mask 1<<45 β€” KMA-GCM-AES-128
  • Bit # 19, Mask 1<<44 β€” KMA-GCM-AES-192
  • Bit # 20, Mask 1<<43 β€” KMA-GCM-AES-256

pcc

  • Bit # 64, Mask 1<<63 β€” PCC-Scalar-Multiply-P256
  • Bit # 65, Mask 1<<62 β€” PCC-Scalar-Multiply-P384
  • Bit # 66, Mask 1<<61 β€” PCC-Scalar-Multiply-P521
  • Bit # 72, Mask 1<<55 β€” PCC-Scalar-Multiply-Ed25519
  • Bit # 73, Mask 1<<54 β€” PCC-Scalar-Multiply-Ed448
  • Bit # 80, Mask 1<<47 β€” PCC-Scalar-Multiply-X25519
  • Bit # 81, Mask 1<<46 β€” PCC-Scalar-Multiply-X448

kdsa

  • Bit # 1, Mask 1<<62 β€” KDSA-ECDSA-Verify-P256
  • Bit # 2, Mask 1<<61 β€” KDSA-ECDSA-Verify-P384
  • Bit # 3, Mask 1<<60 β€” KDSA-ECDSA-Verify-P521
  • Bit # 9, Mask 1<<54 β€” KDSA-ECDSA-Sign-P256
  • Bit # 10, Mask 1<<53 β€” KDSA-ECDSA-Sign-P384
  • Bit # 11, Mask 1<<52 β€” KDSA-ECDSA-Sign-P521
  • Bit # 32, Mask 1<<31 β€” KDSA-EdDSA-Verify-Ed25519
  • Bit # 36, Mask 1<<27 β€” KDSA-EdDSA-Verify-Ed448
  • Bit # 40, Mask 1<<23 β€” KDSA-EdDSA-Sign-Ed25519
  • Bit # 44, Mask 1<<19 β€” KDSA-EdDSA-Sign-Ed448

✨ RETURN VALUES ✨

Not available. Like, it's literally not a thing here. Sorry bestie. πŸ™ˆ


✨ EXAMPLES ✨

Disables all instruction set extensions which the z196 processor does not implement:

OPENSSL_s390xcap="z196"

Disables the vector facility:

OPENSSL_s390xcap="stfle:~0:~0:~0x4000000000000000"

Disables the KM-XTS-AES and the KIMD-SHAKE function codes:

OPENSSL_s390xcap="km:~0x2800:~0;kimd:~0xc000000:~0"

✨ SEE ALSO ✨

  • [1] z/Architecture Principles of Operation, SA22-7832-12

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


Okay bestie, that's the whole page! This masterpiece is brought to you by OpenSSL version 3.5.6, dated 2026-04-07. Periodt. πŸ’–βœ¨ No cap, you're now fully caught up on the z processor capabilities vector. Go slay some mainframe crypto. πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from