mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-04-06 21:02:10 +03:00
change hash function to SHA512
This commit is contained in:
@@ -129,7 +129,7 @@ public class PassStoreContentChunk
|
||||
|
||||
private static byte[] ComputeHmac(byte[] data, byte[] key, int chunkOrdinal)
|
||||
{
|
||||
SHA3_512 hasher = SHA3_512.Create();
|
||||
SHA512 hasher = SHA512.Create();
|
||||
byte[] innerKey = key.Select(x => (byte)(x ^ 0x36)).ToArray();
|
||||
byte[] outerKey = key.Select(x => (byte)(x ^ 0x5c)).ToArray();
|
||||
|
||||
@@ -145,7 +145,7 @@ public class PassStoreContentChunk
|
||||
byte[] innerHash = hasher.Hash!;
|
||||
hasher.Clear();
|
||||
|
||||
hasher = SHA3_512.Create();
|
||||
hasher = SHA512.Create();
|
||||
hasher.TransformBlock(outerKey, 0, outerKey.Length, null, 0);
|
||||
Array.Fill<byte>(outerKey, 0);
|
||||
hasher.TransformFinalBlock(innerHash, 0, innerHash.Length);
|
||||
|
||||
@@ -11,7 +11,7 @@ static class FileFormatConstants
|
||||
public const int MAX_AESKDF_ROUNDS = AesKdf.MAX_ROUNDS;
|
||||
public const byte ENCRYPT_ALGO_AES = 14;
|
||||
public const byte KDF_TYPE_AESKDF = 195;
|
||||
public const int HMAC_SIZE = HMACSHA3_512.HashSizeInBytes;
|
||||
public const int HMAC_SIZE = SHA512.HashSizeInBytes;
|
||||
public const uint FILE_FIELD_BEGIN = 0x7853dbd5;
|
||||
public const uint FILE_FIELD_INNER_CRYPTO = 0x613e91e4;
|
||||
public const uint FILE_FIELD_CONFIG = 0xd36a53c0;
|
||||
|
||||
Reference in New Issue
Block a user