comparison libtomcrypt/src/pk/ecc/ecc_export.c @ 1471:6dba84798cd5

Update to libtomcrypt 1.18.1, merged with Dropbear changes
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 21:44:05 +0800
parents f849a5ca2efc
children
comparison
equal deleted inserted replaced
1470:8bba51a55704 1471:6dba84798cd5
3 * LibTomCrypt is a library that provides various cryptographic 3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner. 4 * algorithms in a highly modular and flexible manner.
5 * 5 *
6 * The library is free for all purposes without any express 6 * The library is free for all purposes without any express
7 * guarantee it works. 7 * guarantee it works.
8 *
9 * Tom St Denis, [email protected], http://libtom.org
10 */ 8 */
11 9
12 /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b 10 /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b
13 * 11 *
14 * All curves taken from NIST recommendation paper of July 1999 12 * All curves taken from NIST recommendation paper of July 1999
17 #include "tomcrypt.h" 15 #include "tomcrypt.h"
18 16
19 /** 17 /**
20 @file ecc_export.c 18 @file ecc_export.c
21 ECC Crypto, Tom St Denis 19 ECC Crypto, Tom St Denis
22 */ 20 */
23 21
24 #if defined(LTC_MECC) && defined(LTC_DER) 22 #if defined(LTC_MECC) && defined(LTC_DER)
25 23
26 /** 24 /**
27 Export an ECC key as a binary packet 25 Export an ECC key as a binary packet
38 unsigned long key_size; 36 unsigned long key_size;
39 37
40 LTC_ARGCHK(out != NULL); 38 LTC_ARGCHK(out != NULL);
41 LTC_ARGCHK(outlen != NULL); 39 LTC_ARGCHK(outlen != NULL);
42 LTC_ARGCHK(key != NULL); 40 LTC_ARGCHK(key != NULL);
43 41
44 /* type valid? */ 42 /* type valid? */
45 if (key->type != PK_PRIVATE && type == PK_PRIVATE) { 43 if (key->type != PK_PRIVATE && type == PK_PRIVATE) {
46 return CRYPT_PK_TYPE_MISMATCH; 44 return CRYPT_PK_TYPE_MISMATCH;
47 } 45 }
48 46
74 72
75 return err; 73 return err;
76 } 74 }
77 75
78 #endif 76 #endif
79 /* $Source$ */ 77 /* ref: $Format:%D$ */
80 /* $Revision$ */ 78 /* git commit: $Format:%H$ */
81 /* $Date$ */ 79 /* commit time: $Format:%ai$ */
82 80