Reputation: 11
In the test vectors of AES-GCM, (I have attached the pdf here), in test vectors, 1,2 and 3, the value of A
is not given.
The link is:
https://pdfs.semanticscholar.org/114a/4222c53f1a6879f1a77f1bae2fc0f8f55348.pdf
But len(A) || len(C) = 00000000000000000000000000000080
C = 0388dace60b6a392f328c2b971b2fe78
. So len(C) = 32
, right??
Can somebody help me, how to get the value of A
and its length.
I am doing this algorithm, AES-GCM. Can somebody help me to solve this issue??
Upvotes: 1
Views: 97
Reputation: 33128
The GCM paper, in section 2.2 says
The function len() returns a 64-bit string containing the nonnegative integer describing the number of bits in its argument, with the least significant bit on the right.
The C
value in test case 2 is 32 hex characters, or 16 bytes, or 128 (0x80) bits.
len(C)
produces as 64-bit value, which in big-endian hexadecimal is 00 00 00 00 00 00 00 80
. The upper half of the 128-bit value is len(A)
. It's all zeros, so len(A)
is zero, which matches A
being absent. This is corroborated by the intro text to the test vectors section:
All values are in hexadecimal, and a zero-length variable is indicated by the absence of any hex digits.
(emphasis mine).
Upvotes: 2