mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 10:45:22 +00:00
2196df60704cf85f28683da89fcf35cdbbf8d720
The format of the payload the handler expects is as follows:
field | size | note
================================================================
mode | 1 | 0 - decrypt, 1 - encrypt
cipher_mode | 1 | ECB = 0, CTR = 1, CBC = 2, GCM = 3
key_len | 1 | key size in bytes (16, 24 or 32)
key | key len | key to use
iv_len | 1 | either 0 or 16
iv | 0 or 16 | as defined by iv_len
text_len | 2 | size of the text to process, big endian
text | text_len | text to encrypt/decrypt
Current limitations are such that actual size of the payload should
not exceed 2036 bytes and only ECB and CTR cipher modes are supported.
If necessary, input data is padded to the closest size divisible by
16.
The response generated by the handler consists of the result of the
encrypt/decrypt operation, it is always an integer amount of 16 byte
blocks.
The test code is compiled in if CRYPTO_TEST_SETUP is defined, which it
presently is.
BRANCH=none
BUG=chrome-os-partner:47524
TEST=Using the python utility on the host, exercised several NIST test
vectors for ECB and CTR, with key sizes of 128, 192 and 256 bytes
for both AES types. Both cipher text and decryption result match
the vector values.
Change-Id: I148f286d614f0212192a95b5518cddd32935f43d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312720
Reviewed-by: Nagendra Modadugu <ngm@google.com>
For an overview of the Embedded Controller firmware, refer to http://www.chromium.org/chromium-os/2014-firmware-summit
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%