checkhelp.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. check_help() {
  2. command="$1"
  3. printf "\n"
  4. echo $command
  5. listhelp="$(./xrnlib-cli --help $command | tail -n +3 | sed -E 's/^(.{1,50}).*$/\1/' | sed '/^a valid example/q' | head -n -1 | tr -s '\n' ' ' | sed 's/^.//; s/.$//' | tr ' ' '\n' | sort | uniq | tr '\n' ' ')"
  6. listexamples=""
  7. counter=1
  8. while [ $counter -le 5000 ]
  9. do
  10. listexample="$(./xrnlib-cli --example -rnd $command | tr -s '\\' ' ' | tr -s '//' ' ' | tr -s '\n' ' ' | tr -s ' ' '\n' | awk '/^-{1,2}[a-zA-Z0-9_]+/ {print}' | sort | tr '\n' ' ')"
  11. listexamples="${listexamples} ${listexample}"
  12. listexamples=$(echo "$listexamples" | tr ' ' '\n' | sort | uniq | tr '\n' ' ')
  13. counter=$((counter + 1))
  14. done
  15. unique_to_string1=$(echo "$listhelp $listexamples" | tr ' ' '\n' | sort | uniq -u | tr -s '\n' ' ')
  16. if [ -z "$unique_to_string1" ]; then
  17. echo "correct"
  18. else
  19. echo "help list: " $listhelp
  20. echo "example list: " $listexamples
  21. echo "fail list: " $unique_to_string1
  22. fi
  23. }
  24. #check_help "dump-encoding-param"
  25. #check_help "mine-xmatrix-comp-rnd"
  26. #check_help "mine-xmatrix-comp-ot"
  27. #check_help "permute-xmatrix-comp-rnd"
  28. #check_help "permute-xmatrix-comp-det"
  29. #check_help "permute-xmatrix-comp-sec"
  30. #check_help "decompress-xmatrix"
  31. #check_help "check-xmatrix-comp"
  32. #check_help "check-xmatrix"
  33. #check_help "make-point"
  34. #check_help "make-secure-pseudo-random-number"
  35. #check_help "make-start-point"
  36. #check_help "make-monomial-key"
  37. #check_help "make-binomial-key"
  38. #check_help "exchange-monomial-key"
  39. #check_help "make-monovalent-key"
  40. #check_help "exchange-polyvalent-key"
  41. #check_help "check-monovalent-key"
  42. #check_help "make-commitment-binomial-key"
  43. #check_help "make-commitment-sym-signature"
  44. #check_help "make-commitment-sym-certificate"
  45. #check_help "make-response"
  46. #check_help "make-monomial-proof"
  47. #check_help "make-monomial-proof-sym-signature"
  48. #check_help "make-monomial-proof-sym-certificate"
  49. #check_help "check-monomial-proof"
  50. #check_help "check-monomial-proof-sym-signature"
  51. #check_help "check-monomial-proof-sym-certificate"
  52. #check_help "make-signature-symmetric"
  53. #check_help "make-signature-asymmetric"
  54. #check_help "make-ring-signature"
  55. #check_help "make-certificate-symmetric"
  56. #check_help "make-certificate-asymmetric"
  57. #check_help "check-signature-symmetric"
  58. #check_help "check-signature-asymmetric"
  59. #check_help "check-ring-signature"
  60. #check_help "check-certificate-symmetric"
  61. #check_help "check-certificate-asymmetric"
  62. #check_help "make-hash"
  63. #check_help "make-checksum"
  64. #check_help "check-hash"
  65. #check_help "check-checksum"
  66. #check_help "convert-hash-to-monomial-key"
  67. #check_help "convert-hash-to-point"
  68. #check_help "convert-point-to-monomial-key"
  69. #check_help "convert-monomial-key-to-point"
  70. #check_help "convert-binomial-key-to-start-point"
  71. #check_help "convert-start-point-to-point"
  72. #check_help "convert-point-to-start-point"
  73. #check_help "convert-monomial-key-to-monomial-commitment"
  74. #check_help "convert-monomial-commitment-to-monomial-key"
  75. #check_help "convert-symmetric-certificate-to-monovalent-key"
  76. #check_help "convert-asymmetric-certificate-to-binomial-key"
  77. #check_help "convert-asymmetric-signature-to-binomial-key"
  78. check_help "convert-symmetric-signature-to-binomial-key"
  79. #check_help "convert-binomial-key-to-asymmetric-signature"
  80. #check_help "convert-binomial-key-to-symmetric-signature"
  81. #check_help "split-symmetric"
  82. #check_help "join-symmetric"
  83. #check_help "encrypt-symmetric"
  84. #check_help "encrypt-asymmetric"
  85. #check_help "decipher-symmetric"
  86. #check_help "decipher-asymmetric"
  87. #check_help "check-complete-block"
  88. #check_help "make-block"
  89. #check_help "combine-blocks"
  90. #check_help "strip-header-from-block"
  91. #check_help "print-header"
  92. #check_help "print-lib-info"
  93. #check_help "get-capacity"
  94. #check_help "make-steganography-block"
  95. #check_help "extract-steganography-block"