forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrypto_pqc.h
More file actions
39 lines (33 loc) · 1.42 KB
/
Copy pathcrypto_pqc.h
File metadata and controls
39 lines (33 loc) · 1.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
#ifndef SRC_CRYPTO_CRYPTO_PQC_H_
#define SRC_CRYPTO_CRYPTO_PQC_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include "crypto/crypto_keys.h"
#include "env.h"
#include "v8.h"
namespace node {
namespace crypto {
#if OPENSSL_WITH_PQC
bool ExportJwkPqcKey(Environment* env,
const KeyObjectData& key,
v8::Local<v8::Object> target);
KeyObjectData ImportJWKPqcKey(Environment* env, v8::Local<v8::Object> jwk);
// Returns true for PQC algorithms that support raw private key export/import.
bool IsPqcRawPrivateKeyId(int id);
// Returns true if the given EVP_PKEY id is a PQC algorithm known to Node.
bool IsPqcKeyId(int id);
// Returns true for PQC algorithms that carry the private key as a seed
// (ML-DSA, ML-KEM). Returns false for algorithms that use the expanded
// private key (SLH-DSA), or for non-PQC ids.
bool IsPqcSeedKeyId(int id);
// Returns true for PQC signature algorithms (ML-DSA, SLH-DSA). Returns false
// for ML-KEM or for non-PQC ids.
bool IsPqcSignatureKeyId(int id);
// Returns the EVP_PKEY id for the given PQC algorithm name, or NID_undef.
int GetPqcNidFromName(const char* name);
// Returns the JS asymmetricKeyType string for a PQC id, or undefined.
v8::Local<v8::Value> GetPqcAsymmetricKeyType(Environment* env, int id);
#endif
} // namespace crypto
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_CRYPTO_CRYPTO_PQC_H_