mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
import mbedtls ecc point (de)compression extension and use
This commit is contained in:
parent
59aa95fa6e
commit
44f2e253d8
4 changed files with 237 additions and 5 deletions
32
common/mbedtls/ecc_point_compression.h
Normal file
32
common/mbedtls/ecc_point_compression.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Not original to the mbedtls library. Taken from
|
||||
* https://github.com/mwarning/mbedtls_ecp_compression
|
||||
* to solve mbedtls' lack of support for elliptic point
|
||||
* compression and decompression
|
||||
*
|
||||
* Released under CC0 1.0 Universal License
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is all about mbedtls_ecp_decompress() and mbedtls_ecp_compress()
|
||||
*
|
||||
* Perform X25519 / Curve25519 point compression and decompression for mbedtls.
|
||||
* As of mbedtls 2.5.1, mbedtls does not support decompression yet.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "mbedtls/ecp.h"
|
||||
|
||||
int mbedtls_ecp_decompress(
|
||||
const mbedtls_ecp_group *grp,
|
||||
const unsigned char *input, size_t ilen,
|
||||
unsigned char *output, size_t *olen, size_t osize
|
||||
);
|
||||
|
||||
int mbedtls_ecp_compress(
|
||||
const mbedtls_ecp_group *grp,
|
||||
const unsigned char *input, size_t ilen,
|
||||
unsigned char *output, size_t *olen, size_t osize
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue