diff options
author | Marius Schilder <mschilder@google.com> | 2018-02-23 15:41:27 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-02-23 23:13:01 -0800 |
commit | 3c4800e59452a7124c34f563d548e09849d59b8d (patch) | |
tree | 24d3662e78c60791366d3761f54d5a615ca0fb7d /include/crc.h | |
parent | d57e5eb3128774732e3b3fe40c0f939d9aaeff1a (diff) | |
download | chrome-ec-3c4800e59452a7124c34f563d548e09849d59b8d.tar.gz |
ec: add crc32_ctx..() to take context parameter.
Add crc32_ctx.. functions to take context parameter.
This allows for multiple instances to exist in parallel.
Signed-off-by: mschilder@google.com
TEST=make buildall -j8 succeeds
BRANCH=none
BUG=b:73832883
Change-Id: I66bbc56377eeebf01c790caad0bc4c7a51a1bc58
Reviewed-on: https://chromium-review.googlesource.com/935825
Commit-Ready: Marius Schilder <mschilder@chromium.org>
Tested-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Marius Schilder <mschilder@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'include/crc.h')
-rw-r--r-- | include/crc.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/crc.h b/include/crc.h index 6615885f27..e3b5e4ffd1 100644 --- a/include/crc.h +++ b/include/crc.h @@ -14,6 +14,8 @@ /* Use software implementation */ +/* Static context variant */ + void crc32_init(void); void crc32_hash32(uint32_t val); @@ -22,6 +24,18 @@ void crc32_hash16(uint16_t val); uint32_t crc32_result(void); +/* Provided context variant */ + +void crc32_ctx_init(uint32_t *ctx); + +void crc32_ctx_hash32(uint32_t *ctx, uint32_t val); + +void crc32_ctx_hash16(uint32_t *ctx, uint16_t val); + +void crc32_ctx_hash8(uint32_t *ctx, uint8_t val); + +uint32_t crc32_ctx_result(uint32_t *ctx); + #endif /* CONFIG_HW_CRC */ #endif /* __CROS_EC_CRC_H */ |