Move CachedStorage, SectorStorage and derivatives

This commit is contained in:
Alex Barney 2021-12-19 00:10:20 -07:00
parent ae35a1b916
commit 5acff2acab
15 changed files with 28 additions and 21 deletions

View file

@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using LibHac.Common.Keys;
using LibHac.Diag;
using LibHac.Tools.FsSystem;
using LibHac.Util;
namespace LibHac.Boot;
@ -550,4 +551,4 @@ public class Package1
{
(byte) '2', (byte) '0', (byte) '1', (byte) '8', (byte) '1', (byte) '1', (byte) '0', (byte) '7'
};
}
}

View file

@ -7,6 +7,7 @@ using LibHac.Crypto;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.Kernel;
using LibHac.Tools.FsSystem;
namespace LibHac.Boot;
@ -266,4 +267,4 @@ public class Package2StorageReader : IDisposable
{
return _header.Meta.PayloadSizes[IniPayloadIndex] != 0;
}
}
}

View file

@ -5,6 +5,7 @@ using System.Security.Cryptography;
using System.Text;
using LibHac.Common;
using LibHac.Fs;
using LibHac.Tools.FsSystem;
using LibHac.Util;
namespace LibHac.FsSystem;

View file

@ -4,6 +4,7 @@ using System.IO;
using LibHac.Common;
using LibHac.Crypto;
using LibHac.Fs;
using LibHac.Tools.FsSystem;
using LibHac.Tools.FsSystem.Save;
namespace LibHac.FsSystem;

View file

@ -2,8 +2,9 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using LibHac.Fs;
using LibHac.FsSystem;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class Aes128CtrExStorage : Aes128CtrStorage
{
@ -111,4 +112,4 @@ public class Aes128CtrExStorage : Aes128CtrStorage
Counter[5] = (byte)(value >> 16);
Counter[4] = (byte)(value >> 24);
}
}
}

View file

@ -3,7 +3,7 @@ using System.Buffers;
using System.Buffers.Binary;
using LibHac.Fs;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class Aes128CtrStorage : SectorStorage
{
@ -121,4 +121,4 @@ public class Aes128CtrStorage : SectorStorage
return counter;
}
}
}

View file

@ -6,7 +6,7 @@ using System.Security.Cryptography;
using LibHac.Common;
using LibHac.Util;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class Aes128CtrTransform
{

View file

@ -1,7 +1,7 @@
using System;
using LibHac.Fs;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class Aes128XtsStorage : SectorStorage
{
@ -75,4 +75,4 @@ public class Aes128XtsStorage : SectorStorage
{
return BaseStorage.Flush();
}
}
}

View file

@ -31,7 +31,7 @@ using System.Security.Cryptography;
using LibHac.Common;
using LibHac.Util;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class Aes128XtsTransform
{

View file

@ -1,9 +1,9 @@
using LibHac.Crypto;
using LibHac.Fs;
using System;
using System;
using LibHac.Common;
using LibHac.Crypto;
using LibHac.Fs;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class AesCbcStorage : SectorStorage
{
@ -80,4 +80,4 @@ public class AesCbcStorage : SectorStorage
decryptor = tmpDecryptor;
return Result.Success;
}
}
}

View file

@ -2,7 +2,7 @@
using System.Collections.Generic;
using LibHac.Fs;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class CachedStorage : IStorage
{
@ -205,4 +205,4 @@ public class CachedStorage : IStorage
public int Length { get; set; }
public bool Dirty { get; set; }
}
}
}

View file

@ -2,7 +2,7 @@
using LibHac.Fs;
using LibHac.Util;
namespace LibHac.FsSystem;
namespace LibHac.Tools.FsSystem;
public class SectorStorage : IStorage
{
@ -84,4 +84,4 @@ public class SectorStorage : IStorage
if (offset % SectorSize != 0)
throw new ArgumentException($"Offset must be a multiple of {SectorSize}");
}
}
}

View file

@ -9,6 +9,7 @@ using LibHac.Crypto;
using LibHac.Crypto.Impl;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.Tools.FsSystem;
namespace hactoolnet;

View file

@ -6,6 +6,7 @@ using LibHac.Boot;
using LibHac.Common;
using LibHac.Fs;
using LibHac.FsSystem;
using LibHac.Tools.FsSystem;
using static hactoolnet.Print;
using Path = System.IO.Path;

View file

@ -1,5 +1,5 @@
using System.Linq;
using LibHac.FsSystem;
using LibHac.Tools.FsSystem;
using LibHac.Util;
using Xunit;
@ -138,4 +138,4 @@ public class AesXts
public byte[] GetInitialText(bool decrypting) => decrypting ? CipherText : PlainText;
public byte[] GetTransformedText(bool decrypting) => decrypting ? PlainText : CipherText;
}
}
}