prg.h 1011 B

12345678910111213141516171819202122232425
  1. #ifndef DPFPP_PRG_H__
  2. #define DPFPP_PRG_H__
  3. namespace dpf
  4. {
  5. template<typename node_t, typename lowmc>
  6. inline void PRG(const lowmc & prgkey, const node_t & seed, void * outbuf, const uint32_t len, const uint32_t from = 0);
  7. // template<typename row_t = __m256i, typename prgkey_t>
  8. // inline void PRG_bit_sliced(const prgkey_t & prgkey, const std::array<row_t, 128>& seed, void * outbuf, const uint32_t len);
  9. // const lowmc & prgkey, const __m128i & seed, void * outbuf, const uint32_t len, const uint32_t from
  10. // inline void PRG(const lowmc & prgkey, const node_t & seed, void * outbuf, const uint32_t len, const uint32_t from = 0)
  11. // {
  12. // using block_t = typename lowmc::block_t;
  13. // block_t * outbuf128 = reinterpret_cast<block_t*>(outbuf);
  14. // for (size_t i = 0; i < len; ++i) outbuf128[i] = seed ^ block_t(from+i);
  15. // prgkey.encrypt(outbuf128, len);
  16. // for (size_t i = 0; i < len; ++i) outbuf128[i] ^= (seed ^ block_t(from+i));
  17. // }
  18. } // namespace dpf
  19. #endif // DPFPP_PRG_H