General code cleanup and style refactor.

This commit is contained in:
2022-11-15 15:58:41 +00:00
parent b5f8686256
commit 40487268b4
6 changed files with 41 additions and 40 deletions

View File

@@ -43,33 +43,33 @@
<NrtShowRevision>true</NrtShowRevision> <NrtShowRevision>true</NrtShowRevision>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Adler32\neon.cs" /> <Compile Include="Adler32\neon.cs"/>
<Compile Include="Adler32\ssse3.cs" /> <Compile Include="Adler32\ssse3.cs"/>
<Compile Include="CRC16CCITTContext.cs" /> <Compile Include="CRC16CCITTContext.cs"/>
<Compile Include="CRC16IBMContext.cs" /> <Compile Include="CRC16IBMContext.cs"/>
<Compile Include="CRC32\arm_simd.cs" /> <Compile Include="CRC32\arm_simd.cs"/>
<Compile Include="CRC32\clmul.cs" /> <Compile Include="CRC32\clmul.cs"/>
<Compile Include="CRC64\clmul.cs" /> <Compile Include="CRC64\clmul.cs"/>
<Compile Include="Native.cs" /> <Compile Include="Native.cs"/>
<Compile Include="Register.cs" /> <Compile Include="Register.cs"/>
<Compile Include="SpamSumContext.cs" /> <Compile Include="SpamSumContext.cs"/>
<Compile Include="Adler32Context.cs" /> <Compile Include="Adler32Context.cs"/>
<Compile Include="CDChecksums.cs" /> <Compile Include="CDChecksums.cs"/>
<Compile Include="CRC16Context.cs" /> <Compile Include="CRC16Context.cs"/>
<Compile Include="CRC32Context.cs" /> <Compile Include="CRC32Context.cs"/>
<Compile Include="CRC64Context.cs" /> <Compile Include="CRC64Context.cs"/>
<Compile Include="FletcherContext.cs" /> <Compile Include="FletcherContext.cs"/>
<Compile Include="MD5Context.cs" /> <Compile Include="MD5Context.cs"/>
<Compile Include="ReedSolomon.cs" /> <Compile Include="ReedSolomon.cs"/>
<Compile Include="SHA1Context.cs" /> <Compile Include="SHA1Context.cs"/>
<Compile Include="SHA256Context.cs" /> <Compile Include="SHA256Context.cs"/>
<Compile Include="SHA384Context.cs" /> <Compile Include="SHA384Context.cs"/>
<Compile Include="SHA512Context.cs" /> <Compile Include="SHA512Context.cs"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj" /> <ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj" /> <ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj" /> <ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="..\LICENSE.LGPL"> <EmbeddedResource Include="..\LICENSE.LGPL">
@@ -80,7 +80,7 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Aaru.Checksums.Native" Version="6.0.0-alpha6" /> <PackageReference Include="Aaru.Checksums.Native" Version="6.0.0-alpha6"/>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all" /> <PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -121,17 +121,20 @@ static class Clmul
while((len -= 64) >= 0) while((len -= 64) >= 0)
{ {
var xmmT0 = Vector128.Create(BitConverter.ToUInt32(src, bufPos), BitConverter.ToUInt32(src, bufPos + 4), var xmmT0 = Vector128.Create(BitConverter.ToUInt32(src, bufPos), BitConverter.ToUInt32(src, bufPos + 4),
BitConverter.ToUInt32(src, bufPos + 8), BitConverter.ToUInt32(src, bufPos + 12)); BitConverter.ToUInt32(src, bufPos + 8),
BitConverter.ToUInt32(src, bufPos + 12));
bufPos += 16; bufPos += 16;
var xmmT1 = Vector128.Create(BitConverter.ToUInt32(src, bufPos), BitConverter.ToUInt32(src, bufPos + 4), var xmmT1 = Vector128.Create(BitConverter.ToUInt32(src, bufPos), BitConverter.ToUInt32(src, bufPos + 4),
BitConverter.ToUInt32(src, bufPos + 8), BitConverter.ToUInt32(src, bufPos + 12)); BitConverter.ToUInt32(src, bufPos + 8),
BitConverter.ToUInt32(src, bufPos + 12));
bufPos += 16; bufPos += 16;
var xmmT2 = Vector128.Create(BitConverter.ToUInt32(src, bufPos), BitConverter.ToUInt32(src, bufPos + 4), var xmmT2 = Vector128.Create(BitConverter.ToUInt32(src, bufPos), BitConverter.ToUInt32(src, bufPos + 4),
BitConverter.ToUInt32(src, bufPos + 8), BitConverter.ToUInt32(src, bufPos + 12)); BitConverter.ToUInt32(src, bufPos + 8),
BitConverter.ToUInt32(src, bufPos + 12));
bufPos += 16; bufPos += 16;

View File

@@ -34,9 +34,7 @@ namespace Aaru.Checksums;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
/// <summary> /// <summary>Handles native implementations of compression algorithms</summary>
/// Handles native implementations of compression algorithms
/// </summary>
public static class Native public static class Native
{ {
static bool _checked; static bool _checked;