struct AvbRSAPublicKeyHeader
Defined at line 158 of file ../../third_party/android/platform/external/avb/include/libavb/../../libavb/avb_crypto.h
The header for a serialized RSA public key.
The size of the key is given by |key_num_bits|, for example 2048
for a RSA-2048 key. By definition, a RSA public key is the pair (n,
e) where |n| is the modulus (which can be represented in
|key_num_bits| bits) and |e| is the public exponent. The exponent
is not stored since it's assumed to always be 65537.
To optimize verification, the key block includes two precomputed
values, |n0inv| (fits in 32 bits) and |rr| and can always be
represented in |key_num_bits|.
The value |n0inv| is the value -1/n[0] (mod 2^32). The value |rr|
is (2^key_num_bits)^2 (mod n).
Following this header is |key_num_bits| bits of |n|, then
|key_num_bits| bits of |rr|. Both values are stored with most
significant bit first. Each serialized number takes up
|key_num_bits|/8 bytes.
All fields in this struct are stored in network byte order when
serialized. To generate a copy with fields swapped to native byte
order, use the function avb_rsa_public_key_header_validate_and_byteswap().
The avb_rsa_verify() function expects a key in this serialized
format.
The 'avbtool extract_public_key' command can be used to generate a
serialized RSA public key.
Public Members
uint32_t key_num_bits
uint32_t n0inv