Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

This directory contains an OCaml implementation of a decompressor for lzo1x_1_15_compress from the LZO decompression library.

val decompress : string -> (string, [> `Msg of string]) result
(** [decompres compressed] is the LZO1x-decompressed
    [Ok decompressed]
    or [Error `Msg error_message]
    @raises Invalid_argument if an out-of-bounds write would have occurred. This is should not happen with valid data; please do send us any offending trigger strings.

Test suite

The Alcotest test suite can be run with dune runtest. It contains static known-good / known-bad cases either manually constructed or lifted from OpenVPN and minilzo.


The minilzo-2.10 subdirectory contains the minilzo distribution by Markus Franz Xaver Johannes Oberhumer (under GPL license, see minilzo-2.10/COPYING). This is not used in the OCaml library, but for test case generation: The testmini.c program has been modified to produce random test cases for the Alcotest test suite. The .ocamlinit file in the directory makes utop load the relevant modules. Usage:

make gcc
while ./testmini > && utop ; do : ; done
# If an error is caught (or exception is raised), you will be left in the utop
# shell with the offending test case in `test_case.ll`

Other implementations and resources that may be of interest

You can’t perform that action at this time.