MCPcopy Index your code
hub / github.com/nodejs/node / getVariant

Function getVariant

lib/internal/crypto/aes.js:74–112  ·  view source on GitHub ↗
(name, length)

Source from the content-addressed store, hash-verified

72}
73
74function getVariant(name, length) {
75 switch (name) {
76 case 'AES-CBC':
77 switch (length) {
78 case 128: return kKeyVariantAES_CBC_128;
79 case 192: return kKeyVariantAES_CBC_192;
80 case 256: return kKeyVariantAES_CBC_256;
81 }
82 break;
83 case 'AES-CTR':
84 switch (length) {
85 case 128: return kKeyVariantAES_CTR_128;
86 case 192: return kKeyVariantAES_CTR_192;
87 case 256: return kKeyVariantAES_CTR_256;
88 }
89 break;
90 case 'AES-GCM':
91 switch (length) {
92 case 128: return kKeyVariantAES_GCM_128;
93 case 192: return kKeyVariantAES_GCM_192;
94 case 256: return kKeyVariantAES_GCM_256;
95 }
96 break;
97 case 'AES-KW':
98 switch (length) {
99 case 128: return kKeyVariantAES_KW_128;
100 case 192: return kKeyVariantAES_KW_192;
101 case 256: return kKeyVariantAES_KW_256;
102 }
103 break;
104 case 'AES-OCB':
105 switch (length) {
106 case 128: return kKeyVariantAES_OCB_128;
107 case 192: return kKeyVariantAES_OCB_192;
108 case 256: return kKeyVariantAES_OCB_256;
109 }
110 break;
111 }
112}
113
114function asyncAesCtrCipher(mode, key, data, algorithm) {
115 return jobPromise(() => new AESCipherJob(

Callers 5

asyncAesCtrCipherFunction · 0.85
asyncAesCbcCipherFunction · 0.85
asyncAesKwCipherFunction · 0.85
asyncAesGcmCipherFunction · 0.85
asyncAesOcbCipherFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…