Home | History | Annotate | Download | only in libtomcrypt

Lines Matching defs:Functions

124 (and helper API functions) are able to use the new designs automatically.  There exists self-check functions for each 
146 With this library all core functions (ciphers, hashes, prngs, and bignum) have the same prototype definition. They all load
149 know how to use Safer+, RC6, or Serpent as well. With all of the core functions there are central descriptor tables
167 are essentially structures with pointers to functions. While you can still call particular functions
226 In general the API is very simple to memorize and use. Most of the functions return either {\bf void} or {\bf int}. Functions
228 if it failed. Certain functions that return int will return $-1$ to indicate an error. These functions will be explicitly
318 \mysection{Functions with Variable Length Output}
319 Certain functions such as (for example) \textit{rsa\_export()} give an output that is variable length. To prevent buffer overflows you
355 As of v1.13, most functions will update your length on failure to indicate the size required by the function. Not all functions
358 \mysection{Functions that need a PRNG}
360 Certain functions such as \textit{rsa\_make\_key()} require a Pseudo Random Number Generator (PRNG). These functions do not setup
391 \mysection{Functions that use Arrays of Octets}
392 Most functions require inputs that are arrays of the data type \textit{unsigned char}. Whether it is a symmetric key, IV
402 \mysection{Core Functions}
404 should never use the ECB modes directly to encrypt data. Instead you should use the ECB functions to make a chaining mode,
412 functions which are (given that XXX is the name of the cipher) the following:
426 pass the scheduled key onto \textit{rc5\_ecb\_encrypt()}. All built--in setup functions do not allocate memory off the heap so
432 To encrypt or decrypt a block in ECB mode there are these two functions per cipher:
443 These two functions will encrypt or decrypt (respectively) a single block of text\footnote{The size of which depends on
491 For the software based ciphers within LibTomCrypt, these functions will not do anything. However, user supplied
492 cipher descriptors may require to be called for resource management purposes. To be compliant, all functions which call a cipher
597 The remaining fields are all pointers to the core functions for each cipher. The end of the cipher\_descriptor array is
911 five of the modes will return {\bf CRYPT\_OK} on success from the encrypt or decrypt functions.
919 To change or read the IV of a previously initialized chaining mode use the following two functions.
932 The XXX\_getiv() functions will read the IV out of the chaining mode and store it into \textit{IV} along with the length of the IV
936 The XXX\_setiv() functions are handy if you wish to change the IV without re--keying the cipher.
1056 To process data use the following functions:
1074 To manipulate the IV use the following functions:
1116 To encrypt or decrypt data we use the following two functions:
1133 To change or retrieve the current counter IV value use the following functions:
1144 These work with the current IV value only and not the encrypted IV value specified during the call to f8\_start(). The purpose of these two functions is to be
1216 Note: both of these functions allow you to send the data in any granularity but the order is important. While
1299 following functions.
1325 have the same meaning as with those respective functions.
1365 both functions given a single \textit{ocb} state. For bi-directional communication you will have to initialize two \textit{ocb}
1406 \subsubsection{Packet Functions}
1407 To make life simpler the following two functions are provided for memory bound OCB.
1645 message tag. The definition of the variables is the same as it is for all the manual functions.
1749 \chapter{One-Way Cryptographic Hash Functions}
1750 \mysection{Core Functions}
1751 Like the ciphers, there are hash core functions and a universal data type to hold the hash state called \textit{hash\_state}. To initialize hash
1753 \index{Hash Functions}
1784 enough for the hash in question. Often hashes are used to get keys for symmetric ciphers so the \textit{XXX\_done()} functions
1903 There are three helper functions to make working with hashes easier. The first is a function to hash a buffer, and produce the digest in a single
1975 Similar to the cipher descriptor table you must register your hash algorithms before you can use them. These functions
1976 work exactly like those of the cipher registration code. The functions are:
2014 An addition to the suite of hash functions is the \textit{Cipher Hash Construction} or \textit{CHC} mode. In this mode
2015 applicable block ciphers (such as AES) can be turned into hash functions that other LTC functions can use. In
2082 The HMAC support works much like the normal hash functions except that the initialization routine requires you to pass a key
2115 There are two utility functions provided to make using HMACs easier to do. They accept the key and information about the
2252 Similar to the HMAC code the file and memory functions
2386 Similar to the OMAC code the file and memory functions are also provided. To PMAC a buffer of memory in one shot use the
2523 This will add the message octets pointed to by \textit{in} of length \textit{inlen} to the XCBC--MAC state pointed to by \textit{state}. Like the other MAC functions,
2538 Helper functions are provided to make parsing memory buffers and files easier. The following functions are provided:
2580 F9--MAC differs slightly from the other MAC functions in that it requires the caller to perform the final message padding. The padding quite simply is a direction
2587 \subsection{F9--MAC Functions}
2608 This will add the message octets pointed to by \textit{in} of length \textit{inlen} to the F9--MAC state pointed to by \textit{state}. Like the other MAC functions,
2624 Helper functions are provided to make parsing memory buffers and files easier. The following functions are provided:
2662 \mysection{Core Functions}
2663 The library provides an array of core functions for Pseudo-Random Number Generators (PRNGs) as well. A cryptographic PRNG is
2723 This will call the start and add\_entropy functions of the given PRNG. It will use the state in
2747 To test a PRNG for operational conformity call the following functions.
2796 PRNGs have descriptors that allow plugin driven functions to be created using PRNGs. The plugin descriptors are stored in the structure \textit{prng\_descriptor}. The
2831 Just like the ciphers and hashes, you must register your prng before you can use it. The two functions provided work exactly as those for the cipher registry functions.
3024 It is possible to access the secure RNG through the PRNG interface, and in turn use it within dependent functions such
3026 requires to be started, that is you need not call the start, add\_entropy, or ready functions. For example, consider
3296 Note: the output of this function is zero--padded as per PKCS \#1 specification. This allows this routine to work with PKCS \#1 padding functions properly.
3300 To facilitate encrypting short keys the following functions have been provided.
3321 As of v1.15, the library supports both v1.5 and v2.1 PKCS \#1 style paddings in these higher level functions. The following is the extended
3367 As of v1.15, the library supports both v1.5 and v2.1 PKCS \#1 style paddings in these higher level functions. The following is the extended
3393 process the following functions have been provided.
3602 The library provides a set of core ECC functions as well that are designed to be the Elliptic Curve analogy of all of the
3694 extended ECC functions which allow the user to specify their own curves.
3725 \mysection{Core Functions}
3727 There is a key structure called \textit{ecc\_key} used by the ECC functions. There is a function to make a key:
3903 There are also functions to sign and verify messages. They use the ANSI X9.62 EC-DSA algorithm to generate and verify signatures in the
4173 are all provided with three basic functions with \textit{similar} prototypes. One function has been dedicated to calculate the length in octets of a given
4174 format, and two functions have been dedicated to encoding and decoding the format.
4316 For small or simple sequences an encoding or decoding can be performed with one of the following two functions.
4366 SETs use the same array structure of ltc\_asn1\_list that the SEQUENCE functions use. They are encoded with the following function:
4403 used to store objects deterministically based solely on their encoding. It uses the same array structure of ltc\_asn1\_list that the SEQUENCE functions
4427 To encode or decode INTEGER data types use the following functions.
4444 a bignum to store the value, the \textit{short} INTEGER functions were made available.
4461 and short integer functions can encode and decode each others outputs.
4545 These will encode or decode an IA5 STRING. The characters are read or stored in individual \textbf{char} elements. These functions performs internal character
4547 say a SPARC machine. Internally, these functions have a table of literal characters and their numerical ASCII values. This provides a stable conversion provided
4569 These will encode or decode an PRINTABLE STRING. The characters are read or stored in individual \textbf{char} elements. These functions performs internal character
4571 say a SPARC machine. Internally, these functions have a table of literal characters and their numerical ASCII values. This provides a stable conversion provided
4596 These functions use the \textbf{wchar\_t} type which is not universally available. In those cases, the library will typedef it to \textbf{unsigned long}. If you
4597 intend to use the ISO C functions for working with wide--char arrays, you should make sure that wchar\_t has been defined previously.
4789 The output of length up to \textit{outlen} is stored in \textit{out}. If \textit{outlen} is initially larger than the size of the hash functions output
4795 hash functions output. As such, it can easily be used to derive session keys for ciphers and MACs as well initial vectors as required
4850 The library provides functions to encode and decode a RFC 1521 base--64 coding scheme. The characters used in the mappings are:
4883 The library includes primality testing and random prime functions as well. The primality tester will perform the test in
4935 Two simple ways to prevent trivial errors is to prevent overflows, and to check the return values. All of the functions
4939 Also, virtually all of the functions return an error code or {\bf CRYPT\_OK}. You should detect all errors, as simple
4948 write the few functions required plus a descriptor. After registering your PRNG, all of the library functions that
5016 The library is not fully thread safe but several simple precautions can be taken to avoid any problems. The registry functions
5031 each new release that will make the library even more flexible. Each of the classes of functions can be disabled during
5167 public key functions.
5196 This lets you control how the LTC\_ARGCHK macro will behave. The macro is used to check pointers inside the functions against
5198 stderr and raising a SIGABRT signal. This is provided so all platforms that use LibTomCrypt can have an error that functions
5218 the name of the respective functions from the standard C library by default. This lets you substitute in your own memory routines.
5219 If you substitute in your own functions they must behave like the standard C library functions in terms of what they expect as input and
5231 functions and instead simply return CRYPT\_NOP. This should help resolve any linker errors stemming from a lack of
5235 When this functions is defined the functions that store key material on the stack will clean up afterwards.
5239 When this has been defined the various self--test functions (for ciphers, hashes, prngs, etc) are included in the build. This is the default configuration.
5249 cutting down the overhead of the respective functions.
5251 This mode does have one downside. It can cause unaligned reads from memory if you are not careful with the functions. This is why
5257 By design the \textit{fast} mode functions won't get unaligned on their own. For instance, if you call ctr\_encrypt() right after calling
5274 cannot handle all of the assembler functions.
5276 \subsection{Symmetric Ciphers, One-way Hashes, PRNGS and Public Key Functions}
5277 There are a plethora of macros for the ciphers, hashes, PRNGs and public key functions which are fairly
5299 it will not speed up the encryption or decryption functions.
5315 When this is activated all of the descriptor table functions will use pthread locking to ensure thread safe updates to the tables. Note that
5356 to functions that do the required work. For a given class of operation (e.g. cipher, hash, prng, bignum) the functions of a descriptor have identical prototypes which makes
5659 To process a single block in ECB mode the ecb\_encrypt() and ecb\_decrypt() functions were provided. The plaintext and ciphertext buffers are allowed to overlap so you
5673 The next set of functions cover the accelerated functionality of the cipher descriptor. Any combination of these functions may be set to \textbf{NULL} to indicate
5677 These two functions are meant for cases where a user wants to encrypt (in ECB mode no less) an array of blocks. These functions are accessed
5681 These two functions are meant for accelerated CBC encryption. These functions are accessed through the accel\_cbc\_encrypt and accel\_cbc\_decrypt pointers.
5707 These functions are meant for accelerated LRW. They process blocks of input in lengths of multiples of 16 octets. They must accept the \textit{IV} and \textit{tweak}
5758 The hash functions are accessed through the ltc\_hash\_descriptor structure.
5965 The library also makes use of the math descriptors to access math functions. While bignum math libraries usually differ in implementation
5978 /* ---- init/deinit functions ---- */
6008 /* ---- trivial low level functions ---- */
6392 Most of the functions are fairly straightforward and do not need documentation. We'll cover the basic conventions of the API and then explain the accelerated functions.
6400 All functions except the Montgomery reductions work from left to right with the arguments. For example, mul(a, b, c) computes $c \leftarrow ab$.
6402 All functions (except where noted otherwise) return \textbf{CRYPT\_OK} to signify a successful operation. All error codes must be valid LibTomCrypt error codes.
6404 The digit routines (including functions with the \textit{i} suffix) use a \textit{unsigned long} to represent the digit. If your internal digit is larger than this you must
6408 \subsection{ECC Functions}
6409 The ECC system in LibTomCrypt is based off of the NIST recommended curves over $GF(p)$ and is used to implement EC-DSA and EC-DH. The ECC functions work with
6425 All ECC functions must use this mapping system. The only exception is when you remap all ECC callbacks which will allow you to have more control
6427 could point to anything you want. The only further exception is the export functions which expects the values to be in affine format.
6447 \subsection{RSA Functions}