(ctx)
| 634 | def bitflipper(expr): |
| 635 | """Return a callable that evaluates expr and returns it with a random bitflip.""" |
| 636 | def fn(ctx): |
| 637 | sub = deep_eval(ctx, expr) |
| 638 | assert isinstance(sub, bytes) |
| 639 | return (int.from_bytes(sub, 'little') ^ (1 << random.randrange(len(sub) * 8))).to_bytes(len(sub), 'little') |
| 640 | return fn |
| 641 | |
| 642 | def zero_appender(expr): |