/
githubmirror
/
bitcoin
Обзор
Документация
Войти
/
githubmirror
/
bitcoin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/bench/ellswift.cpp
33 строки
1 KB
Hennadii Stepanov
iwyu: Fix warnings in `src/bench` and treat them as error
10 июн 2026, 12:32
Не верифицирован
10 июн 2026, 12:32
6751a32
Код
Авторство
О чём код?
// Copyright (c) 2022-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <bench/bench.h> #include <key.h> #include <pubkey.h> #include <random.h> #include <span.h> #include <uint256.h> #include <util/check.h> #include <algorithm> #include <span> static void EllSwiftCreate(benchmark::Bench& bench) { ECC_Context ecc_context{}; CKey key = GenerateRandomKey(); uint256 entropy = GetRandHash(); bench.batch(1).unit("pubkey").run([&] { auto ret = key.EllSwiftCreate(MakeByteSpan(entropy)); /* Use the first 32 bytes of the ellswift encoded public key as next private key. */ key.Set(ret.data(), ret.data() + 32, true); assert(key.IsValid()); /* Use the last 32 bytes of the ellswift encoded public key as next entropy. */ std::copy(ret.begin() + 32, ret.begin() + 64, MakeWritableByteSpan(entropy).begin()); }); } BENCHMARK(EllSwiftCreate);