Home | History | Annotate | Download | only in ecc

Lines Matching refs:key

26 /** Import an ANSI X9.63 format public key 
29 @param key [out] destination to store imported key \
31 int ecc_ansi_x963_import(const unsigned char *in, unsigned long inlen, ecc_key *key)
33 return ecc_ansi_x963_import_ex(in, inlen, key, NULL);
36 int ecc_ansi_x963_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, ltc_ecc_set_type *dp)
41 LTC_ARGCHK(key != NULL);
48 /* init key */
49 if (mp_init_multi(&key->pubkey.x, &key->pubkey.y, &key->pubkey.z, &key->k, NULL) != CRYPT_OK) {
60 if ((err = mp_read_unsigned_bin(key->pubkey.x, (unsigned char *)in+1, (inlen-1)>>1)) != CRYPT_OK) {
64 if ((err = mp_read_unsigned_bin(key->pubkey.y, (unsigned char *)in+1+((inlen-1)>>1), (inlen-1)>>1)) != CRYPT_OK) {
67 if ((err = mp_set(key->pubkey.z, 1)) != CRYPT_OK) { goto error; }
81 key->idx = x;
82 key->dp = &ltc_ecc_sets[x];
88 key->idx = -1;
89 key->dp = dp;
91 key->type = PK_PUBLIC;
96 mp_clear_multi(key->pubkey.x, key->pubkey.y, key->pubkey.z, key->k, NULL);