2D Array operations using fhEVM

How to pre initialize an encrypted 2d Array, can I get some help? I want the values to be mutable

Declaring a 2D encrypted array is done via usual solidity code, for instance for an in-memory array of encrypted booleans of size 10*10 use:


function initArray() public pure {
    ebool[][] memory arr = new ebool[][](size);
    for (uint i; i < size; i++) {
        arr[i] = new ebool[](size);
    }
    // ...
}

If you want to initialize the ebools for some reason you could loop over all elements and pass them a trivially encrypted 0 for instnace via TFHE.asEbool(0) value.

Thanks for the help!
But may u please elaborate this further