pk-decrypt/decrypt pk-decrypt/new pk-encrypt/encrypt pk-encrypt/new pk-kem-decrypt/decrypt-shared-key pk-kem-decrypt/new pk-kem-decrypt/shared-key-length pk-kem-encrypt/create-shared-key pk-kem-encrypt/encapsulated-key-length pk-kem-encrypt/new pk-kem-encrypt/shared-key-length pk-key-agreement/agree pk-key-agreement/new pk-key-agreement/public-value pk-sign/finish pk-sign/new pk-sign/update pk-verify/finish pk-verify/new pk-verify/update
(pk-decrypt/decrypt pk-decrypt-obj message)Decrypt the `message` using `pk-decrypt-obj`. Returns the plaintext.
(pk-decrypt/new privkey padding)Create a new operation object which can be used to decrypt using `privkey` and the specified `padding` scheme (such as "OAEP(SHA-256)" for use with RSA). Returns `pk-decrypt-obj`.
(pk-encrypt/encrypt pk-encrypt-obj message &opt rng)Encrypt the `message` using `pk-encrypt-obj`. Returns the ciphertext. New rng is used by default, if `rng` is not provided.
(pk-encrypt/new pubkey padding)Create a new operation object which can be used to encrypt using `pubkey` and the specified `padding` scheme (such as "OAEP(SHA-256)" for use with RSA). Returns `pk-encrypt-obj`.
(pk-kem-decrypt/decrypt-shared-key pk-kem-decrypt-obj salt desired-key-len encapsulated-key)Decrypt the `encapsulated-key`. Returns the shared secret.
(pk-kem-decrypt/new privkey kdf)Create a KEM operation, decrypt version, using the `privkey` and the specified `kdf`. Returns `pk-kem-decrypt-obj`.
(pk-kem-decrypt/shared-key-length pk-kem-decrypt-obj desired-shared-key-length)Returns the output shared key length, assuming `desired-shared-key-length` is provided.
Normally this will just return `desired-shared-key-length` but may return a different value if a "Raw" KDF is used (returning the unhashed output), or potentially depending on KDF limitations.
(pk-kem-encrypt/create-shared-key pk-kem-encrypt-obj salt desired-key-len &opt rng)Create a new encapsulated key. Returns the tuple of (shared-key, encapsulated-key). New rng is used by default, if `rng` is not provided.
(pk-kem-encrypt/encapsulated-key-length pk-kem-encrypt-obj)Returns the length of the encapsulated key.
(pk-kem-encrypt/new pubkey kdf)Create a KEM operation, encrypt version, using the `pubkey` and the specified `kdf`. Returns `pk-kem-encrypt-obj`.
(pk-kem-encrypt/shared-key-length pk-kem-encrypt-obj desired-shared-key-length)Returns the output shared key length, assuming `desired-shared-key-length` is provided.
Normally this will just return `desired-shared-key-length` but may return a different value if a "Raw" KDF is used (returning the unhashed output), or potentially depending on KDF limitations.
(pk-key-agreement/agree pk-key-agreement-obj other-key salt &opt key-len)Returns a key derived by the KDF. If `key-len` is omitted, default agreement size will be used.
(pk-key-agreement/new privkey kdf)Set up to perform key derivation using the `privkey` and the specified `kdf`. Returns `pk-key-agreement-obj`.
(pk-key-agreement/public-value pk-key-agreement-obj)Returns the public value to be passed to the other party.
(pk-sign/finish pk-sign-obj &opt rng)Returns a signature over all of the messages provided. Afterwards, the `pk-sign-obj` is reset and may be used to sign a new message. New rng is used by default, if `rng` is not provided.
(pk-sign/new privkey hash-and-padding)Create a signature operator for the `privkey`. The `hash-and-padding` string specifies what hash function and padding should be used, for example "PKCS1v15(SHA-256)" for PKCS #1 v1.5 padding (used with RSA) or "SHA-384". Generally speaking only RSA has special padding modes; for other algorithms like ECDSA one just names the hash. Returns `pk-sign-obj`.
(pk-sign/update pk-sign-obj message)Add the `message` to be signed. Returns `pk-sign-obj`.
(pk-verify/finish pk-verify-obj signature)Verify if the `signature` provided matches with the message provided. Returns boolean.
(pk-verify/new pubkey hash-and-padding)Create a verification operator for the `pubkey`. The `hash-and-padding` string specifies what hash function and padding should be used, for example "PKCS1v15(SHA-256)" for PKCS #1 v1.5 padding (used with RSA) or "SHA-384". Generally speaking only RSA has special padding modes; for other algorithms like ECDSA one just names the hash. Returns `pk-verify-obj`.
(pk-verify/update pk-verify-obj message)Add the `message` to be verified. Returns `pk-verify-obj`.