PIByteArray operators & | ^

PIDigest add BLAKE2 algorithms and HMAC
This commit is contained in:
2024-11-27 18:27:51 +03:00
parent 0c973f0216
commit 3a159b0553
15 changed files with 2545 additions and 2 deletions

View File

@@ -33,6 +33,7 @@
#define pidigest_h
#include "pibytearray.h"
#include "piconstchars.h"
class PIP_EXPORT PIDigest {
public:
@@ -47,10 +48,25 @@ public:
MD2,
MD4,
MD5,
BLAKE2s_128,
BLAKE2s_160,
BLAKE2s_224,
BLAKE2s_256,
BLAKE2b_128,
BLAKE2b_160,
BLAKE2b_224,
BLAKE2b_256,
BLAKE2b_384,
BLAKE2b_512,
Count,
};
static int length(Type type);
static int hashLength(Type type);
static int blockLength(Type type);
static PIConstChars typeName(Type type);
static PIByteArray calculate(const PIByteArray & msg, Type type);
static PIByteArray HMAC(const PIByteArray & msg, const PIByteArray & key, PIDigest::Type type);
};
#endif