support multi-byte version identifiers for boxes. minor internal cleanup/refactors.
[squeep-mystery-box] / lib / version-parameters.js
index 5f449a75b934beebe51084bdb348ba7a22524d2a..afa8441bb56243633538ddce8944126c31304978 100644 (file)
@@ -1,12 +1,16 @@
 'use strict';
 
 const ALG = {
+  __proto__: null,
+
   AES_256_GCM: 'aes-256-gcm',
   CHACHA20_POLY1305: 'chacha20-poly1305',
   XCHACHA20_POLY1305: 'xchacha20-poly1305',
 };
 
 const KD = {
+  __proto__: null,
+
   SCRYPT: 'scrypt',
   SHAKE256: 'shake256',
   BLAKE2B512: 'blake2b512',
@@ -18,6 +22,8 @@ const KD = {
  * More preferable versions are numbered higher.
  */
 const allVersions = {
+  __proto__: null,
+
   1: {
     version: 1,
     algorithm: ALG.AES_256_GCM,
@@ -140,4 +146,15 @@ const allVersions = {
   },
 };
 
+Object.defineProperties(allVersions, {
+  ALG: {
+    enumerable: false,
+    get: () => ALG,
+  },
+  KD: {
+    enumerable: false,
+    get: () => KD,
+  },
+});
+
 module.exports = allVersions;
\ No newline at end of file