lib/megar/crypto/support.rb
# Calculates the accummulated MAC given new +chunk+
Calculates the accummulated MAC given new +chunk+
Calculates the accummulated MAC given new + chunk +
def accumulate_mac(chunk,progressive_mac,key,iv,signed=true)
    chunk_mac = calculate_chunk_mac(chunk,key,iv,signed)
    combined_mac = [
      progressive_mac[0] ^ chunk_mac[0],
      progressive_mac[1] ^ chunk_mac[1],
      progressive_mac[2] ^ chunk_mac[2],
      progressive_mac[3] ^ chunk_mac[3]
    ]
    aes_cbc_encrypt_a32(combined_mac, key, signed)
  end
def accumulate_mac ( chunk , progressive_mac , key , iv , signed = true ) chunk_mac = calculate_chunk_mac ( chunk , key , iv , signed ) combined_mac = [ progressive_mac [ 0 ] ^ chunk_mac [ 0 ] , progressive_mac [ 1 ] ^ chunk_mac [ 1 ] , progressive_mac [ 2 ] ^ chunk_mac [ 2 ] , progressive_mac [ 3 ] ^ chunk_mac [ 3 ] ] aes_cbc_encrypt_a32 ( combined_mac , key , signed ) end
Calculates the accummulated MAC given new +chunk+
Calculates the accummulated MAC given new + chunk +
chunk
progressive_mac
key
iv
signed