get_salt


Description:

public uint8[]? get_salt (uint8[] ciphertext, out ErrGetSalt error)

Retrieves the salt used to encrypt the given data.

The retrieved salt can then be passed to PassKey.PassKey.derive_with_salt to produce the same key as was previously used. Any data encrypted with this module can be used as input.

The cipher text must be at least pass_encryption_extra_length bytes in length. The salt must be pass_salt_length bytes in length. If the passed byte arrays are smaller than required, the behaviour is undefined.

If the cipher text pointer or the salt is NULL, this function returns null.

Success does not say anything about the validity of the data, only that data of the appropriate size was copied.

Returns:

true on success.


Namespace: ToxEncryptSave
Package: toxcore