Skip to content

Commit facaa95

Browse files
committed
Latest checkpoints and fixes
1 parent 6f53611 commit facaa95

File tree

6 files changed

+31
-2
lines changed

6 files changed

+31
-2
lines changed

ReleaseNotes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Release notes 4.0.2-beta
2+
3+
- Latest checkpoints and fixes
4+
15
Release notes 4.0.1-beta
26

37
- Default block size updated to 200Kb to avoid any unconfirmed transactions

src/CryptoNoteConfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ const std::initializer_list<CheckpointData> CHECKPOINTS = {
167167
{ 258852, "9f2b0ff556c8088b498928e835134727aede39832bf3c66cc439384b12bab289" },
168168
{ 317000, "775fe833c74ca0e0de22a259364379e83a1b228c99cfdabc52e50beabacf08d3" },
169169
{ 336336, "0075d20bf2b378750a5cc34baa208f75bf3119c5cb009b2b4182e733dff34b67" },
170+
{ 360000, "296cf882a4d14a12de1403ff9326b446ba3694b032fa46e33136a58903897475" },
171+
{ 385000, "79de0d2a49a2ad3407003931c0caa2cd040594519fcaf955ae724909334883ee" },
170172
};
171173

172174
} // CryptoNote

src/CryptoNoteCore/Blockchain.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,12 @@ bool Blockchain::check_tx_input(const KeyInput& txin, const Crypto::Hash& tx_pre
15751575
return true;
15761576
}
15771577

1578+
static const Crypto::KeyImage I = { {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } };
1579+
static const Crypto::KeyImage L = { {0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 } };
1580+
if (m_blocks.size() > 385000 && !(scalarmultKey(txin.keyImage, L) == I)) {
1581+
return false;
1582+
}
1583+
15781584
return Crypto::check_ring_signature(tx_prefix_hash, txin.keyImage, output_keys, sig.data());
15791585
}
15801586

src/crypto/crypto.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,17 @@ namespace Crypto {
286286
ge_p1p1_to_p3(&res, &point2);
287287
}
288288

289+
KeyImage crypto_ops::scalarmultKey(const KeyImage & P, const KeyImage & a) {
290+
ge_p3 A;
291+
ge_p2 R;
292+
// maybe use assert instead?
293+
ge_frombytes_vartime(&A, reinterpret_cast<const unsigned char*>(&P));
294+
ge_scalarmult(&R, reinterpret_cast<const unsigned char*>(&a), &A);
295+
KeyImage aP;
296+
ge_tobytes(reinterpret_cast<unsigned char*>(&aP), &R);
297+
return aP;
298+
}
299+
289300
void crypto_ops::hash_data_to_ec(const uint8_t* data, std::size_t len, PublicKey& key) {
290301
Hash h;
291302
ge_p2 point;

src/crypto/crypto.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ struct EllipticCurveScalar {
7070
friend bool check_signature(const Hash &, const PublicKey &, const Signature &);
7171
static void generate_key_image(const PublicKey &, const SecretKey &, KeyImage &);
7272
friend void generate_key_image(const PublicKey &, const SecretKey &, KeyImage &);
73+
static KeyImage scalarmultKey(const KeyImage & P, const KeyImage & a);
74+
friend KeyImage scalarmultKey(const KeyImage & P, const KeyImage & a);
7375
static void hash_data_to_ec(const uint8_t*, std::size_t, PublicKey&);
7476
friend void hash_data_to_ec(const uint8_t*, std::size_t, PublicKey&);
7577
static void generate_ring_signature(const Hash &, const KeyImage &,
@@ -207,6 +209,10 @@ struct EllipticCurveScalar {
207209
crypto_ops::generate_key_image(pub, sec, image);
208210
}
209211

212+
inline KeyImage scalarmultKey(const KeyImage & P, const KeyImage & a) {
213+
return crypto_ops::scalarmultKey(P, a);
214+
}
215+
210216
inline void hash_data_to_ec(const uint8_t* data, std::size_t len, PublicKey& key) {
211217
crypto_ops::hash_data_to_ec(data, len, key);
212218
}

src/version.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define BUILD_COMMIT_ID "@VERSION@"
2-
#define PROJECT_VERSION "4.0.1-beta"
3-
#define PROJECT_VERSION_BUILD_NO "1799"
2+
#define PROJECT_VERSION "4.0.2-beta"
3+
#define PROJECT_VERSION_BUILD_NO "1800"
44
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"

0 commit comments

Comments
 (0)