add crypto tests, fix a handful of panic bugs