simplify random.js

This commit is contained in:
Bart Butler
2018-03-05 12:18:04 -08:00
parent 3df1d849b3
commit b088f005da
6 changed files with 38 additions and 67 deletions

View File

@@ -309,7 +309,7 @@ describe('API functional testing', function() {
if(algo.substr(0,3) === 'aes') {
it(algo, function() {
const key = crypto.generateSessionKey(algo);
const iv = crypto.random.getRandomValues(new Uint8Array(crypto.gcm.ivLength));
const iv = crypto.random.getRandomBytes(crypto.gcm.ivLength);
return crypto.gcm.encrypt(
algo, util.str_to_Uint8Array(plaintext), key, iv