commit | 463acb4d50929fc3d3c803c7de8a55c07694c951 | [log] [tgz] |
---|---|---|
author | Jerome Forissier <jerome@forissier.org> | Fri Jan 17 10:05:37 2020 +0100 |
committer | Jérôme Forissier <jerome@forissier.org> | Fri Jan 17 15:16:37 2020 +0100 |
tree | 4b557a6168e0764fbd68211e5e5e351f93bfd707 | |
parent | e9c0b5d76918acd90e51e44d9d1b67dbfdb77419 [diff] |
core: ltc: acipher_helpers.h: add macro mp_to_unsigned_bin2() Writing a bignum to a fixed size integer buffer in big endian order is slightly cumbersome, because one has to take into account the actual size of the bignum in order to have the zero padding on the left. Let's say I am working with 256-bit numbers: unsigned char buf[32] = { }; void *n = compute_some_bignum(...); mp_to_unsigned_bin(n, buf + sizeof(buf) - mp_unsigned_bin_size(n)); This commit introduces mp_to_unsigned_bin2() which can be used like so: unsigned char buf[32] = { }; void *n = compute_some_bignum(...); mp_to_unsigned_bin2(n, buf, sizeof(buf)); Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
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