test.cpp 470 B

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