Metadata-Version: 2.4
Name: crossfuzz
Version: 0.0.3
Summary: Python harness for the crossfuzz differential fuzzer
Project-URL: Homepage, https://github.com/KilledKenny/crossfuzz
Project-URL: Source, https://github.com/KilledKenny/crossfuzz
Project-URL: Issues, https://github.com/KilledKenny/crossfuzz/issues
Author-email: Simon Rawet <Simon@rawet.se>
License: MIT License
        
        Copyright (c) 2026 Simon Rawet
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: coverage,differential-fuzzing,fuzzing,security,testing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Requires-Dist: coverage>=7.0
Description-Content-Type: text/markdown

# crossfuzz

Python harness for [crossfuzz](https://github.com/KilledKenny/crossfuzz), a
coverage-guided **differential fuzzer** across C, C++, Go, Java,
JavaScript/TypeScript, Python, and Rust. The coordinator sends the same
generated input to multiple implementations of the same function, collects
coverage from every target, and flags any divergence in outputs.

This package is the Python side: it handles the shared-memory IPC, pipe
protocol, and branch-arc coverage collection so you only have to write the
target function.

## Install

```bash
pip install crossfuzz
```

You also need the `crossfuzz` coordinator binary — see the
[main repo](https://github.com/KilledKenny/crossfuzz) for build/install instructions.

## Quick start

Write a target script that calls `crossfuzz.fuzz(your_function)`:

```python
import crossfuzz

def my_target(data: bytes) -> bytes:
    # Your code under test. Raise an exception to signal an error.
    return data

crossfuzz.fuzz(my_target)
```

Point the coordinator at it from a `crossfuzz.toml` config:

```toml
[[target]]
name = "python_impl"
language = "python"
binary = "python3"
args = ["my_target.py"]
```

Then run the campaign with `crossfuzz run crossfuzz.toml`.

## API

- `crossfuzz.fuzz(target, settings=None)` — persistent fuzz loop.
  `target(data: bytes) -> bytes`.
- `crossfuzz.filter(target, settings=None)` — persistent filter loop.
  `target(data: bytes) -> tuple[bytes, bool]`.
- `crossfuzz.compare(target, settings=None)` — custom comparator loop.
  `target(input: bytes, names: list[str], outputs: list[bytes]) -> str`.
- `crossfuzz.Settings(instrument=True, warmup=0, transform=False)` —
  configuration. Set `instrument=False` for thin HTTP-trigger harnesses
  where coverage comes from an instrumented server process.

## Platform

POSIX only — the harness uses `mmap` and inherited file descriptors 3/4 to
talk to the coordinator. Windows is not supported.

## License

MIT
