/**
 * @module encryption respec
 *
 * we gotta test our encryption ibgibs
 */
// import { cwd, chdir, } from 'node:process';
// import { statSync } from 'node:fs';
// import { mkdir, } from 'node:fs/promises';
// import { ChildProcess, exec, ExecException } from 'node:child_process';
import * as pathUtils from 'path';
import { ifWe, iReckon, respecfully } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
const maam = `[${import.meta.url}]`, sir = maam;
import { getUUID, getTimestamp, } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
import { GLOBAL_LOG_A_LOT } from '../../core-constants.mjs';
import { EncryptionMethod } from './encrypt-types.mjs';
import { SaltStrategy } from '@ibgib/encrypt-gib/dist/types.mjs';
import { getEncryptionIb, parseEncryptionIb } from './encrypt-helper.mjs';
import { ENCRYPTION_ATOM } from './encrypt-constants.mjs';
/**
 * for verbose logging
 */
const logalot = GLOBAL_LOG_A_LOT; // change this when you want to turn off verbose logging
const lcFile = `[${pathUtils.basename(import.meta.url)}]`;
const atom = ENCRYPTION_ATOM;
const recursionCount = 168;
const hashAlgorithm = 'SHA-256';
const saltPrependedPerHash = '';
const saltStrategy = SaltStrategy.prependPerHash;
const initialRecursions = 1000;
const recursionsPerHash = 2;
const method = EncryptionMethod.encrypt_gib;
const salt_empty = ''; //
const description = 'description yo';
const blockName = `encryption ib`;
await respecfully(maam, blockName, async () => {
    const lc = `${lcFile}[${blockName}]`;
    debugger;
    const name = await getUUID();
    const timestampDate = new Date();
    const timestamp = getTimestamp(timestampDate);
    const timestampMs = timestampDate.getMilliseconds();
    const data_valid = {
        name,
        hashAlgorithm,
        initialRecursions: 1000,
        method,
        salt: salt_empty,
        description,
        encryptedDataDelimiter: undefined,
        recursionsPerHash,
        saltStrategy,
        n: 0,
        timestamp,
        timestampMs,
        blockMode: false,
    };
    await ifWe(maam, `getEncryptionIb`, async () => {
        const data = data_valid;
        let ib = getEncryptionIb({ data });
        iReckon(sir, ib.includes(name)).asTo('name').isGonnaBeTrue();
        iReckon(sir, ib.includes(method)).asTo('method').isGonnaBeTrue();
    });
    await ifWe(maam, `parseEncryptionIb`, async () => {
        const data = data_valid;
        let ib = getEncryptionIb({ data });
        let parsed = parseEncryptionIb({ ib });
        iReckon(sir, parsed.atom).asTo('atom').isGonnaBe(atom);
        iReckon(sir, parsed.name).asTo('name').isGonnaBe(name);
        iReckon(sir, parsed.method).asTo('method').isGonnaBe(method);
    });
});
//# sourceMappingURL=encrypt.respec.mjs.map