< prev index next >

src/java.base/share/classes/sun/security/provider/AbstractDrbg.java

Print this page
rev 58428 : [mq]: XXXXXXX-typos


 473             input = Arrays.copyOf(input, minLength);
 474         } else if (input.length > maxLength) {
 475             input = Arrays.copyOf(input, maxLength);
 476         }
 477         if (!instantiated) {
 478             instantiateIfNecessary(input);
 479         } else {
 480             reseedAlgorithm(input, null);
 481         }
 482     }
 483 
 484     // get_entropy_input
 485 
 486     private byte[] getEntropyInput(boolean isPr) {
 487         // Should the 1st arg be minEntropy or minLength?
 488         //
 489         // Technically it should be minEntropy, but CtrDRBG
 490         // (not using derivation function) is so confusing
 491         // (does it need only strength or seedlen of entropy?)
 492         // that it's safer to assume minLength. In all other
 493         // cases minLength equals to minEntropy.
 494         return getEntropyInput(minLength, minLength, maxLength, isPr);
 495     }
 496 
 497     private byte[] getEntropyInput(int minEntropy, int minLength,
 498                                    int maxLength, boolean pr) {
 499         if (debug != null) {
 500             debug.println(this, "getEntropy(" + minEntropy + "," + minLength +
 501                     "," + maxLength + "," + pr + ")");
 502         }
 503         EntropySource esNow = es;
 504         if (esNow == null) {
 505             esNow = pr ? SeederHolder.prseeder : SeederHolder.seeder;
 506         }
 507         return esNow.getEntropy(minEntropy, minLength, maxLength, pr);
 508     }
 509 
 510     // Defaults
 511 
 512     /**
 513      * The default {@code EntropySource} determined by system property




 473             input = Arrays.copyOf(input, minLength);
 474         } else if (input.length > maxLength) {
 475             input = Arrays.copyOf(input, maxLength);
 476         }
 477         if (!instantiated) {
 478             instantiateIfNecessary(input);
 479         } else {
 480             reseedAlgorithm(input, null);
 481         }
 482     }
 483 
 484     // get_entropy_input
 485 
 486     private byte[] getEntropyInput(boolean isPr) {
 487         // Should the 1st arg be minEntropy or minLength?
 488         //
 489         // Technically it should be minEntropy, but CtrDRBG
 490         // (not using derivation function) is so confusing
 491         // (does it need only strength or seedlen of entropy?)
 492         // that it's safer to assume minLength. In all other
 493         // cases minLength is equal to minEntropy.
 494         return getEntropyInput(minLength, minLength, maxLength, isPr);
 495     }
 496 
 497     private byte[] getEntropyInput(int minEntropy, int minLength,
 498                                    int maxLength, boolean pr) {
 499         if (debug != null) {
 500             debug.println(this, "getEntropy(" + minEntropy + "," + minLength +
 501                     "," + maxLength + "," + pr + ")");
 502         }
 503         EntropySource esNow = es;
 504         if (esNow == null) {
 505             esNow = pr ? SeederHolder.prseeder : SeederHolder.seeder;
 506         }
 507         return esNow.getEntropy(minEntropy, minLength, maxLength, pr);
 508     }
 509 
 510     // Defaults
 511 
 512     /**
 513      * The default {@code EntropySource} determined by system property


< prev index next >