- Timestamp:
- Dec 2, 2017 2:28:03 PM (3 years ago)
- Branches:
- master
- Children:
- 1ff9e6e
- Parents:
- e6f17ec1
- Location:
- core/java
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
core/java/src/net/i2p/data/Lease.java
re6f17ec1 r2e88850 73 73 * to the destination through the current lease were successful. 74 74 * 75 * @deprecated unused76 75 */ 77 76 /**** … … 81 80 ****/ 82 81 83 /** @deprecated unused */84 82 /**** 85 83 public void setNumSuccess(int num) { … … 92 90 * to the destination through the current lease failed. 93 91 * 94 * @deprecated unused95 92 */ 96 93 /**** … … 100 97 ****/ 101 98 102 /** @deprecated unused */103 99 /**** 104 100 public void setNumFailure(int num) { -
core/java/test/junit/net/i2p/crypto/AES256Test.java
re6f17ec1 r2e88850 46 46 } 47 47 48 @SuppressWarnings("deprecation") 48 49 public void testLong(){ 49 50 I2PAppContext ctx = new I2PAppContext(); -
core/java/test/junit/net/i2p/crypto/ElGamalTest.java
re6f17ec1 r2e88850 181 181 if (key == null) 182 182 key = _context.sessionKeyManager().createSession(pubKey); 183 byte[] encrypted = _context.elGamalAESEngine().encrypt(DataHelper.getASCII(msg), pubKey, key, 64);183 byte[] encrypted = _context.elGamalAESEngine().encrypt(DataHelper.getASCII(msg), pubKey, key, null, null, 64); 184 184 byte[] decrypted = null; 185 185 try{ 186 decrypted = _context.elGamalAESEngine().decrypt(encrypted, privKey );186 decrypted = _context.elGamalAESEngine().decrypt(encrypted, privKey, _context.sessionKeyManager()); 187 187 }catch(DataFormatException dfe){ 188 188 dfe.printStackTrace(); … … 268 268 key = _context.sessionKeyManager().createSession(pubKey); 269 269 270 byte[] encrypted = _context.elGamalAESEngine().encrypt(msg, pubKey, key, 1024);270 byte[] encrypted = _context.elGamalAESEngine().encrypt(msg, pubKey, key, null, null, 1024); 271 271 byte[] decrypted = null; 272 272 try{ 273 decrypted = _context.elGamalAESEngine().decrypt(encrypted, privKey );273 decrypted = _context.elGamalAESEngine().decrypt(encrypted, privKey, _context.sessionKeyManager()); 274 274 }catch(DataFormatException dfe){ 275 275 dfe.printStackTrace(); … … 344 344 tags.add(new SessionTag(true)); 345 345 } 346 byte encrypted[] = e.encrypt(DataHelper.getASCII("blah"), pubKey, sessionKey, tags, 1024);347 byte decrypted[] = e.decrypt(encrypted, privKey );346 byte encrypted[] = e.encrypt(DataHelper.getASCII("blah"), pubKey, sessionKey, tags, null, 1024); 347 byte decrypted[] = e.decrypt(encrypted, privKey, _context.sessionKeyManager()); 348 348 assertEquals("blah", new String(decrypted)); 349 349 -
core/java/test/junit/net/i2p/crypto/HMACSHA256Bench.java
re6f17ec1 r2e88850 48 48 private static void runTest(I2PAppContext ctx) { 49 49 SessionKey key = ctx.keyGenerator().generateSessionKey(); 50 Hash asdfs = ctx.hmac().calculate(key, "qwerty".getBytes()); 50 byte[] output = new byte[32]; 51 ctx.hmac().calculate(key, "qwerty".getBytes(), 0, 6, output, 0); 51 52 52 53 int times = 100000; … … 71 72 long maxLong1 = 0; 72 73 73 byte[] smess = new String("abc").getBytes();74 byte[] smess = "abc".getBytes(); 74 75 StringBuilder buf = new StringBuilder(); 75 76 for (int x = 0; x < 2*1024; x++) { … … 84 85 85 86 // warm up the engines 86 ctx.hmac().calculate(key, smess );87 ctx.hmac().calculate(key, mmess );88 ctx.hmac().calculate(key, lmess );87 ctx.hmac().calculate(key, smess, 0, smess.length, output, 0); 88 ctx.hmac().calculate(key, mmess, 0, mmess.length, output, 0); 89 ctx.hmac().calculate(key, lmess, 0, lmess.length, output, 0); 89 90 90 91 long before = System.currentTimeMillis(); 91 92 for (int x = 0; x < times; x++) 92 ctx.hmac().calculate(key, smess );93 ctx.hmac().calculate(key, smess, 0, smess.length, output, 0); 93 94 long after = System.currentTimeMillis(); 94 95 … … 97 98 before = System.currentTimeMillis(); 98 99 for (int x = 0; x < times; x++) 99 ctx.hmac().calculate(key, mmess );100 ctx.hmac().calculate(key, mmess, 0, mmess.length, output, 0); 100 101 after = System.currentTimeMillis(); 101 102 … … 104 105 before = System.currentTimeMillis(); 105 106 for (int x = 0; x < times; x++) 106 ctx.hmac().calculate(key, lmess );107 ctx.hmac().calculate(key, lmess, 0, lmess.length, output, 0); 107 108 after = System.currentTimeMillis(); 108 109 -
core/java/test/junit/net/i2p/crypto/HMACSHA256Test.java
re6f17ec1 r2e88850 29 29 _context.random().nextBytes(message); 30 30 31 _context.hmac().calculate(key, message); 31 byte[] output = new byte[32]; 32 _context.hmac().calculate(key, message, 0, message.length, output, 0); 32 33 } 33 34 } -
core/java/test/junit/net/i2p/data/BooleanTest.java
re6f17ec1 r2e88850 21 21 public class BooleanTest extends TestCase{ 22 22 23 @SuppressWarnings("deprecation") 23 24 public void testBoolean() throws Exception{ 24 25 byte[] temp = null; -
core/java/test/junit/net/i2p/data/DataHelperTest.java
re6f17ec1 r2e88850 107 107 } 108 108 109 @SuppressWarnings("deprecation") 109 110 private void checkDate(Date when) throws Exception{ 110 111 byte buf[] = new byte[DataHelper.DATE_LENGTH]; -
core/java/test/junit/net/i2p/kademlia/KBucketSetTest.java
re6f17ec1 r2e88850 130 130 public void testGenRandom() { 131 131 int errors = 0; 132 for (KBucket b : set.getBuckets()) {132 for (KBucket<Hash> b : set.getBuckets()) { 133 133 for (int j = 0; j < 4000; j++) { 134 134 Hash rand = set.generateRandomKey(b); -
core/java/test/junit/net/i2p/stat/SimpleStatDumper.java
re6f17ec1 r2e88850 20 20 } 21 21 22 @SuppressWarnings("deprecation") 22 23 private static void dumpFrequencies(I2PAppContext ctx, StringBuilder buf) { 23 24 Set<String> frequencies = new TreeSet<String>(ctx.statManager().getFrequencyNames());
Note: See TracChangeset
for help on using the changeset viewer.