From 80e3fadcb1b88f358ffa84b25bc43509cdfbb178 Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 26 Oct 2014 21:25:55 -0700 Subject: [PATCH] Remove unused *MACWithVersionByte functions --- js/crypto.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/js/crypto.js b/js/crypto.js index 478bae78..35748d45 100644 --- a/js/crypto.js +++ b/js/crypto.js @@ -364,24 +364,6 @@ window.textsecure.crypto = function() { return testing_only.HKDF(input, salt, info); } - var calculateMACWithVersionByte = function(data, key, version) { - if (version === undefined) - version = 1; - - var prependedData = new Uint8Array(data.byteLength + 1); - prependedData[0] = version; - prependedData.set(new Uint8Array(data), 1); - - return HmacSHA256(key, prependedData.buffer); - } - - var verifyMACWithVersionByte = function(data, key, mac, version) { - return calculateMACWithVersionByte(data, key, version).then(function(calculated_mac) { - if (!isEqual(calculated_mac, mac, true)) - throw new Error("Bad MAC"); - }); - } - var verifyMAC = function(data, key, mac) { return HmacSHA256(key, data).then(function(calculated_mac) { if (!isEqual(calculated_mac, mac, true))