Mode.java 754 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2013 by Yan Huang <yhuang@cs.umd.edu>
  2. // and Xiao Shaun Wang <wangxiao@cs.umd.edu>
  3. package com.oblivm.backend.flexsc;
  4. public enum Mode {
  5. // verify the correctness of the circuit without running the protocol
  6. VERIFY,
  7. // GRR3 + Free XOR
  8. REAL,
  9. // Simulating the protocol and count number of gates/encs
  10. COUNT,
  11. // Half Gates
  12. OPT,
  13. // Offline
  14. OFFLINE;
  15. public static Mode getMode(String optionValue) {
  16. if (optionValue.equals("VERIFY")) {
  17. return VERIFY;
  18. } else if (optionValue.equals("REAL")) {
  19. return REAL;
  20. } else if (optionValue.equals("COUNT")) {
  21. return COUNT;
  22. } else if (optionValue.equals("OPT")) {
  23. return OPT;
  24. } else if (optionValue.equals("OFFLINE")) {
  25. return OPT;
  26. } else
  27. return null;
  28. }
  29. }