//! SPDX-FileCopyrightText: 2026 Chris Duncan <chris@codecow.com>
//! SPDX-License-Identifier: GPL-3.0-or-later
-import { Nano25519WasmError, } from './primordials'
+export class Nano25519MutexError extends Error { }
+Object.defineProperty(Nano25519MutexError, 'name', { value: 'Nano25519MutexError' })
+Object.freeze(Nano25519MutexError)
+export class Nano25519RangeError extends RangeError { }
+Object.defineProperty(Nano25519RangeError, 'name', { value: 'Nano25519RangeError' })
+Object.freeze(Nano25519RangeError)
+export class Nano25519TypeError extends TypeError { }
+Object.defineProperty(Nano25519TypeError, 'name', { value: 'Nano25519TypeError' })
+Object.freeze(Nano25519TypeError)
+export class Nano25519WasmError extends Error { }
+Object.defineProperty(Nano25519WasmError, 'name', { value: 'Nano25519WasmError' })
+Object.freeze(Nano25519WasmError)
/**
* Message text for the codes in `src/assembly/errors.ts`. The numbers are the
//! SPDX-FileCopyrightText: 2026 Chris Duncan <chris@codecow.com>
//! SPDX-License-Identifier: GPL-3.0-or-later
+import { Nano25519RangeError, Nano25519TypeError, } from './errors'
+
/**
* Builtins captured once, when this module is evaluated, so that nothing on a
* call path resolves a global or a prototype method that hostile code could
export const objectDefineProperty = Object.defineProperty
export const objectFreeze = Object.freeze
-/** Custom errors */
-class Nano25519MutexError extends Error { }
-objectDefineProperty(Nano25519MutexError, 'name', { value: 'Nano25519MutexError' })
-objectFreeze(Nano25519MutexError)
-
-class Nano25519RangeError extends RangeError { }
-objectDefineProperty(Nano25519RangeError, 'name', { value: 'Nano25519RangeError' })
-objectFreeze(Nano25519RangeError)
-
-class Nano25519TypeError extends TypeError { }
-objectDefineProperty(Nano25519TypeError, 'name', { value: 'Nano25519TypeError' })
-objectFreeze(Nano25519TypeError)
-
-class Nano25519WasmError extends Error { }
-objectDefineProperty(Nano25519WasmError, 'name', { value: 'Nano25519WasmError' })
-objectFreeze(Nano25519WasmError)
-
-export {
- Nano25519MutexError,
- Nano25519RangeError,
- Nano25519TypeError,
- Nano25519WasmError
-}
-
/** Type aliases for legibility. */
export type Bytes = Uint8Array<ArrayBuffer>
export type Words = Uint32Array<ArrayBuffer>