ESP32: исправить derivation user_pda для Solana
This commit is contained in:
parent
04252e006b
commit
fba6d6bba0
@ -8,6 +8,9 @@
|
||||
#include <Arduino_GFX_Library.h>
|
||||
#include <TouchDrvCSTXXX.hpp>
|
||||
#include <mbedtls/sha256.h>
|
||||
|
||||
extern "C" int ge25519_is_canonical(const unsigned char *s);
|
||||
extern "C" int ge25519_is_on_curve(const unsigned char *p);
|
||||
#include <mbedtls/base64.h>
|
||||
#include <Ed25519.h>
|
||||
#include <sodium.h>
|
||||
@ -915,7 +918,9 @@ static bool findProgramAddress(const std::vector<std::vector<uint8_t>> &seeds, c
|
||||
reinterpret_cast<const unsigned char *>(kProgramDerivedAddressMarker),
|
||||
strlen(kProgramDerivedAddressMarker));
|
||||
crypto_hash_sha256_final(&st, out32);
|
||||
if (crypto_core_ed25519_is_valid_point(out32) == 0) {
|
||||
bool isCanonical = ge25519_is_canonical(out32) != 0;
|
||||
bool isOnCurve = ge25519_is_on_curve(out32) != 0;
|
||||
if (!(isCanonical && isOnCurve)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
client.version=1.2.170
|
||||
server.version=1.2.159
|
||||
client.version=1.2.171
|
||||
server.version=1.2.160
|
||||
|
||||
Loading…
Reference in New Issue
Block a user