mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
crypto: support GCM authenticated encryption mode.
This adds two new member functions getAuthTag and setAuthTag that are useful for AES-GCM encryption modes. Use getAuthTag after Cipheriv.final, transmit the tag along with the data and use Decipheriv.setAuthTag to have the encrypted data verified.
This commit is contained in:
1 parent
f9f9239fa2
commit
e0d31ea2db
5 files changed
+260
-1
No files matched your search
@@ -322,6 +322,15 @@ Cipheriv.prototype.update = Cipher.prototype.update;
|
||||
Cipheriv.prototype.final = Cipher.prototype.final;
|
||||
Cipheriv.prototype.setAutoPadding = Cipher.prototype.setAutoPadding;
|
||||
|
||||
Cipheriv.prototype.getAuthTag = function() {
|
||||
return this._binding.getAuthTag();
|
||||
};
|
||||
|
||||
|
||||
Cipheriv.prototype.setAuthTag = function(tagbuf) {
|
||||
this._binding.setAuthTag(tagbuf);
|
||||
};
|
||||
|
||||
|
||||
|
||||
exports.createDecipher = exports.Decipher = Decipher;
|
||||
@@ -367,6 +376,8 @@ Decipheriv.prototype.update = Cipher.prototype.update;
|
||||
Decipheriv.prototype.final = Cipher.prototype.final;
|
||||
Decipheriv.prototype.finaltol = Cipher.prototype.final;
|
||||
Decipheriv.prototype.setAutoPadding = Cipher.prototype.setAutoPadding;
|
||||
Decipheriv.prototype.getAuthTag = Cipheriv.prototype.getAuthTag;
|
||||
Decipheriv.prototype.setAuthTag = Cipheriv.prototype.setAuthTag;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user