pairing.cpp 479 B

12345678910111213141516171819202122
  1. #include "pairing.hpp"
  2. fp12e_t OptimalAte(const curvepoint_fp_t& op1, const twistpoint_fp2_t& op2)
  3. {
  4. fp12e_t retval;
  5. optate(retval, op2, op1);
  6. return retval;
  7. }
  8. Quadripoint pairing(const Bipoint<curvepoint_fp_t>& op1, const Bipoint<twistpoint_fp2_t>& op2)
  9. {
  10. Quadripoint retval;
  11. retval[0] = OptimalAte(op1[0], op2[0]);
  12. retval[1] = OptimalAte(op1[0], op2[1]);
  13. retval[2] = OptimalAte(op1[1], op2[0]);
  14. retval[3] = OptimalAte(op1[1], op2[1]);
  15. return retval;
  16. }