本文整理汇总了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));
}
示例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()));
}
示例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());
}
示例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));
}
示例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()));
}
示例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());
}