Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8361100

SecureRandom nextLong memory usage

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • security-libs
    • None
    • minimal
    • Java API
    • SE

      Summary

      SecureRandom nextLong memory usage enhancement

      Problem

      SecureRandom uses straightforward implementations inherited from Random but in the process does double the memory allocations necessary. The delegation to SecureRandom.engineNextBytes does not provide int or long values, the caller must allocate a byte array and assemble the value itself.

      Solution

      Add an implementation in SecureRandom that call nextBytes(8 bytes) and then convert that to a long

      Specification

      See attached

            kthirupattur Koushik Muthukrishnan Thirupattur
            rriggs Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: