Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
internal-wage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Southern Storm Software, Pty Ltd.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef LW_INTERNAL_WAGE_H
24 #define LW_INTERNAL_WAGE_H
25 
26 #include "internal-util.h"
27 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
44 #define WAGE_STATE_SIZE 37
45 
51 void wage_permute(unsigned char s[WAGE_STATE_SIZE]);
52 
59 void wage_absorb
60  (unsigned char s[WAGE_STATE_SIZE], const unsigned char data[8]);
61 
68 void wage_get_rate
69  (const unsigned char s[WAGE_STATE_SIZE], unsigned char data[8]);
70 
77 void wage_set_rate
78  (unsigned char s[WAGE_STATE_SIZE], const unsigned char data[8]);
79 
86 void wage_absorb_key
87  (unsigned char s[WAGE_STATE_SIZE], const unsigned char *key);
88 
96 void wage_init
97  (unsigned char s[WAGE_STATE_SIZE],
98  const unsigned char *key, const unsigned char *nonce);
99 
106 void wage_extract_tag
107  (const unsigned char s[WAGE_STATE_SIZE], unsigned char tag[16]);
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif
void wage_extract_tag(const unsigned char s[WAGE_STATE_SIZE], unsigned char tag[16])
Extracts the 128-bit authentication tag from the WAGE state.
Definition: internal-wage.c:473
void wage_get_rate(const unsigned char s[WAGE_STATE_SIZE], unsigned char data[8])
Gets the 8 bytes of the rate from the WAGE state.
Definition: internal-wage.c:311
void wage_set_rate(unsigned char s[WAGE_STATE_SIZE], const unsigned char data[8])
Sets the 8 bytes of the rate in the WAGE state.
Definition: internal-wage.c:330
void wage_init(unsigned char s[WAGE_STATE_SIZE], const unsigned char *key, const unsigned char *nonce)
Initializes the WAGE state with a key and nonce.
Definition: internal-wage.c:418
void wage_absorb(unsigned char s[WAGE_STATE_SIZE], const unsigned char data[8])
Absorbs 8 bytes into the WAGE state.
Definition: internal-wage.c:292
void wage_absorb_key(unsigned char s[WAGE_STATE_SIZE], const unsigned char *key)
Absorbs 16 key bytes into the WAGE state.
Definition: internal-wage.c:389
#define WAGE_STATE_SIZE
Size of the WAGE state in bytes.
Definition: internal-wage.h:44
void wage_permute(unsigned char s[WAGE_STATE_SIZE])
Permutes the WAGE state.
Definition: internal-wage.c:115