This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#define ROTR32(x, n) ((x >> n) | (x << (32 - n))) | |
#define CH(x, y, z) ((x & y) ^ (~x & z)) | |
#define MAJ(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) | |
#define SHA256_F1(x) (ROTR32(x, 2) ^ ROTR32(x, 13) ^ ROTR32(x, 22)) |