test.cpp 452 B

12345678910111213141516
  1. #include <crypt/BigInt64.hpp>
  2. #include <hash.hpp>
  3. #include <iostream>
  4. #include <util.hpp>
  5. int main(){
  6. const int runs = 1000;
  7. std::mt19937_64 gen(54);
  8. std::vector<BigInt> vec(runs, BigInt(gen, 65536));
  9. std::vector<BigInt> hashes(runs);
  10. auto a = std::nanoTime();
  11. for(int i = 0;i < runs;i++){
  12. hashes[i] = sha512(vec[i]);
  13. }
  14. auto b = std::nanoTime();
  15. std::cout << (b - a) / 1000 / 1000.0 << " ms" << std::endl;
  16. }