Skip to content

Commit

Permalink
dos2unix all files, we are on linux
Browse files Browse the repository at this point in the history
trim them, btw... its important to start on a clean base...
  • Loading branch information
tpruvot committed Jul 12, 2015
1 parent a319e02 commit bb31cec
Show file tree
Hide file tree
Showing 291 changed files with 64,248 additions and 64,249 deletions.
8 changes: 4 additions & 4 deletions stratum/algos/Sponge.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Header file for Blake2b's internal permutation in the form of a sponge.
* This code is based on the original Blake2b's implementation provided by
* Header file for Blake2b's internal permutation in the form of a sponge.
* This code is based on the original Blake2b's implementation provided by
* Samuel Neves (https://blake2.net/)
*
*
* Author: The Lyra PHC team (http://www.lyra-kdf.net/) -- 2014.
*
*
* This software is hereby placed in the public domain.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
Expand Down
32 changes: 16 additions & 16 deletions stratum/algos/blake.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include "blake.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_blake.h"


void blake_hash(const char* input, char* output, uint32_t len)
{
sph_blake256_context ctx_blake;
sph_blake256_init(&ctx_blake);
sph_blake256(&ctx_blake, input, len);
sph_blake256_close(&ctx_blake, output);
}
#include "blake.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_blake.h"


void blake_hash(const char* input, char* output, uint32_t len)
{
sph_blake256_context ctx_blake;
sph_blake256_init(&ctx_blake);
sph_blake256(&ctx_blake, input, len);
sph_blake256_close(&ctx_blake, output);
}
32 changes: 16 additions & 16 deletions stratum/algos/blake.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#ifndef BLAKE_H
#define BLAKE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void blake_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif
#ifndef BLAKE_H
#define BLAKE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void blake_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif
88 changes: 44 additions & 44 deletions stratum/algos/fresh.c
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
#include "fresh.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_shavite.h"
#include "../sha3/sph_simd.h"
#include "../sha3/sph_echo.h"

void fresh_hash(const char* input, char* output, uint32_t len)
{
sph_shavite512_context ctx_shavite1;
sph_simd512_context ctx_simd1;
sph_echo512_context ctx_echo1;

//these uint512 in the c++ source of the client are backed by an array of uint32
uint32_t hashA[16], hashB[16];

sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, input, len);
sph_shavite512_close(&ctx_shavite1, hashA);

sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hashA, 64);
sph_simd512_close(&ctx_simd1, hashB);

sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, hashB, 64);
sph_shavite512_close(&ctx_shavite1, hashA);

sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hashA, 64);
sph_simd512_close(&ctx_simd1, hashB);

sph_echo512_init (&ctx_echo1);
sph_echo512 (&ctx_echo1, hashB, 64);
sph_echo512_close(&ctx_echo1, hashA);

memcpy(output, hashA, 32);

}

#include "fresh.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_shavite.h"
#include "../sha3/sph_simd.h"
#include "../sha3/sph_echo.h"

void fresh_hash(const char* input, char* output, uint32_t len)
{
sph_shavite512_context ctx_shavite1;
sph_simd512_context ctx_simd1;
sph_echo512_context ctx_echo1;

//these uint512 in the c++ source of the client are backed by an array of uint32
uint32_t hashA[16], hashB[16];

sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, input, len);
sph_shavite512_close(&ctx_shavite1, hashA);

sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hashA, 64);
sph_simd512_close(&ctx_simd1, hashB);

sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, hashB, 64);
sph_shavite512_close(&ctx_shavite1, hashA);

sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hashA, 64);
sph_simd512_close(&ctx_simd1, hashB);

sph_echo512_init (&ctx_echo1);
sph_echo512 (&ctx_echo1, hashB, 64);
sph_echo512_close(&ctx_echo1, hashA);

memcpy(output, hashA, 32);

}


32 changes: 16 additions & 16 deletions stratum/algos/fresh.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#ifndef FRESH_H
#define FRESH_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void fresh_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif
#ifndef FRESH_H
#define FRESH_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void fresh_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif
82 changes: 41 additions & 41 deletions stratum/algos/groestl.c
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@

#include "groestl.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_groestl.h"
#include "sha256.h"

void groestl_hash(const char* input, char* output, uint32_t len)
{
char hash1[64];
char hash2[64];

sph_groestl512_context ctx_groestl;
sph_groestl512_init(&ctx_groestl);
sph_groestl512(&ctx_groestl, input, len);
sph_groestl512_close(&ctx_groestl, &hash1);

sph_groestl512(&ctx_groestl, hash1, 64);
sph_groestl512_close(&ctx_groestl, &hash2);

memcpy(output, &hash2, 32);
}

void groestlmyriad_hash(const char* input, char* output, uint32_t len)
{
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);
}

#include "groestl.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_groestl.h"
#include "sha256.h"

void groestl_hash(const char* input, char* output, uint32_t len)
{
char hash1[64];
char hash2[64];

sph_groestl512_context ctx_groestl;
sph_groestl512_init(&ctx_groestl);
sph_groestl512(&ctx_groestl, input, len);
sph_groestl512_close(&ctx_groestl, &hash1);

sph_groestl512(&ctx_groestl, hash1, 64);
sph_groestl512_close(&ctx_groestl, &hash2);

memcpy(output, &hash2, 32);
}

void groestlmyriad_hash(const char* input, char* output, uint32_t len)
{
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);
}

36 changes: 18 additions & 18 deletions stratum/algos/groestl.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#ifndef GROESTL_H
#define GROESTL_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void groestl_hash(const char* input, char* output, uint32_t len);
void groestlmyriad_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif
#ifndef GROESTL_H
#define GROESTL_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

void groestl_hash(const char* input, char* output, uint32_t len);
void groestlmyriad_hash(const char* input, char* output, uint32_t len);

#ifdef __cplusplus
}
#endif

#endif

64 changes: 32 additions & 32 deletions stratum/algos/keccak.c
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@

#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_types.h"
#include "../sha3/sph_keccak.h"

void keccak_hash(const char *input, char *output, uint32_t len)
{
sph_keccak256_context ctx_keccak;
sph_keccak256_init(&ctx_keccak);

sph_keccak256(&ctx_keccak, input, len);
sph_keccak256_close(&ctx_keccak, output);
}

//void keccak_hash2(const char *input, char *output, uint32_t len)
//{
// uint32_t hashA[16];
//
// sph_keccak512_context ctx_keccak;
// sph_keccak512_init(&ctx_keccak);
//
// sph_keccak512(&ctx_keccak, input, len);
// sph_keccak512_close(&ctx_keccak, hashA);
//
// memcpy(output, hashA, 32);
//}


#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "../sha3/sph_types.h"
#include "../sha3/sph_keccak.h"

void keccak_hash(const char *input, char *output, uint32_t len)
{
sph_keccak256_context ctx_keccak;
sph_keccak256_init(&ctx_keccak);

sph_keccak256(&ctx_keccak, input, len);
sph_keccak256_close(&ctx_keccak, output);
}

//void keccak_hash2(const char *input, char *output, uint32_t len)
//{
// uint32_t hashA[16];
//
// sph_keccak512_context ctx_keccak;
// sph_keccak512_init(&ctx_keccak);
//
// sph_keccak512(&ctx_keccak, input, len);
// sph_keccak512_close(&ctx_keccak, hashA);
//
// memcpy(output, hashA, 32);
//}


Loading

0 comments on commit bb31cec

Please sign in to comment.