Skip to content

Commit a552c19

Browse files
author
limxdev
committed
Add test Mega_BTX
1 parent 8d44a25 commit a552c19

15 files changed

Lines changed: 3696 additions & 176 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ BitCore BTX preserves and implements Bitcoin features such as SegWit, which enab
1717
- Unique wallet addresses (prefixes of 2 and S and btx (BIP 173 bench32)
1818
- Command Fork System
1919
- Masternode System Dash Core
20+
- 2,100 BTX for one Masternode
2021
- 220 Byte Datacarriersize (OP_RETURN)
2122
- Hashalgorythm Timetravel10
2223
- Bitcore Diffshield

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
44
define(_CLIENT_VERSION_MINOR, 90)
55
define(_CLIENT_VERSION_REVISION, 9)
6-
define(_CLIENT_VERSION_BUILD, 1)
6+
define(_CLIENT_VERSION_BUILD, 2)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2020)
99
define(_COPYRIGHT_HOLDERS,[The %s developers])

src/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ crypto_libbitcoin_crypto_base_a_SOURCES += \
392392
crypto/cubehash.c \
393393
crypto/echo.c \
394394
crypto/groestl.c \
395+
crypto/gost_streebog.h \
395396
crypto/hashblock.h \
396397
crypto/jh.c \
397398
crypto/keccak.c \
@@ -426,13 +427,16 @@ crypto_libbitcoin_crypto_base_a_SOURCES += \
426427
crypto/sph_shabal.c \
427428
crypto/sph_shabal.h \
428429
crypto/sph_shavite.h \
430+
crypto/sph_haval.h \
431+
crypto/haval.c \
429432
crypto/sph_simd.h \
430433
crypto/sph_skein.h \
431434
crypto/sph_types.h \
432435
crypto/sph_whirlpool.c \
433436
crypto/sph_whirlpool.h \
434437
crypto/sponge.c \
435438
crypto/sponge.h \
439+
crypto/gost_streebog.c \
436440
crypto/mega-btx.h
437441

438442

src/consensus/params.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct Params {
112112
int64_t nPowTargetTimespan;
113113
int64_t nPowTargetTimespanV2; // BTX
114114
int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
115-
int64_t DifficultyAdjustmentIntervalV2() const { return nPowTargetTimespanV2 / nPowTargetSpacing; }
115+
int64_t DifficultyAdjustmentIntervalV2() const { return nPowTargetTimespanV2 / nPowTargetSpacing; }
116116
uint256 nMinimumChainWork;
117117
uint256 defaultAssumeValid;
118118
int nlastValidPowHashHeight; // BTX for faster loading

src/crypto/gost_streebog.c

Lines changed: 1023 additions & 0 deletions
Large diffs are not rendered by default.

src/crypto/gost_streebog.h

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/* $Id: sph_gost.h 216 2010-06-08 09:46:57Z tp $ */
2+
/**
3+
* GOST interface. This is the interface for GOST R 12 with the
4+
* recommended parameters for SHA-3, with output lengths 256
5+
* and 512 bits.
6+
*
7+
* ==========================(LICENSE BEGIN)============================
8+
*
9+
* Copyright (c) 2007-2010 Projet RNRT SAPHIR
10+
*
11+
* Permission is hereby granted, free of charge, to any person obtaining
12+
* a copy of this software and associated documentation files (the
13+
* "Software"), to deal in the Software without restriction, including
14+
* without limitation the rights to use, copy, modify, merge, publish,
15+
* distribute, sublicense, and/or sell copies of the Software, and to
16+
* permit persons to whom the Software is furnished to do so, subject to
17+
* the following conditions:
18+
*
19+
* The above copyright notice and this permission notice shall be
20+
* included in all copies or substantial portions of the Software.
21+
*
22+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
26+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29+
*
30+
* ===========================(LICENSE END)=============================
31+
*
32+
* @file sph_gost.h
33+
* @author Mish <mish@btchouse.com>
34+
*/
35+
36+
#ifndef BITCORE_CRYPTO_GOST_STREEBOG_H
37+
#define BITCORE_CRYPTO_GOST_STREEBOG_H
38+
39+
#ifdef __cplusplus
40+
extern "C"{
41+
#endif
42+
43+
#include <stddef.h>
44+
#include <crypto/sph_types.h>
45+
46+
/**
47+
* Output size (in bits) for GOST-256.
48+
*/
49+
#define SPH_SIZE_gost256 256
50+
51+
/**
52+
* Output size (in bits) for GOST-512.
53+
*/
54+
#define SPH_SIZE_gost512 512
55+
56+
/**
57+
* This structure is a context for Keccak computations: it contains the
58+
* intermediate values and some data from the last entered block. Once a
59+
* GOST computation has been performed, the context can be reused for
60+
* another computation.
61+
*
62+
* The contents of this structure are private. A running GOST computation
63+
* can be cloned by copying the context (e.g. with a simple
64+
* <code>memcpy()</code>).
65+
*/
66+
67+
/**
68+
* This structure is a context for Gost-256 computations.
69+
*/
70+
71+
typedef struct {
72+
#ifndef DOXYGEN_IGNORE
73+
unsigned char buf[32]; /* first field, for alignment */
74+
size_t ptr;
75+
sph_u32 V[3][8];
76+
#endif
77+
} sph_gost256_context;
78+
79+
/**
80+
* This structure is a context for Gost-512 computations.
81+
*/
82+
typedef struct {
83+
#ifndef DOXYGEN_IGNORE
84+
unsigned char buf[64]; /* first field, for alignment */
85+
size_t ptr;
86+
sph_u32 V[5][8];
87+
#endif
88+
} sph_gost512_context;
89+
90+
91+
/**
92+
* Initialize a GOST-256 context. This process performs no memory allocation.
93+
*
94+
* @param cc the GOST-256 context (pointer to a
95+
* <code>sph_gost256_context</code>)
96+
*/
97+
void sph_gost256_init(void *cc);
98+
99+
/**
100+
* Process some data bytes. It is acceptable that <code>len</code> is zero
101+
* (in which case this function does nothing).
102+
*
103+
* @param cc the Gost-256 context
104+
* @param data the input data
105+
* @param len the input data length (in bytes)
106+
*/
107+
void sph_gost256(void *cc, const void *data, size_t len);
108+
109+
/**
110+
* Terminate the current GOST-256 computation and output the result into
111+
* the provided buffer. The destination buffer must be wide enough to
112+
* accomodate the result (32 bytes). The context is automatically
113+
* reinitialized.
114+
*
115+
* @param cc the GOST-256 context
116+
* @param dst the destination buffer
117+
*/
118+
void sph_gost256_close(void *cc, void *dst);
119+
120+
/**
121+
* Add a few additional bits (0 to 7) to the current computation, then
122+
* terminate it and output the result in the provided buffer, which must
123+
* be wide enough to accomodate the result (32 bytes). If bit number i
124+
* in <code>ub</code> has value 2^i, then the extra bits are those
125+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
126+
* level). The context is automatically reinitialized.
127+
*
128+
* @param cc the GOST-256 context
129+
* @param ub the extra bits
130+
* @param n the number of extra bits (0 to 7)
131+
* @param dst the destination buffer
132+
*/
133+
void sph_gost256_addbits_and_close(
134+
void *cc, unsigned ub, unsigned n, void *dst);
135+
136+
/**
137+
* Initialize a Gost-512 context. This process performs no memory allocation.
138+
*
139+
* @param cc the GOST-512 context (pointer to a
140+
* <code>sph_gost512_context</code>)
141+
*/
142+
void sph_gost512_init(void *cc);
143+
144+
/**
145+
* Process some data bytes. It is acceptable that <code>len</code> is zero
146+
* (in which case this function does nothing).
147+
*
148+
* @param cc the GOST-512 context
149+
* @param data the input data
150+
* @param len the input data length (in bytes)
151+
*/
152+
void sph_gost512(void *cc, const void *data, size_t len);
153+
154+
/**
155+
* Terminate the current GOST-512 computation and output the result into
156+
* the provided buffer. The destination buffer must be wide enough to
157+
* accomodate the result (64 bytes). The context is automatically
158+
* reinitialized.
159+
*
160+
* @param cc the GOST-512 context
161+
* @param dst the destination buffer
162+
*/
163+
void sph_gost512_close(void *cc, void *dst);
164+
165+
/**
166+
* Add a few additional bits (0 to 7) to the current computation, then
167+
* terminate it and output the result in the provided buffer, which must
168+
* be wide enough to accomodate the result (64 bytes). If bit number i
169+
* in <code>ub</code> has value 2^i, then the extra bits are those
170+
* numbered 7 downto 8-n (this is the big-endian convention at the byte
171+
* level). The context is automatically reinitialized.
172+
*
173+
* @param cc the GOST-512 context
174+
* @param ub the extra bits
175+
* @param n the number of extra bits (0 to 7)
176+
* @param dst the destination buffer
177+
*/
178+
void sph_gost512_addbits_and_close(
179+
void *cc, unsigned ub, unsigned n, void *dst);
180+
181+
#ifdef __cplusplus
182+
}
183+
#endif
184+
185+
#endif // BITCORE_CRYPTO_GOST_STREEBOG_H

0 commit comments

Comments
 (0)