generate_compressed_matrices.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # create archive directory
  2. archive_dir=../../../archives/resources
  3. archive_dir_tests=$archive_dir/parser_tests
  4. [ ! -d $archive_dir_tests ] && mkdir $archive_dir_tests
  5. [ ! -d $archive_dir_tests/128 ] && mkdir $archive_dir_tests/128
  6. [ ! -d $archive_dir_tests/256 ] && mkdir $archive_dir_tests/256
  7. # create cache
  8. cache_dir=../../../cache
  9. cache_dir_tests=$cache_dir/tests
  10. [ ! -d $cache_dir_tests ] && mkdir $cache_dir_tests
  11. cache_output=$cache_dir_tests/xmatrixdir
  12. [ ! -d $cache_output ] && mkdir $cache_output
  13. rm -rf $cache_output/*
  14. # generate 128 bit xoron matrix
  15. arch=128
  16. if [ ! -e $archive_dir_tests/$arch/xmatrix_comp_file.xf ] || [ ! -s $archive_dir_tests/$arch/xmatrix_comp_file.xf ] ; then
  17. str="
  18. xrnlib-cli \
  19. --encoding-conf -compiled-param -no-password \
  20. --permutation-conf -arch $arch \
  21. --mine-xmatrix-comp-rnd -random -xmatrix-comp $archive_dir_tests/$arch/xmatrix_comp_file.xf
  22. "
  23. echo ""; echo $str; echo ""
  24. eval $str
  25. fi
  26. # generate 256 bit xoron matrix
  27. arch=256
  28. if [ ! -e $archive_dir_tests/$arch/xmatrix_comp_file.xf ] || [ ! -s $archive_dir_tests/$arch/xmatrix_comp_file.xf ] ; then
  29. str="
  30. xrnlib-cli \
  31. --encoding-conf -compiled-param -no-password \
  32. --permutation-conf -arch $arch \
  33. --mine-xmatrix-comp-ot -random -xmatrix-comp $archive_dir_tests/$arch/xmatrix_comp_file.xf
  34. "
  35. echo ""; echo $str; echo ""
  36. eval $str
  37. fi