Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
        Rebranding to nrghash
  • Loading branch information
levongh committed Mar 19, 2018
1 parent ecb9d3d commit 69bb76d
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*.exe
*.out
*.app
/egihash
/nrghash

# Autotools files
*.deps
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SUBDIRS=libegihash include test
SUBDIRS=libnrghash include test
ACLOCAL_AMFLAGS=-I m4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# egihash
# nrghash
Energi cryptocurrency hash algorithm
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([egihash],[1.23.0])
AC_INIT([nrghash],[1.23.0])
AC_PROG_CC
AC_PROG_CXX

Expand Down Expand Up @@ -36,7 +36,7 @@ CCFLAGS="$BOOST_CCFLAGS -O3 -Wall -Wextra -Werror -Wno-unused-function"

AC_CONFIG_FILES(Makefile
test/Makefile
libegihash/Makefile
libnrghash/Makefile
include/Makefile)
AC_OUTPUT

2 changes: 1 addition & 1 deletion data/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Dag file used for testing

/egihash.dag
/nrghash.dag
2 changes: 1 addition & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These files will end up in the install include directory
# For example, /usr/include
include_HEADERS = egihash.h
include_HEADERS = nrghash.h
24 changes: 12 additions & 12 deletions include/egihash.h → include/nrghash.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <vector>
#include <cstring>

namespace egihash
namespace nrghash
{
bool test_function() noexcept;

Expand All @@ -39,15 +39,15 @@ namespace egihash
*/
static constexpr uint32_t CALLBACK_FREQUENCY = 1024u;

/** \brief The major version of egihash
/** \brief The major version of nrghash
*/
static constexpr uint32_t MAJOR_VERSION = 1u;

/** \brief The revision number (middle version digit) of egihash
/** \brief The revision number (middle version digit) of nrghash
*/
static constexpr uint32_t REVISION = 23u;

/** \brief The minor version number of egihash
/** \brief The minor version number of nrghash
*/
static constexpr uint32_t MINOR_VERSION = 0u;

Expand Down Expand Up @@ -81,11 +81,11 @@ namespace egihash
*/
static constexpr uint32_t EPOCH_LENGTH = 30000u;

/** \brief The width of the mix hash for egihash.
/** \brief The width of the mix hash for nrghash.
*/
static constexpr uint32_t MIX_BYTES = 128u;

/** \brief The size of an egihash in bytes.
/** \brief The size of an nrghash in bytes.
*/
static constexpr uint32_t HASH_BYTES = 64u;

Expand All @@ -97,7 +97,7 @@ namespace egihash
*/
static constexpr uint32_t CACHE_ROUNDS = 3u;

/** \brief The number of DAG lookups to compute an egihash.
/** \brief The number of DAG lookups to compute an nrghash.
*/
static constexpr uint32_t ACCESSES = 64u;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ namespace egihash
static_assert(sizeof(node) == sizeof(uint32_t), "Invalid hash node size");


/** \brief hash_exception indicates an error or cancellation when performing a task within egihash.
/** \brief hash_exception indicates an error or cancellation when performing a task within nrghash.
*
* All functions not marked noexcept may be assumed to throw hash_exception or C++ runtime exceptions.
*/
Expand Down Expand Up @@ -287,7 +287,7 @@ namespace egihash
*/
static constexpr h512_t empty_h512;

/** \brief result_t represents the result of an egihash.
/** \brief result_t represents the result of an nrghash.
*/
struct result_t
{
Expand Down Expand Up @@ -325,7 +325,7 @@ namespace egihash
*/
bool operator==(result_t const &) const;

/** \brief This member contains the egihash result value.
/** \brief This member contains the nrghash result value.
*/
h256_t value;

Expand Down Expand Up @@ -501,9 +501,9 @@ namespace egihash
::std::shared_ptr<impl_t> impl;
};

/** \brief dag_t is the DAG which is used by full nodes and miners to compute egihashes.
/** \brief dag_t is the DAG which is used by full nodes and miners to compute nrghashes.
*
* The DAG gives egihash it's ASIC resistance, ensuring that this hashing function is memory bound not compute bound.
* The DAG gives nrghash it's ASIC resistance, ensuring that this hashing function is memory bound not compute bound.
* The DAG must be updated once per constants::EPOCH_LENGTH block numbers.
* The DAG for epoch 0 is 1073739904 bytes in size and will grow linearly with each following epoch.
* The DAG can take a long time to generate. It is recommended to save the DAG to disk to avoid having to regenerate it each time.
Expand Down
10 changes: 5 additions & 5 deletions libegihash/Makefile.am → libnrghash/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# The list of libraries we are building seperated by spaces.
# The 'lib_' indicates that these build products will be installed
# in the $(libdir) directory. For example /usr/lib
lib_LTLIBRARIES = libegihash.la
lib_LTLIBRARIES = libnrghash.la

#######################################
# Build information for each library

# Sources for libegihash
libegihash_la_SOURCES = egihash.cpp keccak-tiny.c
# Sources for libnrghash
libnrghash_la_SOURCES = nrghash.cpp keccak-tiny.c

# Linker options libTestProgram
libegihash_la_LDFLAGS =
libnrghash_la_LDFLAGS =

# Compiler options. Here we are adding the include directory
# to be searched for headers included in the source code.
libegihash_la_CPPFLAGS = -I$(top_srcdir)/include -D__STDC_WANT_LIB_EXT1__=1 -DUSE_SECURE_MEMZERO
libnrghash_la_CPPFLAGS = -I$(top_srcdir)/include -D__STDC_WANT_LIB_EXT1__=1 -DUSE_SECURE_MEMZERO
File renamed without changes.
6 changes: 3 additions & 3 deletions libegihash/egihash.cpp → libnrghash/nrghash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "egihash.h"
#include "nrghash.h"
extern "C"
{
#include "keccak-tiny.h"
Expand All @@ -24,7 +24,7 @@ extern "C"

namespace
{
using namespace egihash;
using namespace nrghash;

#pragma pack(push, 1)
struct dag_file_header_t
Expand Down Expand Up @@ -305,7 +305,7 @@ namespace
}
}

namespace egihash
namespace nrghash
{
constexpr h256_t::size_type h256_t::hash_size;

Expand Down
2 changes: 1 addition & 1 deletion test/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/egihash_test
/nrghash_test
12 changes: 6 additions & 6 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# The list of executables we are building seperated by spaces
# the 'bin_' indicates that these build products will be installed
# in the $(bindir) directory. For example /usr/bin
#bin_PROGRAMS=egihash_test
#bin_PROGRAMS=nrghash_test

# Because a.out is only a sample program we don't want it to be installed.
# The 'noinst_' prefix indicates that the following targets are not to be
# installed.
noinst_PROGRAMS=egihash_test
noinst_PROGRAMS=nrghash_test

#######################################
# Build information for each executable. The variable name is derived
Expand All @@ -18,13 +18,13 @@ noinst_PROGRAMS=egihash_test
ACLOCAL_AMFLAGS=-I ../m4

# Sources for the a.out
egihash_test_SOURCES= egihash_test.cpp
nrghash_test_SOURCES= nrghash_test.cpp

# Libraries for a.out
egihash_test_LDADD = $(top_srcdir)/libegihash/libegihash.la
nrghash_test_LDADD = $(top_srcdir)/libnrghash/libnrghash.la

# Linker options for a.out
egihash_test_LDFLAGS = -rpath `cd $(top_srcdir);pwd`/libegihash/.libs $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
nrghash_test_LDFLAGS = -rpath `cd $(top_srcdir);pwd`/libnrghash/.libs $(BOOST_UNIT_TEST_FRAMEWORK_LIB)

# Compiler options for a.out
egihash_test_CPPFLAGS = -I$(top_srcdir)/include -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN
nrghash_test_CPPFLAGS = -I$(top_srcdir)/include -DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN
Loading

0 comments on commit 69bb76d

Please sign in to comment.