XU XUv0.16.0

#crypto/rsa/oaep

import: #crypto/rsa/oaep

counts: 6 functions, 0 methods, 0 types, 0 constants, 0 method sets

XU-CT-USE: fixed-shape-only crypto/subtle covers final fixed-shape checks only; the parent RSA backend remains explicitly variable-time. OAEP / PSS (RFC 8017). Hash ids match PKCS1v15 (sha1/sha256/sha384/sha512).

encrypt_oaep

XuAPI
pub fn encrypt_oaep(pk &rsa.PublicKey, hash int, msg &string, label &string) string

Purpose

Encrypt oaep. Throws on failure; handle the error or propagate it to the caller.

Parameters

pk &rsa.PublicKey
pk (read-only borrow; caller keeps the original; type &rsa.PublicKey)
hash int
hash (int)
msg &string
message (read-only borrow; caller keeps the original; type &string)
label &string
label (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

decrypt_oaep

XuAPI
pub fn decrypt_oaep(priv &rsa.PrivateKey, hash int, ciphertext &string, label &string) string

Purpose

Decrypt oaep. Throws on failure; handle the error or propagate it to the caller.

Parameters

priv &rsa.PrivateKey
priv (read-only borrow; caller keeps the original; type &rsa.PrivateKey)
hash int
hash (int)
ciphertext &string
ciphertext (read-only borrow; caller keeps the original; type &string)
label &string
label (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

sign_pss_opts

XuAPI
pub fn sign_pss_opts(priv &rsa.PrivateKey, hash int, hashed &string, salt_len int) string

Purpose

Sign pss opts. Throws on failure; handle the error or propagate it to the caller.

Parameters

priv &rsa.PrivateKey
priv (read-only borrow; caller keeps the original; type &rsa.PrivateKey)
hash int
hash (int)
hashed &string
hashed (read-only borrow; caller keeps the original; type &string)
salt_len int
salt_len (int)

Returns

string — result string

sign_pss

XuAPI
pub fn sign_pss(priv &rsa.PrivateKey, hash int, hashed &string) string

Purpose

Sign pss. Throws on failure; handle the error or propagate it to the caller.

Parameters

priv &rsa.PrivateKey
priv (read-only borrow; caller keeps the original; type &rsa.PrivateKey)
hash int
hash (int)
hashed &string
hashed (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

verify_pss_opts

XuAPI
pub fn verify_pss_opts(pk &rsa.PublicKey, hash int, hashed &string, sig &string, salt_len int) int

Purpose

Verify pss opts. Throws on failure; handle the error or propagate it to the caller.

Parameters

pk &rsa.PublicKey
pk (read-only borrow; caller keeps the original; type &rsa.PublicKey)
hash int
hash (int)
hashed &string
hashed (read-only borrow; caller keeps the original; type &string)
sig &string
sig (read-only borrow; caller keeps the original; type &string)
salt_len int
salt_len (int)

Returns

int — a value of this type

verify_pss

XuAPI
pub fn verify_pss(pk &rsa.PublicKey, hash int, hashed &string, sig &string) int

Purpose

Verify pss. Throws on failure; handle the error or propagate it to the caller.

Parameters

pk &rsa.PublicKey
pk (read-only borrow; caller keeps the original; type &rsa.PublicKey)
hash int
hash (int)
hashed &string
hashed (read-only borrow; caller keeps the original; type &string)
sig &string
sig (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type