- All Implemented Interfaces:
- junit.framework.Test
public class RawPublicKeyEncodingTest
extends junit.framework.TestCase
NTRU, Dilithium and BIKE public keys are written raw into the SubjectPublicKeyInfo BIT STRING, and the
draft form that wrapped them in an OCTET STRING is still read. A raw key is random bytes, so it can begin
with bytes that read as an OCTET STRING header whose length covers exactly the rest - about once in 2^32
keys - and must still be read as the raw key: such an NTRU key used to be rejected, and such a Dilithium
or BIKE key loaded as a different, shorter key. The prefix is forced onto real keys here; none of the
three binds its public key bytes to anything a decoder checks.