rsa function updates