| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusCore.Crypto.BLS12_381.Error
Synopsis
Documentation
data BLS12_381_Error Source #
Constructors
| HashToCurveDstTooBig | |
| BadCompressedData |
Instances
| Show BLS12_381_Error Source # | |
Defined in PlutusCore.Crypto.BLS12_381.Error | |
checkCompressed ∷ Int → ByteString → Either BLS12_381_Error ByteString Source #
Structural validation of a compressed BLS12-381 point, shared by the C-free
G1 and G2 uncompress stubs (expectedLen is 48 for G1, 96 for G2). It checks
exactly what can be checked without field arithmetic: the length, and the three
metadata bits of the leading byte -- the compression bit must be set, and if the
infinity bit is set the encoding must be the canonical 0xc0 00..00. It
deliberately does NOT verify that the bytes encode a point on the curve or in the
subgroup (that needs blst), so it is weaker than the real blsUncompress; but it
rejects the malformed inputs the real decoder rejects on structure alone, rather
than accepting anything.