sorcery-argon2 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codeql.yml +74 -0
  3. data/.github/workflows/ruby.yml +13 -3
  4. data/.rubocop.yml +112 -2
  5. data/CHANGELOG.md +8 -0
  6. data/MAINTAINING.md +8 -3
  7. data/README.md +155 -14
  8. data/bin/setup +4 -0
  9. data/ext/argon2_wrap/{Makefile → Makefile.real} +1 -0
  10. data/ext/argon2_wrap/extconf.rb +4 -1
  11. data/ext/argon2_wrap/libargon2_wrap.so +0 -0
  12. data/ext/argon2_wrap/tests +0 -0
  13. data/ext/phc-winner-argon2/.git +1 -0
  14. data/ext/phc-winner-argon2/.gitattributes +10 -0
  15. data/ext/phc-winner-argon2/.gitignore +22 -0
  16. data/ext/phc-winner-argon2/.travis.yml +25 -0
  17. data/ext/phc-winner-argon2/Argon2.sln +158 -0
  18. data/ext/phc-winner-argon2/CHANGELOG.md +32 -0
  19. data/ext/phc-winner-argon2/LICENSE +314 -0
  20. data/ext/phc-winner-argon2/Makefile +255 -0
  21. data/ext/phc-winner-argon2/Package.swift +46 -0
  22. data/ext/phc-winner-argon2/README.md +303 -0
  23. data/ext/phc-winner-argon2/appveyor.yml +25 -0
  24. data/ext/phc-winner-argon2/argon2-specs.pdf +0 -0
  25. data/ext/phc-winner-argon2/export.sh +7 -0
  26. data/ext/phc-winner-argon2/include/argon2.h +437 -0
  27. data/ext/phc-winner-argon2/kats/argon2d +12304 -0
  28. data/ext/phc-winner-argon2/kats/argon2d.shasum +1 -0
  29. data/ext/phc-winner-argon2/kats/argon2d_v16 +12304 -0
  30. data/ext/phc-winner-argon2/kats/argon2d_v16.shasum +1 -0
  31. data/ext/phc-winner-argon2/kats/argon2i +12304 -0
  32. data/ext/phc-winner-argon2/kats/argon2i.shasum +1 -0
  33. data/ext/phc-winner-argon2/kats/argon2i_v16 +12304 -0
  34. data/ext/phc-winner-argon2/kats/argon2i_v16.shasum +1 -0
  35. data/ext/phc-winner-argon2/kats/argon2id +12304 -0
  36. data/ext/phc-winner-argon2/kats/argon2id.shasum +1 -0
  37. data/ext/phc-winner-argon2/kats/argon2id_v16 +12304 -0
  38. data/ext/phc-winner-argon2/kats/argon2id_v16.shasum +1 -0
  39. data/ext/phc-winner-argon2/kats/check-sums.ps1 +42 -0
  40. data/ext/phc-winner-argon2/kats/check-sums.sh +13 -0
  41. data/ext/phc-winner-argon2/kats/test.ps1 +50 -0
  42. data/ext/phc-winner-argon2/kats/test.sh +49 -0
  43. data/ext/phc-winner-argon2/latex/IEEEtran.cls +6347 -0
  44. data/ext/phc-winner-argon2/latex/Makefile +18 -0
  45. data/ext/phc-winner-argon2/latex/argon2-specs.tex +920 -0
  46. data/ext/phc-winner-argon2/latex/pics/argon2-par.pdf +0 -0
  47. data/ext/phc-winner-argon2/latex/pics/compression.pdf +0 -0
  48. data/ext/phc-winner-argon2/latex/pics/generic.pdf +0 -0
  49. data/ext/phc-winner-argon2/latex/pics/power-distribution.jpg +0 -0
  50. data/ext/phc-winner-argon2/latex/tradeoff.bib +822 -0
  51. data/ext/phc-winner-argon2/libargon2.pc.in +18 -0
  52. data/ext/phc-winner-argon2/man/argon2.1 +57 -0
  53. data/ext/phc-winner-argon2/src/argon2.c +452 -0
  54. data/ext/phc-winner-argon2/src/bench.c +111 -0
  55. data/ext/phc-winner-argon2/src/blake2/blake2-impl.h +156 -0
  56. data/ext/phc-winner-argon2/src/blake2/blake2.h +89 -0
  57. data/ext/phc-winner-argon2/src/blake2/blake2b.c +390 -0
  58. data/ext/phc-winner-argon2/src/blake2/blamka-round-opt.h +471 -0
  59. data/ext/phc-winner-argon2/src/blake2/blamka-round-ref.h +56 -0
  60. data/ext/phc-winner-argon2/src/core.c +648 -0
  61. data/ext/phc-winner-argon2/src/core.h +228 -0
  62. data/ext/phc-winner-argon2/src/encoding.c +463 -0
  63. data/ext/phc-winner-argon2/src/encoding.h +57 -0
  64. data/ext/phc-winner-argon2/src/genkat.c +213 -0
  65. data/ext/phc-winner-argon2/src/genkat.h +51 -0
  66. data/ext/phc-winner-argon2/src/opt.c +283 -0
  67. data/ext/phc-winner-argon2/src/ref.c +194 -0
  68. data/ext/phc-winner-argon2/src/run.c +337 -0
  69. data/ext/phc-winner-argon2/src/test.c +289 -0
  70. data/ext/phc-winner-argon2/src/thread.c +57 -0
  71. data/ext/phc-winner-argon2/src/thread.h +67 -0
  72. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj +231 -0
  73. data/ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters +69 -0
  74. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj +231 -0
  75. data/ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters +69 -0
  76. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj +230 -0
  77. data/ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters +66 -0
  78. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj +244 -0
  79. data/ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters +72 -0
  80. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj +235 -0
  81. data/ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters +69 -0
  82. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj +243 -0
  83. data/ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters +69 -0
  84. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj +231 -0
  85. data/ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters +69 -0
  86. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj +230 -0
  87. data/ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters +66 -0
  88. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj +232 -0
  89. data/ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters +72 -0
  90. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj +231 -0
  91. data/ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters +69 -0
  92. data/lib/argon2/ffi_engine.rb +4 -4
  93. data/lib/argon2/password.rb +28 -5
  94. data/lib/argon2/version.rb +1 -1
  95. data/sorcery-argon2.gemspec +3 -2
  96. metadata +91 -8
@@ -0,0 +1,72 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup>
4
+ <Filter Include="Source Files">
5
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7
+ </Filter>
8
+ <Filter Include="Header Files">
9
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11
+ </Filter>
12
+ <Filter Include="Resource Files">
13
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15
+ </Filter>
16
+ </ItemGroup>
17
+ <ItemGroup>
18
+ <ClInclude Include="..\..\include\argon2.h">
19
+ <Filter>Header Files</Filter>
20
+ </ClInclude>
21
+ <ClInclude Include="..\..\src\core.h">
22
+ <Filter>Header Files</Filter>
23
+ </ClInclude>
24
+ <ClInclude Include="..\..\src\encoding.h">
25
+ <Filter>Header Files</Filter>
26
+ </ClInclude>
27
+ <ClInclude Include="..\..\src\genkat.h">
28
+ <Filter>Header Files</Filter>
29
+ </ClInclude>
30
+ <ClInclude Include="..\..\src\ref.h">
31
+ <Filter>Header Files</Filter>
32
+ </ClInclude>
33
+ <ClInclude Include="..\..\src\thread.h">
34
+ <Filter>Header Files</Filter>
35
+ </ClInclude>
36
+ <ClInclude Include="..\..\src\blake2\blake2.h">
37
+ <Filter>Header Files</Filter>
38
+ </ClInclude>
39
+ <ClInclude Include="..\..\src\blake2\blake2-impl.h">
40
+ <Filter>Header Files</Filter>
41
+ </ClInclude>
42
+ <ClInclude Include="..\..\src\blake2\blamka-round-opt.h">
43
+ <Filter>Header Files</Filter>
44
+ </ClInclude>
45
+ <ClInclude Include="..\..\src\blake2\blamka-round-ref.h">
46
+ <Filter>Header Files</Filter>
47
+ </ClInclude>
48
+ </ItemGroup>
49
+ <ItemGroup>
50
+ <ClCompile Include="..\..\src\blake2\blake2b.c">
51
+ <Filter>Source Files</Filter>
52
+ </ClCompile>
53
+ <ClCompile Include="..\..\src\argon2.c">
54
+ <Filter>Source Files</Filter>
55
+ </ClCompile>
56
+ <ClCompile Include="..\..\src\core.c">
57
+ <Filter>Source Files</Filter>
58
+ </ClCompile>
59
+ <ClCompile Include="..\..\src\encoding.c">
60
+ <Filter>Source Files</Filter>
61
+ </ClCompile>
62
+ <ClCompile Include="..\..\src\genkat.c">
63
+ <Filter>Source Files</Filter>
64
+ </ClCompile>
65
+ <ClCompile Include="..\..\src\ref.c">
66
+ <Filter>Source Files</Filter>
67
+ </ClCompile>
68
+ <ClCompile Include="..\..\src\thread.c">
69
+ <Filter>Source Files</Filter>
70
+ </ClCompile>
71
+ </ItemGroup>
72
+ </Project>
@@ -0,0 +1,231 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup Label="ProjectConfigurations">
4
+ <ProjectConfiguration Include="Debug|Win32">
5
+ <Configuration>Debug</Configuration>
6
+ <Platform>Win32</Platform>
7
+ </ProjectConfiguration>
8
+ <ProjectConfiguration Include="ReleaseStatic|Win32">
9
+ <Configuration>ReleaseStatic</Configuration>
10
+ <Platform>Win32</Platform>
11
+ </ProjectConfiguration>
12
+ <ProjectConfiguration Include="ReleaseStatic|x64">
13
+ <Configuration>ReleaseStatic</Configuration>
14
+ <Platform>x64</Platform>
15
+ </ProjectConfiguration>
16
+ <ProjectConfiguration Include="Release|Win32">
17
+ <Configuration>Release</Configuration>
18
+ <Platform>Win32</Platform>
19
+ </ProjectConfiguration>
20
+ <ProjectConfiguration Include="Debug|x64">
21
+ <Configuration>Debug</Configuration>
22
+ <Platform>x64</Platform>
23
+ </ProjectConfiguration>
24
+ <ProjectConfiguration Include="Release|x64">
25
+ <Configuration>Release</Configuration>
26
+ <Platform>x64</Platform>
27
+ </ProjectConfiguration>
28
+ </ItemGroup>
29
+ <PropertyGroup Label="Globals">
30
+ <ProjectGuid>{8A1F7F84-34AF-4DB2-9D58-D4823DFE79E9}</ProjectGuid>
31
+ <RootNamespace>Argon2RefTestCI</RootNamespace>
32
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
33
+ </PropertyGroup>
34
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
35
+ <!-- Set DefaultPlatformToolset to v100 (VS2010) if not defined -->
36
+ <PropertyGroup Label="EmptyDefaultPlatformToolset">
37
+ <DefaultPlatformToolset Condition=" '$(DefaultPlatformToolset)' == '' ">v100</DefaultPlatformToolset>
38
+ </PropertyGroup>
39
+ <PropertyGroup Label="PlatformToolset">
40
+ <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
41
+ </PropertyGroup>
42
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
43
+ <ConfigurationType>Application</ConfigurationType>
44
+ <UseDebugLibraries>true</UseDebugLibraries>
45
+ <CharacterSet>MultiByte</CharacterSet>
46
+ </PropertyGroup>
47
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
48
+ <ConfigurationType>Application</ConfigurationType>
49
+ <UseDebugLibraries>false</UseDebugLibraries>
50
+ <WholeProgramOptimization>true</WholeProgramOptimization>
51
+ <CharacterSet>MultiByte</CharacterSet>
52
+ </PropertyGroup>
53
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'" Label="Configuration">
54
+ <ConfigurationType>Application</ConfigurationType>
55
+ <UseDebugLibraries>false</UseDebugLibraries>
56
+ <WholeProgramOptimization>true</WholeProgramOptimization>
57
+ <CharacterSet>MultiByte</CharacterSet>
58
+ </PropertyGroup>
59
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
60
+ <ConfigurationType>Application</ConfigurationType>
61
+ <UseDebugLibraries>true</UseDebugLibraries>
62
+ <CharacterSet>MultiByte</CharacterSet>
63
+ </PropertyGroup>
64
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
65
+ <ConfigurationType>Application</ConfigurationType>
66
+ <UseDebugLibraries>false</UseDebugLibraries>
67
+ <WholeProgramOptimization>true</WholeProgramOptimization>
68
+ <CharacterSet>MultiByte</CharacterSet>
69
+ </PropertyGroup>
70
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|x64'" Label="Configuration">
71
+ <ConfigurationType>Application</ConfigurationType>
72
+ <UseDebugLibraries>false</UseDebugLibraries>
73
+ <WholeProgramOptimization>true</WholeProgramOptimization>
74
+ <CharacterSet>MultiByte</CharacterSet>
75
+ </PropertyGroup>
76
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
77
+ <ImportGroup Label="ExtensionSettings">
78
+ </ImportGroup>
79
+ <ImportGroup Label="Shared">
80
+ </ImportGroup>
81
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
82
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
83
+ </ImportGroup>
84
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
85
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
86
+ </ImportGroup>
87
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'" Label="PropertySheets">
88
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
89
+ </ImportGroup>
90
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
91
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
92
+ </ImportGroup>
93
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
94
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
95
+ </ImportGroup>
96
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|x64'" Label="PropertySheets">
97
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
98
+ </ImportGroup>
99
+ <PropertyGroup Label="UserMacros" />
100
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
101
+ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
102
+ <OutDir>$(SolutionDir)vs2015\build\</OutDir>
103
+ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir>
104
+ </PropertyGroup>
105
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
106
+ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
107
+ <OutDir>$(SolutionDir)vs2015\build\</OutDir>
108
+ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir>
109
+ </PropertyGroup>
110
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'">
111
+ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
112
+ <OutDir>$(SolutionDir)vs2015\build\</OutDir>
113
+ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir>
114
+ </PropertyGroup>
115
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
116
+ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
117
+ <OutDir>$(SolutionDir)vs2015\build\</OutDir>
118
+ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir>
119
+ </PropertyGroup>
120
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
121
+ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
122
+ <OutDir>$(SolutionDir)vs2015\build\</OutDir>
123
+ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir>
124
+ </PropertyGroup>
125
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|x64'">
126
+ <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
127
+ <OutDir>$(SolutionDir)vs2015\build\</OutDir>
128
+ <IntDir>$(SolutionDir)vs2015\build\$(ProjectName)\</IntDir>
129
+ </PropertyGroup>
130
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
131
+ <ClCompile>
132
+ <WarningLevel>Level3</WarningLevel>
133
+ <Optimization>Disabled</Optimization>
134
+ <SDLCheck>true</SDLCheck>
135
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136
+ </ClCompile>
137
+ </ItemDefinitionGroup>
138
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
139
+ <ClCompile>
140
+ <WarningLevel>Level3</WarningLevel>
141
+ <Optimization>Disabled</Optimization>
142
+ <SDLCheck>true</SDLCheck>
143
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
144
+ </ClCompile>
145
+ </ItemDefinitionGroup>
146
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
147
+ <ClCompile>
148
+ <WarningLevel>Level3</WarningLevel>
149
+ <Optimization>MaxSpeed</Optimization>
150
+ <FunctionLevelLinking>true</FunctionLevelLinking>
151
+ <IntrinsicFunctions>true</IntrinsicFunctions>
152
+ <SDLCheck>true</SDLCheck>
153
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
154
+ </ClCompile>
155
+ <Link>
156
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
157
+ <OptimizeReferences>true</OptimizeReferences>
158
+ <GenerateDebugInformation>true</GenerateDebugInformation>
159
+ </Link>
160
+ </ItemDefinitionGroup>
161
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|Win32'">
162
+ <ClCompile>
163
+ <WarningLevel>Level3</WarningLevel>
164
+ <Optimization>MaxSpeed</Optimization>
165
+ <FunctionLevelLinking>true</FunctionLevelLinking>
166
+ <IntrinsicFunctions>true</IntrinsicFunctions>
167
+ <SDLCheck>true</SDLCheck>
168
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
169
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
170
+ </ClCompile>
171
+ <Link>
172
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
173
+ <OptimizeReferences>true</OptimizeReferences>
174
+ <GenerateDebugInformation>true</GenerateDebugInformation>
175
+ </Link>
176
+ </ItemDefinitionGroup>
177
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
178
+ <ClCompile>
179
+ <WarningLevel>Level3</WarningLevel>
180
+ <Optimization>MaxSpeed</Optimization>
181
+ <FunctionLevelLinking>true</FunctionLevelLinking>
182
+ <IntrinsicFunctions>true</IntrinsicFunctions>
183
+ <SDLCheck>true</SDLCheck>
184
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
185
+ </ClCompile>
186
+ <Link>
187
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
188
+ <OptimizeReferences>true</OptimizeReferences>
189
+ <GenerateDebugInformation>true</GenerateDebugInformation>
190
+ </Link>
191
+ </ItemDefinitionGroup>
192
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseStatic|x64'">
193
+ <ClCompile>
194
+ <WarningLevel>Level3</WarningLevel>
195
+ <Optimization>MaxSpeed</Optimization>
196
+ <FunctionLevelLinking>true</FunctionLevelLinking>
197
+ <IntrinsicFunctions>true</IntrinsicFunctions>
198
+ <SDLCheck>true</SDLCheck>
199
+ <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
200
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
201
+ </ClCompile>
202
+ <Link>
203
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
204
+ <OptimizeReferences>true</OptimizeReferences>
205
+ <GenerateDebugInformation>true</GenerateDebugInformation>
206
+ </Link>
207
+ </ItemDefinitionGroup>
208
+ <ItemGroup>
209
+ <ClCompile Include="..\..\src\argon2.c" />
210
+ <ClCompile Include="..\..\src\blake2\blake2b.c" />
211
+ <ClCompile Include="..\..\src\core.c" />
212
+ <ClCompile Include="..\..\src\encoding.c" />
213
+ <ClCompile Include="..\..\src\ref.c" />
214
+ <ClCompile Include="..\..\src\test.c" />
215
+ <ClCompile Include="..\..\src\thread.c" />
216
+ </ItemGroup>
217
+ <ItemGroup>
218
+ <ClInclude Include="..\..\include\argon2.h" />
219
+ <ClInclude Include="..\..\src\blake2\blake2-impl.h" />
220
+ <ClInclude Include="..\..\src\blake2\blake2.h" />
221
+ <ClInclude Include="..\..\src\blake2\blamka-round-opt.h" />
222
+ <ClInclude Include="..\..\src\blake2\blamka-round-ref.h" />
223
+ <ClInclude Include="..\..\src\core.h" />
224
+ <ClInclude Include="..\..\src\encoding.h" />
225
+ <ClInclude Include="..\..\src\ref.h" />
226
+ <ClInclude Include="..\..\src\thread.h" />
227
+ </ItemGroup>
228
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
229
+ <ImportGroup Label="ExtensionTargets">
230
+ </ImportGroup>
231
+ </Project>
@@ -0,0 +1,69 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup>
4
+ <Filter Include="Source Files">
5
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7
+ </Filter>
8
+ <Filter Include="Header Files">
9
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11
+ </Filter>
12
+ <Filter Include="Resource Files">
13
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15
+ </Filter>
16
+ </ItemGroup>
17
+ <ItemGroup>
18
+ <ClCompile Include="..\..\src\argon2.c">
19
+ <Filter>Source Files</Filter>
20
+ </ClCompile>
21
+ <ClCompile Include="..\..\src\core.c">
22
+ <Filter>Source Files</Filter>
23
+ </ClCompile>
24
+ <ClCompile Include="..\..\src\encoding.c">
25
+ <Filter>Source Files</Filter>
26
+ </ClCompile>
27
+ <ClCompile Include="..\..\src\ref.c">
28
+ <Filter>Source Files</Filter>
29
+ </ClCompile>
30
+ <ClCompile Include="..\..\src\test.c">
31
+ <Filter>Source Files</Filter>
32
+ </ClCompile>
33
+ <ClCompile Include="..\..\src\thread.c">
34
+ <Filter>Source Files</Filter>
35
+ </ClCompile>
36
+ <ClCompile Include="..\..\src\blake2\blake2b.c">
37
+ <Filter>Source Files</Filter>
38
+ </ClCompile>
39
+ </ItemGroup>
40
+ <ItemGroup>
41
+ <ClInclude Include="..\..\include\argon2.h">
42
+ <Filter>Header Files</Filter>
43
+ </ClInclude>
44
+ <ClInclude Include="..\..\src\blake2\blake2.h">
45
+ <Filter>Header Files</Filter>
46
+ </ClInclude>
47
+ <ClInclude Include="..\..\src\blake2\blake2-impl.h">
48
+ <Filter>Header Files</Filter>
49
+ </ClInclude>
50
+ <ClInclude Include="..\..\src\core.h">
51
+ <Filter>Header Files</Filter>
52
+ </ClInclude>
53
+ <ClInclude Include="..\..\src\encoding.h">
54
+ <Filter>Header Files</Filter>
55
+ </ClInclude>
56
+ <ClInclude Include="..\..\src\ref.h">
57
+ <Filter>Header Files</Filter>
58
+ </ClInclude>
59
+ <ClInclude Include="..\..\src\thread.h">
60
+ <Filter>Header Files</Filter>
61
+ </ClInclude>
62
+ <ClInclude Include="..\..\src\blake2\blamka-round-opt.h">
63
+ <Filter>Header Files</Filter>
64
+ </ClInclude>
65
+ <ClInclude Include="..\..\src\blake2\blamka-round-ref.h">
66
+ <Filter>Header Files</Filter>
67
+ </ClInclude>
68
+ </ItemGroup>
69
+ </Project>
@@ -67,13 +67,13 @@ module Argon2
67
67
  result.unpack('H*').join
68
68
  end
69
69
 
70
- def self.hash_argon2id(password, salt, t_cost, m_cost, out_len = nil)
70
+ def self.hash_argon2id(password, salt, t_cost, m_cost, p_cost, out_len = nil)
71
71
  out_len = (out_len || Constants::OUT_LEN).to_i
72
72
  raise ::Argon2::Errors::InvalidOutputLength if out_len < 1
73
73
 
74
74
  result = ''
75
75
  FFI::MemoryPointer.new(:char, out_len) do |buffer|
76
- ret = Ext.argon2id_hash_raw(t_cost, 1 << m_cost, 1, password,
76
+ ret = Ext.argon2id_hash_raw(t_cost, 1 << m_cost, p_cost, password,
77
77
  password.length, salt, salt.length,
78
78
  buffer, out_len)
79
79
  raise ::Argon2::Errors::ExtError, ERRORS[ret.abs] unless ret.zero?
@@ -83,7 +83,7 @@ module Argon2
83
83
  result.unpack('H*').join
84
84
  end
85
85
 
86
- def self.hash_argon2id_encode(password, salt, t_cost, m_cost, secret)
86
+ def self.hash_argon2id_encode(password, salt, t_cost, m_cost, p_cost, secret)
87
87
  result = ''
88
88
  secretlen = secret.nil? ? 0 : secret.bytesize
89
89
  passwordlen = password.nil? ? 0 : password.bytesize
@@ -92,7 +92,7 @@ module Argon2
92
92
  FFI::MemoryPointer.new(:char, Constants::ENCODE_LEN) do |buffer|
93
93
  ret = Ext.argon2_wrap(buffer, password, passwordlen,
94
94
  salt, salt.length, t_cost, (1 << m_cost),
95
- 1, secret, secretlen)
95
+ p_cost, secret, secretlen)
96
96
  raise ::Argon2::Errors::ExtError, ERRORS[ret.abs] unless ret.zero?
97
97
 
98
98
  result = buffer.read_string(Constants::ENCODE_LEN)
@@ -19,11 +19,33 @@ module Argon2
19
19
  MIN_M_COST = 3
20
20
  # Used to validate the maximum acceptable memory cost
21
21
  MAX_M_COST = 31
22
+ # Used as the default parallelism cost if one isn't provided when calling
23
+ # Argon2::Password.create
24
+ DEFAULT_P_COST = 1
25
+ # Used to validate the minimum acceptable parallelism cost
26
+ MIN_P_COST = 1
27
+ # Used to validate the maximum acceptable parallelism cost
28
+ MAX_P_COST = 8
22
29
  # The complete Argon2 digest string (not to be confused with the checksum).
30
+ #
31
+ # For a detailed description of the digest format, please see:
32
+ # https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md
23
33
  attr_reader :digest
24
- # The hash portion of the stored password hash.
34
+ # The hash portion of the stored password hash. This is Base64 encoded by
35
+ # default.
25
36
  attr_reader :checksum
26
- # The salt of the stored password hash.
37
+ # The salt of the stored password hash. This is Base64 encoded by default.
38
+ #
39
+ # To retrieve the original salt:
40
+ #
41
+ # require 'base64'
42
+ #
43
+ # argon2 = Argon2::Password.new(digest)
44
+ #
45
+ # argon2.salt
46
+ # => Base64 encoded salt
47
+ # Base64.decode64(argon2.salt)
48
+ # => original salt
27
49
  attr_reader :salt
28
50
  # Variant used (argon2i / argon2d / argon2id)
29
51
  attr_reader :variant
@@ -55,6 +77,7 @@ module Argon2
55
77
  #
56
78
  # * :t_cost
57
79
  # * :m_cost
80
+ # * :p_cost
58
81
  # * :secret
59
82
  #
60
83
  def create(password, options = {})
@@ -62,18 +85,18 @@ module Argon2
62
85
 
63
86
  t_cost = options[:t_cost] || DEFAULT_T_COST
64
87
  m_cost = options[:m_cost] || DEFAULT_M_COST
88
+ p_cost = options[:p_cost] || DEFAULT_P_COST
65
89
 
66
90
  raise Argon2::Errors::InvalidTCost if t_cost < MIN_T_COST || t_cost > MAX_T_COST
67
91
  raise Argon2::Errors::InvalidMCost if m_cost < MIN_M_COST || m_cost > MAX_M_COST
68
-
69
- # TODO: Add support for changing the p_cost
92
+ raise Argon2::Errors::InvalidPCost if p_cost < MIN_P_COST || p_cost > MAX_P_COST
70
93
 
71
94
  salt = Engine.saltgen
72
95
  secret = options[:secret]
73
96
 
74
97
  Argon2::Password.new(
75
98
  Argon2::Engine.hash_argon2id_encode(
76
- password, salt, t_cost, m_cost, secret
99
+ password, salt, t_cost, m_cost, p_cost, secret
77
100
  )
78
101
  )
79
102
  end
@@ -4,5 +4,5 @@ module Argon2
4
4
  ##
5
5
  # Standard Gem version constant.
6
6
  #
7
- VERSION = '1.0.0'
7
+ VERSION = '1.2.0'
8
8
  end
@@ -25,7 +25,8 @@ Gem::Specification.new do |s|
25
25
  'bug_tracker_uri' => "#{repo_url}/issues",
26
26
  'changelog_uri' => "#{repo_url}/releases/tag/v#{version}",
27
27
  'documentation_uri' => 'https://rubydoc.info/gems/sorcery-argon2',
28
- 'source_code_uri' => "#{repo_url}/tree/v#{version}"
28
+ 'source_code_uri' => "#{repo_url}/tree/v#{version}",
29
+ 'rubygems_mfa_required' => 'true'
29
30
  }
30
31
 
31
32
  s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -35,7 +36,7 @@ Gem::Specification.new do |s|
35
36
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
37
  s.require_paths = ['lib']
37
38
 
38
- s.add_dependency 'ffi', '~> 1.14'
39
+ s.add_dependency 'ffi', '~> 1.15'
39
40
  s.add_dependency 'ffi-compiler', '~> 1.0'
40
41
 
41
42
  # Gems required for testing the wrapper locally.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorcery-argon2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Buker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-09 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '1.15'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.14'
26
+ version: '1.15'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ffi-compiler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,7 @@ files:
134
134
  - ".github/ISSUE_TEMPLATE/feature_request.md"
135
135
  - ".github/ISSUE_TEMPLATE/need_help.md"
136
136
  - ".github/PULL_REQUEST_TEMPLATE.md"
137
+ - ".github/workflows/codeql.yml"
137
138
  - ".github/workflows/ruby.yml"
138
139
  - ".gitignore"
139
140
  - ".gitmodules"
@@ -149,10 +150,91 @@ files:
149
150
  - bin/console
150
151
  - bin/setup
151
152
  - bin/test
152
- - ext/argon2_wrap/Makefile
153
+ - ext/argon2_wrap/Makefile.real
153
154
  - ext/argon2_wrap/argon_wrap.c
154
155
  - ext/argon2_wrap/extconf.rb
156
+ - ext/argon2_wrap/libargon2_wrap.so
155
157
  - ext/argon2_wrap/test.c
158
+ - ext/argon2_wrap/tests
159
+ - ext/phc-winner-argon2/.git
160
+ - ext/phc-winner-argon2/.gitattributes
161
+ - ext/phc-winner-argon2/.gitignore
162
+ - ext/phc-winner-argon2/.travis.yml
163
+ - ext/phc-winner-argon2/Argon2.sln
164
+ - ext/phc-winner-argon2/CHANGELOG.md
165
+ - ext/phc-winner-argon2/LICENSE
166
+ - ext/phc-winner-argon2/Makefile
167
+ - ext/phc-winner-argon2/Package.swift
168
+ - ext/phc-winner-argon2/README.md
169
+ - ext/phc-winner-argon2/appveyor.yml
170
+ - ext/phc-winner-argon2/argon2-specs.pdf
171
+ - ext/phc-winner-argon2/export.sh
172
+ - ext/phc-winner-argon2/include/argon2.h
173
+ - ext/phc-winner-argon2/kats/argon2d
174
+ - ext/phc-winner-argon2/kats/argon2d.shasum
175
+ - ext/phc-winner-argon2/kats/argon2d_v16
176
+ - ext/phc-winner-argon2/kats/argon2d_v16.shasum
177
+ - ext/phc-winner-argon2/kats/argon2i
178
+ - ext/phc-winner-argon2/kats/argon2i.shasum
179
+ - ext/phc-winner-argon2/kats/argon2i_v16
180
+ - ext/phc-winner-argon2/kats/argon2i_v16.shasum
181
+ - ext/phc-winner-argon2/kats/argon2id
182
+ - ext/phc-winner-argon2/kats/argon2id.shasum
183
+ - ext/phc-winner-argon2/kats/argon2id_v16
184
+ - ext/phc-winner-argon2/kats/argon2id_v16.shasum
185
+ - ext/phc-winner-argon2/kats/check-sums.ps1
186
+ - ext/phc-winner-argon2/kats/check-sums.sh
187
+ - ext/phc-winner-argon2/kats/test.ps1
188
+ - ext/phc-winner-argon2/kats/test.sh
189
+ - ext/phc-winner-argon2/latex/IEEEtran.cls
190
+ - ext/phc-winner-argon2/latex/Makefile
191
+ - ext/phc-winner-argon2/latex/argon2-specs.tex
192
+ - ext/phc-winner-argon2/latex/pics/argon2-par.pdf
193
+ - ext/phc-winner-argon2/latex/pics/compression.pdf
194
+ - ext/phc-winner-argon2/latex/pics/generic.pdf
195
+ - ext/phc-winner-argon2/latex/pics/power-distribution.jpg
196
+ - ext/phc-winner-argon2/latex/tradeoff.bib
197
+ - ext/phc-winner-argon2/libargon2.pc.in
198
+ - ext/phc-winner-argon2/man/argon2.1
199
+ - ext/phc-winner-argon2/src/argon2.c
200
+ - ext/phc-winner-argon2/src/bench.c
201
+ - ext/phc-winner-argon2/src/blake2/blake2-impl.h
202
+ - ext/phc-winner-argon2/src/blake2/blake2.h
203
+ - ext/phc-winner-argon2/src/blake2/blake2b.c
204
+ - ext/phc-winner-argon2/src/blake2/blamka-round-opt.h
205
+ - ext/phc-winner-argon2/src/blake2/blamka-round-ref.h
206
+ - ext/phc-winner-argon2/src/core.c
207
+ - ext/phc-winner-argon2/src/core.h
208
+ - ext/phc-winner-argon2/src/encoding.c
209
+ - ext/phc-winner-argon2/src/encoding.h
210
+ - ext/phc-winner-argon2/src/genkat.c
211
+ - ext/phc-winner-argon2/src/genkat.h
212
+ - ext/phc-winner-argon2/src/opt.c
213
+ - ext/phc-winner-argon2/src/ref.c
214
+ - ext/phc-winner-argon2/src/run.c
215
+ - ext/phc-winner-argon2/src/test.c
216
+ - ext/phc-winner-argon2/src/thread.c
217
+ - ext/phc-winner-argon2/src/thread.h
218
+ - ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj
219
+ - ext/phc-winner-argon2/vs2015/Argon2Opt/Argon2Opt.vcxproj.filters
220
+ - ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj
221
+ - ext/phc-winner-argon2/vs2015/Argon2OptBench/Argon2OptBench.vcxproj.filters
222
+ - ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj
223
+ - ext/phc-winner-argon2/vs2015/Argon2OptDll/Argon2OptDll.vcxproj.filters
224
+ - ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj
225
+ - ext/phc-winner-argon2/vs2015/Argon2OptGenKAT/Argon2OptGenKAT.vcxproj.filters
226
+ - ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj
227
+ - ext/phc-winner-argon2/vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj.filters
228
+ - ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj
229
+ - ext/phc-winner-argon2/vs2015/Argon2Ref/Argon2Ref.vcxproj.filters
230
+ - ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj
231
+ - ext/phc-winner-argon2/vs2015/Argon2RefBench/Argon2RefBench.vcxproj.filters
232
+ - ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj
233
+ - ext/phc-winner-argon2/vs2015/Argon2RefDll/Argon2RefDll.vcxproj.filters
234
+ - ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj
235
+ - ext/phc-winner-argon2/vs2015/Argon2RefGenKAT/Argon2RefGenKAT.vcxproj.filters
236
+ - ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj
237
+ - ext/phc-winner-argon2/vs2015/Argon2RefTestCI/Argon2RefTestCI.vcxproj.filters
156
238
  - lib/argon2.rb
157
239
  - lib/argon2/constants.rb
158
240
  - lib/argon2/engine.rb
@@ -166,9 +248,10 @@ licenses:
166
248
  - MIT
167
249
  metadata:
168
250
  bug_tracker_uri: https://github.com/sorcery/argon2/issues
169
- changelog_uri: https://github.com/sorcery/argon2/releases/tag/v1.0.0
251
+ changelog_uri: https://github.com/sorcery/argon2/releases/tag/v1.2.0
170
252
  documentation_uri: https://rubydoc.info/gems/sorcery-argon2
171
- source_code_uri: https://github.com/sorcery/argon2/tree/v1.0.0
253
+ source_code_uri: https://github.com/sorcery/argon2/tree/v1.2.0
254
+ rubygems_mfa_required: 'true'
172
255
  post_install_message:
173
256
  rdoc_options: []
174
257
  require_paths:
@@ -184,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
267
  - !ruby/object:Gem::Version
185
268
  version: '0'
186
269
  requirements: []
187
- rubygems_version: 3.1.2
270
+ rubygems_version: 3.2.3
188
271
  signing_key:
189
272
  specification_version: 4
190
273
  summary: A Ruby wrapper for the Argon2 Password hashing algorithm