integrated changes from crypto library