Private/Digest/Get-SecretSharingDigestConstant.ps1
|
function Get-SecretSharingDigestConstant { <# .SYNOPSIS Returns the SLIP-0039 constants used for shared-secret digest verification. .DESCRIPTION Per SLIP-0039: polynomial index 254 encodes the shared secret's digest share, index 255 encodes the shared secret itself, and the digest is truncated to its first 4 bytes. Index 255 (not 0) is used for the secret specifically so a combiner that forgets to validate x-coordinates can't be tricked by a share maliciously modified to x=0. #> [CmdletBinding()] [OutputType([PSCustomObject])] param() return [PSCustomObject]@{ DigestIndex = [byte]254 SecretIndex = [byte]255 DigestLength = 4 } } |