test_gen_pub.test 694 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # N = 11 * 13
  3. # e = 103
  4. # d = 7
  5. ./gen pub -N 143 -e 103 | grep -q PUBLIC
  6. if [ $? -ne 0 ]
  7. then
  8. echo "should accept public exponent and public modulus."
  9. exit 1
  10. fi
  11. # <http://cryptowars2011.forumfree.it/?t=58954862>
  12. p='5596931086554284281185296406554840964858720713572245165038844132225787390922\
  13. 226340619345603534845283511495476913891096668345376424228245705523358529690689'
  14. q='5596931086554284281185296406554840964858720713572245165038844132225787390922\
  15. 226340619345603534845283511495476913891096668345376424228245705523358529692809'
  16. ./gen pub -p $p -q $q -e 29
  17. if [ $? -ne 0 ]
  18. then
  19. echo "should accept the pair of primes <p, q> and the public exponent."
  20. exit 1
  21. fi