@Override public byte[] saltKey(Key key) { return key.getRoutingKey(); }
@Override public byte[] saltKey(Key key) { return key.getRoutingKey(); }
@Override public byte[] saltKey(Key key) { return key.getRoutingKey(); }
private byte[] localSaltKey(Key key) { MessageDigest md = SHA256.getMessageDigest(); md.update(key.getRoutingKey()); md.update(localSalt); byte[] ret = md.digest(); SHA256.returnMessageDigest(md); return ret; }
public byte[] saltKey(Key key) { MessageDigest md = SHA256.getMessageDigest(); md.update(key.getRoutingKey()); md.update(globalSalt); byte[] ret = md.digest(); SHA256.returnMessageDigest(md); return ret; }
BaseSender(Key key, boolean realTimeFlag, PeerNode source, Node node, short htl, long uid) { if(key.getRoutingKey() == null) throw new NullPointerException(); startTime = System.currentTimeMillis(); this.uid = uid; this.key = key; this.realTimeFlag = realTimeFlag; this.node = node; this.source = source; target = key.toNormalizedDouble(); this.isSSK = key instanceof NodeSSK; assert(isSSK || key instanceof NodeCHK); this.htl = htl; this.origHTL = htl; newLoadManagement = node.enableNewLoadManagement(realTimeFlag); incomingSearchTimeout = calculateTimeout(realTimeFlag, htl, node); }
@Override public Key getNodeKey(boolean cloneKey) { try { Key nodeKey; synchronized(this) { if(ehDocname == null) throw new NullPointerException(); if(pubKeyHash == null) throw new NullPointerException(); if (cachedNodeKey == null || cachedNodeKey.getKeyBytes() == null || cachedNodeKey.getRoutingKey() == null) cachedNodeKey = new NodeSSK(pubKeyHash, ehDocname, pubKey, cryptoAlgorithm); nodeKey = cachedNodeKey; } return cloneKey ? nodeKey.cloneKey() : nodeKey; } catch (SSKVerifyException e) { Logger.error(this, "Have already verified and yet it fails!: "+e); throw (AssertionError)new AssertionError("Have already verified and yet it fails!").initCause(e); } }
store.put(block.getBlock(), false); assertEquals(saltStore.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null), null); tests.add(test); chkBlocks.add(block); assertEquals(test, data); assertNotNull(saltStore.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null));
if(key != null && key.getRoutingKey() == null) throw new NullPointerException(); boolean localRequestOnly;
ClientCHKBlock block = encodeBlockCHK(test); assertEquals(saltStore.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null), null); store.put(block.getBlock(), false); tests.add(test);
if(key.getRoutingKey() == null) throw new NullPointerException();
assertEquals(test, data); assertNotNull(saltStore.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null));
assertEquals(test, data); assertNotNull(saltStore2.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null));
assertNull(saltStore.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null)); } else { assertNotNull(saltStore.fetch(block.getKey().getRoutingKey(), block.getKey().getFullKey(), false, false, false, false, null));