Commit graph

17 commits

Author SHA1 Message Date
Dave Rodgman
2c91f4b8b2 Fix for big-endian architectures
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 19:59:05 +01:00
Dave Rodgman
2f0f998ec4 Unify ABSORB and ABSORB8 to fix compile error
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 19:12:04 +01:00
Dave Rodgman
f213d0a7b0 Tidy-up
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 17:09:47 +01:00
Dave Rodgman
1b42763516 Remove NULL checks
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 17:09:02 +01:00
Dave Rodgman
cf4d2bdc09 Spell as SHA-3 not SHA3
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 17:08:09 +01:00
Dave Rodgman
9d7fa93e6c move mbedtls_sha3_family_functions out of public interface
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 16:50:15 +01:00
Dave Rodgman
1789d84282 remove not-needed fields from SHA-3 context
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 16:50:15 +01:00
Dave Rodgman
bcfd79c699 Consume input in 8-byte chunks
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-07 16:50:15 +01:00
Pol Henarejos
a6779287e8
Style.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2023-02-08 00:50:04 +01:00
Pol Henarejos
39fb1d52d1
Update library/sha3.c
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Pol Henarejos <55573252+polhenarejos@users.noreply.github.com>
2022-10-13 08:29:47 +02:00
Pol Henarejos
7dbd5d1760
Add self tests (taken from #1549).
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-20 20:42:33 +02:00
Pol Henarejos
938b5abb13
Fix when reusing the same context for another operation.
Occurs in hmac, where multiple hashes are performed with the same context) and thus, it requires to reinitialize the internal states to 0.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-20 20:07:40 +02:00
Pol Henarejos
1f3ae1639d
olen parameter shall contain the length of the buffer.
For SHA-3 families, it must be at least 28, 32, 48 or 64, depending on the family.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-20 20:07:40 +02:00
Pol Henarejos
116411e1a9
Fix when no SHA3 family is found.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-20 20:07:39 +02:00
Pol Henarejos
85eeda0122
olen = 0 is not allowed for SHA-3.
Sanity checks are moved to mbedtls_sha3_xxx() functions.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-20 20:07:39 +02:00
Pol Henarejos
084649d189
SHA-3 does not use SHA3_ALT anymore.
Next releases will not use alt files.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-20 20:07:39 +02:00
Pol Henarejos
0cd1f1c77f
Add SHA-3 module.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
2022-05-09 01:04:15 +02:00