Merge crypto code with master branch