059d3d0d by brandonocasey

added file-level comments to files

1 parent 63c80f63
1 /**
2 * This file contains the `Decrypter` class which manages
3 * AES decryption through the `decrypt` function (which uses
4 * the `AES` class for lower level decrypting) and Asynchronous
5 * Streams from the `AsyncStream` class
6 */
7
1 import AES from './aes'; 8 import AES from './aes';
2 import AsyncStream from './async-stream'; 9 import AsyncStream from './async-stream';
3 import {unpad} from 'pkcs7'; 10 import {unpad} from 'pkcs7';
...@@ -95,6 +102,11 @@ export const decrypt = function(encrypted, key, initVector) { ...@@ -95,6 +102,11 @@ export const decrypt = function(encrypted, key, initVector) {
95 return decrypted; 102 return decrypted;
96 }; 103 };
97 104
105 /**
106 * The `Decrypter` class that manages decryption of AES
107 * data through `AsyncStream` objects and the `decrypt`
108 * function
109 */
98 export class Decrypter { 110 export class Decrypter {
99 constructor(encrypted, key, initVector, done) { 111 constructor(encrypted, key, initVector, done) {
100 let step = Decrypter.STEP; 112 let step = Decrypter.STEP;
......
1 /**
2 * Main file for Decrypter so that we can neatly export
3 * all of our functionality as one object in one file
4 * and we will only have to require the top level directory
5 * in this case that would look like:
6 * ``` JavaScript
7 * import {Decrypter, decrypt, AsyncStream} from './src/decrypter';
8 * ```
9 */
1 import {decrypt, Decrypter} from './decrypter'; 10 import {decrypt, Decrypter} from './decrypter';
2 import AsyncStream from './async-stream'; 11 import AsyncStream from './async-stream';
3 12
......