< prev index next >

test/java/security/spec/EllipticCurveMatch.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 6738532
  27  * @summary Check EllipticCurve.equals() does not compare seed value of curve.
  28  * @author Mike StJohns

  29  */
  30 
  31 import java.security.spec.*;
  32 import java.math.BigInteger;
  33 import java.util.Random;
  34 
  35 public class EllipticCurveMatch {
  36     static String primeP256 =
  37         "0FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF";
  38     static String aP256 =
  39         "0FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC";
  40     static String bP256 =
  41         "05AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B";
  42     static String seedP256 =
  43         "0C49D360886E704936A6678E1139D26B7819F7E90";
  44 
  45     private static EllipticCurve addSeedToCurve(EllipticCurve curve)
  46     {
  47         Random rand = new Random();
  48         byte[] seed = new byte[12];




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 6738532
  27  * @summary Check EllipticCurve.equals() does not compare seed value of curve.
  28  * @author Mike StJohns
  29  * @key randomness
  30  */
  31 
  32 import java.security.spec.*;
  33 import java.math.BigInteger;
  34 import java.util.Random;
  35 
  36 public class EllipticCurveMatch {
  37     static String primeP256 =
  38         "0FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF";
  39     static String aP256 =
  40         "0FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC";
  41     static String bP256 =
  42         "05AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B";
  43     static String seedP256 =
  44         "0C49D360886E704936A6678E1139D26B7819F7E90";
  45 
  46     private static EllipticCurve addSeedToCurve(EllipticCurve curve)
  47     {
  48         Random rand = new Random();
  49         byte[] seed = new byte[12];


< prev index next >