Skip to content

Commit

Permalink
Fuzz tests for CKey->EllSwift
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv committed Oct 20, 2022
1 parent d314684 commit 3856507
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/fuzz/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
#include <script/signingprovider.h>
#include <script/standard.h>
#include <streams.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <util/strencodings.h>

#include <array>
#include <cassert>
#include <cstdint>
#include <numeric>
Expand Down Expand Up @@ -304,3 +306,14 @@ FUZZ_TARGET_INIT(key, initialize_key)
}
}
}

FUZZ_TARGET_INIT(ellswift, initialize_key)
{
FuzzedDataProvider fdp{buffer.data(), buffer.size()};
auto key_bytes = fdp.ConsumeBytes<uint8_t>(32);
key_bytes.resize(32);
CKey key;
key.Set(key_bytes.begin(), key_bytes.end(), fdp.ConsumeBool());

(void)key.EllSwiftEncode();
}

0 comments on commit 3856507

Please sign in to comment.