types.hpp 803 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __OBLIVDS_TYPES_HPP__
  2. #define __OBLIVDS_TYPES_HPP__
  3. #include <tuple>
  4. #include <cstdint>
  5. #ifndef VALUE_BITS
  6. #define VALUE_BITS 64
  7. #endif
  8. // Values in memory are of this type
  9. #if VALUE_BITS == 64
  10. typedef uint64_t value_t;
  11. #elif VALUE_BITS == 32
  12. typedef uint32_t value_t;
  13. #else
  14. #error "Unsupported value of VALUE_BITS"
  15. #endif
  16. // A multiplication triple is a triple (X0,Y0,Z0) held by P0 (and
  17. // correspondingly (X1,Y1,Z1) held by P1), with all values random,
  18. // but subject to the relation that X0*Y1 + Y0*X1 = Z0+Z1
  19. typedef std::tuple<value_t, value_t, value_t> MultTriple;
  20. // A half-triple is (X0,Z0) held by P0 (and correspondingly (Y1,Z1) held
  21. // by P1), with all values random, but subject to the relation that
  22. // X0*Y1 = Z0+Z1
  23. typedef std::tuple<value_t, value_t> HalfTriple;
  24. #endif