[OnePlus 6T  Questions & Answers] thedevilslettucemd:
I'm currently running a custom ROM (AOSiP), but this started happening on a different rom (Syberia). With a recent update, I noticed that suddenly I couldn't use fingerprint authentication for apps anymore. Eventually, I wound up having to format data (and sadly lost quite a few recent photos that had not yet been backed up) and start all over because neither the lockscreen nor TWRP would accept my correct pattern to decrypt.

Several wipe and resets later I decided to switch to a different ROM (AOSiP). And now I'm having the same issues with a completely clean flash (I started off with MSMDownloadTool to bring the phone back to factory). The ROM was working fine, as well as fingerprint and pattern unlocks, until I restarted. Now, I can't get past the lockscreen OR TWRP pattern unlocks. Here is what I found in logcat:

java.lang.RuntimeException: Failed to decrypt blob
at com.android.server.locksettings.SyntheticPasswordCrypto.decryptBlob(SyntheticPasswordCrypto.java:143)
at com.android.server.locksettings.SyntheticPasswordManager.decryptSPBlob(SyntheticPasswordManager.java:1117)
at com.android.server.locksettings.SyntheticPasswordManager.unwrapSyntheticPasswordBlob(SyntheticPasswordManager.java:978)
at com.android.server.locksettings.SyntheticPasswordManager.unwrapPasswordBasedSyntheticPassword(SyntheticPasswordManager.java:907)
at com.android.server.locksettings.LockSettingsService.spBasedDoVerifyCredential(LockSettingsService.java:2426)
at com.android.server.locksettings.LockSettingsService.doVerifyCredential(LockSettingsService.java:1700)
at com.android.server.locksettings.LockSettingsService.checkCredential(LockSettingsService.java:1667)
at com.android.internal.widget.LockPatternUtils.checkCredential(LockPatternUtils.java:374)
at com.android.internal.widget.LockPatternUtils.checkPattern(LockPatternUtils.java:426)
at com.android.internal.widget.LockPatternUtils.checkPattern(LockPatternUtils.java:413)
at com.android.server.locksettings.LockSettingsShellCommand.checkCredential(LockSettingsShellCommand.java:182)
at com.android.server.locksettings.LockSettingsShellCommand.onCommand(LockSettingsShellCommand.java:59)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.locksettings.LockSettingsService.onShellCommand(LockSettingsService.java:2074)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at com.android.internal.widget.ILockSettings$Stub.onTransact(ILockSettings.java:532)
at android.os.Binder.execTransact(Binder.java:731)
Caused by: java.security.InvalidKeyException: Only SecretKey is supported
at com.android.org.conscrypt.OpenSSLCipher.checkAndSetEncodedKey(OpenSSLCipher.java:462)
at com.android.org.conscrypt.OpenSSLCipher.engineInit(OpenSSLCipher.java:296)
at javax.crypto.Cipher.tryTransformWithProvider(Cipher.java:2980)
at javax.crypto.Cipher.tryCombinations(Cipher.java:2891)
at javax.crypto.Cipher$SpiAndProviderUpdater.updateAndGetSpiAndProvider(Cipher.java:2796)
at javax.crypto.Cipher.chooseProvider(Cipher.java:773)
at javax.crypto.Cipher.init(Cipher.java:1288)
at javax.crypto.Cipher.init(Cipher.java:1223)
at com.android.server.locksettings.SyntheticPasswordCrypto.decrypt(SyntheticPasswordCrypto.java:63)
at com.android.server.locksettings.SyntheticPasswordCrypto.decryptBlob(SyntheticPasswordCrypto.java:135)
... 17 more

Obviously my device is encrypted so I my only option is to format again and start over for the 4th time in the past 2 days, only to worry that this might happen again. Can anyone help? Thanks in advance.

NOTE: Sig is outdated.

EDIT: Not sure if it is relevant, but the phone was initially encrypted via OOS, then wiped and set up via AOSiP with encryption already in place.