mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Add HKDF/SHA-512 and HKDF/SHA-256
This commit is contained in:
@@ -120,6 +120,8 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -243,6 +245,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -251,6 +254,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -153,6 +153,12 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>crypto_kdf\blake2b</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>crypto_shorthash</Filter>
|
||||
</ClCompile>
|
||||
@@ -518,6 +524,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -542,6 +551,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -862,6 +874,9 @@
|
||||
<Filter Include="crypto_kdf\blake2b">
|
||||
<UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kdf\hkdf">
|
||||
<UniqueIdentifier>{baf7d894-9298-391d-8dc2-e4c3010f5ddc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kx">
|
||||
<UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -243,6 +245,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -251,6 +254,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -153,6 +153,12 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>crypto_kdf\blake2b</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>crypto_shorthash</Filter>
|
||||
</ClCompile>
|
||||
@@ -518,6 +524,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -542,6 +551,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -862,6 +874,9 @@
|
||||
<Filter Include="crypto_kdf\blake2b">
|
||||
<UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kdf\hkdf">
|
||||
<UniqueIdentifier>{baf7d894-9298-391d-8dc2-e4c3010f5ddc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kx">
|
||||
<UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -243,6 +245,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -251,6 +254,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -153,6 +153,12 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>crypto_kdf\blake2b</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>crypto_shorthash</Filter>
|
||||
</ClCompile>
|
||||
@@ -518,6 +524,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -542,6 +551,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -862,6 +874,9 @@
|
||||
<Filter Include="crypto_kdf\blake2b">
|
||||
<UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kdf\hkdf">
|
||||
<UniqueIdentifier>{baf7d894-9298-391d-8dc2-e4c3010f5ddc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kx">
|
||||
<UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -243,6 +245,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -251,6 +254,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -153,6 +153,12 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>crypto_kdf\blake2b</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>crypto_shorthash</Filter>
|
||||
</ClCompile>
|
||||
@@ -518,6 +524,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -542,6 +551,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -862,6 +874,9 @@
|
||||
<Filter Include="crypto_kdf\blake2b">
|
||||
<UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kdf\hkdf">
|
||||
<UniqueIdentifier>{baf7d894-9298-391d-8dc2-e4c3010f5ddc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kx">
|
||||
<UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -243,6 +245,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -251,6 +254,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -153,6 +153,12 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>crypto_kdf\blake2b</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>crypto_shorthash</Filter>
|
||||
</ClCompile>
|
||||
@@ -518,6 +524,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -542,6 +551,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -862,6 +874,9 @@
|
||||
<Filter Include="crypto_kdf\blake2b">
|
||||
<UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kdf\hkdf">
|
||||
<UniqueIdentifier>{baf7d894-9298-391d-8dc2-e4c3010f5ddc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kx">
|
||||
<UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -243,6 +245,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -251,6 +254,7 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -153,6 +153,12 @@
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>crypto_kdf\blake2b</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>crypto_kdf\hkdf</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>crypto_shorthash</Filter>
|
||||
</ClCompile>
|
||||
@@ -518,6 +524,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -542,6 +551,9 @@
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>include\sodium</Filter>
|
||||
</ClInclude>
|
||||
@@ -862,6 +874,9 @@
|
||||
<Filter Include="crypto_kdf\blake2b">
|
||||
<UniqueIdentifier>{3d42d2a2-b192-33dd-9162-508916414707}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kdf\hkdf">
|
||||
<UniqueIdentifier>{baf7d894-9298-391d-8dc2-e4c3010f5ddc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="crypto_kx">
|
||||
<UniqueIdentifier>{898b6bd5-1360-3a34-adcd-0fade7561685}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
_crypto_aead_aegis256_abytes 0 0
|
||||
_crypto_aead_aegis256_decrypt 0 0
|
||||
_crypto_aead_aegis256_decrypt_detached 0 0
|
||||
_crypto_aead_aegis256_encrypt 0 0
|
||||
_crypto_aead_aegis256_encrypt_detached 0 0
|
||||
_crypto_aead_aegis256_is_available 0 0
|
||||
_crypto_aead_aegis256_keybytes 0 0
|
||||
_crypto_aead_aegis256_keygen 0 0
|
||||
_crypto_aead_aegis256_messagebytes_max 0 0
|
||||
_crypto_aead_aegis256_npubbytes 0 0
|
||||
_crypto_aead_aegis256_nsecbytes 0 0
|
||||
_crypto_aead_aes256gcm_abytes 0 0
|
||||
_crypto_aead_aes256gcm_beforenm 0 0
|
||||
_crypto_aead_aes256gcm_decrypt 0 0
|
||||
@@ -15,17 +26,6 @@ _crypto_aead_aes256gcm_messagebytes_max 0 0
|
||||
_crypto_aead_aes256gcm_npubbytes 0 0
|
||||
_crypto_aead_aes256gcm_nsecbytes 0 0
|
||||
_crypto_aead_aes256gcm_statebytes 0 0
|
||||
_crypto_aead_aegis256_abytes 0 0
|
||||
_crypto_aead_aegis256_decrypt 0 0
|
||||
_crypto_aead_aegis256_decrypt_detached 0 0
|
||||
_crypto_aead_aegis256_encrypt 0 0
|
||||
_crypto_aead_aegis256_encrypt_detached 0 0
|
||||
_crypto_aead_aegis256_is_available 0 0
|
||||
_crypto_aead_aegis256_keybytes 0 0
|
||||
_crypto_aead_aegis256_keygen 0 0
|
||||
_crypto_aead_aegis256_messagebytes_max 0 0
|
||||
_crypto_aead_aegis256_npubbytes 0 0
|
||||
_crypto_aead_aegis256_nsecbytes 0 0
|
||||
_crypto_aead_chacha20poly1305_abytes 1 1
|
||||
_crypto_aead_chacha20poly1305_decrypt 1 1
|
||||
_crypto_aead_chacha20poly1305_decrypt_detached 1 1
|
||||
@@ -269,6 +269,18 @@ _crypto_kdf_bytes_max 1 1
|
||||
_crypto_kdf_bytes_min 1 1
|
||||
_crypto_kdf_contextbytes 1 1
|
||||
_crypto_kdf_derive_from_key 1 1
|
||||
_crypto_kdf_hkdf_sha256_bytes_max 0 1
|
||||
_crypto_kdf_hkdf_sha256_bytes_min 0 1
|
||||
_crypto_kdf_hkdf_sha256_expand 0 1
|
||||
_crypto_kdf_hkdf_sha256_extract 0 1
|
||||
_crypto_kdf_hkdf_sha256_keybytes 0 1
|
||||
_crypto_kdf_hkdf_sha256_keygen 0 1
|
||||
_crypto_kdf_hkdf_sha512_bytes_max 0 1
|
||||
_crypto_kdf_hkdf_sha512_bytes_min 0 1
|
||||
_crypto_kdf_hkdf_sha512_expand 0 1
|
||||
_crypto_kdf_hkdf_sha512_extract 0 1
|
||||
_crypto_kdf_hkdf_sha512_keybytes 0 1
|
||||
_crypto_kdf_hkdf_sha512_keygen 0 1
|
||||
_crypto_kdf_keybytes 1 1
|
||||
_crypto_kdf_keygen 1 1
|
||||
_crypto_kdf_primitive 0 1
|
||||
@@ -599,14 +611,16 @@ _sodium_mlock 0 0
|
||||
_sodium_mprotect_noaccess 0 0
|
||||
_sodium_mprotect_readonly 0 0
|
||||
_sodium_mprotect_readwrite 0 0
|
||||
_sodium_mshield 1 1
|
||||
_sodium_munlock 0 0
|
||||
_sodium_munshield 1 1
|
||||
_sodium_pad 1 1
|
||||
_sodium_runtime_has_aesni 0 0
|
||||
_sodium_runtime_has_armcrypto 0 0
|
||||
_sodium_runtime_has_avx 0 0
|
||||
_sodium_runtime_has_avx2 0 0
|
||||
_sodium_runtime_has_avx512f 0 0
|
||||
_sodium_runtime_has_neon 0 0
|
||||
_sodium_runtime_has_armcrypto 0 0
|
||||
_sodium_runtime_has_pclmul 0 0
|
||||
_sodium_runtime_has_rdrand 0 0
|
||||
_sodium_runtime_has_sse2 0 0
|
||||
@@ -614,8 +628,6 @@ _sodium_runtime_has_sse3 0 0
|
||||
_sodium_runtime_has_sse41 0 0
|
||||
_sodium_runtime_has_ssse3 0 0
|
||||
_sodium_set_misuse_handler 0 0
|
||||
_sodium_mshield 1 1
|
||||
_sodium_munshield 1 1
|
||||
_sodium_stackzero 0 0
|
||||
_sodium_sub 0 0
|
||||
_sodium_unpad 1 1
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -358,6 +358,8 @@
|
||||
<ClCompile Include="src\libsodium\crypto_auth\hmacsha256\auth_hmacsha256.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\crypto_kdf.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_shorthash\crypto_shorthash.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_shorthash\siphash24\shorthash_siphash24.c" />
|
||||
<ClCompile Include="src\libsodium\crypto_shorthash\siphash24\shorthash_siphashx24.c" />
|
||||
@@ -481,6 +483,7 @@
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_kdf_blake2b.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_scalarmult_curve25519.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_shorthash.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_argon2id.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_secretstream_xchacha20poly1305.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_scryptsalsa208sha256.h" />
|
||||
@@ -489,6 +492,7 @@
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_verify_64.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_box_curve25519xchacha20poly1305.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_core_ed25519.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_argon2i.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\randombytes_internal_random.h" />
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_generichash.h" />
|
||||
|
||||
@@ -144,6 +144,12 @@
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\blake2b\kdf_blake2b.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha256.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\libsodium\crypto_kdf\hkdf\kdf_hkdf_sha512.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\libsodium\crypto_shorthash\crypto_shorthash.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -509,6 +515,9 @@
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_shorthash.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_kdf_hkdf_sha256.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_argon2id.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -533,6 +542,9 @@
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_core_ed25519.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_kdf_hkdf_sha512.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="src\libsodium\include\sodium\crypto_pwhash_argon2i.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -153,6 +153,8 @@ libsodium_la_SOURCES += \
|
||||
crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c \
|
||||
crypto_core/ed25519/core_ed25519.c \
|
||||
crypto_core/ed25519/core_ristretto255.c \
|
||||
crypto_kdf/hkdf/kdf_hkdf_sha256.c \
|
||||
crypto_kdf/hkdf/kdf_hkdf_sha512.c \
|
||||
crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c \
|
||||
crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h \
|
||||
crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c \
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "crypto_auth_hmacsha256.h"
|
||||
#include "crypto_kdf.h"
|
||||
#include "crypto_kdf_hkdf_sha256.h"
|
||||
#include "randombytes.h"
|
||||
#include "utils.h"
|
||||
|
||||
int
|
||||
crypto_kdf_hkdf_sha256_extract(
|
||||
unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES],
|
||||
const unsigned char *salt, size_t salt_len, const unsigned char *ikm,
|
||||
size_t ikm_len)
|
||||
{
|
||||
crypto_auth_hmacsha256_state st;
|
||||
|
||||
crypto_auth_hmacsha256_init(&st, salt, salt_len);
|
||||
crypto_auth_hmacsha256_update(&st, ikm, ikm_len);
|
||||
crypto_auth_hmacsha256_final(&st, prk);
|
||||
sodium_memzero(&st, sizeof st);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
crypto_kdf_hkdf_sha256_keygen(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES])
|
||||
{
|
||||
randombytes_buf(prk, crypto_kdf_hkdf_sha256_KEYBYTES);
|
||||
}
|
||||
|
||||
int
|
||||
crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len,
|
||||
const char *ctx, size_t ctx_len,
|
||||
const unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES])
|
||||
{
|
||||
crypto_auth_hmacsha256_state st;
|
||||
unsigned char tmp[crypto_auth_hmacsha256_BYTES];
|
||||
size_t i;
|
||||
size_t left;
|
||||
unsigned char counter = 1U;
|
||||
|
||||
if (out_len > crypto_kdf_hkdf_sha256_BYTES_MAX) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
for (i = (size_t) 0U; i < out_len; i += crypto_auth_hmacsha256_BYTES) {
|
||||
crypto_auth_hmacsha256_init(&st, prk, crypto_kdf_hkdf_sha256_KEYBYTES);
|
||||
if (i != (size_t) 0U) {
|
||||
crypto_auth_hmacsha256_update(
|
||||
&st, &out[i - crypto_auth_hmacsha256_BYTES],
|
||||
crypto_auth_hmacsha256_BYTES);
|
||||
}
|
||||
crypto_auth_hmacsha256_update(&st,
|
||||
(const unsigned char *) ctx, ctx_len);
|
||||
crypto_auth_hmacsha256_update(&st, &counter, (size_t) 1U);
|
||||
crypto_auth_hmacsha256_final(&st, &out[i]);
|
||||
counter++;
|
||||
}
|
||||
if ((left = out_len & (crypto_auth_hmacsha256_BYTES - 1U)) != (size_t) 0U) {
|
||||
crypto_auth_hmacsha256_init(&st, prk, crypto_kdf_hkdf_sha256_KEYBYTES);
|
||||
if (i != (size_t) 0U) {
|
||||
crypto_auth_hmacsha256_update(
|
||||
&st, &out[i - crypto_auth_hmacsha256_BYTES],
|
||||
crypto_auth_hmacsha256_BYTES);
|
||||
}
|
||||
crypto_auth_hmacsha256_update(&st,
|
||||
(const unsigned char *) ctx, ctx_len);
|
||||
crypto_auth_hmacsha256_update(&st, &counter, (size_t) 1U);
|
||||
crypto_auth_hmacsha256_final(&st, tmp);
|
||||
memcpy(&out[i], tmp, left);
|
||||
sodium_memzero(tmp, sizeof tmp);
|
||||
}
|
||||
sodium_memzero(&st, sizeof st);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_kdf_hkdf_sha256_keybytes(void)
|
||||
{
|
||||
return crypto_kdf_hkdf_sha256_KEYBYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_kdf_hkdf_sha256_bytes_min(void)
|
||||
{
|
||||
return crypto_kdf_hkdf_sha256_BYTES_MIN;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_kdf_hkdf_sha256_bytes_max(void)
|
||||
{
|
||||
return crypto_kdf_hkdf_sha256_BYTES_MAX;
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "crypto_auth_hmacsha512.h"
|
||||
#include "crypto_kdf.h"
|
||||
#include "crypto_kdf_hkdf_sha512.h"
|
||||
#include "randombytes.h"
|
||||
#include "utils.h"
|
||||
|
||||
int
|
||||
crypto_kdf_hkdf_sha512_extract(
|
||||
unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES],
|
||||
const unsigned char *salt, size_t salt_len, const unsigned char *ikm,
|
||||
size_t ikm_len)
|
||||
{
|
||||
crypto_auth_hmacsha512_state st;
|
||||
|
||||
crypto_auth_hmacsha512_init(&st, salt, salt_len);
|
||||
crypto_auth_hmacsha512_update(&st, ikm, ikm_len);
|
||||
crypto_auth_hmacsha512_final(&st, prk);
|
||||
sodium_memzero(&st, sizeof st);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
crypto_kdf_hkdf_sha512_keygen(unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES])
|
||||
{
|
||||
randombytes_buf(prk, crypto_kdf_hkdf_sha512_KEYBYTES);
|
||||
}
|
||||
|
||||
int
|
||||
crypto_kdf_hkdf_sha512_expand(unsigned char *out, size_t out_len,
|
||||
const char *ctx, size_t ctx_len,
|
||||
const unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES])
|
||||
{
|
||||
crypto_auth_hmacsha512_state st;
|
||||
unsigned char tmp[crypto_auth_hmacsha512_BYTES];
|
||||
size_t i;
|
||||
size_t left;
|
||||
unsigned char counter = 1U;
|
||||
|
||||
if (out_len > crypto_kdf_hkdf_sha512_BYTES_MAX) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
for (i = (size_t) 0U; i < out_len; i += crypto_auth_hmacsha512_BYTES) {
|
||||
crypto_auth_hmacsha512_init(&st, prk, crypto_kdf_hkdf_sha512_KEYBYTES);
|
||||
if (i != (size_t) 0U) {
|
||||
crypto_auth_hmacsha512_update(
|
||||
&st, &out[i - crypto_auth_hmacsha512_BYTES],
|
||||
crypto_auth_hmacsha512_BYTES);
|
||||
}
|
||||
crypto_auth_hmacsha512_update(&st,
|
||||
(const unsigned char *) ctx, ctx_len);
|
||||
crypto_auth_hmacsha512_update(&st, &counter, (size_t) 1U);
|
||||
crypto_auth_hmacsha512_final(&st, &out[i]);
|
||||
counter++;
|
||||
}
|
||||
if ((left = out_len & (crypto_auth_hmacsha512_BYTES - 1U)) != (size_t) 0U) {
|
||||
crypto_auth_hmacsha512_init(&st, prk, crypto_kdf_hkdf_sha512_KEYBYTES);
|
||||
if (i != (size_t) 0U) {
|
||||
crypto_auth_hmacsha512_update(
|
||||
&st, &out[i - crypto_auth_hmacsha512_BYTES],
|
||||
crypto_auth_hmacsha512_BYTES);
|
||||
}
|
||||
crypto_auth_hmacsha512_update(&st,
|
||||
(const unsigned char *) ctx, ctx_len);
|
||||
crypto_auth_hmacsha512_update(&st, &counter, (size_t) 1U);
|
||||
crypto_auth_hmacsha512_final(&st, tmp);
|
||||
memcpy(&out[i], tmp, left);
|
||||
sodium_memzero(tmp, sizeof tmp);
|
||||
}
|
||||
sodium_memzero(&st, sizeof st);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_kdf_hkdf_sha512_keybytes(void)
|
||||
{
|
||||
return crypto_kdf_hkdf_sha512_KEYBYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_kdf_hkdf_sha512_bytes_min(void)
|
||||
{
|
||||
return crypto_kdf_hkdf_sha512_BYTES_MIN;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_kdf_hkdf_sha512_bytes_max(void)
|
||||
{
|
||||
return crypto_kdf_hkdf_sha512_BYTES_MAX;
|
||||
}
|
||||
@@ -27,6 +27,8 @@ SODIUM_EXPORT = \
|
||||
sodium/crypto_hash_sha512.h \
|
||||
sodium/crypto_kdf.h \
|
||||
sodium/crypto_kdf_blake2b.h \
|
||||
sodium/crypto_kdf_hkdf_sha256.h \
|
||||
sodium/crypto_kdf_hkdf_sha512.h \
|
||||
sodium/crypto_kx.h \
|
||||
sodium/crypto_onetimeauth.h \
|
||||
sodium/crypto_onetimeauth_poly1305.h \
|
||||
|
||||
@@ -58,6 +58,8 @@
|
||||
# include "sodium/crypto_box_curve25519xchacha20poly1305.h"
|
||||
# include "sodium/crypto_core_ed25519.h"
|
||||
# include "sodium/crypto_core_ristretto255.h"
|
||||
# include "sodium/crypto_kdf_hkdf_sha256.h"
|
||||
# include "sodium/crypto_kdf_hkdf_sha512.h"
|
||||
# include "sodium/crypto_scalarmult_ed25519.h"
|
||||
# include "sodium/crypto_scalarmult_ristretto255.h"
|
||||
# include "sodium/crypto_secretbox_xchacha20poly1305.h"
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#ifndef crypto_kdf_hkdf_sha256_H
|
||||
#define crypto_kdf_hkdf_sha256_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "crypto_kdf.h"
|
||||
#include "crypto_auth_hmacsha256.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_kdf_hkdf_sha256_KEYBYTES crypto_auth_hmacsha256_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_hkdf_sha256_keybytes(void);
|
||||
|
||||
#define crypto_kdf_hkdf_sha256_BYTES_MIN 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_hkdf_sha256_bytes_min(void);
|
||||
|
||||
#define crypto_kdf_hkdf_sha256_BYTES_MAX (0xff * crypto_auth_hmacsha256_BYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_hkdf_sha256_bytes_min(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kdf_hkdf_sha256_extract(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES],
|
||||
const unsigned char *salt, size_t salt_len,
|
||||
const unsigned char *ikm, size_t ikm_len);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_kdf_hkdf_sha256_keygen(unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kdf_hkdf_sha256_expand(unsigned char *out, size_t out_len,
|
||||
const char *ctx, size_t ctx_len,
|
||||
const unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
#ifndef crypto_kdf_hkdf_sha512_H
|
||||
#define crypto_kdf_hkdf_sha512_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "crypto_kdf.h"
|
||||
#include "crypto_auth_hmacsha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_kdf_hkdf_sha512_KEYBYTES crypto_auth_hmacsha512_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_hkdf_sha512_keybytes(void);
|
||||
|
||||
#define crypto_kdf_hkdf_sha512_BYTES_MIN 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_hkdf_sha512_bytes_min(void);
|
||||
|
||||
#define crypto_kdf_hkdf_sha512_BYTES_MAX (0xff * crypto_auth_hmacsha512_BYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_kdf_hkdf_sha512_bytes_min(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kdf_hkdf_sha512_extract(unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES],
|
||||
const unsigned char *salt, size_t salt_len,
|
||||
const unsigned char *ikm, size_t ikm_len);
|
||||
|
||||
SODIUM_EXPORT
|
||||
void crypto_kdf_hkdf_sha512_keygen(unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_kdf_hkdf_sha512_expand(unsigned char *out, size_t out_len,
|
||||
const char *ctx, size_t ctx_len,
|
||||
const unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES]);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -302,6 +302,18 @@ crypto_kdf_bytes_max
|
||||
crypto_kdf_bytes_min
|
||||
crypto_kdf_contextbytes
|
||||
crypto_kdf_derive_from_key
|
||||
crypto_kdf_hkdf_sha256_bytes_max
|
||||
crypto_kdf_hkdf_sha256_bytes_min
|
||||
crypto_kdf_hkdf_sha256_expand
|
||||
crypto_kdf_hkdf_sha256_extract
|
||||
crypto_kdf_hkdf_sha256_keybytes
|
||||
crypto_kdf_hkdf_sha256_keygen
|
||||
crypto_kdf_hkdf_sha512_bytes_max
|
||||
crypto_kdf_hkdf_sha512_bytes_min
|
||||
crypto_kdf_hkdf_sha512_expand
|
||||
crypto_kdf_hkdf_sha512_extract
|
||||
crypto_kdf_hkdf_sha512_keybytes
|
||||
crypto_kdf_hkdf_sha512_keygen
|
||||
crypto_kdf_keybytes
|
||||
crypto_kdf_keygen
|
||||
crypto_kdf_primitive
|
||||
|
||||
Reference in New Issue
Block a user