hoodie-plugin-store-crypto
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -5,3 +5,3 @@ 'use strict' | ||
* Core of the plugin. | ||
* All methos and event handling is setup here. | ||
* All methods and event handling is setup here. | ||
* | ||
@@ -51,2 +51,7 @@ * Mostly copied and adjusted from https://github.com/hoodiehq/hoodie-store-client | ||
if (prefix == null) { | ||
api.encrypt = require('./encrypt-json').bind(null, state) | ||
api.decrypt = require('./decrypt-json').bind(null, state) | ||
} | ||
if (prefix == null && isRoot) { | ||
@@ -53,0 +58,0 @@ api.setup = require('./setup').bind(null, store, state) |
@@ -8,3 +8,3 @@ 'use strict' | ||
var createKey = require('../create-key') | ||
var encrypt = require('../encrypt') | ||
var encrypt = require('../encrypt-doc') | ||
@@ -11,0 +11,0 @@ module.exports = createResetKeys |
@@ -35,6 +35,9 @@ 'use strict' | ||
name: 'AES-GCM', | ||
iv: iv, | ||
additionalData: aad | ||
iv: iv | ||
} | ||
if (aad != null) { | ||
options.additionalData = aad | ||
} | ||
var encryptedData = Buffer.concat([data, tag]) | ||
@@ -50,3 +53,5 @@ return subtle.decrypt(options, cryptoKey, encryptedData) | ||
var cipher = aes.createDecipheriv('aes-256-gcm', key, iv) | ||
cipher.setAAD(aad) | ||
if (aad != null) { | ||
cipher.setAAD(aad) | ||
} | ||
cipher.setAuthTag(tag) | ||
@@ -53,0 +58,0 @@ |
@@ -6,3 +6,3 @@ 'use strict' | ||
var decrypt = require('../decrypt') | ||
var decrypt = require('../decrypt-doc') | ||
@@ -9,0 +9,0 @@ module.exports = decryptOne |
@@ -35,6 +35,9 @@ 'use strict' | ||
name: 'AES-GCM', | ||
iv: iv, | ||
additionalData: aad | ||
iv: iv | ||
} | ||
if (aad != null) { | ||
options.additionalData = aad | ||
} | ||
return subtle.encrypt(options, key, data) | ||
@@ -54,3 +57,5 @@ }) | ||
var cipher = aes.createCipheriv('aes-256-gcm', key, iv) | ||
cipher.setAAD(aad) | ||
if (aad != null) { | ||
cipher.setAAD(aad) | ||
} | ||
@@ -57,0 +62,0 @@ var output = cipher.update(data) |
@@ -6,3 +6,3 @@ 'use strict' | ||
var encrypt = require('../encrypt') | ||
var encrypt = require('../encrypt-doc') | ||
@@ -9,0 +9,0 @@ module.exports = encryptOne |
{ | ||
"name": "hoodie-plugin-store-crypto", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "End-to-end crypto plugin for the Hoodie client store.", | ||
@@ -59,4 +59,4 @@ "main": "index.js", | ||
"tap-spec": "^5.0.0", | ||
"tape": "^4.12.0", | ||
"textlint": "^11.5.0", | ||
"tape": "^4.12.1", | ||
"textlint": "^11.6.0", | ||
"textlint-rule-alex": "^1.3.1", | ||
@@ -63,0 +63,0 @@ "textlint-rule-common-misspellings": "^1.0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96423
48
2069