Skip to content

Commit c2aeffb

Browse files
changed CoreLib module name + version bump to 2.0.0.0
1 parent 3c668a0 commit c2aeffb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+65
-63
lines changed

AOT-Static-Linking.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop
44
<Reference Include="HWRandom.NET">
55
<HintPath>libs\HWRandom.NET.dll</HintPath>
66
</Reference>
7-
<DirectPInvoke Include="native" />
8-
<NativeLibrary Include="libs\native.lib" />
7+
<DirectPInvoke Include="HWRandomCore" />
8+
<NativeLibrary Include="libs\HWRandomCore.lib" />
99
<LinkerArg Include="/LTCG /FIXED:NO /NXCOMPAT /DYNAMICBASE /LARGEADDRESSAWARE /CETCOMPAT" />
1010
</ItemGroup>

Core Library/Core Library.rc

12 Bytes
Binary file not shown.

Core Library/Core Library.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<CharacterSet>Unicode</CharacterSet>
4848
</PropertyGroup>
4949
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
50-
<ConfigurationType>DynamicLibrary</ConfigurationType>
50+
<ConfigurationType>StaticLibrary</ConfigurationType>
5151
<UseDebugLibraries>false</UseDebugLibraries>
5252
<PlatformToolset>v143</PlatformToolset>
5353
<WholeProgramOptimization>true</WholeProgramOptimization>
@@ -75,12 +75,12 @@
7575
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
7676
<OutDir>$(SolutionDir)Core Library\$(Platform)\$(Configuration)\</OutDir>
7777
<IntDir>$(Platform)\intermediate\$(Configuration)\</IntDir>
78-
<TargetName>native</TargetName>
78+
<TargetName>HWRandomCore</TargetName>
7979
</PropertyGroup>
8080
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8181
<OutDir>$(SolutionDir)Core Library\$(Platform)\$(Configuration)\</OutDir>
8282
<IntDir>$(Platform)\intermediate\$(Configuration)\</IntDir>
83-
<TargetName>native</TargetName>
83+
<TargetName>HWRandomCore</TargetName>
8484
</PropertyGroup>
8585
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8686
<ClCompile>

Core Library/__1.2.0.0/native.lib

-15.8 KB
Binary file not shown.
15.9 KB
Binary file not shown.

NET 9/Buffers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace BSS.Random
55
{
66
public static partial class HWRandom
77
{
8-
[LibraryImport("native.dll", EntryPoint = "SeedNextBytes", SetLastError = false)]
8+
[LibraryImport("HWRandomCore", EntryPoint = "SeedNextBytes", SetLastError = false)]
99
[return: MarshalAs(UnmanagedType.Bool)]
1010
private unsafe static partial Boolean InternalSeedNextBytes(Byte* buffer, UInt64 offset, UInt64 count);
1111

12-
[LibraryImport("native.dll", EntryPoint = "NextBytes", SetLastError = false)]
12+
[LibraryImport("HWRandomCore", EntryPoint = "NextBytes", SetLastError = false)]
1313
[return: MarshalAs(UnmanagedType.Bool)]
1414
private unsafe static partial Boolean InternalNextBytes(Byte* buffer, UInt64 offset, UInt64 count);
1515

@@ -49,7 +49,7 @@ public unsafe static Boolean SeedNextBytes(ref readonly Span<Byte> buffer, UInt6
4949
}
5050
}
5151

52-
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
52+
/********************************************************************/
5353

5454
/// <summary>
5555
/// Fills a buffer with RDRAND

NET 9/CheckHardwareSupport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace BSS.Random
88
/// </summary>
99
public static partial class HWRandom
1010
{
11-
[LibraryImport("native.dll", EntryPoint = "GetSupportedInstructions", SetLastError = false)]
11+
[LibraryImport("HWRandomCore", EntryPoint = "GetSupportedInstructions", SetLastError = false)]
1212
[return: MarshalAs(UnmanagedType.U4)]
1313
private static partial UInt32 InternalGetSupportedInstructions();
1414

NET 9/NET 9 (DLL).csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@
1010
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
1111
<AssemblyName>HWRandom.NET</AssemblyName>
1212
<Platforms>x64</Platforms>
13-
<AssemblyVersion>1.2.0.0</AssemblyVersion>
14-
<FileVersion>1.2.0.0</FileVersion>
15-
<Version>1.2.0.0</Version>
1613
<PackageId></PackageId>
1714
<Company></Company>
1815
<Authors></Authors>
19-
<Product>HWRandom.NET Library</Product>
2016
<Description></Description>
2117
<PackageReleaseNotes></PackageReleaseNotes>
22-
<AssemblyTitle>.NET 9 Wrapper for native.dll</AssemblyTitle>
2318
<Title></Title>
2419
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2520
</PropertyGroup>
@@ -28,17 +23,21 @@
2823
<IsTrimmable>True</IsTrimmable>
2924
<IsAotCompatible>True</IsAotCompatible>
3025
<IsPublishable>False</IsPublishable>
26+
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
3127
</PropertyGroup>
3228

3329
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
3430
<IsTrimmable>True</IsTrimmable>
3531
<IsAotCompatible>True</IsAotCompatible>
3632
<IsPublishable>False</IsPublishable>
3733
<DebugType>none</DebugType>
34+
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
3835
</PropertyGroup>
3936

4037
<ItemGroup>
41-
<Folder Include="Properties\" />
38+
<Compile Remove="__2.0.0.0\**" />
39+
<EmbeddedResource Remove="__2.0.0.0\**" />
40+
<None Remove="__2.0.0.0\**" />
4241
</ItemGroup>
4342

4443
</Project>

NET 9/Properties/AssemblyInfo.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.Reflection;
2+
using System.Runtime.Versioning;
3+
4+
// description
5+
[assembly: AssemblyTitle(".NET 9 Wrapper for the native HWRandomCore module")]
6+
[assembly: AssemblyDescription("")]
7+
[assembly: AssemblyConfiguration("")]
8+
[assembly: AssemblyCompany("")]
9+
// product name
10+
[assembly: AssemblyProduct("HWRandom.NET Library")]
11+
[assembly: AssemblyCopyright("")]
12+
[assembly: AssemblyTrademark("")]
13+
[assembly: TargetPlatform("Windows10.0.26100.0")]
14+
[assembly: SupportedOSPlatform("Windows10.0.19041.0")]
15+
[assembly: AssemblyCulture("")]
16+
17+
[assembly: AssemblyVersion("2.0.0.0")]
18+
[assembly: AssemblyFileVersion("2.0.0.0")]
19+
[assembly: AssemblyInformationalVersion("2.0.0.0")]

NET 9/RandNumbers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static partial class HWRandom
1111
/// <remarks>Returns random bits from the pool, which is seeded by the conditioner. An upper bound of 511 128-bit samples will be generated per seed. That is, no more than 511*2=1022 sequential DRNG random numbers will be generated from the same seed value. - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-3-3">intel.com</see></remarks>
1212
/// <param name="random">value output variable</param>
1313
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
14-
[LibraryImport("native.dll", EntryPoint = "ReadRandom64", SetLastError = false)]
14+
[LibraryImport("HWRandomCore", EntryPoint = "ReadRandom64", SetLastError = false)]
1515
[return: MarshalAs(UnmanagedType.Bool)]
1616
public static partial Boolean ReadRandom64(in UInt64 random);
1717

@@ -21,7 +21,7 @@ public static partial class HWRandom
2121
/// <remarks>Returns random bits from the pool, which is seeded by the conditioner. An upper bound of 511 128-bit samples will be generated per seed. That is, no more than 511*2=1022 sequential DRNG random numbers will be generated from the same seed value. - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-3-3">intel.com</see></remarks>
2222
/// <param name="random">value output variable</param>
2323
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
24-
[LibraryImport("native.dll", EntryPoint = "ReadRandom32", SetLastError = false)]
24+
[LibraryImport("HWRandomCore", EntryPoint = "ReadRandom32", SetLastError = false)]
2525
[return: MarshalAs(UnmanagedType.Bool)]
2626
public static partial Boolean ReadRandom32(in UInt32 random);
2727

@@ -31,7 +31,7 @@ public static partial class HWRandom
3131
/// <remarks>Returns random bits from the pool, which is seeded by the conditioner. An upper bound of 511 128-bit samples will be generated per seed. That is, no more than 511*2=1022 sequential DRNG random numbers will be generated from the same seed value. - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-3-3">intel.com</see></remarks>
3232
/// <param name="random">value output variable</param>
3333
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
34-
[LibraryImport("native.dll", EntryPoint = "ReadRandom16", SetLastError = false)]
34+
[LibraryImport("HWRandomCore", EntryPoint = "ReadRandom16", SetLastError = false)]
3535
[return: MarshalAs(UnmanagedType.Bool)]
3636
public static partial Boolean ReadRandom16(in UInt16 random);
3737
}

NET 9/SeedNumbers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static partial class HWRandom
1111
/// <remarks>The seed values come directly from the entropy conditioner - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-5-8">intel.com</see></remarks>
1212
/// <param name="random">value output variable</param>
1313
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
14-
[LibraryImport("native.dll", EntryPoint = "ReadSeed64", SetLastError = false)]
14+
[LibraryImport("HWRandomCore", EntryPoint = "ReadSeed64", SetLastError = false)]
1515
[return: MarshalAs(UnmanagedType.Bool)]
1616
public static partial Boolean ReadSeed64(in UInt64 random);
1717

@@ -21,7 +21,7 @@ public static partial class HWRandom
2121
/// <remarks>The seed values come directly from the entropy conditioner - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-5-8">intel.com</see></remarks>
2222
/// <param name="random">value output variable</param>
2323
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
24-
[LibraryImport("native.dll", EntryPoint = "ReadSeed32", SetLastError = false)]
24+
[LibraryImport("HWRandomCore", EntryPoint = "ReadSeed32", SetLastError = false)]
2525
[return: MarshalAs(UnmanagedType.Bool)]
2626
public static partial Boolean ReadSeed32(in UInt32 random);
2727

@@ -31,7 +31,7 @@ public static partial class HWRandom
3131
/// <remarks>The seed values come directly from the entropy conditioner - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-5-8">intel.com</see></remarks>
3232
/// <param name="random">value output variable</param>
3333
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
34-
[LibraryImport("native.dll", EntryPoint = "ReadSeed16", SetLastError = false)]
34+
[LibraryImport("HWRandomCore", EntryPoint = "ReadSeed16", SetLastError = false)]
3535
[return: MarshalAs(UnmanagedType.Bool)]
3636
public static partial Boolean ReadSeed16(in UInt16 random);
3737
}

NET 9/__1.2.0.0/HWRandom.NET.dll

-6.5 KB
Binary file not shown.

NET 9/__1.2.0.0/native.dll

-105 KB
Binary file not shown.

NET 9/__1.2.0.0/native.lib

-15.8 KB
Binary file not shown.

NET 9/__1.2.0.0/HWRandom.NET.deps.json renamed to NET 9/__2.0.0.0/HWRandom.NET.deps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"compilationOptions": {},
77
"targets": {
88
".NETCoreApp,Version=v9.0": {
9-
"HWRandom.NET/1.2.0.0": {
9+
"HWRandom.NET/1.0.0": {
1010
"dependencies": {
1111
"Microsoft.NET.ILLink.Tasks": "9.0.2",
1212
"runtimepack.Microsoft.Windows.SDK.NET.Ref": "10.0.26100.57"
@@ -31,7 +31,7 @@
3131
}
3232
},
3333
"libraries": {
34-
"HWRandom.NET/1.2.0.0": {
34+
"HWRandom.NET/1.0.0": {
3535
"type": "project",
3636
"serviceable": false,
3737
"sha512": ""

NET 9/__2.0.0.0/HWRandom.NET.dll

13.3 KB
Binary file not shown.
File renamed without changes.

NET Framework 4.8/Buffers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace BSS.Random
55
{
66
public static partial class HWRandom
77
{
8-
[DllImport("native.dll", EntryPoint = "SeedNextBytes", SetLastError = false)]
8+
[DllImport("HWRandomCore", EntryPoint = "SeedNextBytes", SetLastError = false)]
99
[return: MarshalAs(UnmanagedType.Bool)]
1010
private unsafe static extern Boolean InternalSeedNextBytes(Byte* buffer, UInt64 offset, UInt64 count);
1111

12-
[DllImport("native.dll", EntryPoint = "NextBytes", SetLastError = false)]
12+
[DllImport("HWRandomCore", EntryPoint = "NextBytes", SetLastError = false)]
1313
[return: MarshalAs(UnmanagedType.Bool)]
1414
private unsafe static extern Boolean InternalNextBytes(Byte* buffer, UInt64 offset, UInt64 count);
1515

@@ -49,7 +49,7 @@ public unsafe static Boolean SeedNextBytes(ref readonly Span<Byte> buffer, UInt6
4949
}
5050
}
5151

52-
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
52+
/********************************************************************/
5353

5454
/// <summary>
5555
/// Fills a buffer with RDRAND

NET Framework 4.8/CheckHardwareSupport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace BSS.Random
88
/// </summary>
99
public static partial class HWRandom
1010
{
11-
[DllImport("native.dll", EntryPoint = "GetSupportedInstructions", SetLastError = false)]
11+
[DllImport("HWRandomCore", EntryPoint = "GetSupportedInstructions", SetLastError = false)]
1212
[return: MarshalAs(UnmanagedType.U4)]
1313
private static extern UInt32 InternalGetSupportedInstructions();
1414

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System.Reflection;
2-
using System.Runtime.InteropServices;
32

43
// General Information about an assembly is controlled through the following
54
// set of attributes. Change these attribute values to modify the information
65
// associated with an assembly.
7-
[assembly: AssemblyTitle(".NET Framework 4.8 Wrapper for native.dll")]
6+
[assembly: AssemblyTitle(".NET Framework 4.8 Wrapper for the HWRandomCore module")]
87
[assembly: AssemblyDescription("")]
98
[assembly: AssemblyConfiguration("")]
109
[assembly: AssemblyCompany("")]
@@ -13,21 +12,6 @@
1312
[assembly: AssemblyTrademark("")]
1413
[assembly: AssemblyCulture("")]
1514

16-
// Setting ComVisible to false makes the types in this assembly not visible
17-
// to COM components. If you need to access a type in this assembly from
18-
// COM, set the ComVisible attribute to true on that type.
19-
[assembly: ComVisible(false)]
20-
21-
// The following GUID is for the ID of the typelib if this project is exposed to COM
22-
[assembly: Guid("41ebec3e-7803-4367-bcb9-1f8f96f311b6")]
23-
24-
// Version information for an assembly consists of the following four values:
25-
//
26-
// Major Version
27-
// Minor Version
28-
// Build Number
29-
// Revision
30-
//
31-
[assembly: AssemblyVersion("1.2.0.0")]
32-
[assembly: AssemblyFileVersion("1.2.0.0")]
33-
[assembly: AssemblyInformationalVersion("1.2.0.0")]
15+
[assembly: AssemblyVersion("2.0.0.0")]
16+
[assembly: AssemblyFileVersion("2.0.0.0")]
17+
[assembly: AssemblyInformationalVersion("2.0.0.0")]

NET Framework 4.8/RandNumbers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static partial class HWRandom
1111
/// <remarks>Returns random bits from the pool, which is seeded by the conditioner. An upper bound of 511 128-bit samples will be generated per seed. That is, no more than 511*2=1022 sequential DRNG random numbers will be generated from the same seed value. - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-3-3">intel.com</see></remarks>
1212
/// <param name="random">value output variable</param>
1313
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
14-
[DllImport("native.dll", EntryPoint = "ReadRandom64", SetLastError = false)]
14+
[DllImport("HWRandomCore", EntryPoint = "ReadRandom64", SetLastError = false)]
1515
[return: MarshalAs(UnmanagedType.Bool)]
1616
public static extern Boolean ReadRandom64(in UInt64 random);
1717

@@ -21,7 +21,7 @@ public static partial class HWRandom
2121
/// <remarks>Returns random bits from the pool, which is seeded by the conditioner. An upper bound of 511 128-bit samples will be generated per seed. That is, no more than 511*2=1022 sequential DRNG random numbers will be generated from the same seed value. - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-3-3">intel.com</see></remarks>
2222
/// <param name="random">value output variable</param>
2323
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
24-
[DllImport("native.dll", EntryPoint = "ReadRandom32", SetLastError = false)]
24+
[DllImport("HWRandomCore", EntryPoint = "ReadRandom32", SetLastError = false)]
2525
[return: MarshalAs(UnmanagedType.Bool)]
2626
public static extern Boolean ReadRandom32(in UInt32 random);
2727

@@ -31,7 +31,7 @@ public static partial class HWRandom
3131
/// <remarks>Returns random bits from the pool, which is seeded by the conditioner. An upper bound of 511 128-bit samples will be generated per seed. That is, no more than 511*2=1022 sequential DRNG random numbers will be generated from the same seed value. - <see href="https://www.intel.com/content/www/us/en/developer/articles/guide/intel-digital-random-number-generator-drng-software-implementation-guide.html#inpage-nav-3-3">intel.com</see></remarks>
3232
/// <param name="random">value output variable</param>
3333
/// <returns>Indicated whether the operation succeeded or not (<see langword="bool"></see> success = <see langword="true"></see>) | will only return false if generation failed 128 times in a row</returns>
34-
[DllImport("native.dll", EntryPoint = "ReadRandom16", SetLastError = false)]
34+
[DllImport("HWRandomCore", EntryPoint = "ReadRandom16", SetLastError = false)]
3535
[return: MarshalAs(UnmanagedType.Bool)]
3636
public static extern Boolean ReadRandom16(in UInt16 random);
3737
}

0 commit comments

Comments
 (0)