chiark / gitweb /
Update my own copyright year to include 2023
[secnet.git] / serpent.h
1 /*
2  * This file is part of secnet.
3  * See LICENCE and this file CREDITS for full list of copyright holders.
4  * SPDX-License-Identifier: GPL-3.0-or-later
5  * There is NO WARRANTY.
6  */
7
8 #ifndef serpent_h
9 #define serpent_h
10
11 struct keyInstance {
12       uint32_t key[8];             /* The key in binary */
13       uint32_t subkeys[33][4];  /* Serpent subkeys */
14 };
15
16 /*  Function protoypes  */
17 void serpent_makekey(struct keyInstance *key, int keyLen,
18                      const uint8_t *keyMaterial);
19 void serpentbe_makekey(struct keyInstance *key, int keyLen,
20                      const uint8_t *keyMaterial);
21
22 void serpent_encrypt(struct keyInstance *key, const uint8_t plaintext[16],
23                      uint8_t ciphertext[16]);
24 void serpentbe_encrypt(struct keyInstance *key, const uint8_t plaintext[16],
25                      uint8_t ciphertext[16]);
26
27 void serpent_decrypt(struct keyInstance *key, const uint8_t ciphertext[16],
28                      uint8_t plaintext[16]);
29 void serpentbe_decrypt(struct keyInstance *key, const uint8_t ciphertext[16],
30                      uint8_t plaintext[16]);
31
32 #endif /* serpent_h */