GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — node/src/crypto/crypto_scrypt.h at main · styfle/node

Expand file tree

/

crypto_scrypt.h

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
87 lines (68 loc) · 2.24 KB
/

crypto_scrypt.h

Copy path

File metadata and controls

87 lines (68 loc) · 2.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#ifndef SRC_CRYPTO_CRYPTO_SCRYPT_H_
#define SRC_CRYPTO_CRYPTO_SCRYPT_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "crypto/crypto_util.h"
#include "env.h"
#include "memory_tracker.h"
#include "v8.h"
namespace node {
namespace crypto {
#ifndef OPENSSL_NO_SCRYPT
// Scrypt is a password-based key derivation algorithm
// defined in https://tools.ietf.org/html/rfc7914
// It takes as input a password, a salt value, and a
// handful of additional parameters that control the
// cost of the operation. In this case, the higher
// the cost, the better the result. The length parameter
// defines the number of bytes that are generated.
// The salt must be as random as possible and should be
// at least 16 bytes in length.
struct ScryptConfig final : public MemoryRetainer {
CryptoJobMode mode;
ByteSource pass;
ByteSource salt;
uint32_t N;
uint32_t r;
uint32_t p;
uint64_t maxmem;
int32_t length;
ScryptConfig() = default;
explicit ScryptConfig(ScryptConfig&& other) noexcept;
ScryptConfig& operator=(ScryptConfig&& other) noexcept;
void MemoryInfo(MemoryTracker* tracker) const override;
SET_MEMORY_INFO_NAME(ScryptConfig)
SET_SELF_SIZE(ScryptConfig)
};
struct ScryptTraits final {
using AdditionalParameters = ScryptConfig;
static constexpr const char* JobName = "ScryptJob";
static constexpr AsyncWrap::ProviderType Provider =
AsyncWrap::PROVIDER_SCRYPTREQUEST;
static v8::Maybe<bool> AdditionalConfig(
CryptoJobMode mode,
const v8::FunctionCallbackInfo<v8::Value>& args,
unsigned int offset,
ScryptConfig* params);
static bool DeriveBits(
Environment* env,
const ScryptConfig& params,
ByteSource* out);
static v8::Maybe<bool> EncodeOutput(
Environment* env,
const ScryptConfig& params,
ByteSource* out,
v8::Local<v8::Value>* result);
};
using ScryptJob = DeriveBitsJob<ScryptTraits>;
#else
// If there is no Scrypt support, ScryptJob becomes a non-op
struct ScryptJob {
static void Initialize(
Environment* env,
v8::Local<v8::Object> target) {}
};
#endif // !OPENSSL_NO_SCRYPT
} // namespace crypto
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_CRYPTO_CRYPTO_SCRYPT_H_
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.