Changeset 1bd5ebd for core


Ignore:
Timestamp:
Oct 21, 2016 5:19:44 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d367149
Parents:
534609e8
Message:

Crypto: Actually use a random nonzero byte in ElGamal?,
as our specification says

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/ElGamalEngine.java

    r534609e8 r1bd5ebd  
    121121
    122122        byte d2[] = new byte[1+Hash.HASH_LENGTH+data.length];
    123         // FIXME this isn't a random nonzero byte!
    124         d2[0] = (byte)0xFF;
     123        // random nonzero byte
     124        do {
     125            _context.random().nextBytes(d2, 0, 1);
     126        } while (d2[0] == 0);
    125127        _context.sha().calculateHash(data, 0, data.length, d2, 1);
    126128        System.arraycopy(data, 0, d2, 1+Hash.HASH_LENGTH, data.length);
Note: See TracChangeset for help on using the changeset viewer.