prg.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. /* Copyright (C) 2019 Anonymous
  2. *
  3. * This is a pre-release version of the DPF++ library distributed anonymously
  4. * for peer review. A public release of the software will be published under the
  5. * LPGL v2.1 license in the near future. Please do not redistribute this version
  6. * of the software.
  7. */
  8. #ifndef DPFPP_PRG_H__
  9. #define DPFPP_PRG_H__
  10. namespace dpf
  11. {
  12. template<typename node_t, typename lowmc>
  13. inline void PRG(const lowmc & prgkey, const node_t & seed, void * outbuf, const uint32_t len, const uint32_t from = 0);
  14. // template<typename row_t = __m256i, typename prgkey_t>
  15. // inline void PRG_bit_sliced(const prgkey_t & prgkey, const std::array<row_t, 128>& seed, void * outbuf, const uint32_t len);
  16. // const lowmc & prgkey, const __m128i & seed, void * outbuf, const uint32_t len, const uint32_t from
  17. // inline void PRG(const lowmc & prgkey, const node_t & seed, void * outbuf, const uint32_t len, const uint32_t from = 0)
  18. // {
  19. // using block_t = typename lowmc::block_t;
  20. // block_t * outbuf128 = reinterpret_cast<block_t*>(outbuf);
  21. // for (size_t i = 0; i < len; ++i) outbuf128[i] = seed ^ block_t(from+i);
  22. // prgkey.encrypt(outbuf128, len);
  23. // for (size_t i = 0; i < len; ++i) outbuf128[i] ^= (seed ^ block_t(from+i));
  24. // }
  25. } // namespace dpf
  26. #endif // DPFPP_PRG_H