Changeset cc6cd9e for router


Ignore:
Timestamp:
Nov 24, 2016 6:04:40 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
497d088
Parents:
64f5fed0
Message:

Sybil tool enhancements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/router/RouterKeyGenerator.java

    r64f5fed0 rcc6cd9e  
    188188   
    189189    /**
     190     * Get the routing key for the specified date, not today's
     191     *
     192     * @param time Java time
     193     * @since 0.9.28
     194     */
     195    public Hash getRoutingKey(Hash origKey, long time) {
     196        String modVal;
     197        synchronized(this) {
     198            modVal = _fmt.format(time);
     199        }
     200        if (modVal.length() != LENGTH)
     201            throw new IllegalStateException();
     202        byte[] mod = new byte[LENGTH];
     203        for (int i = 0; i < LENGTH; i++) {
     204            mod[i] = (byte)(modVal.charAt(i) & 0xFF);
     205        }
     206        return getKey(origKey, mod);
     207    }
     208   
     209    /**
    190210     * Generate a modified (yet consistent) hash from the origKey by generating the
    191211     * SHA256 of the targetKey with the specified modData appended to it
Note: See TracChangeset for help on using the changeset viewer.