Changeset 4


Ignore:
Timestamp:
05/06/06 17:15:01 (14 years ago)
Author:
sgk
Message:

定数表をリストではなく、タプルに変更。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • camellia/trunk/camellia.py

    r1 r4  
    11''' 
    22camellia.py v 0.0 
     3 
     4http://omake.accense.com/wiki/PythonCamellia 
    35 
    46Portions Copyright (c) 2006 by Accense Technology, Inc. 
     
    3840# S-box data 
    3941# 
    40 SBOX1_1110 = [ 
     42SBOX1_1110 = ( 
    4143  0x70707000L, 0x82828200L, 0x2c2c2c00L, 0xececec00L, 0xb3b3b300L, 0x27272700L, 
    4244  0xc0c0c000L, 0xe5e5e500L, 0xe4e4e400L, 0x85858500L, 0x57575700L, 0x35353500L, 
     
    8284  0x43434300L, 0xc1c1c100L, 0x15151500L, 0xe3e3e300L, 0xadadad00L, 0xf4f4f400L, 
    8385  0x77777700L, 0xc7c7c700L, 0x80808000L, 0x9e9e9e00L 
    84 ] 
    85  
    86 SBOX4_4404 = [ 
     86) 
     87 
     88SBOX4_4404 = ( 
    8789  0x70700070L, 0x2c2c002cL, 0xb3b300b3L, 0xc0c000c0L, 0xe4e400e4L, 0x57570057L, 
    8890  0xeaea00eaL, 0xaeae00aeL, 0x23230023L, 0x6b6b006bL, 0x45450045L, 0xa5a500a5L, 
     
    128130  0x38380038L, 0xa4a400a4L, 0x28280028L, 0x7b7b007bL, 0xc9c900c9L, 0xc1c100c1L, 
    129131  0xe3e300e3L, 0xf4f400f4L, 0xc7c700c7L, 0x9e9e009eL 
    130 ] 
    131  
    132 SBOX2_0222 = [ 
     132) 
     133 
     134SBOX2_0222 = ( 
    133135  0x00e0e0e0L, 0x00050505L, 0x00585858L, 0x00d9d9d9L, 0x00676767L, 0x004e4e4eL, 
    134136  0x00818181L, 0x00cbcbcbL, 0x00c9c9c9L, 0x000b0b0bL, 0x00aeaeaeL, 0x006a6a6aL, 
     
    174176  0x00868686L, 0x00838383L, 0x002a2a2aL, 0x00c7c7c7L, 0x005b5b5bL, 0x00e9e9e9L, 
    175177  0x00eeeeeeL, 0x008f8f8fL, 0x00010101L, 0x003d3d3dL 
    176 ] 
    177  
    178 SBOX3_3033 = [ 
     178) 
     179 
     180SBOX3_3033 = ( 
    179181  0x38003838L, 0x41004141L, 0x16001616L, 0x76007676L, 0xd900d9d9L, 0x93009393L, 
    180182  0x60006060L, 0xf200f2f2L, 0x72007272L, 0xc200c2c2L, 0xab00ababL, 0x9a009a9aL, 
     
    220222  0xa100a1a1L, 0xe000e0e0L, 0x8a008a8aL, 0xf100f1f1L, 0xd600d6d6L, 0x7a007a7aL, 
    221223  0xbb00bbbbL, 0xe300e3e3L, 0x40004040L, 0x4f004f4fL 
    222 ] 
     224) 
    223225 
    224226 
    225227# Key generation constants 
    226 SIGMA1 = [ 0xa09e667fL, 0x3bcc908bL, 0xb67ae858L, 0x4caa73b2L ] 
    227 SIGMA2 = [ 0xc6ef372fL, 0xe94f82beL, 0x54ff53a5L, 0xf1d36f1cL ] 
    228 SIGMA3 = [ 0x10e527faL, 0xde682d1dL, 0xb05688c2L, 0xb3e6c1fdL ] 
     228SIGMA1 = ( 0xa09e667fL, 0x3bcc908bL, 0xb67ae858L, 0x4caa73b2L ) 
     229SIGMA2 = ( 0xc6ef372fL, 0xe94f82beL, 0x54ff53a5L, 0xf1d36f1cL ) 
     230SIGMA3 = ( 0x10e527faL, 0xde682d1dL, 0xb05688c2L, 0xb3e6c1fdL ) 
    229231 
    230232 
Note: See TracChangeset for help on using the changeset viewer.