Changeset 2244142b


Ignore:
Timestamp:
Aug 14, 2010 6:22:46 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c035ef6e
Parents:
4323036
Message:

javadoc, comment out some main()s

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/I2PAppContext.java

    r4323036 r2244142b  
    211211    *
    212212    *  All dirs except the base are created if they don't exist, but the creation will fail silently.
     213    *  @since 0.7.6
    213214    */
    214215    private void initializeDirs() {
     
    266267    }
    267268
     269    /**
     270     *  This is the installation dir, often referred to as $I2P.
     271     *  Applilcations should consider this directory read-only and never
     272     *  attempt to write to it.
     273     *  It may actually be read-only on a multi-user installation.
     274     *  The config files in this directory are templates for user
     275     *  installations and should not be accessed by applications.
     276     *  The only thing that may be useful in here is the lib/ dir
     277     *  containing the .jars.
     278     *  @since 0.7.6
     279     *  @return dir constant for the life of the context
     280     */
    268281    public File getBaseDir() { return _baseDir; }
     282
     283    /**
     284     *  The base dir for config files.
     285     *  Applications may use this to access router configuration files if necessary.
     286     *  Usually ~/.i2p on Linux and %APPDIR%\I2P on Windows.
     287     *  In installations originally installed with 0.7.5 or earlier, and in
     288     *  "portable" installations, this will be the same as the base dir.
     289     *  @since 0.7.6
     290     *  @return dir constant for the life of the context
     291     */
    269292    public File getConfigDir() { return _configDir; }
     293
     294    /**
     295     *  Where the router keeps its files.
     296     *  Applications should not use this.
     297     *  The same as the config dir for now.
     298     *  @since 0.7.6
     299     *  @return dir constant for the life of the context
     300     */
    270301    public File getRouterDir() { return _routerDir; }
     302
     303    /**
     304     *  Where router.ping goes.
     305     *  Applications should not use this.
     306     *  The same as the system temp dir for now.
     307     *  Which is a problem for multi-user installations.
     308     *  @since 0.7.6
     309     *  @return dir constant for the life of the context
     310     */
    271311    public File getPIDDir() { return _pidDir; }
     312
     313    /**
     314     *  Where the router keeps its log directory.
     315     *  Applications should not use this.
     316     *  The same as the config dir for now.
     317     *  (i.e. ~/.i2p, NOT ~/.i2p/logs)
     318     *  @since 0.7.6
     319     *  @return dir constant for the life of the context
     320     */
    272321    public File getLogDir() { return _logDir; }
     322
     323    /**
     324     *  Where applications may store data.
     325     *  The same as the config dir for now, but may change in the future.
     326     *  Apps should be careful not to overwrite router files.
     327     *  @since 0.7.6
     328     *  @return dir constant for the life of the context
     329     */
    273330    public File getAppDir() { return _appDir; }
     331
     332    /**
     333     *  Where anybody may store temporary data.
     334     *  This is a directory created in the system temp dir on the
     335     *  first call in this context, and is deleted on JVM exit.
     336     *  Applications should create their own directory inside this directory
     337     *  to avoid collisions with other apps.
     338     *  @since 0.7.6
     339     *  @return dir constant for the life of the context
     340     */
    274341    public File getTempDir() {
    275342        // fixme don't synchronize every time
  • core/java/src/net/i2p/crypto/AESEngine.java

    r4323036 r2244142b  
    1919/**
    2020 * Dummy wrapper for AES cipher operation.
    21  *
     21 * UNUSED unless i2p.encryption = off
     22 * See CryptixAESEngine for the real thing.
    2223 */
    2324public class AESEngine {
     
    146147    }
    147148
    148    
     149    /**
     150     *   Just copies payload to out
     151     *   @param sessionKey unused
     152     */
    149153    public void encryptBlock(byte payload[], int inIndex, SessionKey sessionKey, byte out[], int outIndex) {
    150154        System.arraycopy(payload, inIndex, out, outIndex, out.length - outIndex);
     
    159163    }
    160164   
     165/******
    161166    public static void main(String args[]) {
    162167        I2PAppContext ctx = new I2PAppContext();
     
    179184        ctx.logManager().getLog(AESEngine.class).debug("Long test: " + DataHelper.eq(ld, lbuf));
    180185    }
     186******/
    181187}
  • core/java/src/net/i2p/crypto/CryptixAESEngine.java

    r4323036 r2244142b  
    127127    }
    128128   
     129    /** encrypt exactly 16 bytes using the session key */
    129130    @Override
    130131    public final void encryptBlock(byte payload[], int inIndex, SessionKey sessionKey, byte out[], int outIndex) {
     
    167168    }
    168169   
     170/********
    169171    public static void main(String args[]) {
    170172        I2PAppContext ctx = new I2PAppContext();
     
    279281            System.out.println("block D(E(orig)) == orig");
    280282    }
     283*******/
    281284}
  • core/java/src/net/i2p/crypto/ElGamalEngine.java

    r4323036 r2244142b  
    6767        context.statManager().createRateStat("crypto.elGamal.encrypt",
    6868                                             "how long does it take to do a full ElGamal encryption", "Encryption",
    69                                              new long[] { 60 * 1000, 60 * 60 * 1000, 24 * 60 * 60 * 1000});
     69                                             new long[] { 60 * 60 * 1000});
    7070        context.statManager().createRateStat("crypto.elGamal.decrypt",
    7171                                             "how long does it take to do a full ElGamal decryption", "Encryption",
    72                                              new long[] { 60 * 1000, 60 * 60 * 1000, 24 * 60 * 60 * 1000});
     72                                             new long[] { 60 * 60 * 1000});
    7373        _context = context;
    7474        _log = context.logManager().getLog(ElGamalEngine.class);
     
    8686
    8787    /** encrypt the data to the public key
    88      * @return encrypted data
     88     * @return encrypted data, will be about twice as big as the cleartext
    8989     * @param publicKey public key encrypt to
    90      * @param data data to encrypt
     90     * @param data data to encrypt, must be 222 bytes or less
    9191     */
    9292    public byte[] encrypt(byte data[], PublicKey publicKey) {
     
    157157
    158158    /** Decrypt the data
    159      * @param encrypted encrypted data
     159     * @param encrypted encrypted data, must be 514 bytes or less
    160160     * @param privateKey private key to decrypt with
    161161     * @return unencrypted data
  • core/java/src/net/i2p/crypto/KeyGenerator.java

    r4323036 r2244142b  
    2626import net.i2p.util.RandomSource;
    2727
    28 /** Define a way of generating asymetrical key pairs as well as symetrical keys
     28/** Define a way of generating asymmetrical key pairs as well as symmetrical keys
    2929 * @author jrandom
    3030 */
     
    158158     * given length. 
    159159     */
    160     final static byte[] padBuffer(byte src[], int length) {
     160    private final static byte[] padBuffer(byte src[], int length) {
    161161        byte buf[] = new byte[length];
    162162
     
    172172    }
    173173
     174/******
    174175    public static void main(String args[]) {
    175176        Log log = new Log("keygenTest");
     
    223224        }
    224225    }
     226******/
    225227}
  • router/java/src/net/i2p/router/transport/udp/UDPPacketReader.java

    r4323036 r2244142b  
    599599            return rv;
    600600        }
     601
     602        /** unused */
    601603        public int readChallengeSize() {
    602604            int offset = readBodyOffset() + 4;
     
    609611            return rv;
    610612        }
     613
     614        /** unused */
    611615        public void readChallengeSize(byte target[], int targetOffset) {
    612616            int offset = readBodyOffset() + 4;
     
    669673            return (int)DataHelper.fromLong(_message, offset, 2);
    670674        }
     675
     676        /** unused */
    671677        public int readChallengeSize() {
    672678            int offset = readBodyOffset();
     
    676682            return (int)DataHelper.fromLong(_message, offset, 1);
    677683        }
     684
     685        /** unused */
    678686        public void readChallengeSize(byte target[], int targetOffset) {
    679687            int offset = readBodyOffset();
Note: See TracChangeset for help on using the changeset viewer.