ARM Shanghai IoT Team (Internal) / newMiniTLS-GPL

Fork of MiniTLS-GPL by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

ltc.h File Reference

ltc.h File Reference

Copyright (c) AppNearMe Ltd 2013 More...

Go to the source code of this file.

Functions

ecc_pointltc_ecc_new_point (void)
 Allocate a new ECC point.
void ltc_ecc_del_point (ecc_point *p)
 Free an ECC point from memory.
int ltc_ecc_projective_dbl_point (ecc_point *P, ecc_point *R, void *modulus, void *mp)
 Double an ECC point.
int ltc_ecc_projective_add_point (ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp)
 Add two ECC points.
int ltc_ecc_mulmod (void *k, ecc_point *G, ecc_point *R, void *modulus, int map)
 Perform a point multiplication (timing resistant)
int ltc_ecc_mul2add (ecc_point *A, void *kA, ecc_point *B, void *kB, ecc_point *C, void *modulus)
 Computes kA*A + kB*B = C using Shamir's Trick.
int ltc_ecc_map (ecc_point *P, void *modulus, void *mp)
 Map a projective jacbobian point back to affine space.

Detailed Description

Copyright (c) AppNearMe Ltd 2013

Author:
Donatien Garnier

Definition in file ltc.h.


Function Documentation

void ltc_ecc_del_point ( ecc_point p )

Free an ECC point from memory.

Parameters:
pThe point to free

Definition at line 66 of file ltc_ecc_points.c.

int ltc_ecc_map ( ecc_point P,
void *  modulus,
void *  mp 
)

Map a projective jacbobian point back to affine space.

Parameters:
P[in/out] The point to map
modulusThe modulus of the field the ECC curve is in
mpThe "b" value from montgomery_setup()
Returns:
MINITLS_OK on success

Definition at line 51 of file ltc_ecc_map.c.

int ltc_ecc_mul2add ( ecc_point A,
void *  kA,
ecc_point B,
void *  kB,
ecc_point C,
void *  modulus 
)

Computes kA*A + kB*B = C using Shamir's Trick.

Parameters:
AFirst point to multiply
kAWhat to multiple A by
BSecond point to multiply
kBWhat to multiple B by
C[out] Destination point (can overlap with A or B
modulusModulus for curve
Returns:
CRYPT_OK on success

Definition at line 55 of file ltc_ecc_mul2add.c.

int ltc_ecc_mulmod ( void *  k,
ecc_point G,
ecc_point R,
void *  modulus,
int  map 
)

Perform a point multiplication (timing resistant)

Parameters:
kThe scalar to multiply by
GThe base point
R[out] Destination for kG
modulusThe modulus of the field the ECC curve is in
mapBoolean whether to map back to affine or not (1==map, 0 == leave in projective)
Returns:
MINITLS_OK on success

Definition at line 55 of file ltc_ecc_mulmod_timing.c.

ecc_point* ltc_ecc_new_point ( void   )

Allocate a new ECC point.

Returns:
A newly allocated point or NULL on error

Definition at line 49 of file ltc_ecc_points.c.

int ltc_ecc_projective_add_point ( ecc_point P,
ecc_point Q,
ecc_point R,
void *  modulus,
void *  mp 
)

Add two ECC points.

Parameters:
PThe point to add
QThe point to add
R[out] The destination of the double
modulusThe modulus of the field the ECC curve is in
mpThe "b" value from montgomery_setup()
Returns:
MINITLS_OK on success

Definition at line 53 of file ltc_ecc_projective_add_point.c.

int ltc_ecc_projective_dbl_point ( ecc_point P,
ecc_point R,
void *  modulus,
void *  mp 
)

Double an ECC point.

Parameters:
PThe point to double
R[out] The destination of the double
modulusThe modulus of the field the ECC curve is in
mpThe "b" value from montgomery_setup()
Returns:
MINITLS_OK on success

Definition at line 52 of file ltc_ecc_projective_dbl_point.c.