ddn.crypto.internal.bigintutils

Internal BigInt conversion helpers shared by the key and key-exchange modules.

This module is an implementation detail of ddn.crypto and is not part of the public API; it exists so that byte/BigInt conversions and zeroization cannot drift between modules.

Functions 4

fnvoid zeroBigInt(ref BigInt val) nothrow @nogc @trustedZeroizes a BigInt's limbs in place and clears its sign.
fnubyte[] bigIntToBytes(BigInt val) @safeConverts a non-negative BigInt to minimal big-endian unsigned bytes.
fnBigInt bytesToBigInt(const(ubyte)[] bytes) @safe pureConverts big-endian unsigned bytes to a BigInt.
fnubyte[] bigIntToFixedBytes(BigInt val, size_t len) @safeConverts a non-negative BigInt to a fixed-width big-endian representation, zero-padded or truncated from the left.