X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt.h;h=22182d6c080fb7a95633b819bf148b70775a6474;hp=1406197d0c6cd64c14cf1b30d8ef281417903638;hb=93ad956d88ffd117a6f81c5e38d9aaed3ae8b6e9;hpb=85a6aec201576a1ec57e78d91f73e45d9d6fae21 diff --git a/crypt.h b/crypt.h index 1406197d..22182d6c 100644 --- a/crypt.h +++ b/crypt.h @@ -1,18 +1,7 @@ -/* - * Copyright (C) 2005-2013 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 2005 Andre Noll , see file COPYING. */ /** \file crypt.h Public crypto interface. */ - -/* These are used to distinguish between loading of private/public key. */ - -/** The key to load is a public key. */ -#define LOAD_PUBLIC_KEY 0 -/** The key to load is a private key. */ -#define LOAD_PRIVATE_KEY 1 /** The size of the challenge sent to the client. */ #define CHALLENGE_SIZE 64 @@ -51,22 +40,21 @@ int priv_decrypt(const char *key_file, unsigned char *outbuf, * Read an asymmetric key from a file. * * \param key_file The file containing the key. - * \param private if non-zero, read the private key, otherwise the public key. * \param result The key structure is returned here. * * \return The size of the key on success, negative on errors. */ -int get_asymmetric_key(const char *key_file, int private, - struct asymmetric_key **result); +int get_public_key(const char *key_file, struct asymmetric_key **result); /** - * Deallocate an asymmetric key structure. + * Deallocate a public key. * * \param key Pointer to the key structure to free. * - * This must be called for any key obtained by get_asymmetric_key(). + * This should be called for keys obtained by get_public_key() if the key is no + * longer needed. */ -void free_asymmetric_key(struct asymmetric_key *key); +void free_public_key(struct asymmetric_key *key); /** @@ -119,7 +107,7 @@ struct stream_cipher_context { }; /** - * Allocate and initialize a stream cipher structure. + * Allocate and initialize an aes_ctr128 stream cipher structure. * * \param data The key. * \param len The size of the key.