Skip to content

Commit

Permalink
Added support for .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddesmet committed Apr 6, 2022
1 parent d5cf70c commit 1acee02
Show file tree
Hide file tree
Showing 7 changed files with 573 additions and 573 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0.100",
"version": "6.0.101",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion src/NaCl.Core/Base/Snuffle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public virtual byte[] Encrypt(ReadOnlySpan<byte> plaintext)

var ciphertext = new byte[plaintext.Length + NonceSizeInBytes];

#if NETCOREAPP3_1
#if NETCOREAPP3_1_OR_GREATER
Span<byte> nonce = stackalloc byte[NonceSizeInBytes];
RandomNumberGenerator.Fill(nonce);

Expand Down
8 changes: 4 additions & 4 deletions src/NaCl.Core/NaCl.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net45;net48;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Unix'">netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp3.1;net45;net48;net5.0;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -53,11 +53,11 @@
</PackageReference>
</ItemGroup>

<ItemGroup Label="Package References for Windows" Condition="$(TargetFramework) != 'net5.0' AND $(TargetFramework) != 'netcoreapp3.1' AND $(TargetFramework) != 'netstandard2.1'">
<ItemGroup Label="Package References for Windows" Condition="$(TargetFramework) != 'net6.0' AND $(TargetFramework) != 'net5.0' AND $(TargetFramework) != 'netcoreapp3.1' AND $(TargetFramework) != 'netstandard2.1'">
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>

<PropertyGroup Label="Constants Definition" Condition="$(TargetFramework) == 'netcoreapp3.1' OR $(TargetFramework) == 'net5.0'">
<PropertyGroup Label="Constants Definition" Condition="$(TargetFramework) == 'netcoreapp3.1' OR $(TargetFramework) == 'net5.0' OR $(TargetFramework) == 'net6.0'">
<DefineConstants>FCL_BITOPS</DefineConstants>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/NaCl.Core.Benchmarks/ChaCha20Poly1305Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void Setup()

ciphertext = new byte[message.Length];

aead = new ChaCha20Poly1305(key);
aead = new ChaCha20Poly1305(key.Span);
}

[Benchmark]
Expand Down
2 changes: 1 addition & 1 deletion test/NaCl.Core.Benchmarks/NaCl.Core.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Build">
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Loading

0 comments on commit 1acee02

Please sign in to comment.