Browse Subversion Repository
Contents of /branches/mty-makai/desconst.c
Parent Directory
| Revision Log
Revision 125 -
( show annotations)
( download)
( as text)
Mon Apr 16 14:50:11 2007 UTC
(16 years, 11 months ago)
by notanpe
File MIME type: text/x-csrc
File size: 1089 byte(s)
魔改造用ブランチ
| 1 |
/*********************************************************************** |
| 2 |
* |
| 3 |
* file: desconst.c |
| 4 |
* |
| 5 |
* DES にて使用する定数(の一部) |
| 6 |
* |
| 7 |
* $Id$ |
| 8 |
* |
| 9 |
*/ |
| 10 |
|
| 11 |
#include "desconst.h" |
| 12 |
|
| 13 |
/* 鍵転置 PC1 */ |
| 14 |
int const tr_pc1[8][7] = |
| 15 |
{ |
| 16 |
{ 8, 16, 24, 56, 52, 44, 36}, |
| 17 |
{ 7, 15, 23, 55, 51, 43, 35}, |
| 18 |
{ 6, 14, 22, 54, 50, 42, 34}, |
| 19 |
{ 5, 13, 21, 53, 49, 41, 33}, |
| 20 |
{ 4, 12, 20, 28, 48, 40, 32}, |
| 21 |
{ 3, 11, 19, 27, 47, 39, 31}, |
| 22 |
{ 2, 10, 18, 26, 46, 38, 30}, |
| 23 |
{ 1, 9, 17, 25, 45, 37, 29}, |
| 24 |
}; |
| 25 |
|
| 26 |
/* LR最終転置 */ |
| 27 |
int const tr_fp[64 + 2] = |
| 28 |
{ |
| 29 |
39, 7, 47, 15, 55, 23, 63, 31, |
| 30 |
38, 6, 46, 14, 54, 22, 62, 30, |
| 31 |
37, 5, 45, 13, 53, 21, 61, 29, |
| 32 |
36, 4, 44, 12, 52, 20, 60, 28, |
| 33 |
35, 3, 43, 11, 51, 19, 59, 27, |
| 34 |
34, 2, 42, 10, 50, 18, 58, 26, |
| 35 |
33, 1, 41, 9, 49, 17, 57, 25, |
| 36 |
32, 0, 40, 8, 48, 16, 56, 24, |
| 37 |
64, 64, |
| 38 |
}; |
| 39 |
|
| 40 |
/* 鍵シフトスケジュール |
| 41 |
KEY::k[2] を贅沢に用いて取り出しの簡素化を図る */ |
| 42 |
int const ks_ls[28] = |
| 43 |
{ |
| 44 |
1, 1, 2, -1, |
| 45 |
2, -1, 2, -1, |
| 46 |
2, -1, 2, -1, |
| 47 |
2, -1, 1, 2, |
| 48 |
-1, 2, -1, 2, |
| 49 |
-1, 2, -1, 2, |
| 50 |
-1, 2, -1, 1 - 28, |
| 51 |
}; |
| 52 |
|
| 53 |
/* |
| 54 |
* Local Variables: |
| 55 |
* tab-width: 4 |
| 56 |
* End: |
| 57 |
* |
| 58 |
* EOF */ |
Properties
| svn:eol-style |
native
|
| svn:keywords |
Author Date Id Rev URL
|
| |