Skip to content

Commit 3856507

Browse files
committed
Fuzz tests for CKey->EllSwift
1 parent d314684 commit 3856507

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/fuzz/key.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#include <script/signingprovider.h>
1717
#include <script/standard.h>
1818
#include <streams.h>
19+
#include <test/fuzz/FuzzedDataProvider.h>
1920
#include <test/fuzz/fuzz.h>
2021
#include <util/strencodings.h>
2122

23+
#include <array>
2224
#include <cassert>
2325
#include <cstdint>
2426
#include <numeric>
@@ -304,3 +306,14 @@ FUZZ_TARGET_INIT(key, initialize_key)
304306
}
305307
}
306308
}
309+
310+
FUZZ_TARGET_INIT(ellswift, initialize_key)
311+
{
312+
FuzzedDataProvider fdp{buffer.data(), buffer.size()};
313+
auto key_bytes = fdp.ConsumeBytes<uint8_t>(32);
314+
key_bytes.resize(32);
315+
CKey key;
316+
key.Set(key_bytes.begin(), key_bytes.end(), fdp.ConsumeBool());
317+
318+
(void)key.EllSwiftEncode();
319+
}

0 commit comments

Comments
 (0)