(LZMA is a compression algorithm, not cryptographic.) For the
purpose of implementing cryptographic algorithms, the generic
method is getting the relevant descriptive standard, grabbing
your keyboard, and trying. Most standards include "test
vectors", i.e. sample values which let you know whether your
implementation returns the correct answers. At that point,
things differ, depending on what kind of algorithm you are
considering. Symmetric algorithms cover symmetric encryption,
hash functions, and message authentication codes (MAC). You do
not need to know much mathematics to handle these; most of it is
about additions of 32-bit and 64-bit integers (that's modular
arithmetic, with 232 or 264 as modulus) and bitwise operations
(XOR, AND...). Such code is usually done in C. Good performance
is achieved by having some notions on how the C compiler will
understand and translate the code into instructions for the CPU;
knowledge of assembly is not strictly mandatory, but quite
useful. An important parameter is cach