mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Move CachedStorage, SectorStorage and derivatives
This commit is contained in:
parent
ae35a1b916
commit
5acff2acab
15 changed files with 28 additions and 21 deletions
|
@ -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'
|
||||
};
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ using System.Security.Cryptography;
|
|||
using LibHac.Common;
|
||||
using LibHac.Util;
|
||||
|
||||
namespace LibHac.FsSystem;
|
||||
namespace LibHac.Tools.FsSystem;
|
||||
|
||||
public class Aes128CtrTransform
|
||||
{
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ using System.Security.Cryptography;
|
|||
using LibHac.Common;
|
||||
using LibHac.Util;
|
||||
|
||||
namespace LibHac.FsSystem;
|
||||
namespace LibHac.Tools.FsSystem;
|
||||
|
||||
public class Aes128XtsTransform
|
||||
{
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ using LibHac.Crypto;
|
|||
using LibHac.Crypto.Impl;
|
||||
using LibHac.Fs;
|
||||
using LibHac.FsSystem;
|
||||
using LibHac.Tools.FsSystem;
|
||||
|
||||
namespace hactoolnet;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue