equal
deleted
inserted
replaced
139 byte[] kdfOutput; |
139 byte[] kdfOutput; |
140 |
140 |
141 // Calculate the number of rounds of HMAC that are needed to |
141 // Calculate the number of rounds of HMAC that are needed to |
142 // meet the requested data. Then set up the buffers we will need. |
142 // meet the requested data. Then set up the buffers we will need. |
143 Objects.requireNonNull(pseudoRandKey, "A null PRK is not allowed."); |
143 Objects.requireNonNull(pseudoRandKey, "A null PRK is not allowed."); |
|
144 |
|
145 // Output from the expand operation must be <= 255 * hmac length |
|
146 if (outLen > 255 * hmacLen) { |
|
147 throw new IllegalArgumentException("Requested output length " + |
|
148 "exceeds maximum length allowed for HKDF expansion"); |
|
149 } |
144 hmacObj.init(pseudoRandKey); |
150 hmacObj.init(pseudoRandKey); |
145 if (info == null) { |
151 if (info == null) { |
146 info = new byte[0]; |
152 info = new byte[0]; |
147 } |
153 } |
148 int rounds = (outLen + hmacLen - 1) / hmacLen; |
154 int rounds = (outLen + hmacLen - 1) / hmacLen; |