You need to compile the device-mapper in your kernel as well as support for the cryptographic functions you intend to use.
Those settings are found (when using make menuconfig) there:
Device Drivers -> Multi-device support (RAID and LVM) -> Device mapper support
Assuming that your swap partition is /dev/hda2, you can enable it with:
Although you could encrypt partitions in a similar manner (use a key-file
instead of /dev/urandom), you'd better use LUKS instead.
See my LUKS HOWTO.