-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from rafael-santiago/inc-hash-emu
Emulate incremental hashing
- Loading branch information
Showing
19 changed files
with
1,068 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--forgefiles=Arc4Sample.hsl,BlowfishSample.hsl,SerpentSample.hsl,FealSample.hsl,HashSample.hsl,DiffieHellmanMerkleSample.hsl,RsaSample.hsl,ElgamalSample.hsl,DsaSample.hsl,EncodingSample.hsl,PemSample.hsl,FortunaSample.hsl,AesSample.hsl,KdfSample.hsl,BcryptSample.hsl,Poly1305Sample.hsl,SipHashSample.hsl,FiveAesFinalistsSample.hsl,OtpSample.hsl --Arc4Sample-projects=arc4-sample,arc4-c99-sample --BlowfishSample-projects=blowfish-ecb-sample,blowfish-ecb-c99-sample --SerpentSample-projects=serpent-cbc-c99-sample --FealSample-projects=feal-cbc-c99-sample --HashSample-projects=bare-bone-hash-sample,hash-macro-sample,hmac-sample,blake2b-keyed-hash-sample,blake2n-sample,blake3-sample --DiffieHellmanMerkleSample-projects=std-dh-sample,mod-dh-sample,dh-domain-params-sample,dh-domain-params-verify-sample,dh-domain-params-load-sample,ecdh-sample --RsaSample-projects=rsa-mk-key-pair-sample,rsa-schoolbook-sample,rsa-schoolbook-c99-sample,rsa-oaep-c99-sample,rsa-sign-sample,rsa-sign-c99-sample,rsa-emsa-pss-sign-c99-sample --ElgamalSample-projects=elgamal-mk-key-pair-sample,elgamal-schoolbook-c99-sample,elgamal-oaep-c99-sample --DsaSample-projects=dsa-mk-key-pair-sample,dsa-sign-c99-sample,ecdsa-mk-key-pair-sample,ecdsa-sign-c99-sample --EncodingSample-projects=base64-sample,base64-dsl-sample,uuencode-dsl-sample,huffman-sample --PemSample-projects=pem-buffer-put-data-sample,pem-buffer-get-data-sample,pem-buffer-get-mp-data-sample --FortunaSample-projects=fortuna-sample --AesSample-projects=aes-ctr-c99-sample,aes-gcm-c99-sample --KdfSample-projects=hkdf-sample,pbkdf2-sample,argon2-sample --BcryptSample-projects=bcrypt-sample --Poly1305Sample-projects=poly1305-c99-sample,poly1305-bare-bone-sample --SipHashSample-projects=siphash-sum-sample,siphash-as-mac-c99-sample --FiveAesFinalistsSample-projects=5-aes-finalists-sample --OtpSample-projects=hotp-c99-sample,totp-c99-sample --obj-output-dir=o --bin-output-dir=../../samples/ --includes=.. --libraries=../../lib --ldflags=-lkryptos --cflags=-DKRYPTOS_MITIGATE_TIMING_ATTACKS=1,-DKRYPTOS_ENSURE_MEMSET_CLEANUPS=1,-DKRYPTOS_DATA_WIPING_WHEN_FREEING_MEMORY=1 | ||
--forgefiles=Arc4Sample.hsl,BlowfishSample.hsl,SerpentSample.hsl,FealSample.hsl,HashSample.hsl,DiffieHellmanMerkleSample.hsl,RsaSample.hsl,ElgamalSample.hsl,DsaSample.hsl,EncodingSample.hsl,PemSample.hsl,FortunaSample.hsl,AesSample.hsl,KdfSample.hsl,BcryptSample.hsl,Poly1305Sample.hsl,SipHashSample.hsl,FiveAesFinalistsSample.hsl,OtpSample.hsl --Arc4Sample-projects=arc4-sample,arc4-c99-sample --BlowfishSample-projects=blowfish-ecb-sample,blowfish-ecb-c99-sample --SerpentSample-projects=serpent-cbc-c99-sample --FealSample-projects=feal-cbc-c99-sample --HashSample-projects=bare-bone-hash-sample,hash-macro-sample,hmac-sample,blake2b-keyed-hash-sample,blake2n-sample,blake3-sample,hash-inc-input-sample --DiffieHellmanMerkleSample-projects=std-dh-sample,mod-dh-sample,dh-domain-params-sample,dh-domain-params-verify-sample,dh-domain-params-load-sample,ecdh-sample --RsaSample-projects=rsa-mk-key-pair-sample,rsa-schoolbook-sample,rsa-schoolbook-c99-sample,rsa-oaep-c99-sample,rsa-sign-sample,rsa-sign-c99-sample,rsa-emsa-pss-sign-c99-sample --ElgamalSample-projects=elgamal-mk-key-pair-sample,elgamal-schoolbook-c99-sample,elgamal-oaep-c99-sample --DsaSample-projects=dsa-mk-key-pair-sample,dsa-sign-c99-sample,ecdsa-mk-key-pair-sample,ecdsa-sign-c99-sample --EncodingSample-projects=base64-sample,base64-dsl-sample,uuencode-dsl-sample,huffman-sample --PemSample-projects=pem-buffer-put-data-sample,pem-buffer-get-data-sample,pem-buffer-get-mp-data-sample --FortunaSample-projects=fortuna-sample --AesSample-projects=aes-ctr-c99-sample,aes-gcm-c99-sample --KdfSample-projects=hkdf-sample,pbkdf2-sample,argon2-sample --BcryptSample-projects=bcrypt-sample --Poly1305Sample-projects=poly1305-c99-sample,poly1305-bare-bone-sample --SipHashSample-projects=siphash-sum-sample,siphash-as-mac-c99-sample --FiveAesFinalistsSample-projects=5-aes-finalists-sample --OtpSample-projects=hotp-c99-sample,totp-c99-sample --obj-output-dir=o --bin-output-dir=../../samples/ --includes=.. --libraries=../../lib --ldflags=-lkryptos --cflags=-DKRYPTOS_MITIGATE_TIMING_ATTACKS=1,-DKRYPTOS_ENSURE_MEMSET_CLEANUPS=1,-DKRYPTOS_DATA_WIPING_WHEN_FREEING_MEMORY=1 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (C) 2022 by Rafael Santiago | ||
* | ||
* This is a free software. You can redistribute it and/or modify under | ||
* the terms of the GNU General Public License version 2. | ||
* | ||
*/ | ||
#include <kryptos.h> | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
|
||
int main(void) { | ||
kryptos_task_ctx t, *ktask = &t; | ||
kryptos_u8_t *alpha = (kryptos_u8_t *)"abcdefghijklmnopqrstuvwxyz"; | ||
kryptos_hash_init(sha3_512, ktask); | ||
while (*alpha != 0) { | ||
kryptos_hash_update(ktask, alpha, 2); | ||
alpha += 2; | ||
} | ||
kryptos_hash_finalize(ktask, 1); | ||
printf("SHA3-512 hex result = %s\n", ktask->out); | ||
kryptos_task_free(ktask, KRYPTOS_TASK_OUT); | ||
return EXIT_SUCCESS; | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.