README 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Test the nx-gzip function:
  2. =========================
  3. Verify that following device exists:
  4. /dev/crypto/nx-gzip
  5. If you get a permission error run as sudo or set the device permissions:
  6. sudo chmod go+rw /dev/crypto/nx-gzip
  7. However, chmod may not survive across boots. You may create a udev file such
  8. as:
  9. /etc/udev/rules.d/99-nx-gzip.rules
  10. To manually build and run:
  11. $ gcc -O3 -I./include -o gzfht_test gzfht_test.c gzip_vas.c
  12. $ gcc -O3 -I./include -o gunz_test gunz_test.c gzip_vas.c
  13. Compress any file using Fixed Huffman mode. Output will have a .nx.gz suffix:
  14. $ ./gzfht_test gzip_vas.c
  15. file gzip_vas.c read, 6413 bytes
  16. compressed 6413 to 3124 bytes total, crc32 checksum = abd15e8a
  17. Uncompress the previous output. Output will have a .nx.gunzip suffix:
  18. ./gunz_test gzip_vas.c.nx.gz
  19. gzHeader FLG 0
  20. 00 00 00 00 04 03
  21. gzHeader MTIME, XFL, OS ignored
  22. computed checksum abd15e8a isize 0000190d
  23. stored checksum abd15e8a isize 0000190d
  24. decomp is complete: fclose
  25. Compare two files:
  26. $ sha1sum gzip_vas.c.nx.gz.nx.gunzip gzip_vas.c
  27. bf43e3c0c3651f5f22b6f9784cd9b1eeab4120b6 gzip_vas.c.nx.gz.nx.gunzip
  28. bf43e3c0c3651f5f22b6f9784cd9b1eeab4120b6 gzip_vas.c
  29. Note that the code here are intended for testing the nx-gzip hardware function.
  30. They are not intended for demonstrating performance or compression ratio.
  31. By being simplistic these selftests expect to allocate the entire set of source
  32. and target pages in the memory so it needs enough memory to work.
  33. For more information and source code consider using:
  34. https://github.com/libnxz/power-gzip