"use strict";
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeAlgorithmSuite = void 0;
/*
 * This file contains information about particular algorithm suites used
 * within the encryption SDK.  In most cases, end-users don't need to
 * manipulate this structure, but it can occasionally be needed for more
 * advanced use cases, such as writing keyrings.
 *
 * These are the Node.js specific values the AWS Encryption SDK for JavaScript
 * Algorithm Suites.
 */
const algorithm_suites_1 = require("./algorithm_suites");
/* References to https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/algorithms-reference.html
 * These are the composed parameters for each algorithm suite specification for
 * for the WebCrypto environment.
 */
const nodeAlgAes128GcmIv12Tag16 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-128-gcm',
    keyLength: 128,
    ivLength: 12,
    tagLength: 128,
    cacheSafe: false,
    commitment: 'NONE',
};
const nodeAlgAes192GcmIv12Tag16 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES192_GCM_IV12_TAG16,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-192-gcm',
    keyLength: 192,
    ivLength: 12,
    tagLength: 128,
    cacheSafe: false,
    commitment: 'NONE',
};
const nodeAlgAes256GcmIv12Tag16 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-256-gcm',
    keyLength: 256,
    ivLength: 12,
    tagLength: 128,
    cacheSafe: false,
    commitment: 'NONE',
};
const nodeAlgAes128GcmIv12Tag16HkdfSha256 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-128-gcm',
    keyLength: 128,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha256',
    cacheSafe: true,
    commitment: 'NONE',
};
const nodeAlgAes192GcmIv12Tag16HkdfSha256 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES192_GCM_IV12_TAG16_HKDF_SHA256,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-192-gcm',
    keyLength: 192,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha256',
    cacheSafe: true,
    commitment: 'NONE',
};
const nodeAlgAes256GcmIv12Tag16HkdfSha256 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA256,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-256-gcm',
    keyLength: 256,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha256',
    cacheSafe: true,
    commitment: 'NONE',
};
const nodeAlgAes128GcmIv12Tag16HkdfSha256EcdsaP256 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-128-gcm',
    keyLength: 128,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha256',
    cacheSafe: true,
    signatureCurve: 'prime256v1',
    signatureHash: 'sha256',
    commitment: 'NONE',
};
const nodeAlgAes192GcmIv12Tag16HkdfSha384EcdsaP384 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-192-gcm',
    keyLength: 192,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha384',
    cacheSafe: true,
    signatureCurve: 'secp384r1',
    signatureHash: 'sha384',
    commitment: 'NONE',
};
const nodeAlgAes256GcmIv12Tag16HkdfSha384EcdsaP384 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384,
    messageFormat: algorithm_suites_1.MessageFormat.V1,
    encryption: 'aes-256-gcm',
    keyLength: 256,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha384',
    cacheSafe: true,
    signatureCurve: 'secp384r1',
    signatureHash: 'sha384',
    commitment: 'NONE',
};
const nodeAlgAes256GcmHkdfSha512Committing = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA512_COMMIT_KEY,
    messageFormat: algorithm_suites_1.MessageFormat.V2,
    encryption: 'aes-256-gcm',
    keyLength: 256,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha512',
    cacheSafe: true,
    commitment: 'KEY',
    commitmentHash: 'sha512',
    suiteDataLength: 32,
    commitmentLength: 256,
    saltLengthBytes: 32,
};
const nodeAlgAes256GcmHkdfSha512CommittingEcdsaP384 = {
    id: algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA512_COMMIT_KEY_ECDSA_P384,
    messageFormat: algorithm_suites_1.MessageFormat.V2,
    encryption: 'aes-256-gcm',
    keyLength: 256,
    ivLength: 12,
    tagLength: 128,
    kdf: 'HKDF',
    kdfHash: 'sha512',
    cacheSafe: true,
    signatureCurve: 'secp384r1',
    signatureHash: 'sha384',
    commitment: 'KEY',
    commitmentHash: 'sha512',
    suiteDataLength: 32,
    commitmentLength: 256,
    saltLengthBytes: 32,
};
const nodeAlgorithms = Object.freeze({
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16]: Object.freeze(nodeAlgAes128GcmIv12Tag16),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES192_GCM_IV12_TAG16]: Object.freeze(nodeAlgAes192GcmIv12Tag16),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16]: Object.freeze(nodeAlgAes256GcmIv12Tag16),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256]: Object.freeze(nodeAlgAes128GcmIv12Tag16HkdfSha256),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES192_GCM_IV12_TAG16_HKDF_SHA256]: Object.freeze(nodeAlgAes192GcmIv12Tag16HkdfSha256),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA256]: Object.freeze(nodeAlgAes256GcmIv12Tag16HkdfSha256),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256]: Object.freeze(nodeAlgAes128GcmIv12Tag16HkdfSha256EcdsaP256),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384]: Object.freeze(nodeAlgAes192GcmIv12Tag16HkdfSha384EcdsaP384),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384]: Object.freeze(nodeAlgAes256GcmIv12Tag16HkdfSha384EcdsaP384),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA512_COMMIT_KEY]: Object.freeze(nodeAlgAes256GcmHkdfSha512Committing),
    [algorithm_suites_1.AlgorithmSuiteIdentifier.ALG_AES256_GCM_IV12_TAG16_HKDF_SHA512_COMMIT_KEY_ECDSA_P384]: Object.freeze(nodeAlgAes256GcmHkdfSha512CommittingEcdsaP384),
});
class NodeAlgorithmSuite extends algorithm_suites_1.AlgorithmSuite {
    type = 'node';
    constructor(id) {
        super(nodeAlgorithms[id]);
        Object.setPrototypeOf(this, NodeAlgorithmSuite.prototype);
        Object.freeze(this);
    }
}
exports.NodeAlgorithmSuite = NodeAlgorithmSuite;
Object.freeze(NodeAlgorithmSuite.prototype);
Object.freeze(NodeAlgorithmSuite);
//# sourceMappingURL=data:application/json;base64, 