⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aesaux.h

📁 AES加密算法的VS2005工程实现
💻 H
字号:
/*
 ---------------------------------------------------------------------------
 Copyright (c) 1998-2006, Brian Gladman, Worcester, UK. All rights reserved.

 LICENSE TERMS

 The free distribution and use of this software in both source and binary
 form is allowed (with or without changes) provided that:

   1. distributions of this source code include the above copyright
      notice, this list of conditions and the following disclaimer;

   2. distributions in binary form include the above copyright
      notice, this list of conditions and the following disclaimer
      in the documentation and/or other associated materials;

   3. the copyright holder's name is not used to endorse products
      built using this software without specific written permission.

 ALTERNATIVELY, provided that this notice is retained in full, this product
 may be distributed under the terms of the GNU General Public License (GPL),
 in which case the provisions of the GPL apply INSTEAD OF those given above.

 DISCLAIMER

 This software is provided 'as is' with no explicit or implied warranties
 in respect of its properties, including, but not limited to, correctness
 and/or fitness for purpose.
 ---------------------------------------------------------------------------
 Issue 16/04/2007
*/

#ifndef AESAUX_H
#define AESAUX_H

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#include "aestst.h"

#if defined(__cplusplus)
extern "C"
{
#endif

#define FALSE   0
#define TRUE    1

enum line_type { bad_line = 0, block_len, key_len, test_no, iv_val, key_val, pt_val, ct_val };
#define NO_LTYPES   8
#define BADL_STR    "BADLINE="
#define BLEN_STR    "BLOCKSIZE="
#define KLEN_STR    "KEYSIZE=  "
#define TEST_STR    "TEST= "
#define IV_STR      "IV=   "
#define KEY_STR     "KEY=  "
#define PT_STR      "PT=   "
#define CT_STR      "CT=   "

char *file_name(char* buf, size_t len, const unsigned long type, const unsigned long blen, const unsigned long klen);
const char *pos(const char *s);
int to_hex(int ch);
int get_line(FILE *inf, char s[]);
char *copy_str(char *s, const char *fstr);
int block_in(unsigned char l[], const char *p);
void block_clear(unsigned char l[], const unsigned long len);
void block_reverse(unsigned char l[], const unsigned long len);
void block_copy(unsigned char l[], const unsigned char r[], const unsigned long len);
void block_xor(unsigned char l[], const unsigned char r[], const unsigned long len);
int block_cmp(const unsigned char l[], const unsigned char r[], const unsigned long len);
unsigned long rand32(void);
unsigned char rand8(void);
void block_rndfill(unsigned char l[], unsigned long len);
void put_dec(char *s, unsigned long val);
unsigned long get_dec(const char *s);
int cmp_nocase(const char *s1, const char *s2);
int test_args(int argc, char *argv[], char des_chr, char tst_chr);
int find_string(const char *s1, const char s2[]);
enum line_type find_line(FILE *inf, char str[]);
void block_out(const enum line_type ty, const unsigned char b[], FILE *outf, const unsigned long len);
#if defined( DLL_IMPORT ) && defined(  DYNAMIC_LINK  )
  HINSTANCE init_dll(fn_ptrs *fn);
#endif

#if defined(__cplusplus)
}
#endif
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -