XU XUv0.8.8
中文

API

#crypto/rsa/oaep

import: #crypto/rsa/oaep

counts: 4 fns, 0 methods, 0 types, 0 consts, 0 ifaces

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/sha512).

encrypt_oaep

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

Purpose

Encrypt oaep. Throws on failure.

Parameters

pk &rsa.PublicKey
pk (borrowed; caller keeps it; type &rsa.PublicKey)
hash int
hash (int)
msg &string
message (borrowed; caller keeps it; type &string)
label &string
label (borrowed; caller keeps it; 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.

Parameters

priv &rsa.PrivateKey
priv (borrowed; caller keeps it; type &rsa.PrivateKey)
hash int
hash (int)
ciphertext &string
ciphertext (borrowed; caller keeps it; type &string)
label &string
label (borrowed; caller keeps it; type &string)

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.

Parameters

priv &rsa.PrivateKey
priv (borrowed; caller keeps it; type &rsa.PrivateKey)
hash int
hash (int)
hashed &string
hashed (borrowed; caller keeps it; type &string)

Returns

string — result string

verify_pss

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

Purpose

Verify pss. Throws on failure.

Parameters

pk &rsa.PublicKey
pk (borrowed; caller keeps it; type &rsa.PublicKey)
hash int
hash (int)
hashed &string
hashed (borrowed; caller keeps it; type &string)
sig &string
sig (borrowed; caller keeps it; type &string)

Returns

int — a value of this type