wipe

fun wipe(data: ByteArray)

Wipes a byte array from memory by filling it with zeros.

IMPORTANT:

  • This is a destructive operation - the array is modified in-place

  • After calling this, the array should not be used again

  • This method is idempotent - safe to call multiple times

  • Always use this in finally blocks to ensure cleanup

Implementation: Uses Arrays.fill() which is optimized by the JVM and less likely to be optimized away by the compiler compared to manual loops.

Parameters

data

Byte array to wipe (typically seeds, private keys, etc.)