GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/lib/crypto.js at master · rbs392/node Expand file tree/ Copy pathcrypto.jsMore file actions 234 lines (211 loc) · 5.42 KB / Copy pathcrypto.jsFile metadata and controls234 lines (211 loc) · 5.42 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // Note: In 0.8 and before, crypto functions all defaulted to using // binary-encoded strings rather than buffers. 'use strict'; const { assertCrypto, deprecate } = require('internal/util'); assertCrypto(); const errors = require('internal/errors'); const constants = process.binding('constants').crypto; const { fipsMode, fipsForced } = process.binding('config'); const { getFipsCrypto, setFipsCrypto, } = process.binding('crypto'); const { randomBytes, randomFill, randomFillSync } = require('internal/crypto/random'); const { pbkdf2, pbkdf2Sync } = require('internal/crypto/pbkdf2'); const { DiffieHellman, DiffieHellmanGroup, ECDH } = require('internal/crypto/diffiehellman'); const { Cipher, Cipheriv, Decipher, Decipheriv, privateDecrypt, privateEncrypt, publicDecrypt, publicEncrypt } = require('internal/crypto/cipher'); const { Sign, Verify } = require('internal/crypto/sig'); const { Hash, Hmac } = require('internal/crypto/hash'); const { getCiphers, getCurves, getDefaultEncoding, getHashes, setDefaultEncoding, setEngine, timingSafeEqual, toBuf } = require('internal/crypto/util'); const Certificate = require('internal/crypto/certificate'); // These helper functions are needed because the constructors can // use new, in which case V8 cannot inline the recursive constructor call function createHash(algorithm, options) { return new Hash(algorithm, options); } function createCipher(cipher, password, options) { return new Cipher(cipher, password, options); } function createCipheriv(cipher, key, iv, options) { return new Cipheriv(cipher, key, iv, options); } function createDecipher(cipher, password, options) { return new Decipher(cipher, password, options); } function createDecipheriv(cipher, key, iv, options) { return new Decipheriv(cipher, key, iv, options); } function createDiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { return new DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding); } function createDiffieHellmanGroup(name) { return new DiffieHellmanGroup(name); } function createECDH(curve) { return new ECDH(curve); } function createHmac(hmac, key, options) { return new Hmac(hmac, key, options); } function createSign(algorithm, options) { return new Sign(algorithm, options); } function createVerify(algorithm, options) { return new Verify(algorithm, options); } module.exports = exports = { // Methods _toBuf: toBuf, createCipher, createCipheriv, createDecipher, createDecipheriv, createDiffieHellman, createDiffieHellmanGroup, createECDH, createHash, createHmac, createSign, createVerify, getCiphers, getCurves, getDiffieHellman: createDiffieHellmanGroup, getHashes, pbkdf2, pbkdf2Sync, privateDecrypt, privateEncrypt, prng: randomBytes, pseudoRandomBytes: randomBytes, publicDecrypt, publicEncrypt, randomBytes, randomFill, randomFillSync, rng: randomBytes, setEngine, timingSafeEqual, // Classes Certificate, Cipher, Cipheriv, Decipher, Decipheriv, DiffieHellman, DiffieHellmanGroup, ECDH, Hash, Hmac, Sign, Verify }; function setFipsDisabled() { throw new errors.Error('ERR_CRYPTO_FIPS_UNAVAILABLE'); } function setFipsForced(val) { if (val) return; throw new errors.Error('ERR_CRYPTO_FIPS_FORCED'); } function getFipsDisabled() { return 0; } function getFipsForced() { return 1; } Object.defineProperties(exports, { fips: { get: !fipsMode ? getFipsDisabled : fipsForced ? getFipsForced : getFipsCrypto, set: !fipsMode ? setFipsDisabled : fipsForced ? setFipsForced : setFipsCrypto }, DEFAULT_ENCODING: { enumerable: true, configurable: true, get: getDefaultEncoding, set: setDefaultEncoding }, constants: { configurable: false, enumerable: true, value: constants }, // Legacy API createCredentials: { configurable: true, enumerable: true, get: deprecate(() => { return require('tls').createSecureContext; }, 'crypto.createCredentials is deprecated. ' + 'Use tls.createSecureContext instead.', 'DEP0010') }, Credentials: { configurable: true, enumerable: true, get: deprecate(function() { return require('tls').SecureContext; }, 'crypto.Credentials is deprecated. ' + 'Use tls.SecureContext instead.', 'DEP0011') } }); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |