UNPKG

@iota-big3/sdk-quantum

Version:

Quantum-ready architecture with post-quantum cryptography

600 lines 16 kB
export interface QuantumConfig { region?: string; environment?: string; logLevel?: 'debug' | 'info' | 'warn' | 'error'; enableMetrics?: boolean; enableEvents?: boolean; cryptoProvider?: string; simulatorBackend?: string; quantumCloudProvider?: string; } export type QuantumSDKConfig = QuantumConfig; export interface QuantumArchitectureConfig { cryptoMigrationEnabled?: boolean; quantumSimulationEnabled?: boolean; quantumStorageEnabled?: boolean; postQuantumCryptoEnabled?: boolean; hybridCryptoMode?: boolean; } export interface PostQuantumCryptoConfig { algorithm: PostQuantumAlgorithm; keySize: number; securityLevel: SecurityLevel; hybridMode?: boolean; classicalFallback?: boolean; } export declare enum PostQuantumAlgorithm { KYBER = "kyber", DILITHIUM = "dilithium", FALCON = "falcon", SPHINCS_PLUS = "sphincs-plus", NTRU = "ntru", SABER = "saber", FRODO_KEM = "frodo-kem", CLASSIC_MCELIECE = "classic-mceliece" } export declare enum SecurityLevel { LEVEL_1 = 1, LEVEL_2 = 2, LEVEL_3 = 3, LEVEL_4 = 4, LEVEL_5 = 5 } export interface KeyPair { publicKey: Uint8Array; privateKey: Uint8Array; algorithm: PostQuantumAlgorithm; securityLevel: SecurityLevel; createdAt: Date; expiresAt?: Date; } export interface EncryptionResult { ciphertext: Uint8Array; nonce?: Uint8Array; tag?: Uint8Array; algorithm: PostQuantumAlgorithm; keyId: string; timestamp: Date; } export interface SignatureResult { signature: Uint8Array; algorithm: PostQuantumAlgorithm; keyId: string; timestamp: Date; } export interface CryptoMigrationPlan { id: string; name: string; description: string; fromAlgorithm: string; toAlgorithm: PostQuantumAlgorithm; migrationStrategy: MigrationStrategy; phases: MigrationPhase[]; timeline: MigrationTimeline; rollbackPlan: RollbackPlan; status: MigrationStatus; createdAt: Date; updatedAt: Date; } export declare enum MigrationStrategy { GRADUAL = "gradual", BIG_BANG = "big-bang", HYBRID = "hybrid", BLUE_GREEN = "blue-green" } export interface MigrationPhase { id: string; name: string; description: string; order: number; dependencies: string[]; tasks: MigrationTask[]; estimatedDuration: number; status: PhaseStatus; startedAt?: Date; completedAt?: Date; } export interface MigrationTask { id: string; name: string; description: string; type: TaskType; config: Record<string, unknown>; status: TaskStatus; progress: number; startedAt?: Date; completedAt?: Date; error?: string; } export declare enum TaskType { KEY_GENERATION = "key-generation", DATA_ENCRYPTION = "data-encryption", SIGNATURE_UPDATE = "signature-update", CERTIFICATE_RENEWAL = "certificate-renewal", SYSTEM_UPDATE = "system-update", VALIDATION = "validation", ROLLBACK = "rollback" } export declare enum TaskStatus { PENDING = "pending", RUNNING = "running", COMPLETED = "completed", FAILED = "failed", CANCELLED = "cancelled" } export declare enum PhaseStatus { NOT_STARTED = "not-started", IN_PROGRESS = "in-progress", COMPLETED = "completed", FAILED = "failed", CANCELLED = "cancelled" } export declare enum MigrationStatus { PLANNING = "planning", READY = "ready", IN_PROGRESS = "in-progress", COMPLETED = "completed", FAILED = "failed", CANCELLED = "cancelled", ROLLED_BACK = "rolled-back" } export interface MigrationTimeline { plannedStart: Date; plannedEnd: Date; actualStart?: Date; actualEnd?: Date; milestones: Milestone[]; } export interface Milestone { id: string; name: string; description: string; plannedDate: Date; actualDate?: Date; status: MilestoneStatus; } export declare enum MilestoneStatus { PENDING = "pending", ACHIEVED = "achieved", MISSED = "missed", CANCELLED = "cancelled" } export interface RollbackPlan { id: string; name: string; description: string; triggers: RollbackTrigger[]; steps: RollbackStep[]; estimatedDuration: number; status: RollbackStatus; } export interface RollbackTrigger { type: TriggerType; condition: string; threshold?: number; enabled: boolean; } export declare enum TriggerType { ERROR_RATE = "error-rate", PERFORMANCE_DEGRADATION = "performance-degradation", SECURITY_BREACH = "security-breach", MANUAL = "manual", TIMEOUT = "timeout" } export interface RollbackStep { id: string; name: string; description: string; order: number; type: RollbackStepType; config: Record<string, unknown>; status: TaskStatus; } export declare enum RollbackStepType { RESTORE_KEYS = "restore-keys", RESTORE_DATA = "restore-data", REVERT_CONFIG = "revert-config", RESTART_SERVICES = "restart-services", VALIDATE_SYSTEM = "validate-system" } export declare enum RollbackStatus { READY = "ready", IN_PROGRESS = "in-progress", COMPLETED = "completed", FAILED = "failed" } export interface QuantumSimulatorConfig { backend: SimulatorBackend; maxQubits: number; precision: number; enableNoise?: boolean; noiseModel?: NoiseModel; enableOptimization?: boolean; } export declare enum SimulatorBackend { STATE_VECTOR = "state-vector", DENSITY_MATRIX = "density-matrix", STABILIZER = "stabilizer", TENSOR_NETWORK = "tensor-network", QUANTUM_CLOUD = "quantum-cloud" } export interface NoiseModel { type: NoiseType; parameters: Record<string, number>; gates: string[]; } export declare enum NoiseType { DEPOLARIZING = "depolarizing", AMPLITUDE_DAMPING = "amplitude-damping", PHASE_DAMPING = "phase-damping", BIT_FLIP = "bit-flip", PHASE_FLIP = "phase-flip", THERMAL = "thermal" } export interface QuantumCircuit { id: string; name: string; description?: string; qubits: number; classicalBits: number; gates: QuantumGate[]; measurements: Measurement[]; createdAt: Date; optimized?: boolean; } export interface QuantumGate { id: string; type: GateType; qubits: number[]; parameters?: number[]; condition?: ClassicalCondition; label?: string; } export declare enum GateType { I = "i", X = "x", Y = "y", Z = "z", H = "h", S = "s", T = "t", RX = "rx", RY = "ry", RZ = "rz", U = "u", CNOT = "cnot", CZ = "cz", SWAP = "swap", CX = "cx", CCNOT = "ccnot", CSWAP = "cswap", QFT = "qft", IQFT = "iqft" } export interface Measurement { id: string; qubit: number; classicalBit: number; basis?: MeasurementBasis; condition?: ClassicalCondition; } export declare enum MeasurementBasis { COMPUTATIONAL = "computational", HADAMARD = "hadamard", PAULI_X = "pauli-x", PAULI_Y = "pauli-y", PAULI_Z = "pauli-z" } export interface ClassicalCondition { register: string; value: number; comparison: ComparisonOperator; } export declare enum ComparisonOperator { EQUAL = "equal", NOT_EQUAL = "not-equal", GREATER = "greater", LESS = "less", GREATER_EQUAL = "greater-equal", LESS_EQUAL = "less-equal" } export interface QuantumState { amplitudes: Complex[]; qubits: number; normalized: boolean; entangled: boolean; } export interface Complex { real: number; imaginary: number; } export interface SimulationResult { id: string; circuitId: string; shots: number; results: MeasurementResult[]; statistics: SimulationStatistics; executionTime: number; timestamp: Date; } export interface MeasurementResult { classicalBits: number[]; probability: number; count: number; } export interface SimulationStatistics { totalShots: number; uniqueResults: number; entropy: number; fidelity?: number; gateCount: number; circuitDepth: number; } export interface QuantumStorageConfig { provider: StorageProvider; encryption: QuantumEncryptionConfig; replication: ReplicationConfig; compression?: CompressionConfig; quantumErrorCorrection?: boolean; } export declare enum StorageProvider { LOCAL = "local", QUANTUM_CLOUD = "quantum-cloud", HYBRID = "hybrid", DISTRIBUTED = "distributed" } export interface QuantumEncryptionConfig { algorithm: PostQuantumAlgorithm; keyRotationInterval: number; quantumKeyDistribution?: boolean; entanglementBased?: boolean; } export interface ReplicationConfig { factor: number; strategy: ReplicationStrategy; quantumErrorCorrection: boolean; geographicDistribution?: boolean; } export declare enum ReplicationStrategy { SYNCHRONOUS = "synchronous", ASYNCHRONOUS = "asynchronous", QUANTUM_ENTANGLED = "quantum-entangled", CLASSICAL_REDUNDANT = "classical-redundant" } export interface CompressionConfig { algorithm: CompressionAlgorithm; level: number; quantumCompression?: boolean; } export declare enum CompressionAlgorithm { GZIP = "gzip", BROTLI = "brotli", QUANTUM_COMPRESSION = "quantum-compression", LOSSLESS_QUANTUM = "lossless-quantum" } export interface QuantumDataEntry { id: string; key: string; data: Uint8Array; metadata: QuantumMetadata; encryption: EncryptionMetadata; replication: ReplicationMetadata; createdAt: Date; updatedAt: Date; accessedAt: Date; } export interface QuantumMetadata { size: number; checksum: string; quantumSignature?: string; entanglementId?: string; errorCorrectionCode?: string; compressionRatio?: number; } export interface EncryptionMetadata { algorithm: PostQuantumAlgorithm; keyId: string; nonce?: string; quantumKeyDistributed?: boolean; entanglementBased?: boolean; } export interface ReplicationMetadata { replicas: ReplicaInfo[]; strategy: ReplicationStrategy; consistency: ConsistencyLevel; quantumErrorsCorrected: number; } export interface ReplicaInfo { id: string; location: string; status: ReplicaStatus; lastSyncAt: Date; quantumFidelity?: number; } export declare enum ReplicaStatus { ACTIVE = "active", SYNCING = "syncing", DEGRADED = "degraded", FAILED = "failed", QUANTUM_DECOHERENT = "quantum-decoherent" } export declare enum ConsistencyLevel { EVENTUAL = "eventual", STRONG = "strong", QUANTUM_CONSISTENT = "quantum-consistent", CAUSAL = "causal" } export interface QuantumAlgorithm { id: string; name: string; description: string; type: AlgorithmType; complexity: AlgorithmComplexity; parameters: AlgorithmParameter[]; circuit?: QuantumCircuit; classicalPreprocessing?: boolean; classicalPostprocessing?: boolean; } export declare enum AlgorithmType { OPTIMIZATION = "optimization", SEARCH = "search", SIMULATION = "simulation", CRYPTOGRAPHY = "cryptography", MACHINE_LEARNING = "machine-learning", FACTORING = "factoring", CHEMISTRY = "chemistry", FINANCE = "finance" } export interface AlgorithmComplexity { timeComplexity: string; spaceComplexity: string; quantumAdvantage: QuantumAdvantage; requiredQubits: number; requiredDepth: number; } export declare enum QuantumAdvantage { EXPONENTIAL = "exponential", QUADRATIC = "quadratic", POLYNOMIAL = "polynomial", CONSTANT = "constant", UNKNOWN = "unknown" } export interface AlgorithmParameter { name: string; type: ParameterType; description: string; required: boolean; defaultValue?: unknown; constraints?: ParameterConstraints; } export declare enum ParameterType { INTEGER = "integer", FLOAT = "float", BOOLEAN = "boolean", STRING = "string", ARRAY = "array", QUANTUM_STATE = "quantum-state", QUANTUM_CIRCUIT = "quantum-circuit" } export interface ParameterConstraints { min?: number; max?: number; allowedValues?: unknown[]; pattern?: string; } export interface QuantumEvent { id: string; type: QuantumEventType; source: string; timestamp: Date; data: Record<string, unknown>; severity: EventSeverity; category: EventCategory; } export declare enum QuantumEventType { CRYPTO_MIGRATION_STARTED = "crypto-migration-started", CRYPTO_MIGRATION_COMPLETED = "crypto-migration-completed", CRYPTO_MIGRATION_FAILED = "crypto-migration-failed", KEY_GENERATED = "key-generated", KEY_ROTATED = "key-rotated", ENCRYPTION_PERFORMED = "encryption-performed", DECRYPTION_PERFORMED = "decryption-performed", SIGNATURE_CREATED = "signature-created", SIGNATURE_VERIFIED = "signature-verified", SIMULATION_STARTED = "simulation-started", SIMULATION_COMPLETED = "simulation-completed", SIMULATION_FAILED = "simulation-failed", CIRCUIT_COMPILED = "circuit-compiled", GATE_APPLIED = "gate-applied", CIRCUIT_OPTIMIZED = "circuit-optimized", QUANTUM_STATE_MEASURED = "quantum-state-measured", DATA_STORED = "data-stored", DATA_RETRIEVED = "data-retrieved", DATA_REPLICATED = "data-replicated", QUANTUM_ERROR_CORRECTED = "quantum-error-corrected", ENTANGLEMENT_ESTABLISHED = "entanglement-established", DECOHERENCE_DETECTED = "decoherence-detected", QUANTUM_SYSTEM_INITIALIZED = "quantum-system-initialized", QUANTUM_SYSTEM_SHUTDOWN = "quantum-system-shutdown", QUANTUM_HARDWARE_CONNECTED = "quantum-hardware-connected", QUANTUM_HARDWARE_DISCONNECTED = "quantum-hardware-disconnected", QUANTUM_CALIBRATION_PERFORMED = "quantum-calibration-performed" } export declare enum EventSeverity { DEBUG = "debug", INFO = "info", WARNING = "warning", ERROR = "error", CRITICAL = "critical" } export declare enum EventCategory { SECURITY = "security", PERFORMANCE = "performance", RELIABILITY = "reliability", COMPLIANCE = "compliance", OPERATIONAL = "operational" } export interface QuantumMetrics { timestamp: Date; crypto: CryptoMetrics; simulation: SimulationMetrics; storage: StorageMetrics; system: SystemMetrics; } export interface CryptoMetrics { keyGenerationsPerSecond: number; encryptionsPerSecond: number; decryptionsPerSecond: number; signaturesPerSecond: number; verificationsPerSecond: number; averageKeyGenerationTime: number; averageEncryptionTime: number; averageDecryptionTime: number; migrationProgress: number; activeAlgorithms: string[]; } export interface SimulationMetrics { circuitsExecutedPerSecond: number; averageExecutionTime: number; averageCircuitDepth: number; averageQubitCount: number; totalShots: number; successRate: number; quantumVolumeAchieved: number; fidelityScore: number; } export interface StorageMetrics { totalDataStored: number; dataRetrievalRate: number; replicationLatency: number; quantumErrorsCorrected: number; entanglementFidelity: number; compressionRatio: number; storageEfficiency: number; } export interface SystemMetrics { cpuUsage: number; memoryUsage: number; quantumProcessorUsage: number; networkLatency: number; systemUptime: number; errorRate: number; quantumCoherenceTime: number; } export interface QuantumKeyPair { publicKey: string; privateKey: string; algorithm: PostQuantumAlgorithm; keySize: number; generatedAt: Date; expiresAt?: Date; metadata?: Record<string, unknown>; } export declare class QuantumError extends Error { code: string; severity: EventSeverity; category: EventCategory; details?: Record<string, unknown>; constructor(message: string, code: string, severity?: EventSeverity, category?: EventCategory); } //# sourceMappingURL=types.d.ts.map