Warning, file /include/nettle/poly1305.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 
0010 
0011 
0012 
0013 
0014 
0015 
0016 
0017 
0018 
0019 
0020 
0021 
0022 
0023 
0024 
0025 
0026 
0027 
0028 
0029 
0030 
0031 
0032 
0033 
0034 
0035 #ifndef NETTLE_POLY1305_H_INCLUDED
0036 #define NETTLE_POLY1305_H_INCLUDED
0037 
0038 #include "aes.h"
0039 
0040 #ifdef __cplusplus
0041 extern "C" {
0042 #endif
0043 
0044 
0045 #define poly1305_aes_set_key nettle_poly1305_aes_set_key
0046 #define poly1305_aes_set_nonce nettle_poly1305_aes_set_nonce
0047 #define poly1305_aes_update nettle_poly1305_aes_update
0048 #define poly1305_aes_digest nettle_poly1305_aes_digest
0049 
0050 
0051 
0052 #define POLY1305_BLOCK_SIZE 16
0053 
0054 struct poly1305_ctx {
0055   
0056   union
0057   {
0058     uint32_t r32[6];
0059     uint64_t r64[3];
0060   } r;
0061   uint32_t s32[3];
0062   
0063 
0064   
0065   uint32_t hh;
0066   union
0067   {
0068     uint32_t h32[4];
0069     uint64_t h64[2];
0070   } h;
0071 };
0072 
0073 
0074 
0075 #define POLY1305_AES_KEY_SIZE 32
0076 #define POLY1305_AES_DIGEST_SIZE 16
0077 #define POLY1305_AES_NONCE_SIZE 16
0078 
0079 struct poly1305_aes_ctx
0080 {
0081   
0082 
0083   struct poly1305_ctx pctx;
0084   uint8_t block[POLY1305_BLOCK_SIZE];
0085   unsigned index;
0086   uint8_t nonce[POLY1305_BLOCK_SIZE];
0087   struct aes128_ctx aes;
0088 };
0089 
0090 
0091 void
0092 poly1305_aes_set_key (struct poly1305_aes_ctx *ctx, const uint8_t *key);
0093 
0094 
0095 
0096 void
0097 poly1305_aes_set_nonce (struct poly1305_aes_ctx *ctx,
0098                 const uint8_t *nonce);
0099 
0100 
0101 
0102 void
0103 poly1305_aes_update (struct poly1305_aes_ctx *ctx, size_t length, const uint8_t *data);
0104 
0105 
0106 void
0107 poly1305_aes_digest (struct poly1305_aes_ctx *ctx,
0108                  size_t length, uint8_t *digest);
0109 
0110 #ifdef __cplusplus
0111 }
0112 #endif
0113 
0114 #endif