Skip to main content

encrypt_private_data

Function encrypt_private_data 

Source
pub fn encrypt_private_data(
    key: &[u8; 32],
    iv: &[u8; 16],
    plaintext: &[u8],
) -> Vec<u8> ⓘ
Expand description

Encrypt a contactInfo.privateData plaintext (the DIP-15 var-int encoding, built by the wallet’s encode_private_data) as IV(16) ‖ AES-256-CBC(plaintext) — the same prepended-IV layout encryptedPublicKey uses (DIP-15 doesn’t pin the layout for this field; we adopt the same convention).