packages feed

crypton-2.1.2: cbits/crypton_ecc_s2n_curves.h

/*
 * p, a and b of the two curves the vendored s2n-bignum assembly knows, as
 * big-endian bytes, which is how crypton_ecc_mul is given a curve.  They are
 * here to be compared against, not computed with: a caller naming some other
 * curve with the same sizes has to go to the C.
 *
 * Generated from `openssl ecparam -name secp384r1 -param_enc explicit -text`
 * and the same for secp521r1, rather than transcribed.
 */
#ifndef CRYPTON_ECC_S2N_CURVES_H
#define CRYPTON_ECC_S2N_CURVES_H

#include <stdint.h>

#define P384_PLEN 48
static const uint8_t P384_P[48] = {
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,
	0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff
};
static const uint8_t P384_A[48] = {
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,
	0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xfc
};
static const uint8_t P384_B[48] = {
	0xb3,0x31,0x2f,0xa7,0xe2,0x3e,0xe7,0xe4,
	0x98,0x8e,0x05,0x6b,0xe3,0xf8,0x2d,0x19,
	0x18,0x1d,0x9c,0x6e,0xfe,0x81,0x41,0x12,
	0x03,0x14,0x08,0x8f,0x50,0x13,0x87,0x5a,
	0xc6,0x56,0x39,0x8d,0x8a,0x2e,0xd1,0x9d,
	0x2a,0x85,0xc8,0xed,0xd3,0xec,0x2a,0xef
};

#define P521_PLEN 66
static const uint8_t P521_P[66] = {
	0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff
};
static const uint8_t P521_A[66] = {
	0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
	0xff,0xfc
};
static const uint8_t P521_B[66] = {
	0x00,0x51,0x95,0x3e,0xb9,0x61,0x8e,0x1c,
	0x9a,0x1f,0x92,0x9a,0x21,0xa0,0xb6,0x85,
	0x40,0xee,0xa2,0xda,0x72,0x5b,0x99,0xb3,
	0x15,0xf3,0xb8,0xb4,0x89,0x91,0x8e,0xf1,
	0x09,0xe1,0x56,0x19,0x39,0x51,0xec,0x7e,
	0x93,0x7b,0x16,0x52,0xc0,0xbd,0x3b,0xb1,
	0xbf,0x07,0x35,0x73,0xdf,0x88,0x3d,0x2c,
	0x34,0xf1,0xef,0x45,0x1f,0xd4,0x6b,0x50,
	0x3f,0x00
};

#endif