Remove useless function

This commit is contained in:
Matt Corallo 2014-07-17 18:13:32 -04:00
parent d63eba1bdc
commit a2da4fffb0

View file

@ -312,12 +312,8 @@ window.textsecure.crypto = function() {
});
}
var calculateMAC = function(data, key) {
return HmacSHA256(key, data);
}
var verifyMAC = function(data, key, mac) {
return calculateMAC(data, key).then(function(calculated_mac) {
return HmacSHA256(key, data).then(function(calculated_mac) {
var macString = getString(mac);//TODO: Move away from strings for comparison?
if (getString(calculated_mac).substring(0, macString.length) != macString)
@ -637,7 +633,7 @@ window.textsecure.crypto = function() {
ivAndCiphertext.set(iv);
ivAndCiphertext.set(ciphertext, 16);
return calculateMAC(ivAndCiphertext.buffer, mac_key).then(function(mac) {
return HmacSHA256(mac_key, ivAndCiphertext.buffer).then(function(mac) {
var encryptedBin = new Uint8Array(16 + ciphertext.byteLength + 32);
encryptedBin.set(ivAndCiphertext.buffer);
encryptedBin.set(mac, 16 + ciphertext.byteLength);