File: serpent.h

package info (click to toggle)
secnet 0.6.8
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,956 kB
  • sloc: ansic: 15,234; python: 1,057; perl: 966; sh: 596; tcl: 484; java: 231; asm: 114; yacc: 89; php: 64; makefile: 48; awk: 40
file content (32 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * This file is part of secnet.
 * See LICENCE and this file CREDITS for full list of copyright holders.
 * SPDX-License-Identifier: GPL-3.0-or-later
 * There is NO WARRANTY.
 */

#ifndef serpent_h
#define serpent_h

struct keyInstance {
      uint32_t key[8];             /* The key in binary */
      uint32_t subkeys[33][4];	/* Serpent subkeys */
};

/*  Function protoypes  */
void serpent_makekey(struct keyInstance *key, int keyLen,
		     const uint8_t *keyMaterial);
void serpentbe_makekey(struct keyInstance *key, int keyLen,
		     const uint8_t *keyMaterial);

void serpent_encrypt(struct keyInstance *key, const uint8_t plaintext[16],
		     uint8_t ciphertext[16]);
void serpentbe_encrypt(struct keyInstance *key, const uint8_t plaintext[16],
		     uint8_t ciphertext[16]);

void serpent_decrypt(struct keyInstance *key, const uint8_t ciphertext[16],
		     uint8_t plaintext[16]);
void serpentbe_decrypt(struct keyInstance *key, const uint8_t ciphertext[16],
		     uint8_t plaintext[16]);

#endif /* serpent_h */