lib/crypto/hmac-block-transform.js
function getHmacKey(key, blockIndex) {
    var shaSrc = new Uint8Array(8 + key.byteLength);
    shaSrc.set(new Uint8Array(key), 8);
    var view = new DataView(shaSrc.buffer);
    view.setUint32(0, blockIndex.lo, true);
    view.setUint32(4, blockIndex.hi, true);
    return CryptoEngine.sha512(ByteUtils.arrayToBuffer(shaSrc)).then(function(sha) {
        ByteUtils.zeroBuffer(shaSrc);
        return sha;
    });
}
function getHmacKey(key, blockIndex) {
    var shaSrc = new Uint8Array(8 + key.byteLength);
    shaSrc.set(new Uint8Array(key), 8);
    var view = new DataView(shaSrc.buffer);
    view.setUint32(0, blockIndex.lo, true);
    view.setUint32(4, blockIndex.hi, true);
    return CryptoEngine.sha512(ByteUtils.arrayToBuffer(shaSrc)).then(function(sha) {
        ByteUtils.zeroBuffer(shaSrc);
        return sha;
    });
}
function getHmacKey ( key , blockIndex ) { var shaSrc = new Uint8Array ( 8 + key . byteLength ) ; shaSrc . set ( new Uint8Array ( key ) , 8 ) ; var view = new DataView ( shaSrc . buffer ) ; view . setUint32 ( 0 , blockIndex . lo , true ) ; view . setUint32 ( 4 , blockIndex . hi , true ) ; return CryptoEngine . sha512 ( ByteUtils . arrayToBuffer ( shaSrc ) ) . then ( function ( sha ) { ByteUtils . zeroBuffer ( shaSrc ) ; return sha ; } ) ; }
Computes HMAC-SHA key
@param {ArrayBuffer} key
@param {Int64} blockIndex
@returns {Promise.<ArrayBuffer>}
Computes HMAC - SHA key