plutus-core-1.69.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Crypto.BLS12_381.Error

Synopsis

Documentation

checkCompressedIntByteStringEither 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.