Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
supermassive committed Jan 15, 2025
1 parent 3644ec4 commit 8249e0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "brave/components/brave_wallet/browser/internal/hd_key_ed25519_slip23.h"

#include <array>
#include <string>
#include <utility>
#include <vector>

Expand All @@ -22,11 +23,11 @@ namespace brave_wallet {

namespace {

// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-eddsa-05#section-5.1.5
// https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5
// requires scalar to follow this requirements 'The lowest 3 bits of the first
// octet are cleared, the highest bit of the last octet is cleared, and the
// second highest bit of the last octet is set'.
// https://input-output-hk.github.io/adrestia/static/Ed25519_BIP.pdf expands
// https://input-output-hk.github.io/adrestia/static/Ed25519_BIP.pdf extends
// this requirement to `We admit only those k such that the third highest bit
// of the last byte of k is zero`
base::span<uint8_t, kSlip23ScalarSize> ClampScalarEd25519Bip32(
Expand All @@ -41,7 +42,7 @@ base::span<uint8_t, kSlip23ScalarSize> ClampScalarEd25519Bip32(
return scalar;
}

// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-eddsa-05#section-5.1.5
// https://datatracker.ietf.org/doc/html/rfc8032#section-5.1.5
// requires scalar to follow this requirements 'The lowest 3 bits of the first
// octet are cleared, the highest bit of the last octet is cleared, and the
// second highest bit of the last octet is set'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "brave/components/brave_wallet/browser/internal/hd_key_ed25519_slip23.h"

#include <string>
#include <vector>

#include "base/containers/span.h"
Expand Down Expand Up @@ -199,8 +200,7 @@ TEST(HDKeyEd25519Slip23UnitTest, CustomED25519Sign) {
}

TEST(HDKeyEd25519Slip23UnitTest, CardanoSdkCryptoSlip23) {
base::FilePath test_data_dir;
base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir);
auto test_data_dir = base::PathService::CheckedGet(brave::DIR_TEST_DATA);

std::string file_contents;

Expand All @@ -210,6 +210,7 @@ TEST(HDKeyEd25519Slip23UnitTest, CardanoSdkCryptoSlip23) {
&file_contents));

auto test_items = base::test::ParseJsonList(file_contents);
ASSERT_EQ(test_items.size(), 1000u);

for (auto& test : test_items) {
auto& test_dict = test.GetDict();
Expand Down

0 comments on commit 8249e0c

Please sign in to comment.