projects
/
squeep-mystery-box
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f537ed3
)
eslint cleanups
author
Justin Wind
<justin.wind+git@gmail.com>
Sat, 4 Mar 2023 19:25:34 +0000
(11:25 -0800)
committer
Justin Wind
<justin.wind+git@gmail.com>
Sat, 4 Mar 2023 19:25:34 +0000
(11:25 -0800)
lib/version-parameters.js
patch
|
blob
|
history
diff --git
a/lib/version-parameters.js
b/lib/version-parameters.js
index 9af7d49d61eee45b8ee4922abc7f6f66ab30100f..5f449a75b934beebe51084bdb348ba7a22524d2a 100644
(file)
--- a/
lib/version-parameters.js
+++ b/
lib/version-parameters.js
@@
-1,5
+1,17
@@
'use strict';
'use strict';
+const ALG = {
+ AES_256_GCM: 'aes-256-gcm',
+ CHACHA20_POLY1305: 'chacha20-poly1305',
+ XCHACHA20_POLY1305: 'xchacha20-poly1305',
+};
+
+const KD = {
+ SCRYPT: 'scrypt',
+ SHAKE256: 'shake256',
+ BLAKE2B512: 'blake2b512',
+};
+
/**
* Supported packings/cipher types.
* To be useful, any cipher included here must be Authenticated Encryption with Additional Data (AEAD).
/**
* Supported packings/cipher types.
* To be useful, any cipher included here must be Authenticated Encryption with Additional Data (AEAD).
@@
-8,19
+20,19
@@
const allVersions = {
1: {
version: 1,
const allVersions = {
1: {
version: 1,
- algorithm:
'aes-256-gcm'
,
+ algorithm:
ALG.AES_256_GCM
,
algOptions: {},
versionBytes: 1,
flagsBytes: 1,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
algOptions: {},
versionBytes: 1,
flagsBytes: 1,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'scrypt'
,
+ keyDeriver:
KD.SCRYPT
,
keyBytes: 32,
},
2: {
version: 2,
keyBytes: 32,
},
2: {
version: 2,
- algorithm:
'chacha20-poly1305'
, // Prefer this over NIST because we stan djb
+ algorithm:
ALG.CHACHA20_POLY1305
, // Prefer this over NIST because we stan djb
algOptions: {
authTagLength: 16,
},
algOptions: {
authTagLength: 16,
},
@@
-29,12
+41,12
@@
const allVersions = {
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'scrypt'
,
+ keyDeriver:
KD.SCRYPT
,
keyBytes: 32,
},
3: {
version: 3,
keyBytes: 32,
},
3: {
version: 3,
- algorithm:
'xchacha20-poly1305'
, // Not yet available, but would prefer even more...
+ algorithm:
ALG.XCHACHA20_POLY1305
, // Not yet available, but would prefer even more...
algOptions: {
authTagLength: 16,
},
algOptions: {
authTagLength: 16,
},
@@
-43,24
+55,24
@@
const allVersions = {
ivBytes: 24,
saltBytes: 16,
tagBytes: 16,
ivBytes: 24,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'scrypt'
,
+ keyDeriver:
KD.SCRYPT
,
keyBytes: 32,
},
4: {
version: 4,
keyBytes: 32,
},
4: {
version: 4,
- algorithm:
'aes-256-gcm'
,
+ algorithm:
ALG.AES_256_GCM
,
algOptions: {},
versionBytes: 1,
flagsBytes: 1,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
algOptions: {},
versionBytes: 1,
flagsBytes: 1,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'shake256'
,
+ keyDeriver:
KD.SHAKE256
,
keyBytes: 32,
},
5: {
version: 5,
keyBytes: 32,
},
5: {
version: 5,
- algorithm:
'chacha20-poly1305'
,
+ algorithm:
ALG.CHACHA20_POLY1305
,
algOptions: {
authTagLength: 16,
},
algOptions: {
authTagLength: 16,
},
@@
-69,12
+81,12
@@
const allVersions = {
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'shake256'
,
+ keyDeriver:
KD.SHAKE256
,
keyBytes: 32,
},
6: {
version: 6,
keyBytes: 32,
},
6: {
version: 6,
- algorithm:
'xchacha20-poly1305'
, // Not yet available, but would prefer even more...
+ algorithm:
ALG.XCHACHA20_POLY1305
, // Not yet available, but would prefer even more...
algOptions: {
authTagLength: 16,
},
algOptions: {
authTagLength: 16,
},
@@
-83,24
+95,24
@@
const allVersions = {
ivBytes: 24,
saltBytes: 16,
tagBytes: 16,
ivBytes: 24,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'shake256'
,
+ keyDeriver:
KD.SHAKE256
,
keyBytes: 32,
},
7: {
version: 7,
keyBytes: 32,
},
7: {
version: 7,
- algorithm:
'aes-256-gcm'
,
+ algorithm:
ALG.AES_256_GCM
,
algOptions: {},
versionBytes: 1,
flagsBytes: 1,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
algOptions: {},
versionBytes: 1,
flagsBytes: 1,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'blake2b512'
,
+ keyDeriver:
KD.BLAKE2B512
,
keyBytes: 32,
},
8: {
version: 8,
keyBytes: 32,
},
8: {
version: 8,
- algorithm:
'chacha20-poly1305'
,
+ algorithm:
ALG.CHACHA20_POLY1305
,
algOptions: {
authTagLength: 16,
},
algOptions: {
authTagLength: 16,
},
@@
-109,12
+121,12
@@
const allVersions = {
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
ivBytes: 12,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'blake2b512'
,
+ keyDeriver:
KD.BLAKE2B512
,
keyBytes: 32,
},
9: {
version: 9,
keyBytes: 32,
},
9: {
version: 9,
- algorithm:
'xchacha20-poly1305'
, // Not yet available, but would prefer even more...
+ algorithm:
ALG.XCHACHA20_POLY1305
, // Not yet available, but would prefer even more...
algOptions: {
authTagLength: 16,
},
algOptions: {
authTagLength: 16,
},
@@
-123,7
+135,7
@@
const allVersions = {
ivBytes: 24,
saltBytes: 16,
tagBytes: 16,
ivBytes: 24,
saltBytes: 16,
tagBytes: 16,
- keyDeriver:
'blake2b512'
,
+ keyDeriver:
KD.BLAKE2B512
,
keyBytes: 32,
},
};
keyBytes: 32,
},
};