当前位置: 首页>>代码示例>>Java>>正文


Java EllipticCurve.getSeed方法代码示例

本文整理汇总了Java中java.security.spec.EllipticCurve.getSeed方法的典型用法代码示例。如果您正苦于以下问题:Java EllipticCurve.getSeed方法的具体用法?Java EllipticCurve.getSeed怎么用?Java EllipticCurve.getSeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.security.spec.EllipticCurve的用法示例。


在下文中一共展示了EllipticCurve.getSeed方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testGetSeed01

import java.security.spec.EllipticCurve; //导入方法依赖的package包/类
/**
 * Test #1 for <code>getSeed()</code> method<br>
 * Assertion: returns <code>seed</code><br>
 * Test preconditions: <code>ECFieldF2m</code> instance
 * created using valid parameters<br>
 * Expected: must return <code>seed</code> which is equal
 * to the one passed to the constructor
 */
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verifies positive case.",
    method = "getSeed",
    args = {}
)
public final void testGetSeed01() {
    ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
    BigInteger a = BigInteger.ONE;
    BigInteger b = BigInteger.valueOf(19L);
    byte[] seed = new byte[24];
    EllipticCurve c = new EllipticCurve(f, a, b, seed);
    byte[] seedRet = c.getSeed();
    assertNotNull(seedRet);
    assertTrue(Arrays.equals(seed, seedRet));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:25,代码来源:EllipticCurveTest.java

示例2: testGetSeed02

import java.security.spec.EllipticCurve; //导入方法依赖的package包/类
/**
 * Test #2 for <code>getSeed()</code> method<br>
 * Assertion: returned array is copied to prevent subsequent modification<br>
 * Test preconditions: <code>ECFieldF2m</code> instance
 * created using valid parameters; <code>getSeed()</code>
 * called and then returned array modified<br>
 * Expected: internal state must not be affected by the modification
 */
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verifies that modification of byte array  doesn't change internal state of test object.",
    method = "getSeed",
    args = {}
)
public final void testGetSeed02() {
    ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
    BigInteger a = BigInteger.ONE;
    BigInteger b = BigInteger.valueOf(19L);
    byte[] seed = new byte[24];
    EllipticCurve c = new EllipticCurve(f, a, b, seed.clone());
    byte[] seedRet = c.getSeed();
    // modify returned array
    seedRet[0] = (byte) 1;
    // check that above modification did not changed
    // internal state of test object
    assertTrue(Arrays.equals(seed, c.getSeed()));
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:28,代码来源:EllipticCurveTest.java

示例3: testGetSeed03

import java.security.spec.EllipticCurve; //导入方法依赖的package包/类
/**
 * Test #3 for <code>getSeed()</code> method<br>
 * Assertion: returned array is copied to prevent subsequent modification<br>
 * Test preconditions: <code>ECFieldF2m</code> instance
 * created using valid parameters<br>
 * Expected: repeated method calls must return different refs
 */
@TestTargetNew(
    level = TestLevel.PARTIAL_COMPLETE,
    notes = "Verifies that repeated calls of getSeed method must return different refs.",
    method = "getSeed",
    args = {}
)
public final void testGetSeed03() {
    ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
    BigInteger a = BigInteger.ONE;
    BigInteger b = BigInteger.valueOf(19L);
    byte[] seed = new byte[24];
    EllipticCurve c = new EllipticCurve(f, a, b, seed);
    c.getSeed();
    assertNotSame(c.getSeed(), c.getSeed());
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:23,代码来源:EllipticCurveTest.java

示例4: testGetSeed01

import java.security.spec.EllipticCurve; //导入方法依赖的package包/类
/**
 * Test #1 for <code>getSeed()</code> method<br>
 * Assertion: returns <code>seed</code><br>
 * Test preconditions: <code>ECFieldF2m</code> instance
 * created using valid parameters<br>
 * Expected: must return <code>seed</code> which is equal
 * to the one passed to the constructor
 */
public final void testGetSeed01() {
    ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
    BigInteger a = BigInteger.ONE;
    BigInteger b = BigInteger.valueOf(19L);
    byte[] seed = new byte[24];
    EllipticCurve c = new EllipticCurve(f, a, b, seed);
    byte[] seedRet = c.getSeed();
    assertNotNull(seedRet);
    assertTrue(Arrays.equals(seed, seedRet));
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:19,代码来源:EllipticCurveTest.java

示例5: testGetSeed02

import java.security.spec.EllipticCurve; //导入方法依赖的package包/类
/**
 * Test #2 for <code>getSeed()</code> method<br>
 * Assertion: returned array is copied to prevent subsequent modification<br>
 * Test preconditions: <code>ECFieldF2m</code> instance
 * created using valid parameters; <code>getSeed()</code>
 * called and then returned array modified<br>
 * Expected: internal state must not be affected by the modification
 */
public final void testGetSeed02() {
    ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
    BigInteger a = BigInteger.ONE;
    BigInteger b = BigInteger.valueOf(19L);
    byte[] seed = new byte[24];
    EllipticCurve c = new EllipticCurve(f, a, b, seed.clone());
    byte[] seedRet = c.getSeed();
    // modify returned array
    seedRet[0] = (byte) 1;
    // check that above modification did not changed
    // internal state of test object
    assertTrue(Arrays.equals(seed, c.getSeed()));
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:22,代码来源:EllipticCurveTest.java

示例6: testGetSeed03

import java.security.spec.EllipticCurve; //导入方法依赖的package包/类
/**
 * Test #3 for <code>getSeed()</code> method<br>
 * Assertion: returned array is copied to prevent subsequent modification<br>
 * Test preconditions: <code>ECFieldF2m</code> instance
 * created using valid parameters<br>
 * Expected: repeated method calls must return different refs
 */
public final void testGetSeed03() {
    ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
    BigInteger a = BigInteger.ONE;
    BigInteger b = BigInteger.valueOf(19L);
    byte[] seed = new byte[24];
    EllipticCurve c = new EllipticCurve(f, a, b, seed);
    c.getSeed();
    assertNotSame(c.getSeed(), c.getSeed());
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:17,代码来源:EllipticCurveTest.java


注:本文中的java.security.spec.EllipticCurve.getSeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。