Private/Field/Invoke-SecretSharingFieldAddition.ps1

function Invoke-SecretSharingFieldAddition {
    <#
    .SYNOPSIS
        Adds two GF(256) field elements.
    .DESCRIPTION
        GF(256) has characteristic 2, so addition and subtraction are the same operation
        (XOR) - this function serves as both.
    #>

    [CmdletBinding()]
    [OutputType([byte])]
    param(
        [Parameter(Mandatory)]
        [byte]$A,

        [Parameter(Mandatory)]
        [byte]$B
    )

    return [byte]($A -bxor $B)
}