Can I flash magisk on encrypted HTC10? Phone in question is european HTC 10 with Oreo.

Here is what I did:


Unlocked the bootloader following procedure from htcdev. 
Flashed TWRP. 
Sideloaded SuperSu.


Then I figured that I don't want SuperSu because of SafetyNet. (fails both basicIntegrity and ctsProfile)


I didn't changed anything on system partition manually. 
Did full unroot in SuperSu.


Now basicIntegrity passes, but ctsProfile fails. I think its because
   bootloader is unlocked.


Now I want to flash Magisk, but TWRP can't mount data partition because disk is encrypted(password doesn't work). This makes me unsure if it is possible to flash magisk.
Can I ADB sideload Magisk? or flash it with fastboot?


Ideally I want to end up with rooted phone that passes both cts and basicIntegrity.
It turns out it doesn't matter data is encrypted(click cancel on password prompt), I just put zips on microSD and flashed them via TWRP (install option), everything passed.

Safety net passes completely and root works.