Class OwlCurve
java.lang.Object
org.bouncycastle.crypto.agreement.owl.OwlCurve
A pre-computed elliptic curve over a prime field, in short-Weierstrass form for use during an Owl exchange.
In general, Owl can use any elliptic curve or prime order group that is suitable for public key cryptography.
See OwlCurves for convenient standard curves.
NIST publishes many curves with different forms and levels of security.
-
Constructor Summary
ConstructorsConstructorDescriptionOwlCurve(BigInteger q, BigInteger a, BigInteger b, BigInteger n, BigInteger h, BigInteger g_x, BigInteger g_y) Constructs a newOwlCurve. -
Method Summary
Modifier and TypeMethodDescriptiongetA()Get the curve coefficient agetB()Get the curve coefficient bgetCurve()Get the elliptic curvegetG()Get the base point GgetH()Get the co-factor h of the curvegetN()Get n, the order of the base pointgetQ()Get the prime field modulus q of the curve
-
Constructor Details
-
OwlCurve
public OwlCurve(BigInteger q, BigInteger a, BigInteger b, BigInteger n, BigInteger h, BigInteger g_x, BigInteger g_y) Constructs a newOwlCurve.In general, you should use one of the pre-approved curves from
OwlCurves, rather than manually constructing one.The following basic checks are performed:
- q must be prime
- n must be prime
- The curve must not be singular i.e. the discriminant is equal to 0 mod q
- G must lie on the curve
- n*h must equal the order of the curve
- a must be in [0, q-1]
- b must be in [0, q-1]
The prime checks are performed using
BigInteger.isProbablePrime(int), and are therefore subject to the same probability guarantees.These checks prevent trivial mistakes. However, due to the small uncertainties if p and q are not prime, advanced attacks are not prevented. Use it at your own risk.
- Parameters:
q- The prime field modulusa- The curve coefficient ab- The curve coefficient bn- The order of the base point Gh- The co-factorg_x- The x coordinate of the base point Gg_y- The y coordinate of the base point G- Throws:
NullPointerException- if any argument is nullIllegalArgumentException- if any of the above validations fail
-
-
Method Details
-
getCurve
-
getG
-
getA
-
getB
-
getN
-
getH
-
getQ
-