All I2C access in crypto_ataes132a goes through
ataes132a_device_config. The i2c field in ataes132a_device_data
field is never written or read.
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
Table 14-1. ATAES132A Configuration Memory Map says
that key config spans from 0xf080 to 0xf0bf for a total of
16 keys. (0xF080 + (keyid < 2)) uses the boolean operator
instead of bit shift operator and produces values.
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
EncryptOK is represented by bits 1 and 2 and the proper
mask is (BIT(1) | BIT(2)) and not (BIT(1) & BIT(2)) that
evaluates always to 0b00.
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
Make static the function ataes132a_atmel_crc implemented in
the private header to avoid possible linkage error if the file
is inlcluded ina different object unit.
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
This commit addresses two integer handling issues in the ataes132a
crypto driver identified by coverity scans.
1. In ataes132a_send_command, added a centralized validation check
to ensure the 'nparams' value, when combined with the 5-byte
packet overhead, does not exceed the 8-bit 'count' limit or the
physical 64-byte command buffer. This prevents a potential wrap-
around that would cause the chip to receive an invalid length byte.
2. In the Atmel CRC calculation, added an explicit cast to uint16_t
during the bit-shift operation. This prevents unintended integer
promotion and satisfies static analysis regarding potential
overflows during the 16-bit CRC generation.
Fixes#84683Fixes#84690
Signed-off-by: David J. Leach, Jr. <tasmar@gmail.com>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move i2c.h to drivers/i2c.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Any word started with underscore followed by and uppercase letter or a
second underscore is a reserved word according with C99.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
In the code we had an if defined based on
CONFIG_ATAES132A_I2C_SPEED_STANDARD that should be
CONFIG_CRYPTO_ATAES132A_I2C_SPEED_STANDARD.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.
Jira: ZEP-2051
Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Adds a driver for Atmel Crypto Authorization solution
ATAES132A crypto device.
The driver supports the following functionality.
- AES CCM encryption, decryption and authentication
- AES ECB block operation.
The driver requires an I2C device to access crypto device registers.
Jira: ZEP-1387
Change-Id: I60aa8f3b069b703d4f83d866d28391625bb9ac13
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>