B2G/gecko/services/sync/tests/unit/head_helpers.js
// Turn WBO cleartext into fake "encrypted" payload as it goes over the wire.
Turn WBO cleartext into fake "encrypted" payload as it goes over the wire.
Turn WBO cleartext into fake " encrypted " payload as it goes over the wire .
function encryptPayload(cleartext) {
  if (typeof cleartext == "object") {
    cleartext = JSON.stringify(cleartext);
  }
  return {ciphertext: cleartext, 
          IV: "irrelevant",
          hmac: fakeSHA256HMAC(cleartext, Utils.makeHMACKey(""))};
}
function encryptPayload ( cleartext ) { if ( typeof cleartext == "object" ) { cleartext = JSON . stringify ( cleartext ) ; } return { ciphertext : cleartext , IV : "irrelevant" , hmac : fakeSHA256HMAC ( cleartext , Utils . makeHMACKey ( "" ) ) } ; }
Turn WBO cleartext into fake "encrypted" payload as it goes over the wire.
Turn WBO cleartext into fake " encrypted " payload as it goes over the wire .
// ciphertext == cleartext with fake crypto