GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/crypto/crypto_dsa.h Lines: 2 8 25.0 %
Date: 2021-05-26 04:16:18 Branches: 0 0 - %

Line Branch Exec Source
1
#ifndef SRC_CRYPTO_CRYPTO_DSA_H_
2
#define SRC_CRYPTO_CRYPTO_DSA_H_
3
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
6
#include "crypto/crypto_keys.h"
7
#include "crypto/crypto_keygen.h"
8
#include "crypto/crypto_util.h"
9
#include "env.h"
10
#include "memory_tracker.h"
11
#include "v8.h"
12
13
namespace node {
14
namespace crypto {
15
12
struct DsaKeyPairParams final : public MemoryRetainer {
16
  unsigned int modulus_bits;
17
  int divisor_bits;
18
  SET_NO_MEMORY_INFO()
19
  SET_MEMORY_INFO_NAME(DsaKeyPairParams)
20
  SET_SELF_SIZE(DsaKeyPairParams)
21
};
22
23
using DsaKeyPairGenConfig = KeyPairGenConfig<DsaKeyPairParams>;
24
25
struct DsaKeyGenTraits final {
26
  using AdditionalParameters = DsaKeyPairGenConfig;
27
  static constexpr const char* JobName = "DsaKeyPairGenJob";
28
29
  static EVPKeyCtxPointer Setup(DsaKeyPairGenConfig* params);
30
31
  static v8::Maybe<bool> AdditionalConfig(
32
      CryptoJobMode mode,
33
      const v8::FunctionCallbackInfo<v8::Value>& args,
34
      unsigned int* offset,
35
      DsaKeyPairGenConfig* params);
36
};
37
38
using DsaKeyPairGenJob = KeyGenJob<KeyPairGenTraits<DsaKeyGenTraits>>;
39
40
24
struct DSAKeyExportConfig final : public MemoryRetainer {
41
  SET_NO_MEMORY_INFO()
42
  SET_MEMORY_INFO_NAME(DSAKeyExportConfig)
43
  SET_SELF_SIZE(DSAKeyExportConfig)
44
};
45
46
struct DSAKeyExportTraits final {
47
  static constexpr const char* JobName = "DSAKeyExportJob";
48
  using AdditionalParameters = DSAKeyExportConfig;
49
50
  static v8::Maybe<bool> AdditionalConfig(
51
      const v8::FunctionCallbackInfo<v8::Value>& args,
52
      unsigned int offset,
53
      DSAKeyExportConfig* config);
54
55
  static WebCryptoKeyExportStatus DoExport(
56
      std::shared_ptr<KeyObjectData> key_data,
57
      WebCryptoKeyFormat format,
58
      const DSAKeyExportConfig& params,
59
      ByteSource* out);
60
};
61
62
using DSAKeyExportJob = KeyExportJob<DSAKeyExportTraits>;
63
64
v8::Maybe<bool> GetDsaKeyDetail(
65
    Environment* env,
66
    std::shared_ptr<KeyObjectData> key,
67
    v8::Local<v8::Object> target);
68
69
namespace DSAAlg {
70
void Initialize(Environment* env, v8::Local<v8::Object> target);
71
}  // namespace DSAAlg
72
}  // namespace crypto
73
}  // namespace node
74
75
#endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
76
#endif  // SRC_CRYPTO_CRYPTO_DSA_H_