Update to use new crypto api