brintos

brintos / linux-shallow public Read only

0
0
Text · 1.5 KiB · 9809dba Raw
46 lines · plain
1Test the nx-gzip function:2=========================3 4Verify that following device exists:5  /dev/crypto/nx-gzip6If you get a permission error run as sudo or set the device permissions:7   sudo chmod go+rw /dev/crypto/nx-gzip8However, chmod may not survive across boots. You may create a udev file such9as:10   /etc/udev/rules.d/99-nx-gzip.rules11 12 13To manually build and run:14$ gcc -O3 -I./include -o gzfht_test gzfht_test.c gzip_vas.c15$ gcc -O3 -I./include -o gunz_test gunz_test.c gzip_vas.c16 17 18Compress any file using Fixed Huffman mode. Output will have a .nx.gz suffix:19$ ./gzfht_test gzip_vas.c20file gzip_vas.c read, 6413 bytes21compressed 6413 to 3124 bytes total, crc32 checksum = abd15e8a22 23 24Uncompress the previous output. Output will have a .nx.gunzip suffix:25./gunz_test gzip_vas.c.nx.gz26gzHeader FLG 02700 00 00 00 04 0328gzHeader MTIME, XFL, OS ignored29computed checksum abd15e8a isize 0000190d30stored   checksum abd15e8a isize 0000190d31decomp is complete: fclose32 33 34Compare two files:35$ sha1sum gzip_vas.c.nx.gz.nx.gunzip gzip_vas.c36bf43e3c0c3651f5f22b6f9784cd9b1eeab4120b6  gzip_vas.c.nx.gz.nx.gunzip37bf43e3c0c3651f5f22b6f9784cd9b1eeab4120b6  gzip_vas.c38 39 40Note that the code here are intended for testing the nx-gzip hardware function.41They are not intended for demonstrating performance or compression ratio.42By being simplistic these selftests expect to allocate the entire set of source43and target pages in the memory so it needs enough memory to work.44For more information and source code consider using:45https://github.com/libnxz/power-gzip46