public Result Create(out IFileSystem encryptedFileSystem, IFileSystem baseFileSystem, EncryptedFsKeyId keyId, ReadOnlySpan <byte> encryptionSeed) { encryptedFileSystem = default; if (keyId < EncryptedFsKeyId.Save || keyId > EncryptedFsKeyId.CustomStorage) { return(ResultFs.InvalidArgument.Log()); } // todo: "proper" key generation instead of a lazy hack Keyset.SetSdSeed(encryptionSeed.ToArray()); encryptedFileSystem = new AesXtsFileSystem(baseFileSystem, Keyset.SdCardKeys[(int)keyId], 0x4000); return(Result.Success); }
public Result Create(out ReferenceCountedDisposable <IFileSystem> encryptedFileSystem, ReferenceCountedDisposable <IFileSystem> baseFileSystem, EncryptedFsKeyId keyId, in EncryptionSeed encryptionSeed)