  We present a theory of generation of strong (sub-equipartition) magnetic
fields in relativistic collisionless GRB shocks. These fields produced by the
kinetic two-stream instability are tangled on very small spatial scales. This
has a clear signature in the otherwise synchrotron(-self-Compton) $\gamma$-ray
spectrum. Second, we present an analytical theory of jitter radiation, which is
emitted when the correlation length of the magnetic field is smaller then the
gyration (Larmor) radius of the accelerated electrons. We demonstrate that the
spectral power $P(\nu)$ for pure jitter radiation is well-described by a
sharply broken power-law: $P(\nu)\propto\nu^1$ for $\nu<\nu_j$ and
$P(\nu)\propto\nu^{-(p-1)/2}$ for $\nu>\nu_j$, where $p$ is the electron
power-law index and $\nu_j$ is the jitter break, which is independent of the
magnetic field strength and depends on the shock energetics and kinematics.
Here we mostly focus on the first problem. The radiation theory and comparison
with observations will be discussed in the forthcoming publications.
