Sha256: 609b36209b38c7b2dd837f78fed547695a1041398a9b7807b45b0cebb6b0f982

Contents?: true

Size: 518 Bytes

Versions: 35

Compression:

Stored size: 518 Bytes

Contents

var Buffer = require('safe-buffer').Buffer

function encryptByte (self, byteParam, decrypt) {
  var pad = self._cipher.encryptBlock(self._prev)
  var out = pad[0] ^ byteParam

  self._prev = Buffer.concat([
    self._prev.slice(1),
    Buffer.from([decrypt ? byteParam : out])
  ])

  return out
}

exports.encrypt = function (self, chunk, decrypt) {
  var len = chunk.length
  var out = Buffer.allocUnsafe(len)
  var i = -1

  while (++i < len) {
    out[i] = encryptByte(self, chunk[i], decrypt)
  }

  return out
}

Version data entries

35 entries across 34 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.18.0 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.18.2 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.16.1 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.15.2 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.18.4 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.18.1 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.14.0 test/dummy/node_modules/browserify-aes/modes/cfb8.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/browserify-aes/modes/cfb8.js
tang-0.2.1 spec/tang_app/node_modules/browserify-aes/modes/cfb8.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/browserify-aes/modes/cfb8.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/browserify-aes/modes/cfb8.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/browserify-aes/modes/cfb8.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/browserify-aes/modes/cfb8.js
tang-0.2.0 spec/tang_app/node_modules/browserify-aes/modes/cfb8.js
tang-0.1.0 spec/tang_app/node_modules/browserify-aes/modes/cfb8.js
tang-0.0.9 spec/tang_app/node_modules/browserify-aes/modes/cfb8.js
enju_library-0.3.8 spec/dummy/node_modules/browserify-aes/modes/cfb8.js
ilog-0.4.1 node_modules/browserify-aes/modes/cfb8.js