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 System.Runtime.InteropServices;
|
||||||
using LibHac.Common.Keys;
|
using LibHac.Common.Keys;
|
||||||
using LibHac.Diag;
|
using LibHac.Diag;
|
||||||
|
using LibHac.Tools.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.Boot;
|
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'
|
(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.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
using LibHac.Kernel;
|
using LibHac.Kernel;
|
||||||
|
using LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.Boot;
|
namespace LibHac.Boot;
|
||||||
|
|
||||||
|
@ -266,4 +267,4 @@ public class Package2StorageReader : IDisposable
|
||||||
{
|
{
|
||||||
return _header.Meta.PayloadSizes[IniPayloadIndex] != 0;
|
return _header.Meta.PayloadSizes[IniPayloadIndex] != 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.Tools.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.FsSystem;
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.IO;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Crypto;
|
using LibHac.Crypto;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.Tools.FsSystem;
|
||||||
using LibHac.Tools.FsSystem.Save;
|
using LibHac.Tools.FsSystem.Save;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.FsSystem;
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
using LibHac.FsSystem;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class Aes128CtrExStorage : Aes128CtrStorage
|
public class Aes128CtrExStorage : Aes128CtrStorage
|
||||||
{
|
{
|
||||||
|
@ -111,4 +112,4 @@ public class Aes128CtrExStorage : Aes128CtrStorage
|
||||||
Counter[5] = (byte)(value >> 16);
|
Counter[5] = (byte)(value >> 16);
|
||||||
Counter[4] = (byte)(value >> 24);
|
Counter[4] = (byte)(value >> 24);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@ using System.Buffers;
|
||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class Aes128CtrStorage : SectorStorage
|
public class Aes128CtrStorage : SectorStorage
|
||||||
{
|
{
|
||||||
|
@ -121,4 +121,4 @@ public class Aes128CtrStorage : SectorStorage
|
||||||
|
|
||||||
return counter;
|
return counter;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,7 +6,7 @@ using System.Security.Cryptography;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class Aes128CtrTransform
|
public class Aes128CtrTransform
|
||||||
{
|
{
|
|
@ -1,7 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class Aes128XtsStorage : SectorStorage
|
public class Aes128XtsStorage : SectorStorage
|
||||||
{
|
{
|
||||||
|
@ -75,4 +75,4 @@ public class Aes128XtsStorage : SectorStorage
|
||||||
{
|
{
|
||||||
return BaseStorage.Flush();
|
return BaseStorage.Flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -31,7 +31,7 @@ using System.Security.Cryptography;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class Aes128XtsTransform
|
public class Aes128XtsTransform
|
||||||
{
|
{
|
|
@ -1,9 +1,9 @@
|
||||||
using LibHac.Crypto;
|
using System;
|
||||||
using LibHac.Fs;
|
|
||||||
using System;
|
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
|
using LibHac.Crypto;
|
||||||
|
using LibHac.Fs;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class AesCbcStorage : SectorStorage
|
public class AesCbcStorage : SectorStorage
|
||||||
{
|
{
|
||||||
|
@ -80,4 +80,4 @@ public class AesCbcStorage : SectorStorage
|
||||||
decryptor = tmpDecryptor;
|
decryptor = tmpDecryptor;
|
||||||
return Result.Success;
|
return Result.Success;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class CachedStorage : IStorage
|
public class CachedStorage : IStorage
|
||||||
{
|
{
|
||||||
|
@ -205,4 +205,4 @@ public class CachedStorage : IStorage
|
||||||
public int Length { get; set; }
|
public int Length { get; set; }
|
||||||
public bool Dirty { get; set; }
|
public bool Dirty { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
|
|
||||||
namespace LibHac.FsSystem;
|
namespace LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
public class SectorStorage : IStorage
|
public class SectorStorage : IStorage
|
||||||
{
|
{
|
||||||
|
@ -84,4 +84,4 @@ public class SectorStorage : IStorage
|
||||||
if (offset % SectorSize != 0)
|
if (offset % SectorSize != 0)
|
||||||
throw new ArgumentException($"Offset must be a multiple of {SectorSize}");
|
throw new ArgumentException($"Offset must be a multiple of {SectorSize}");
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ using LibHac.Crypto;
|
||||||
using LibHac.Crypto.Impl;
|
using LibHac.Crypto.Impl;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
|
using LibHac.Tools.FsSystem;
|
||||||
|
|
||||||
namespace hactoolnet;
|
namespace hactoolnet;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ using LibHac.Boot;
|
||||||
using LibHac.Common;
|
using LibHac.Common;
|
||||||
using LibHac.Fs;
|
using LibHac.Fs;
|
||||||
using LibHac.FsSystem;
|
using LibHac.FsSystem;
|
||||||
|
using LibHac.Tools.FsSystem;
|
||||||
using static hactoolnet.Print;
|
using static hactoolnet.Print;
|
||||||
using Path = System.IO.Path;
|
using Path = System.IO.Path;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using LibHac.FsSystem;
|
using LibHac.Tools.FsSystem;
|
||||||
using LibHac.Util;
|
using LibHac.Util;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
@ -138,4 +138,4 @@ public class AesXts
|
||||||
public byte[] GetInitialText(bool decrypting) => decrypting ? CipherText : PlainText;
|
public byte[] GetInitialText(bool decrypting) => decrypting ? CipherText : PlainText;
|
||||||
public byte[] GetTransformedText(bool decrypting) => decrypting ? PlainText : CipherText;
|
public byte[] GetTransformedText(bool decrypting) => decrypting ? PlainText : CipherText;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue