Add an allocate buffer funtion to mcrypt1.c