diff options
author | Roberto Tyley <roberto.tyley@gmail.com> | 2014-07-15 01:38:01 +0400 |
---|---|---|
committer | Roberto Tyley <roberto.tyley@gmail.com> | 2014-07-26 11:23:17 +0400 |
commit | 7cb752aaf746dc0b473afeb9e892b7fbc12666c5 (patch) | |
tree | cc4f91ddc18332b5adbe82e3fcb040d976c90105 /prov/src/main/java/org/bouncycastle/jce/ECPointUtil.java | |
parent | 551830f8ea5177042af2c7dd1fc90888bc67387d (diff) |
Execute become-spongy.sh
https://github.com/rtyley/spongycastle/blob/3040af/become-spongy.sh
Diffstat (limited to 'prov/src/main/java/org/bouncycastle/jce/ECPointUtil.java')
-rw-r--r-- | prov/src/main/java/org/bouncycastle/jce/ECPointUtil.java | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/prov/src/main/java/org/bouncycastle/jce/ECPointUtil.java b/prov/src/main/java/org/bouncycastle/jce/ECPointUtil.java deleted file mode 100644 index 5ff966a2..00000000 --- a/prov/src/main/java/org/bouncycastle/jce/ECPointUtil.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.bouncycastle.jce; - -import java.security.spec.ECFieldF2m; -import java.security.spec.ECFieldFp; -import java.security.spec.ECPoint; -import java.security.spec.EllipticCurve; - -import org.bouncycastle.math.ec.ECCurve; - -/** - * Utility class for handling EC point decoding. - */ -public class ECPointUtil -{ - /** - * Decode a point on this curve which has been encoded using point - * compression (X9.62 s 4.2.1 and 4.2.2) or regular encoding. - * - * @param curve - * The elliptic curve. - * @param encoded - * The encoded point. - * @return the decoded point. - */ - public static ECPoint decodePoint( - EllipticCurve curve, - byte[] encoded) - { - ECCurve c = null; - - if (curve.getField() instanceof ECFieldFp) - { - c = new ECCurve.Fp( - ((ECFieldFp)curve.getField()).getP(), curve.getA(), curve.getB()); - } - else - { - int k[] = ((ECFieldF2m)curve.getField()).getMidTermsOfReductionPolynomial(); - - if (k.length == 3) - { - c = new ECCurve.F2m( - ((ECFieldF2m)curve.getField()).getM(), k[2], k[1], k[0], curve.getA(), curve.getB()); - } - else - { - c = new ECCurve.F2m( - ((ECFieldF2m)curve.getField()).getM(), k[0], curve.getA(), curve.getB()); - } - } - - org.bouncycastle.math.ec.ECPoint p = c.decodePoint(encoded); - - return new ECPoint(p.getAffineXCoord().toBigInteger(), p.getAffineYCoord().toBigInteger()); - } -} |