Function toBytes [src]

Pack a scalar into bytes

Prototype

pub fn toBytes(expanded: *const Scalar) CompressedScalar

Parameters

expanded: *const Scalar

Source

pub fn toBytes(expanded: *const Scalar) CompressedScalar { var bytes: CompressedScalar = undefined; var i: usize = 0; while (i < 4) : (i += 1) { mem.writeInt(u64, bytes[i * 7 ..][0..8], expanded.limbs[i], .little); } mem.writeInt(u32, bytes[i * 7 ..][0..4], @intCast(expanded.limbs[i]), .little); return bytes; }