aboutsummaryrefslogtreecommitdiff
path: root/lib/crypto/mpi/ec.c
AgeCommit message (Collapse)AuthorFilesLines
2024-06-21crypto: lib/mpi - Use swap() in mpi_ec_mul_point()Jiapeng Chong1-4/+2
Use existing swap() function rather than duplicating its implementation. ./lib/crypto/mpi/ec.c:1291:20-21: WARNING opportunity for swap(). ./lib/crypto/mpi/ec.c:1292:20-21: WARNING opportunity for swap(). Reported-by: Abaci Robot <[email protected]> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9328 Signed-off-by: Jiapeng Chong <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2023-12-22crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_initTianjia Zhang1-0/+3
When the mpi_ec_ctx structure is initialized, some fields are not cleared, causing a crash when referencing the field when the structure was released. Initially, this issue was ignored because memory for mpi_ec_ctx is allocated with the __GFP_ZERO flag. For example, this error will be triggered when calculating the Za value for SM2 separately. Fixes: d58bb7e55a8a ("lib/mpi: Introduce ec implementation to MPI library") Cc: [email protected] # v6.5 Signed-off-by: Tianjia Zhang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2023-08-11crypto: lib - Move mpi into lib/cryptoHerbert Xu1-0/+1506
As lib/mpi is mostly used by crypto code, move it under lib/crypto so that patches touching it get directed to the right mailing list. Signed-off-by: Herbert Xu <[email protected]> Reviewed-by: Mimi Zohar <[email protected]> Signed-off-by: Herbert Xu <[email protected]>