Elliptic Curve Crypto

class tomcrypt.ecc.Curve

A elliptic curve for use in ECC.

Due to LibTomCrypt’s limitations and implementation, we will only use the 8 recommended curves as provided by LibTomCrypt.

Passing a bit size to the constructor will yield the smallest curve of at least the given size.

class tomcrypt.ecc.Key

An ECC key.

Attributes:
curve – The Curve object used with this key. public – The public component of this key.
Constructor Params:
curve – int of the minimum bit size of key to use (picks from the
NIST recommended curves), or a Curve to use directly.

prng – The PRNG to use to generate the key; defaults to “sprng”.

as_dict()

Return a dict of all of the key parts encoded into strings.

Params:
radix – The base into which to convert the bignum. From 2-64.
as_string()

Build the string representation of a key.

Params:
type – None (as is), ‘private’ or ‘public’. format – ‘pem’ (default), or ‘der’.
is_private

True if this is a private key.

is_public

True if this is a public key.

public

A view of this key with only the public part.

If this is already a public key, this will be the same object.

type

‘private’ or ‘public’

Previous topic

RSA

Next topic

PKCS5

This Page