Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 4)
define(_CLIENT_VERSION_MINOR, 5)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
89 changes: 49 additions & 40 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Raven Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand Down Expand Up @@ -82,12 +82,57 @@ endif
RAVEN_CORE_H = \
addrdb.h \
addressindex.h \
algo/sph_groestl.h \
algo/sph_types.h \
algo/sph_blake.h \
algo/sph_bmw.h \
algo/sph_jh.h \
algo/sph_keccak.h \
algo/sph_skein.h \
algo/sph_luffa.h \
algo/sph_cubehash.h \
algo/sph_simd.h \
algo/sph_echo.h \
algo/sph_shavite.h \
algo/sph_sha2.h \
algo/sph_haval.h \
algo/sph_tiger.h \
algo/lyra2.h \
algo/sponge.h \
algo/gost_streebog.h \
algo/hash_algos.h \
algo/groestl.c \
algo/blake.c \
algo/bmw.c \
algo/cubehash.c \
algo/echo.c \
algo/jh.c \
algo/keccak.c \
algo/luffa.c \
algo/shavite.c \
algo/simd.c \
algo/skein.c \
algo/hamsi.c \
algo/whirlpool.c \
algo/shabal.c \
algo/fugue.c \
algo/sha2.c \
algo/extra.c \
algo/extra.h \
algo/sph_sha2big.c \
algo/haval.c \
algo/tiger.cpp \
algo/lyra2.cpp \
algo/sponge.cpp \
algo/sph_sha2.c \
algo/gost_streebog.c \
spentindex.h \
timestampindex.h \
addrman.h \
assets/assets.h \
assets/assetdb.h \
assets/assettypes.h \
assets/restricteddb.h \
base58.h \
bloom.h \
blockencodings.h \
Expand Down Expand Up @@ -281,49 +326,12 @@ crypto_libraven_crypto_a_SOURCES = \
crypto/hmac_sha512.h \
crypto/ripemd160.cpp \
crypto/aes_helper.c \
crypto/blake.c \
crypto/bmw.c \
crypto/cubehash.c \
crypto/echo.c \
crypto/groestl.c \
crypto/jh.c \
crypto/keccak.c \
crypto/luffa.c \
crypto/shavite.c \
crypto/simd.c \
crypto/skein.c \
crypto/sph_hamsi.c \
crypto/sph_hamsi_helper.c \
crypto/sph_fugue.c \
crypto/sph_shabal.c \
crypto/sph_whirlpool.c \
crypto/sph_sha2.c \
crypto/sph_sha512.c \
crypto/ripemd160.h \
crypto/sha1.cpp \
crypto/sha1.h \
crypto/sha256.cpp \
crypto/sha256.h \
crypto/sha512.h \
crypto/sph_blake.h \
crypto/sph_bmw.h \
crypto/sph_cubehash.h \
crypto/sph_echo.h \
crypto/sph_groestl.h \
crypto/sph_jh.h \
crypto/sph_keccak.h \
crypto/sph_luffa.h \
crypto/sph_shavite.h \
crypto/sph_simd.h \
crypto/sph_skein.h \
crypto/sph_hamsi.h \
crypto/sph_fugue.h \
crypto/sph_shabal.h \
crypto/sph_whirlpool.h \
crypto/sph_sha2.h \
crypto/sph_types.h \
crypto/sha512.cpp \
crypto/sha512.h
crypto/sha512.cpp

if USE_ASM
crypto_libraven_crypto_a_SOURCES += crypto/sha256_sse4.cpp
Expand Down Expand Up @@ -364,7 +372,8 @@ libraven_consensus_a_SOURCES = \
uint256.h \
utilstrencodings.cpp \
utilstrencodings.h \
version.h
version.h \
$(RAVEN_CORE_H)

# common: shared between ravend, and raven-qt and non-server tools
libraven_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(RAVEN_INCLUDES)
Expand Down
110 changes: 110 additions & 0 deletions src/algo/Lyra2RE.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
/*-
* Copyright 2009 Colin Percival, 2011 ArtForz, 2013 Neisklar, 2014 James Lovejoy
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file was originally written by Colin Percival as part of the Tarsnap
* online backup system.
*/

#include "Lyra2RE.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "sph_blake.h"
#include "sph_groestl.h"
#include "sph_cubehash.h"
#include "sph_bmw.h"
#include "sph_keccak.h"
#include "sph_skein.h"
#include "Lyra2.h"

void lyra2re_hash(const char* input, char* output)
{
sph_blake256_context ctx_blake;
sph_groestl256_context ctx_groestl;
sph_keccak256_context ctx_keccak;
sph_skein256_context ctx_skein;

uint32_t hashA[8], hashB[8];

sph_blake256_init(&ctx_blake);
sph_blake256 (&ctx_blake, input, 80);
sph_blake256_close (&ctx_blake, hashA);

sph_keccak256_init(&ctx_keccak);
sph_keccak256 (&ctx_keccak,hashA, 32);
sph_keccak256_close(&ctx_keccak, hashB);

LYRA2_old(hashA, 32, hashB, 32, hashB, 32, 1, 8, 8);

sph_skein256_init(&ctx_skein);
sph_skein256 (&ctx_skein, hashA, 32);
sph_skein256_close(&ctx_skein, hashB);

sph_groestl256_init(&ctx_groestl);
sph_groestl256 (&ctx_groestl, hashB, 32);
sph_groestl256_close(&ctx_groestl, hashA);

memcpy(output, hashA, 32);
}

void lyra2re2_hash(const char* input, char* output)
{
sph_blake256_context ctx_blake;
sph_cubehash256_context ctx_cubehash;
sph_keccak256_context ctx_keccak;
sph_skein256_context ctx_skein;
sph_bmw256_context ctx_bmw;

uint32_t hashA[8], hashB[8];

sph_blake256_init(&ctx_blake);
sph_blake256(&ctx_blake, input, 80);
sph_blake256_close (&ctx_blake, hashA);

sph_keccak256_init(&ctx_keccak);
sph_keccak256(&ctx_keccak, hashA, 32);
sph_keccak256_close(&ctx_keccak, hashB);

sph_cubehash256_init(&ctx_cubehash);
sph_cubehash256(&ctx_cubehash, hashB, 32);
sph_cubehash256_close(&ctx_cubehash, hashA);

LYRA2(hashB, 32, hashA, 32, hashA, 32, 1, 4, 4);

sph_skein256_init(&ctx_skein);
sph_skein256(&ctx_skein, hashB, 32);
sph_skein256_close(&ctx_skein, hashA);

sph_cubehash256_init(&ctx_cubehash);
sph_cubehash256(&ctx_cubehash, hashA, 32);
sph_cubehash256_close(&ctx_cubehash, hashB);

sph_bmw256_init(&ctx_bmw);
sph_bmw256(&ctx_bmw, hashB, 32);
sph_bmw256_close(&ctx_bmw, hashA);

memcpy(output, hashA, 32);
}
15 changes: 15 additions & 0 deletions src/algo/Lyra2RE.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef LYRA2RE_H
#define LYRA2RE_H

#ifdef __cplusplus
extern "C" {
#endif

void lyra2re_hash(const char* input, char* output);
void lyra2re2_hash(const char* input, char* output);

#ifdef __cplusplus
}
#endif

#endif
Loading