#include <tommath.h>#include "stdio.h"#include "string.h"#include <tomcrypt.h>#include "utils.h"#include <math.h>Macros | |
| #define | _CRT_SECURE_NO_WARNINGS |
Functions | |
| void | shakeHash (const int hashAlgorithm, const char *message, int outHashLength, char *outHash) |
| SHAKE 可變長度雜湊函數 | |
| void | shakeMCTHash (const int hashAlgorithm, const char *initialSeedString, int maxOutBitLength, int minOutBitLength) |
| SHAKE 可變長度雜湊函數的Monte Carlo Test. | |
Variables | |
| const int | SHAKE_128 = 1 |
| const int | SHAKE_256 = 2 |
| #define _CRT_SECURE_NO_WARNINGS |
| void shakeHash | ( | const int | hashAlgorithm, |
| const char * | message, | ||
| int | outHashLength, | ||
| char * | outHash ) |
SHAKE 可變長度雜湊函數
SHAKE 可變長度雜湊函數
此函式的輸入為雜湊演算法、訊息、雜湊值長度
此函式的輸出為雜湊值
使用範例:
| hashAlgorithm | 使用的雜湊演算法: SHAKE_128, SHAKE_256 |
| message | 要雜湊的訊息 |
| outHashLength | 希望輸出的雜湊值長度 (bits) |
| outHash | 輸出的雜湊值 (利用指標回傳) |
| void shakeMCTHash | ( | const int | hashAlgorithm, |
| const char * | initialSeedString, | ||
| int | maxOutBitLength, | ||
| int | minOutBitLength ) |
SHAKE 可變長度雜湊函數的Monte Carlo Test.
SHAKE 可變長度雜湊函數的Monte Carlo Test
此函式的輸入為雜湊演算法、初始種子字串、最大輸出長度、最小輸出長度
使用範例:
| hashAlgorithm | 使用的雜湊演算法: SHAKE_128, SHAKE_256 |
| initialSeedString | 初始種子字串 |
| maxOutBitLength | 最大輸出長度 (MCT測試所需) |
| minOutBitLength | 最小輸出長度 (MCT測試所需) |
| const int SHAKE_128 = 1 |
| const int SHAKE_256 = 2 |