Crypto bugs fixed, part III.
counter synchronization implemented