Canada's Supreme Court upheld expansions to the country's rape shield laws added four years ago to further prevent a sexual assault complainant's sexual past from being used against them in a trial.

The rules are "constitutional in their entirety," the Supreme Court said in a 6-3 ruling on Thursday.

Canada's rape shield laws were enacted four decades ago to prevent a victim of a sexual assault from having evidence of their sexual history be used to discredit their claims in court.

Evidence of a complainant's prior sexual activities unrelated to the accusations at hand can only be admitted with a judge's permission following a private hearing, and cannot be used to infer the complainant is less trustworthy or more likely to have consented, according to the Criminal Code.

In 2018, Canada expanded the definition of what that evidence includes, adding communications of a sexual nature such as emails, videos and documents about the complainant that are possessed by the accused.

The Supreme Court reviewed the rules after a case involving defendant Shane Reddick, who was charged with sexual assault. In his defense, he planned to cross-examine the complainant about her prior sexual activity.

Reddick had challenged the constitutionality of Criminal Code provisions that deal with such evidence and argued they violated his rights to fundamental justice and a fair trial.

"Ultimately, the right to a fair trial does not guarantee "the most advantageous trial possible from the accused's perspective" nor does it guarantee "perfect justice," the ruling on Thursday said.

"Rather, the guarantee is fundamentally fair justice, which requires consideration of the privacy interests of others involved in the justice system," the ruling added.