25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

50 satır
1.3 KiB

  1. // +build amd64,!noasm
  2. package p503
  3. import (
  4. . "github.com/cloudflare/sidh/internal/isogeny"
  5. // This is imported only because arith_amd64.s needs
  6. // some symbols from cpuid.go
  7. _ "github.com/cloudflare/sidh/internal/utils"
  8. )
  9. // If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x.
  10. // If choice is neither 0 nor 1 then behaviour is undefined.
  11. // This function executes in constant time.
  12. //go:noescape
  13. func fp503ConditionalSwap(x, y *FpElement, choice uint8)
  14. // Compute z = x + y (mod p).
  15. //go:noescape
  16. func fp503AddReduced(z, x, y *FpElement)
  17. // Compute z = x - y (mod p).
  18. //go:noescape
  19. func fp503SubReduced(z, x, y *FpElement)
  20. // Compute z = x + y, without reducing mod p.
  21. //go:noescape
  22. func fp503AddLazy(z, x, y *FpElement)
  23. // Compute z = x + y, without reducing mod p.
  24. //go:noescape
  25. func fp503X2AddLazy(z, x, y *FpElementX2)
  26. // Compute z = x - y, without reducing mod p.
  27. //go:noescape
  28. func fp503X2SubLazy(z, x, y *FpElementX2)
  29. // Reduce a field element in [0, 2*p) to one in [0,p).
  30. //go:noescape
  31. func fp503StrongReduce(x *FpElement)
  32. // Computes z = x * y.
  33. //go:noescape
  34. func fp503Mul(z *FpElementX2, x, y *FpElement)
  35. // Computes the Montgomery reduction z = x R^{-1} (mod 2*p). On return value
  36. // of x may be changed. z=x not allowed.
  37. //go:noescape
  38. func fp503MontgomeryReduce(z *FpElement, x *FpElementX2)