core: ltc: SM2 PKE: fix bignum conversions

All integers used in the SM2 algorithms are encoded as 32 byte buffers
in big endian format. The current code does not properly pad the buffer
with zeros when a value does not need the whole 32 bytes and has a few
other related issues. Fix that.

Fixes: f9a78287dd12 ("core: ltc: add support for SM2 PKE")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: 99c3a43e2163752a35720069765a233f8690db61
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .gitignore
  10. .shippable.yml
  11. .travis.yml
  12. CHANGELOG.md
  13. LICENSE
  14. MAINTAINERS
  15. Makefile
  16. README.md
  17. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers