SleelaDoc API
HTML documentation for the SLeeLa standard library (/lib)
Home › Packages › crypto

Package crypto

This package contains 25 source unit(s) defining 25 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

SLAes #sleela 2.5 (lib/crypto/SLAes.sleela)

SLAes class

Defines the SLeeLa standard-library type SLAes used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
BLOCK_BYTESstatic final int BLOCK_BYTES = 16AES block size in bytes (FIPS 197).
algorithmString algorithmNo description in source.
keyBitsint keyBits128, 192, or 256
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
keySetint keySet1 once a valid key size has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
keySizeint keySize(int b)key_bits must be 128, 192, or 256 (FIPS 197).
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()active() requires enable + a valid algorithm + a valid key size + a ready backend.
blockSizeint blockSize()No description in source.
encryptBlockint encryptBlock(String in)Single-block ECB primitive (FIPS 197). Models slc_aes_encrypt_block()/slc_aes_decrypt_block().
decryptBlockint decryptBlock(String in)No description in source.
securityNoteString securityNote()No description in source.

SLAesGcm #sleela 2.5 (lib/crypto/SLAesGcm.sleela)

SLAesGcm class

Defines the SLeeLa standard-library type SLAesGcm used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2tag verification failed on decrypt
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
RECOMMENDED_IV_BYTESstatic final int RECOMMENDED_IV_BYTES = 12SP 800-38D recommends a 96-bit (12-byte) nonce and a 16-byte tag.
MAX_TAG_BYTESstatic final int MAX_TAG_BYTES = 16No description in source.
algorithmString algorithmNo description in source.
keyBitsint keyBits128, 192, or 256
tagBytesint tagBytes1..16 (16 recommended)
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
keySetint keySet1 once a valid key size has been accepted
tagSetint tagSet1 once a valid tag size has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
keySizeint keySize(int b)key_bits must be 128, 192, or 256.
tagSizeint tagSize(int t)tag_len must be 1..16 (SP 800-38D); 16 recommended.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
encryptint encrypt(String iv, int ivLen, String aad, String pt)AEAD encrypt. Models slc_aes_gcm_encrypt(); validates the nonce before dispatch.
decryptint decrypt(String iv, int ivLen, String aad, String ct, String tag)AEAD decrypt. Models slc_aes_gcm_decrypt(); a bad tag yields ERR_AUTH and the native layer releases no plaintext.
securityNoteString securityNote()No description in source.

SLCertificate #sleela 2.5 (lib/crypto/SLCertificate.sleela)

SLCertificate class

Defines the SLeeLa standard-library type SLCertificate used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2certificate signature did not verify
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmsignature algorithm, e.g. "ML-DSA"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
loadedint loaded1 once a certificate has been parsed
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
loadint load(String encoded)Parse an encoded certificate (DER/PEM).
isLoadedboolean isLoaded()No description in source.
verifyAgainstint verifyAgainst(String issuerPublicKey)Verify this certificate's signature against an issuer public key. OK = valid, ERR_AUTH = bad signature.
securityNoteString securityNote()No description in source.

SLCertificateStore #sleela 2.5 (lib/crypto/SLCertificateStore.sleela)

SLCertificateStore class

Defines the SLeeLa standard-library type SLCertificateStore used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmNo description in source.
countint countnumber of certificates held
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
sizeint size()No description in source.
addint add(String encoded)Add a parsed certificate to the store.
clearint clear()Clear all held certificates.
securityNoteString securityNote()No description in source.

SLCipher #sleela 2.5 (lib/crypto/SLCipher.sleela)

SLCipher class

Defines the SLeeLa standard-library type SLCipher used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithm"AES" | "AES-GCM"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
encryptint encrypt(String in)No description in source.
decryptint decrypt(String in)No description in source.
securityNoteString securityNote()No description in source.

SLCipherContext #sleela 2.5 (lib/crypto/SLCipherContext.sleela)

SLCipherContext class

Defines the SLeeLa standard-library type SLCipherContext used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmNo description in source.
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
startedint started1 between init() and final()
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
initint init()Streaming lifecycle: init -> update* -> final.
updateint update(String chunk)No description in source.
finalizeint finalize()No description in source.
securityNoteString securityNote()No description in source.
serviceNameString serviceName()---- common service contract (identity) ----------------------------- SLCipherContext conforms to the SLService lifecycle CONCEPT (configure -> enable/active -> init/update/final -> disable), but is NOT an SLPluginService: it is a cipher context, not a plugin-registry, and its result codes (OK/ERR_PARAM/ERR_AUTH/ERR_UNIMPL) are cryptography-specific and deliberately NOT the shared SLServiceResult vocabulary, so a caller is never misled about an auth failure. serviceName() gives status surfaces a uniform handle across all services.

SLCipherKey #sleela 2.5 (lib/crypto/SLCipherKey.sleela)

SLCipherKey class

Defines the SLeeLa standard-library type SLCipherKey used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithme.g. "AES"
keyBitsint keyBits128, 192, or 256
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
keySetint keySet1 once a valid key size has been accepted
loadedint loaded1 once key material has been loaded
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
keySizeint keySize(int b)AES key sizes only (FIPS 197).
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
loadint load(String keyMaterial)Load raw key bytes and build the native key schedule.
isLoadedboolean isLoaded()No description in source.
wipeint wipe()Best-effort zeroization of the native key schedule.
securityNoteString securityNote()No description in source.

SLDigest #sleela 2.5 (lib/crypto/SLDigest.sleela)

SLDigest class

Defines the SLeeLa standard-library type SLDigest used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmNo description in source.
outBytesint outBytesdigest length for the selected hash
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported hash name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)Accept any hash the native layer implements, and record its digest length.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
digestLengthint digestLength()No description in source.
digestint digest(String data)No description in source.
securityNoteString securityNote()No description in source.

SLHkdf #sleela 2.5 (lib/crypto/SLHkdf.sleela)

SLHkdf class

Defines the SLeeLa standard-library type SLHkdf used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
MAX_OUT_BYTESstatic final int MAX_OUT_BYTES = 8160RFC 5869 caps expand output at 255 * HashLen; HashLen is 32 for SHA-256. 255 * 32
algorithmString algorithmNo description in source.
outBytesint outBytesrequested output keying material length
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
outSetint outSet1 once a valid output size has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
outputSizeint outputSize(int n)outputSize must be in 1 .. 255*HashLen (RFC 5869).
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
outputLengthint outputLength()No description in source.
deriveint derive(String salt, String ikm, String info)Extract-and-expand in one call. Models slc_hkdf_sha256(salt, ikm, info -> okm).
securityNoteString securityNote()No description in source.

SLHmac #sleela 2.5 (lib/crypto/SLHmac.sleela)

SLHmac class

Defines the SLeeLa standard-library type SLHmac used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2MAC verification failed
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
SHA256_MAC_LENstatic final int SHA256_MAC_LEN = 32No description in source.
SHA512_MAC_LENstatic final int SHA512_MAC_LEN = 64No description in source.
algorithmString algorithmNo description in source.
outBytesint outBytesMAC length for the selected hash
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)Accept only the two HMAC variants the native layer provides.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
macLengthint macLength()No description in source.
signint sign(String key, String msg)Compute a MAC over msg with key. Models slc_hmac_sha256()/slc_hmac_sha512().
verifyint verify(String key, String msg, String mac)Verify a MAC. The native layer compares in constant time (slc_ct_equal); a mismatch yields ERR_AUTH.
securityNoteString securityNote()No description in source.

SLKey #sleela 2.5 (lib/crypto/SLKey.sleela)

SLKey class

Defines the SLeeLa standard-library type SLKey used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmNo description in source.
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
loadedint loaded1 once key material has been loaded
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
loadint load(String keyMaterial)No description in source.
isLoadedboolean isLoaded()No description in source.
wipeint wipe()No description in source.
securityNoteString securityNote()No description in source.

SLKeyDerivation #sleela 2.5 (lib/crypto/SLKeyDerivation.sleela)

SLKeyDerivation class

Defines the SLeeLa standard-library type SLKeyDerivation used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmNo description in source.
outBytesint outBytesrequested derived-key length
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
outSetint outSet1 once a valid output size has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)Only HKDF-SHA-256 is currently wired through the native layer.
outputSizeint outputSize(int n)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
outputLengthint outputLength()No description in source.
deriveint derive(String salt, String ikm, String info)No description in source.
securityNoteString securityNote()No description in source.

SLKeyPair #sleela 2.5 (lib/crypto/SLKeyPair.sleela)

SLKeyPair class

Defines the SLeeLa standard-library type SLKeyPair used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithm"ML-KEM" | "ML-DSA"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
generatedint generated1 once a key pair has been produced
backendint backend1 only once a real native implementation is linked

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
generateint generate()Generate a fresh key pair; surfaces ERR_UNIMPL while the PQ backend is pending.
isGeneratedboolean isGenerated()No description in source.
securityNoteString securityNote()No description in source.

SLMlDsa #sleela 2.5 (lib/crypto/SLMlDsa.sleela)

SLMlDsa class

Defines the SLeeLa standard-library type SLMlDsa used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2signature verification failed
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
parameterSetString parameterSet"ML-DSA-44" | "ML-DSA-65" | "ML-DSA-87"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported parameter set has been accepted
backendint backend1 only once a real native implementation is linked

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String p)Validate against the three FIPS 204 parameter sets named by CNSA 2.0.
bindBackendvoid bindBackend(int ready)The VM/OS bridge binding calls this with 1 only when a real ML-DSA implementation is present. It stays 0 while src/pq.c returns ERR_UNIMPL.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()active() reflects real usability: it is false while the PQ backend is pending.
keygenint keygen()Signature operations. Model slc_mldsa_keygen/sign/verify; they surface ERR_UNIMPL until the backend is vendored. verify returns ERR_AUTH on a bad signature.
signint sign(String secretKey, String msg)No description in source.
verifyint verify(String publicKey, String msg, String sig)No description in source.
securityNoteString securityNote()No description in source.

SLMlKem #sleela 2.5 (lib/crypto/SLMlKem.sleela)

SLMlKem class

Defines the SLeeLa standard-library type SLMlKem used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
parameterSetString parameterSet"ML-KEM-512" | "ML-KEM-768" | "ML-KEM-1024"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported parameter set has been accepted
backendint backend1 only once a real native implementation is linked

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String p)Validate against the three FIPS 203 parameter sets named by CNSA 2.0.
bindBackendvoid bindBackend(int ready)The VM/OS bridge binding calls this with 1 only when a real ML-KEM implementation is present. It stays 0 while src/pq.c returns ERR_UNIMPL.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()active() reflects real usability: it is false while the PQ backend is pending, so it cannot report ready for an unimplemented primitive.
keygenint keygen()KEM operations. Model slc_mlkem_keygen/encaps/decaps; they surface ERR_UNIMPL until the backend is vendored.
encapsulateint encapsulate(String publicKey)No description in source.
decapsulateint decapsulate(String secretKey, String ciphertext)No description in source.
securityNoteString securityNote()No description in source.

SLNationalSuite #sleela 2.5 (lib/crypto/SLNationalSuite.sleela)

SLNationalSuite class

Defines the SLeeLa standard-library type SLNationalSuite used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
suiteString suite"CNSA-1.0" | "CNSA-2.0"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported suite has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String s)Accept only the two named suites.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
membersString members()Classical members are implemented and KAT-verified in /crypto today.
pendingMembersString pendingMembers()The two CNSA 2.0 post-quantum members whose native backend is still pending (slc_mlkem_* / slc_mldsa_* return ERR_UNIMPL). Surfaced so callers can tell which roster entries are not yet usable.
memberReadyint memberReady(String name)1 if the named member is implemented and callable today, 0 if pending, ERR_PARAM if unknown.
securityNoteString securityNote()No description in source.

SLNonce #sleela 2.5 (lib/crypto/SLNonce.sleela)

SLNonce class

Defines the SLeeLa standard-library type SLNonce used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
GCM_NONCE_BYTESstatic final int GCM_NONCE_BYTES = 12AES-GCM recommends a 96-bit (12-byte) nonce (SP 800-38D).
algorithmString algorithme.g. "AES-GCM"
sizeBytesint sizeBytesrequested nonce length
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
sizeSetint sizeSet1 once a valid nonce size has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
sizeint size(int n)Nonce length must be positive; reject zero/negative sizes.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
nonceLengthint nonceLength()No description in source.
generateint generate()Draw a fresh random nonce of the configured size from the native CSPRNG.
securityNoteString securityNote()No description in source.

SLPrivateKey #sleela 2.5 (lib/crypto/SLPrivateKey.sleela)

SLPrivateKey class

Defines the SLeeLa standard-library type SLPrivateKey used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithm"ML-KEM" | "ML-DSA"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
loadedint loaded1 once a private key has been loaded
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
loadint load(String encoded)Import an encoded private key.
isLoadedboolean isLoaded()No description in source.
wipeint wipe()Best-effort zeroization of the native secret key material.
securityNoteString securityNote()No description in source.

SLPublicKey #sleela 2.5 (lib/crypto/SLPublicKey.sleela)

SLPublicKey class

Defines the SLeeLa standard-library type SLPublicKey used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithm"ML-KEM" | "ML-DSA"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
loadedint loaded1 once a public key has been loaded
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
loadint load(String encoded)Import an encoded public key.
isLoadedboolean isLoaded()No description in source.
exportint export()Export the encoded public key.
securityNoteString securityNote()No description in source.

SLSha256 #sleela 2.5 (lib/crypto/SLSha256.sleela)

SLSha256 class

Defines the SLeeLa standard-library type SLSha256 used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
DIGEST_LENstatic final int DIGEST_LEN = 32Native digest length for SHA-256.
algorithmString algorithmNo description in source.
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)Accept only the algorithm name this facade bridges to.
bindBackendvoid bindBackend(int ready)Declare native backend availability (set by the VM/OS bridge binding).
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()active() is only true when enabled, configured, AND the native backend is ready, so it cannot report usable while the computation path is unavailable.
digestLengthint digestLength()No description in source.
digestint digest(String data)One-shot hash over data. Models slc_sha256(); returns a status code.
securityNoteString securityNote()No description in source.

SLSha3 #sleela 2.5 (lib/crypto/SLSha3.sleela)

SLSha3 class

Defines the SLeeLa standard-library type SLSha3 used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
SHA3_256_DIGEST_LENstatic final int SHA3_256_DIGEST_LEN = 32Native digest lengths.
SHA3_512_DIGEST_LENstatic final int SHA3_512_DIGEST_LEN = 64No description in source.
algorithmString algorithmNo description in source.
outBytesint outBytesselected digest length (32 or 64)
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)Accept only the two variants this facade bridges to.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
digestLengthint digestLength()No description in source.
digestint digest(String data)One-shot hash over data. Models slc_sha3_256()/slc_sha3_512(); returns a status code.
securityNoteString securityNote()No description in source.

SLSha512 #sleela 2.5 (lib/crypto/SLSha512.sleela)

SLSha512 class

Defines the SLeeLa standard-library type SLSha512 used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
SHA384_DIGEST_LENstatic final int SHA384_DIGEST_LEN = 48Native digest lengths.
SHA512_DIGEST_LENstatic final int SHA512_DIGEST_LEN = 64No description in source.
algorithmString algorithmNo description in source.
outBytesint outBytesselected digest length (48 or 64)
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)Accept only the two variants this facade bridges to.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
digestLengthint digestLength()No description in source.
digestint digest(String data)One-shot hash over data. Models slc_sha384()/slc_sha512(); returns a status code.
securityNoteString securityNote()No description in source.

SLSignature #sleela 2.5 (lib/crypto/SLSignature.sleela)

SLSignature class

Defines the SLeeLa standard-library type SLSignature used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2No description in source.
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithm"ML-DSA"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 only once a real native implementation is linked

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
signint sign(String privateKey, String msg)Produce a signature over msg with the private key; ERR_UNIMPL while pending.
securityNoteString securityNote()No description in source.

SLTrustStore #sleela 2.5 (lib/crypto/SLTrustStore.sleela)

SLTrustStore class

Defines the SLeeLa standard-library type SLTrustStore used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2chain did not validate to a trust anchor
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithmNo description in source.
anchorsint anchorsnumber of trust anchors held
stateint state1 = enabled, 0 = disabled
configuredint configured1 once an algorithm name has been accepted
backendint backend1 when the native /crypto backend is linked and ready

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
anchorCountint anchorCount()No description in source.
addAnchorint addAnchor(String encoded)Install a trusted root/anchor certificate.
validateChainint validateChain(String leafEncoded)Validate a certificate chain to a trust anchor. OK = trusted, ERR_AUTH = did not chain to an anchor.
securityNoteString securityNote()No description in source.

SLVerifier #sleela 2.5 (lib/crypto/SLVerifier.sleela)

SLVerifier class

Defines the SLeeLa standard-library type SLVerifier used within the crypto library family.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
OKstatic final int OK = 0Status codes mirror slcrypto_status in crypto/include/slcrypto.h.
ERR_PARAMstatic final int ERR_PARAM = -1No description in source.
ERR_AUTHstatic final int ERR_AUTH = -2signature did not verify
ERR_UNIMPLstatic final int ERR_UNIMPL = -3No description in source.
algorithmString algorithm"ML-DSA"
stateint state1 = enabled, 0 = disabled
configuredint configured1 once a supported algorithm name has been accepted
backendint backend1 only once a real native implementation is linked

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureint configure(String a)No description in source.
bindBackendvoid bindBackend(int ready)No description in source.
backendReadyboolean backendReady()No description in source.
enablevoid enable()No description in source.
disablevoid disable()No description in source.
activeboolean active()No description in source.
verifyint verify(String publicKey, String msg, String sig)Verify sig over msg with the public key. OK = valid, ERR_AUTH = invalid, ERR_UNIMPL while the PQ backend is pending.
securityNoteString securityNote()No description in source.