Added additional input/security validation on SAL's crypto