[openssl-users] What is the need for 0x00 byte prefix in pubkey and prime of a static DH key pair?

Matt Caswell matt at openssl.org
Fri Nov 30 08:26:47 UTC 2018

On 30/11/2018 05:26, M K Saravanan wrote:
> Hi,
> When I create static DH key pair using openssl, why the public key and
> prime contains the prefix 0x00 byte?

Because otherwise those numbers would be treated as negative (due to the most
significant bit being set) which is incorrect.


More information about the openssl-users mailing list