License
BSD-3-Clause
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.
void zeroBigInt(ref BigInt val) nothrow @nogc @trustedZeroizes a BigInt's limbs in place and clears its sign.ubyte[] bigIntToBytes(BigInt val) @safeConverts a non-negative BigInt to minimal big-endian unsigned bytes.BigInt bytesToBigInt(const(ubyte)[] bytes) @safe pureConverts big-endian unsigned bytes to a BigInt.ubyte[] 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.