This repository has been archived by the owner on Oct 1, 2018. It is now read-only.
forked from breadwallet/breadwallet-core
-
Notifications
You must be signed in to change notification settings - Fork 6
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 #1 from digicontributer/dev
digibyte support
- Loading branch information
Showing
36 changed files
with
21,351 additions
and
21 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
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,26 @@ | ||
#include "groestl.h" | ||
#include <stdlib.h> | ||
#include <stdint.h> | ||
#include <string.h> | ||
#include <stdio.h> | ||
|
||
#include "sha3/sph_groestl.h" | ||
#include "sha256.h" | ||
|
||
|
||
// This is myriadgroestl | ||
void groestl_hash(const char* input, char* output) | ||
{ | ||
uint32_t len = 80; | ||
char temp[64]; | ||
|
||
sph_groestl512_context ctx_groestl; | ||
sph_groestl512_init(&ctx_groestl); | ||
sph_groestl512(&ctx_groestl, input, len); | ||
sph_groestl512_close(&ctx_groestl, &temp); | ||
|
||
SHA256_CTX ctx_sha256; | ||
SHA256_Init(&ctx_sha256); | ||
SHA256_Update(&ctx_sha256, &temp, 64); | ||
SHA256_Final((unsigned char*) output, &ctx_sha256); | ||
} |
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,15 @@ | ||
#ifndef GROESTL_H | ||
#define GROESTL_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
|
||
void groestl_hash(const char* input, char* output); | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
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,45 @@ | ||
#include "qubit.h" | ||
|
||
#include <string.h> | ||
#include <stdlib.h> | ||
|
||
#include "sha3/sph_cubehash.h" | ||
#include "sha3/sph_luffa.h" | ||
#include "sha3/sph_shavite.h" | ||
#include "sha3/sph_simd.h" | ||
#include "sha3/sph_echo.h" | ||
|
||
void qubit_hash(const char* input, char* output) | ||
{ | ||
sph_luffa512_context ctx_luffa; | ||
sph_cubehash512_context ctx_cubehash; | ||
sph_shavite512_context ctx_shavite; | ||
sph_simd512_context ctx_simd; | ||
sph_echo512_context ctx_echo; | ||
|
||
uint32_t len = 80; | ||
char hash1[64]; | ||
char hash2[64]; | ||
|
||
sph_luffa512_init(&ctx_luffa); | ||
sph_luffa512(&ctx_luffa, (const void*) input, len); | ||
sph_luffa512_close(&ctx_luffa, (void*) &hash1); // 1 | ||
|
||
sph_cubehash512_init(&ctx_cubehash); | ||
sph_cubehash512(&ctx_cubehash, (const void*) &hash1, 64); // 1 | ||
sph_cubehash512_close(&ctx_cubehash, (void*) &hash2); // 2 | ||
|
||
sph_shavite512_init(&ctx_shavite); | ||
sph_shavite512(&ctx_shavite, (const void*) &hash2, 64); // 3 | ||
sph_shavite512_close(&ctx_shavite, (void*) &hash1); // 4 | ||
|
||
sph_simd512_init(&ctx_simd); | ||
sph_simd512(&ctx_simd, (const void*) &hash1, 64); // 4 | ||
sph_simd512_close(&ctx_simd, (void*) &hash2); // 5 | ||
|
||
sph_echo512_init(&ctx_echo); | ||
sph_echo512(&ctx_echo, (const void*) &hash2, 64); // 5 | ||
sph_echo512_close(&ctx_echo, (void*) &hash1); // 6 | ||
|
||
memcpy(output, &hash1, 32); | ||
} |
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,16 @@ | ||
#ifndef QUBIT_H | ||
#define QUBIT_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
|
||
void qubit_hash(const char* input, char* output); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.