`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 46
`
`
`
`C:\cfs-1.3.3\cfs_cipher.c
`
`/*
`* The author of this software is Matt Blaze.
`
`Permi
`
`(c) 1994 by AT&T.
`ssion to use, copy,
`and modify this software without fee
`
`Copyright
`
`* *
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`
`* This software is subject to United States export controls.
`
`* THIS SOFTWARE IS BEING PROVIDED
`
`"AS IS" I WITHOUT ANY EXPRESS OR IMPLIED
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* WARRANTY.
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`#include
`
`<stdio.h>
`
`#include
`
`#include
`
`#include
`
`#include
`
`<rpc/rpc.h>
`"nfsproto.h"
`
`"admproto.h"
`"cfs.h"
`
`cipher(k
`cfs
`uns
`
`.s.d)
`
`key *k;
`
`igned char *s;
`
`int d;
`
`/* "decrypting" flag */
`
`d=d&
`
`1;
`
`swit
`
`ch (k—>cipher)
`case STD_DES:
`
`{
`
`des_block_cipher(k—>Var.des.primary,s,d);
`break;
`
`case THREE_DES:
`
`des_block_cipher(k—>Var.des3.primaryl,s,d);
`
`des_block_cipher(k—>Var.des3.primary2,s,l—d);
`
`des_block_cipher(k—>Var.des3.primaryl,s,d);
`break;
`
`case TRUE_THREE_DES:
`
`{
`if (d)
`des_block_cipher(k—>Var.dest3.primary3,s,1);
`
`des_block_cipher(k—>Var.dest3.primary2,s,l);
`
`des_block_cipher(k—>Var.dest3.primaryl,s,l);
`
`} else {
`des_block_cipher(k—>Var.dest3.primaryl,s,0);
`
`des_block_cipher(k—>Var.dest3.primary2,s,0);
`
`des_block_cipher(k—>Var.dest3.primary3,s,0);
`
`} b
`
`reak;
`case MCG:
`
`if (d)
`
`komQOWU'IrbUJNH
`
`rbw[\Ji-‘OkomQOWU'Irbw[\Ji—‘OkOQJQOWU'Irbw[\JHOKOQJQOWU‘IFbUJNi-‘OkOQJQOWU‘IprJNi-‘O
`
`U'IU'IU'IU'IU'Irbpbri>rbrbpbri>rbrbpbwwwwwwwwwww[\JNNNNNNNNi—‘i—‘i—‘i—‘i—‘i—‘i—‘i—‘i—‘H
`
`mcg_block_decrypt(s,&k—>var.mcg.primary);
`else
`4-
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 47
`
`
`
`C:\cfs-1.3.3\cfs_cipher.c
`
`55
`56
`
`57
`58
`
`59
`
`60
`61
`
`62
`63
`64
`
`65
`66
`
`67
`68
`
`69
`70
`71
`
`72
`
`73
`74
`
`mcg_block_encrypt(s,&k—>var.mcg.primary);
`break;
`
`#ifdef NOTDEF
`case BLOWFISH:
`
`if (d)
`
`Blowfish_decipher(s,&k—>var.bf.primary);
`
`else
`
`Blowfish_encipher(s,&k—>var.bf.primary);
`break;
`
`#endif
`
`case SAFER_SK128:
`if (d)
`
`Safer_Decrypt_Block(s,k—>var.safer.primary,s);
`
`else
`
`Safer_Encrypt_Block(s,k—>var.safer.primary,s);
`default:
`/* just does nothing */
`break;
`
`}
`
`}
`
`75 mask_cipher(k,s,d)
`76
`cfskey *k;
`
`77
`78
`
`79
`8O
`
`81
`82
`
`83
`84
`
`85
`
`86
`
`87
`
`88
`89
`
`90
`
`91
`92
`
`93
`
`94
`
`95
`96
`
`97
`
`98
`
`99
`100
`101
`
`102
`
`103
`104
`
`105
`106
`
`unsigned char *5;
`int d;
`
`{
`
`d=d&l;
`
`switch (k—>cipher)
`case STD_DES:
`
`{
`
`des_block_cipher(k—>Var.des.secondary,s,d);
`break;
`
`case THREE_DES:
`
`des_block_cipher(k—>Var.des3.secondary1,s,d);
`
`des_block_cipher(k—>Var.des3.secondary2,s,1—d);
`
`des_block_cipher(k—>Var.des3.secondary1,s,d);
`break;
`
`case TRUE_THREE_DES:
`
`{
`if (d)
`des_block_cipher(k—>Var.dest3.secondary3,s,1);
`
`des_block_cipher(k—>Var.dest3.secondary2,s,1);
`
`des_block_cipher(k—>Var.dest3.secondary1,s,1);
`
`} else {
`des_block_cipher(k—>Var.dest3.secondary1,s,0);
`
`des_block_cipher(k—>Var.dest3.secondary2,s,0);
`
`des_block_cipher(k—>Var.dest3.secondary3,s,0);
`
`}
`break;
`case MCG:
`
`if (d)
`
`mcg_block_decrypt(s,&k—>var.mcg.secondary);
`
`else
`
`mcg_block_encrypt(s,&k—>var.mcg.secondary);
`break;
`
`#ifdef NOTDEF
`107
`
`108 case BLOWFISH:
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 48
`
`
`
`C:\cfs-1.3.3\cfs_cipher.c
`
`109
`
`110
`111
`
`112
`113
`114
`
`115
`116
`
`117
`118
`
`119
`120
`121
`
`122
`
`123
`124
`
`125
`
`126
`
`127
`
`128
`129
`
`130
`
`131
`132
`
`133
`
`134
`135
`
`136
`137
`138
`
`139
`
`14 O
`
`141
`142
`
`143
`144
`
`145
`146
`
`147
`148
`149
`
`150
`
`151
`
`152
`153
`
`154
`155
`
`156
`157
`
`158
`159
`
`if (d)
`
`Blowfish_decipher(s,&k—>var.bf.secondary);
`
`else
`
`Blowfish_encipher(s,&k—>var.bf.secondary);
`break;
`
`#endif
`
`case SAFER_SK12 8 :
`if (d)
`
`Safer_Decrypt_Block(s,k—>var.safer.secondary,s);
`
`else
`
`Safer_Encrypt_Block(s,k—>var.safer.secondary,s);
`default:
`/* just does nothing */
`break;
`
`}
`
`}
`
`copykey(key,k)
`
`cfs_admkey *key;
`cfskey *k;
`
`{
`
`switch (key->cipher)
`case CFS_STD_DES:
`
`{
`
`k—>cipher=STD_DES;
`
`des_key_setup(key—>cfs_admkey_u.deskey.primary,
`k—>Var.des.primary);
`
`des_key_setup(key—>cfs_admkey_u.deskey.secondary,
`k—>Var.des.secondary);
`
`break;
`
`case CFS_THREE_DES:
`
`k— >Cipher=THREE_DES ;
`
`des_key_setup(key—>cfs_admkey_u.des3key.primary1,
`k—>Var.des3.primary1);
`
`des_key_setup(key—>cfs_admkey_u.des3key.primary2,
`k—>Var.des3.primary2);
`
`des_key_setup(key—>cfs_admkey_u.des3key.secondaryl,
`k—>Var.des3.secondary1);
`
`des_key_setup(key—>cfs_admkey_u.des3key.secondary2,
`k—>Var.des3.secondary2);
`
`break;
`
`case CFS_TRUE_THREE_DES:
`
`k->cipher=TRUE_THREE_DES;
`
`des_key_setup(key—>cfs_admkey_u.tdes3key.primary1,
`k—>Var.dest3.primary1);
`
`des_key_setup(key—>cfs_admkey_u.tdes3key.primary2,
`k—>Var.dest3.primary2);
`
`des_key_setup(key—>cfs_admkey_u.tdes3key.primary3,
`k—>var.dest3.primary3);
`
`des_key_setup(key—>cfs_admkey_u.tdes3key.secondary1,
`k—>Var.dest3.secondary1);
`
`des_key_setup(key—>cfs_admkey_u.tdes3key.secondary2,
`160
`k—>Var.dest3.secondary2);
`161
`162 des_key_setup(key—>cfs_admkey_u.tdes3key.secondary3,
`
`
`
`'3'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 49
`
`
`
`C:\cfs-1.3.3\cfs_cipher.c
`
`163
`164
`
`165
`166
`
`167
`168
`
`169
`170
`171
`172
`
`173
`174
`
`175
`176
`
`177
`178
`179
`180
`
`181
`
`182
`
`183
`
`184
`
`185
`186
`187
`
`188
`
`189
`
`190
`191
`192
`
`193
`194
`
`195
`
`196
`
`197
`198
`
`k->var.dest3.secondary3);
`
`break;
`
`case CFS_MACGUFFIN:
`k->cipher=MCG;
`
`mcg_keyset(key—>cfs_admkey_u.mcgkey.primary,
`&k—>Var.mcg.primary);
`
`mcg_keyset(key—>cfs_admkey_u.mcgkey.secondary,
`&k—>Var.mcg.secondary);
`
`break;
`#ifdef NOTDEF
`
`case CFS_BLOWFISH:
`k->Cipher=BLOWFISH;
`
`Blowfish_Initialize(key—>cfs_admkey_u.blowkey.primary,16,
`&k—>Var.bf.primary);
`
`Blowfish_Initialize(key—>cfs_admkey_u.blowkey.secondary,16,
`&k—>Var.bf.secondary);
`
`break;
`
`#endif
`
`case CFS_SAFER_SK128:
`
`k—>cipher=SAFER_SK128;
`
`Safer_Init_Modu1e();
`
`Safer_Expand_Userkey(key—>cfs_admkey_u.saferkey.primary,
`
`&(key—>cfs_admkey_u.saferkey.primary[8]),
`SAFER_SK128_DEFAULT_NOF_ROUNDS,
`1,
`/* for SK128 */
`
`k—>Var.safer.primary);
`
`Safer_Expand_Userkey(key—>cfs_admkey_u.saferkey.secondary,
`
`&(key—>cfs_admkey_u.saferkey.secondary[8]),
`SAFER_SK128_DEFAULT_NOF_ROUNDS,
`1,
`/* for SK128 */
`
`k—>Var.safer.secondary);
`
`default:
`
`break;
`
`}
`
`}
`
`
`
`'4'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 50
`
`
`
`cfs_des.c
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 51
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`
`/*
`
`* The authors of this software are Don Mitchell, Jack Lacy, and Matt Blaze.
`
`*
`
`Copyright
`
`(c) 1992, 1993, 1994 by AT&T.
`
`* Permission to use, copy, and modify this software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`
`* This software is subject to United States export controls.
`
`* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
`
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* WARRANTY.
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`* Data Encryption Standard
`* D.P.Mitchell
`83/06/08.
`
`* block_cipher(key, block, decrypting)
`*/
`
`#ifdef SOLARISZX
`
`#define bcopy(s, d, 1)
`
`memcpy(d, s,
`
`l)
`
`#define bcmp(s, d, 1)
`#endif
`
`(memcmp(s, d,
`
`l)? l
`
`: 0)
`
`static long ip_low();
`
`static long ip_high();
`static void fp();
`
`void
`
`des_key_setup();
`
`/*
`* Tables for Combined S and P Boxes
`
`*/
`
`= {
`s0p[]
`static long
`0x00410100,0XOOOlOOO0,0x404000O0,0x40410100,0x00400000,0X400lOlO0,0x400lOOO0,0x40400000,
`
`0x40010100,0x00410100,0x00410000,0x40000100,0x40400100,0x00400000,0xOOOOOOO0,0x400lOOOO,
`
`0X0001000010X40000000,0X00400100,OXOOOlOlOO,0x40410100,0X00410000,0X40000100,0X00400100:
`
`OX4OOOOOOO,OXOOOOOIOO,0X00010100,0x40410000,OXOOOOOIOO,OX4O40010010X40410000,OXOOOOOOOOI
`
`OX00000000,0X40410100,0X00400100,0x40010000,0XOO410100,0X00010000,0X40000100,0X00400100:
`
`OX4O4IOOOO,OXOOOOOIOO,0X00010100,0x40400000,0x40010100,0X4000000010X40400000,0X00410000:
`
`Ox404lOlOO,OXOOOlOlOO,0X00410000,0x40400100,0X00400000,0X4000010010X40010000,OXOOOOOOOOI
`
`0x00010000,0x00400000,0x40400100,0x00410100,0x40000000,0x40410000,0xOOOOOlO0,0X400lOlOO.
`
`};
`
`= {
`slp[]
`static long
`0x08021002,0xOOOOOOO0,0xOOOZlOO0,0x08020000,0x08000002,0x00001002.0x08001000,0x00021000.
`
`OXOOOOIOOO,0X08020002,0x00000002,OXOBOOIOOO,OXOOOZOOOZIOXOBOZIOOO,0X08020000,0X000000021
`
`komQOWU'IrbUJNH
`
`rbw[\Ji-‘OkomQOWU'Irbw[\Ji—‘OkOQJQOWU'Irbw[\JHOKOQJQOWU‘IFbUJNi-‘OkOQJQOWU‘IprJNi-‘O
`
`U'IU'IU'IU'IU'IH>H>ri>rbrbpbri>rbrbfiwwwwwwwwwww[\JNNNNNNNNHi—‘i—‘i—‘i—‘i—‘i—‘i—‘i—‘H
`
`OXOOOZOOOO,OXOBOOIOOZ,0x08020002,OXOOOOlOOO,OXOOOZIOOZIOXOBOOOOOO,OX00000000,0X000200021
`0X08001002,OXOOOZIOOZI0X08021000,OXOBOOOOOZI0X08000000,0X00020000,0X00001002,0X080210021
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 52
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`55
`0x00020002,0x08021000,0x08001000,0x00021002,0x08021002,0x00020002,0x08000002.0x00000000.
`
`56
`
`57
`
`58
`
`59
`
`60
`
`61
`
`62
`
`63
`
`64
`
`65
`
`66
`
`67
`
`68
`
`69
`
`70
`71
`
`72
`
`73
`74
`
`75
`
`76
`77
`
`78
`
`79
`
`80
`
`81
`
`82
`
`83
`
`84
`
`85
`
`86
`
`87
`
`88
`
`89
`
`90
`
`91
`
`92
`
`93
`
`94
`
`95
`
`96
`
`97
`
`98
`
`99
`
`100
`
`101
`
`102
`
`103
`
`104
`
`105
`
`106
`
`0x08000000,0x00001002,0x00020000,0x08020002,0X00001000,0x08000000,0x00021002,0x08001002:
`
`0x08021000,0x00001000,0x00000000,0x08000002,0x00000002,0x08021002,0x00021000,0x08020000.
`
`0x08020002,0x00020000,0x00001002,0x08001000,0x08001002,0x00000002,0x08020000,0x00021000.
`
`};
`
`= {
`s2p[]
`static long
`0x20800000,0x00808020,0x00000020,0x20800020,0x20008000,0x00800000,0x20800020,0x00008020.
`
`OX00800020,OXOOOO8OOO,OXOO8O8OOO,OXZOOOOOOO,OX20808020,0X20000020,0X20000000,0X208080001
`
`0x00000000,0x20008000,0x00808020,0x00000020,0x20000020,0x20808020,0x00008000,0x20800000,
`
`0X20808000,0X00800020,0x20008020,OXOO8O8OOO,OXOOOO8020,OXOOOOOOOO,0X00800000,0X200080201
`
`0x00808020,0x00000020,0x20000000,0x00008000,0x20000020,0x20008000,0x00808000,0x20800020.
`
`OXOOOOOOOO,OX00808020,OXOOOO8020,0X20808000,0X20008000,0X00800000,0X20808020,0X200000001
`
`0x20008020,0x20800000,0x00800000,0x20808020,0x00008000,0x00800020,0x20800020,0x00008020.
`
`OX00800020,OXOOOOOOOO,0X20808000,OXZOOOOOZO,0X20800000,0X20008020,0X00000020,0X008080001
`
`};
`
`= {
`s3p[]
`static long
`0X00080201,0X02000200,OXOOOOOOOl:0X02080201:0X00000000,0X02080000,0X020002011OXOOOBOOOl:
`
`0X02080200,0X020000011OXOZOOOOOO,OXOOOOOZOl:OXOZOOOOOl:0X0008020110X00080000,OXOZOOOOOOI
`
`0X02080001,0X00080200,OXOOOOOZOO,OXOOOOOOOl:OXOOOBOZOO,0X0200020110X02080000,0X00000200:
`
`OXOOOOOZOlIOXOOOOOOOO,OX00080001:0X02080200,OXOZOOOZOO,0X0208000110X0208020110X00080000:
`
`0x02080001,0x00000201,0x00080000,0x02000001,0x00080200,0x02000200,0x0000000110x02080000,
`
`OXOZOOOZOlIOXOOOOOOOO,OXOOOOOZOO,0X00080001:OXOOOOOOOO,0X0208000110X02080200,0X00000200:
`
`0X02000000,0X020802011OX00080201:0X00080000,0X02080201:OXOOOOOOOlIOXOZOOOZOO,0X00080201:
`
`0x00080001,0x00080200,0x02080000,0x02000201,0x00000201,0x02000000,0x0200000110x02080200:
`
`};
`
`= {
`s4p[]
`static long
`0x01000000,0x00002000,0x00000080,0x01002084,0x01002004,0x01000080,0x00002084.0x01002000:
`
`0x00002000,0x00000004,0x01000004,0x00002080,0x01000084,0x01002004,0x01002080,0x00000000,
`
`0X00002080,OXOlOOOOOO,0X00002004,OXOOOOOO84,OX01000080,0X000020841OX00000000,0X010000041
`
`OXOOOOOOO4,0X01000084,0x01002084,0X00002004,0X01002000,0X00000080,OXOOOOOO84IOX01002080:
`
`0x01002080,0x01000084,0x00002004,0x01002000,0x00002000,0x00000004,0x01000004.0x01000080,
`
`OXOlOOOOOO,0X00002080,0X01002084,OXOOOOOOOO,0X0000208410X01000000,0X00000080,0X000020041
`
`0X01000084,OXOOOOOO80,OXOOOOOOOO,OX01002084,0x0100200410X01002080,OXOOOOOO84IOX00002000:
`
`0x00002080,0x01002004,0x01000080,0x00000084,0x00000004,0x00002084,0x01002000,0x01000004:
`
`};
`
`= {
`s5p[]
`static long
`OX1000000810X00040008,OXOOOOOOOO,0X10040400,0X00040008,0X00000400,0X10000408,0X00040000:
`
`0X00000408,0X10040408,0X00040400,OXlOOOOOOO,0X10000400,0X1000000810X10040000,0X00040408:
`
`0X00040000,0X10000408,0X10040008,0XOOOOOOO0,0X00000400,0X00000008,0X10040400,0X10040008:
`
`OX10040408,0X10040000,0XlOOOOOO0,0X00000408,0XOOOOOOOB,0X00040400,0X00040408,0X10000400:
`
`0X0000040810X10000000,0X10000400,0X00040408,0X10040400,0X0004000810X00000000,0X10000400:
`
`OX10000000,0X00000400,0X10040008,0X00040000,0X00040008,0X10040408,0X00040400,OXOOOOOOOBI
`
`OX1004O408,0X00040400,0X00040000,0X10000408,0X10000008,0x10040000,0x00040408,OXOOOOOOOOI
`
`0x00000400,0x10000008,0x10000408,0x10040400,0x10040000,0x00000408,0x00000008,0x10040008,
`
`};
`
`= {
`s6p[]
`static long
`0X00000800,0X00000040,0X00200040,0x80200000,0x80200840,0X80000800,0X00000840,OXOOOOOOOOI
`
`107
`
`0x00200000,0x80200040,0x80000040,0x00200800,0x80000000,0x00200840,0x00200800,0x80000040.
`108
`0x80200040,0x00000800,0x80000800,0x80200840,0x00000000,0x00200040,0x80200000,0x00000840.
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 53
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`109
`OX80200800,0x80000840,0x00200840,0x80000000,0x80000840,0x80200800,0xOOOOOO40,0xOO2000OO,
`
`0x80000840,0x00200800,0x80200800,0X8000OO40,0XOOOOOBO0,0x00000040,0XOO2000O0,0X80200800,
`
`0x80200040,0x80000840,0x00000840,0x00000000,0x00000040,0x80200000,0X8000OOO0,0XOO200040:
`
`0x00000000,0x80200040,0x00200040,0x00000840,0x80000040,0x00000800,0x80200840,0x00200000.
`
`0x00200840,0x80000000,0x80000800,0x80200840,0x80200000,0x00200840,0XOO200800,0X8000O800,
`
`};
`
`= {
`s7p[]
`static long
`OX04100010,0XO4104000,OXOOOO4010,OXOOOOOOOO,0X04004000,0X00100010,0X04100000,0XO41040101
`
`OXOOOOOOlO,0X04000000,0X00104000,0X00004010,0X00104010,0X04OO4010,0X04000010,0X041000001
`
`OXOOOO4OOO,0X00104010,0x00100010,0X04OO4000,OXO4104010,0X04000010,OX00000000,0X001040001
`
`0x04000000,0xOOlOOOO0,0xO40040l0,0x04100010,0x00100000,0x00004000,0xO4lO4000,0xOOOOOOlO.
`
`0X00100000,0X00004000,OX04000010,OXO4104010,OXOOOO4010,0XO4OOOOOO,OX00000000,0X001040001
`
`0x04100010,0xO40040l0,0xO4004000,0x00100010,0x04104000,0x00000010,0xOOlOOOl0,0xO4004000.
`
`OxO41040l0,0xOOlOOOO0,0x04100000,0xO4000Ol0,0xOOlO4000,0x00004010,0xO40040l0,0xO4lOOOOO,
`
`0X00000010,0XO4104000,0X001O4010,OXOOOOOOOO,0X04000000,0XO4100010,0X00004000,0X001O40101
`
`};
`
`/*
`
`*
`
`*
`*/
`
`DES electronic codebook encryption of one block
`
`(quick version)
`
`q_block_cipher(short_key,
`
`text, decrypting)
`
`char short_key[8];
`char text[8];
`
`int decrypting;
`
`{
`
`register char *key;
`
`register long temp;
`
`register long left, right;
`
`register i;
`
`register key_offset;
`int j,k;
`static int 1k: —1;
`
`static char 1astkey[4][8]={"xxxxxxx","xxxxxxx","xxxxxxx","xxxxxxx"};
`static char expanded_key[4][128];
`
`/* now caches 4 session keys.
`k: -l;
`
`for (j=O;
`
`j<4;
`
`j++)
`
`{
`
`drops least recently added
`
`*/
`
`if (bcmp(short_key,lastkey[j],8)==O)
`k=j;
`break;
`
`{
`
`}
`
`} i
`
`{
`f (k<0)
`k= 1k =
`
`(1k+1)%4;
`
`bcopy(short_key,lastkey[k],8);
`
`des_key_setup(short_key, expanded_key[kJ);
`
`} k
`
`ey = expanded_key[k];
`
`left = ip_low(text);
`
`110
`111
`
`112
`
`113
`114
`
`115
`
`116
`117
`
`118
`
`119
`
`120
`121
`
`122
`
`123
`124
`
`125
`
`126
`127
`
`128
`
`129
`
`130
`
`131
`
`132
`
`133
`
`134
`
`135
`
`136
`
`137
`
`138
`
`139
`
`140
`141
`
`142
`
`143
`144
`
`145
`
`146
`147
`
`148
`
`149
`
`150
`
`151
`
`152
`
`153
`
`154
`
`155
`
`156
`
`157
`
`158
`
`159
`
`160
`
`161
`
`right = ip_high(text);
`162
`if (decrypting) {
`
`
`
`'3'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 54
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`ol
`163
`oI
`
`key_offset = 16 — 8
`key = key + 128 — 8
`
`} else
`key_offset = O — 8;
`
`i++)
`i < 16;
`for (i = O;
`temp = (right << 1)
`left A: s0p[(temp
`
`{
`
`|
`
`&
`
`A s1p[((temp >>
`
`A s2p[((temp >>
`
`4) &
`
`8) &
`
`A s3p[((temp >> 12) &
`
`A s4p[((temp >> 16) &
`
`A s5p[((temp >> 20) &
`
`A s6p[((temp >> 24) &
`temp = ((right & 1) << 5)
`
`
`left A: s7p[temp A key[7]];
`temp = left;
`
`left = right;
`
`right = temp;
`
`key —= key_offset;
`
`} t
`
`emp = left;
`
`left = right;
`
`right = temp;
`/*
`
`164
`
`165
`
`166
`
`167
`
`168
`
`169
`
`170
`171
`
`172
`
`173
`174
`
`175
`
`176
`177
`
`178
`
`179
`
`180
`
`181
`
`182
`
`183
`
`184
`
`185
`
`186
`
`((right >> 31) & l);
`Ox3f)
`
`key[O]]
`
`key[lll
`
`key[211
`
`key[3]]
`
`key[411
`
`key[5]]
`
`key[6]];
`>> 27) & 0x1f);
`
`A A A A A A A
`
`Ox3f)
`
`Ox3f)
`
`Ox3f)
`
`Ox3f)
`
`Ox3f)
`
`Ox3f)
`
`((right
`
`standard final permutation
`
`(IPI)
`
`*
`*/
`
`fp(left, right,
`
`text);
`
`DES electronic codebook encryption of one block
`
`(expanded key version)
`
`} /
`
`* *
`
`*
`*/
`
`des_block_cipher(expanded_key,
`
`text, decrypting)
`
`char expanded_key[8];
`char text[8];
`
`int decrypting;
`
`{
`
`register char *key;
`
`register long temp;
`
`register long left,
`
`right;
`
`register i;
`
`register key_offset;
`
`key =
`left =
`
`expanded_key;
`
`ip_low(text);
`
`right =
`
`ip_high(text);
`
`{
`if (decrypting)
`key_offset = 16 — 8
`key = key + 128 — 8
`
`0l
`ol
`
`187
`
`188
`
`189
`
`190
`
`191
`
`192
`
`193
`
`194
`
`195
`
`196
`
`197
`
`198
`
`199
`
`200
`
`201
`
`202
`
`203
`
`204
`
`205
`
`206
`
`207
`
`208
`
`209
`
`210
`211
`
`212
`
`213
`214
`
`} else
`key_offset = O — 8;
`for (i =
`{
`0;
`i < 16;
`i++)
`216
`
`temp = (right << 1) ((right >> 31) & l);
`
`215
`
`-4
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 55
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`217
`
`left A: s0p[(temp
`
`& Ox3f)
`
`A key[OJJ
`
`" s1p[((temp >>
`
`4) & Ox3f)
`
`" key[l]]
`
`A s2p[((temp >>
`
`8) & Ox3f)
`
`A key[2]]
`
`A s3p[((temp >> 12) & Ox3f)
`
`A key[3]]
`
`A s4p[((temp >> 16) & Ox3f)
`
`A key[4]]
`
`A s5p[((temp >> 20) & Ox3f)
`
`A key[5]]
`
`A key[6]];
`A s6p[((temp >> 24) & Ox3f)
`temp = ((right & 1) << 5)
`((right >> 27) & Oxlf);
`
`
`left A: s7p[temp A key[7]];
`temp = left;
`
`left = right;
`
`right = temp;
`
`key —= key_offset;
`
`} t
`
`emp = left;
`
`left = right;
`
`right = temp;
`/*
`
`standard final permutation (IPI)
`
`*
`*/
`
`fp(left, right,
`
`text);
`
`Final Permutation
`
`} /
`
`* *
`
`*/
`
`= {
`static long fph0[l6]
`0x00000000,0x4000OOO0,0xOO4000O0,0x40400000,0x00004000,0x40004000,0xOO404000,0x40404000.
`
`OXOOOOOO40,0X4000OO40,0XOO400040,0X40400040,0XOOOO4040,0X40004040,0XOO404040,0X40404040:
`
`static long fpll[l6] = {
`OXOOOOOOOO,OX4OOOOOOO,OXOO4OOOOO,0x40400000,0X00004000,0X40004000,0X00404000,0X4O4040001
`
`OXOOOOOO40,0X4000OO40,0XOO400040,0X40400040,0XOOOO4040,0X40004040,0XOO404040,0X40404040:
`
`= {
`static long fph2[l6]
`OXOOOOOOOO,OX10000000,0X00100000,0X10100000,0X00001000,0X10001000,0X00101000,0X101010001
`
`0X00000010,0X10000010,0X00100010,0X10100010,0X00001010,0X10001010,0X00101010,0X10101010:
`
`static long fpl3[l6] = {
`OXOOOOOOOO,OX10000000,0X00100000,0X10100000,0X00001000,0x10001000,0X00101000,0X101010001
`
`0X00000010,0X10000010,0X00100010,0X10100010,0X00001010,0X10001010,0X00101010,0X10101010:
`
`= {
`static long fph4[l6]
`OXOOOOOOO0,0XO4000OO0,0X00040000,0X04040000,0XOOOOO400,0XO4000400,0X00040400,0XO4040400:
`
`OxOOOOOOO4,0xO4000OO4,0x00040004,0xO4040004,0xOOOOO404,0x04000404,0x00040404,0x04040404,
`
`= {
`static long fp15[l6]
`OXOOOOOOO0,0XO4000OO0,0X00040000,0X04040000,0XOOOOO400,0XO4000400,0X00040400,0XO4040400:
`
`OxOOOOOOO4,0xO4000OO4,0x00040004,0xO4040004,0xOOOOO404,0x04000404,0x00040404,0x04040404,
`
`= {
`static long fph6[l6]
`OXOOOOOOO0,0X01000OO0,0X00010000,0X01010000,0X00000100,0X01000100,0X00010100,0X01010100:
`
`218
`
`219
`
`220
`221
`
`222
`
`223
`224
`
`225
`
`226
`227
`
`228
`
`229
`
`230
`
`231
`
`232
`
`233
`
`234
`
`235
`
`236
`
`237
`
`238
`
`239
`
`240
`241
`
`242
`
`243
`244
`
`245
`
`246
`247
`
`248
`
`249
`
`250
`
`251
`
`252
`
`253
`
`254
`
`255
`
`256
`
`257
`
`258
`
`259
`
`260
`
`261
`
`262
`
`263
`
`264
`
`265
`
`266
`
`267
`
`268
`
`269
`
`0x00000001,0x01000001,0x00010001,0x0101000110x00000101,0x01000101,0x00010101,0x01010101,
`270
`};
`
`'5'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 56
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`271
`
`= {
`static long fpl7[16]
`0X00000000,0X01000000,0X00010000,0X01010000,0X00000100,0X01000100,0X00010100,0X01010100:
`
`272
`
`273
`274
`
`275
`
`276
`277
`
`278
`
`279
`
`280
`
`281
`
`282
`
`283
`
`284
`
`285
`
`286
`
`287
`
`288
`
`289
`
`290
`
`291
`
`292
`
`293
`
`294
`
`295
`
`296
`
`297
`
`298
`
`299
`
`300
`
`301
`
`302
`
`303
`
`304
`
`305
`
`306
`
`307
`
`308
`
`309
`
`310
`
`311
`
`312
`
`313
`
`314
`
`315
`
`316
`
`317
`
`318
`
`319
`
`320
`
`321
`
`322
`
`0x00000001,0x01000001,0x00010001,0x01010001,0x00000101,0x01000101,0x00010101,0x01010101,
`
`= {
`static long fph8[l6]
`0x00000000,0x80000000,0x00800000,0x80800000,0x00008000,0x80008000,0x00808000,0x80808000,
`
`0x00000080,0x80000080,0x00800080,0x80800080,0x00008080,0x80008080,0x00808080,0x80808080,
`
`= {
`static long fp19[l6]
`0x00000000,0x80000000,0x00800000,0x80800000,0x00008000,0x80008000,0x00808000,0x80808000,
`
`0x00000080,0x80000080,0x00800080,0x80800080,0X00008080,0x80008080,0x00808080,0x80808080,
`
`= {
`static long fpha[l6]
`0x00000000,0x20000000,0x00200000,0x20200000,0x00002000,0x20002000,0x00202000,0x20202000.
`
`0x00000020,0x20000020,0x00200020,0x20200020,0x00002020,0x20002020,0xOOZOZOZ0,0x20202020.
`
`static long fplb[l6] = {
`0x00000000,0x20000000,0x00200000,0x20200000,0x00002000,0x20002000,0x00202000,0x20202000.
`
`0X00000020,0x20000020,0X00200020,0x20200020,0X00002020,0X20002020,0X00202020,0X20202020:
`
`= {
`static long fphc[l6]
`0X00000000,0X08000000,0X00080000,0X08080000,0X00000800,0X08000800,0X00080800,0X08080800,
`
`0X00000008,0X08000008,0X00080008,0X08080008,0X00000808,0X08000808,0X00080808,0X08080808,
`
`static long fpld[l6] = {
`0X00000000,0X08000000,0X00080000,0X08080000,0X00000800,0X08000800,0X00080800,0X08080800,
`
`0X00000008,0X08000008,0X00080008,0X08080008,0X00000808,0X08000808,0X00080808,0X08080808,
`
`= {
`static long fphe[l6]
`0X00000000,0X02000000,0X00020000,0X02020000,0X00000200,0X02000200,0X00020200,0X02020200:
`
`0x00000002,0x02000002,0x00020002,0x02020002,0x00000202,0x02000202,0x00020202,0x02020202,
`
`static long fplf[l6] = {
`0X00000000,0X02000000,0X00020000,0X02020000,0X00000200,0X02000200,0X00020200,0X02020200:
`
`0x00000002,0x02000002,0x00020002,0x02020002,0x00000202,0x02000202,0x00020202,0x02020202,
`
`};
`
`static void
`
`fp(left, right,
`
`text)
`
`long left, right;
`char text[8];
`
`{
`
`register unsigned long low, high;
`
`register unsigned long temp;
`
`temp = left;
`
`high = fph0[temp & Oxf];
`temp >>= 4;
`
`low = fpll[temp & Oxf];
`temp >>= 4;
`
`high |= fph2[temp & Oxf];
`temp >>= 4;
`
`323
`
`low |= fpl3[temp & Oxf];
`324
`temp >>= 4;
`
`'6'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 57
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`
`high |= fph4[temp & Oxf];
`temp >>= 4;
`
`low |= fp15[temp & Oxf];
`temp >>= 4;
`
`high |= fph6[temp & Oxf];
`temp >>= 4;
`
`low |= fp17[temp & Oxf];
`temp = right;
`
`high |= fph8[temp & Oxf];
`temp >>= 4;
`
`low |= fp19[temp & Oxf];
`temp >>= 4;
`
`high |= fpha[temp & Oxf];
`temp >>= 4;
`
`low |= fp1b[temp & Oxf];
`temp >>= 4;
`
`high |= fphc[temp & Oxf];
`temp >>= 4;
`
`low I: fp1d[temp & Oxf];
`temp >>= 4;
`
`high |= fphe[temp & Oxf];
`temp >>= 4;
`
`low |= fp1f[temp & Oxf];
`text[O]
`= low;
`
`text[l] = low >> 8;
`
`text[2]
`
`= low >> 16;
`
`text[3]
`
`= low >> 24;
`
`text[4]
`
`= high;
`
`text[5]
`
`= high >> 8;
`
`text[6]
`
`= high >> 16;
`
`text[7]
`
`= high >> 24;
`
`}
`
`/*
`*
`
`Initial Permutation
`
`*/
`
`325
`326
`
`327
`328
`
`329
`330
`
`331
`332
`
`333
`334
`
`335
`336
`
`337
`338
`
`339
`340
`
`341
`342
`
`343
`344
`
`345
`346
`
`347
`348
`
`349
`
`350
`
`351
`
`352
`
`353
`
`354
`
`355
`
`356
`357
`
`358
`359
`
`360
`
`361
`362
`
`363
`
`364
`
`365
`366
`
`367
`
`368
`
`369
`37o
`
`371
`
`372
`
`373
`374
`
`375
`
`376
`
`static long iplo[l6] = {
`0x00000000,
`
`0x00008000,0x00000000,0x00008000,0x00000080,0x00008080,0x00000080,0x00008080,0x00000000,
`
`0x00008000,0x00000000,0x00008000,0x00000080,0x00008080,0x00000080,0x00008080,};
`
`static long iph0[l6]
`0x00000000,
`
`= {
`
`0x00000000,0x00008000,0x00008000,0x00000000,0x00000000,0x00008000,0x00008000,0x00000080,
`
`0x00000080,0x00008080,0x00008080,0x00000080,0x00000080,0x00008080,0x00008080,};
`
`static long ipll[l6] = {
`0x00000000,
`
`0x80000000,0x00000000,0x80000000,0x00800000,0x80800000,0x00800000,0x80800000,0x00000000,
`
`0x80000000,0x00000000,0x80000000,0x00800000,0x80800000,0x00800000,0x80800000,};
`
`static long iphl[l6] = {
`0x00000000,
`
`0x00000000,0x80000000,0x80000000,0x00000000,0x00000000,0x80000000,0x80000000,0x008ooooo,
`
`0x00800000,0x80800000,0x80800000,0x00800000,0x00800000,0x80800000,0x80800000,};
`
`= {
`static long ip12[l6]
`377
`
`378 0x00000000,
`
`'7'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 58
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`379
`OXOOOO4OOO,OXOOOOOOOO,OXOOOO4OOO,OXOOOOOO4O,OXOOOO404O,OXOOOOOO4O,OXOOOO4O4O,OXOOOOOOOOI
`
`380
`
`381
`
`382
`
`383
`
`384
`
`385
`
`386
`
`387
`
`388
`
`389
`
`390
`
`391
`
`392
`
`393
`
`394
`
`395
`
`396
`
`397
`
`398
`
`399
`
`400
`
`401
`
`402
`
`403
`
`404
`
`405
`
`406
`
`407
`
`408
`
`409
`
`410
`411
`
`412
`
`413
`414
`
`415
`
`416
`417
`
`418
`
`419
`
`420
`421
`
`422
`
`423
`424
`
`425
`
`426
`427
`
`428
`
`429
`
`430
`
`OXOOOO4000,0XOOOOOOO0,0XOOOO4000,0XOOOOOO40,0XOOOO4040,0XOOOOOO40,0XOOOO4040,}i
`
`static long iph2[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOO0,0X00004000,0X00004000,0XOOOOOOO0,0XOOOOOOO0,0XOOOO4000,0XOOOO4000,0XOOOOOO40:
`
`OXOOOOOO40,0XOOOO4040,0XOOOO4040,0XOOOOOO40,0XOOOOOO40,0XOOOO4040,0XOOOO4040,}7
`
`static long ipl3[l6] = {
`OXOOOOOOOOI
`
`0x40000000,OXOOOOOOOO,OX4OOOOOOO,0X00400000,0X4O4OOOOO,0XOO4OOOOO,0X4O4OOOOO,OXOOOOOOOOI
`
`0x40000000,0x00000000,0x40000000,0x00400000,0x40400000,0x00400000,0x40400000.};
`
`static long iph3[16]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OX4OOOOOOO,OX4OOOOOOO,OXOOOOOOOO,OXOOOOOOOO,OX4OOOOOOO,OX4OOOOOOO,0XOO4OOOOOI
`
`0x00400000,0x40400000,0x40400000,0x00400000,0x00400000,0x40400000,0x40400000,};
`
`static long ipl4[l6] = {
`OXOOOOOOOOI
`
`OXOOOOZOOO,OXOOOOOOOO,OXOOOOZOOO,OXOOOOOOZO,0X00002020,0X00000020,0X00002020,0X000000001
`
`OXOOOOZOO0,0XOOOOOOO0,0X00002000,0X00000020,0X00002020,0X00000020,0X00002020,}7
`
`static long iph4[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXOOOOZOOO,OXOOOOZOOO,OXOOOOOOOO,OX00000000,0X00002000,0X00002000,0X000000201
`
`OXOOOOOOZ0,0X00002020,0X00002020,0X00000020,0X00000020,0X00002020,0X00002020,}7
`
`static long ip15[l6]
`OXOOOOOOOOI
`
`= {
`
`0x20000000,0x00000000,0x20000000,0x00200000,0x20200000,0x00200000,0x20200000,0x00000000,
`
`0x20000000,0x00000000,0x20000000,0x00200000,0x20200000,0x00200000,0x20200000.};
`
`static long iph5[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXZOOOOOOO,OXZOOOOOOO,OXOOOOOOOO,OX00000000,0X20000000,0X20000000,0X002000001
`
`0x00200000,0x20200000,0x20200000,0x00200000,0x00200000,0x20200000,0x20200000,};
`
`static long ipl6[l6] = {
`OXOOOOOOOOI
`
`OXOOOOlOOO,OXOOOOOOOO,OXOOOOlOOO,0X00000010,0X00001010,0X00000010,0X00001010,0X000000001
`
`OXOOOOlOO0,0XOOOOOOO0,0X00001000,0X00000010,0X00001010,0X00000010,0X00001010,}i
`
`static long iph6[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXOOOOlOOO,OXOOOOlOOO,OXOOOOOOOO,OX00000000,0X00001000,0X00001000,0X000000101
`
`OXOOOOOOl0,0X00001010,0x00001010,0X00000010,0X00000010,0X00001010,0X00001010,}i
`
`static long ipl7[l6] = {
`OXOOOOOOOOI
`
`0x10000000,0x00000000,0x10000000,0x00100000,0x10100000,0x00100000,0x10100000,0x00000000.
`
`0x10000000,0x00000000,0x10000000,0x00100000,0x10100000,0x00100000,0x10100000,};
`
`static long iph7[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXlOOOOOOO,OXlOOOOOOO,OXOOOOOOOO,OX00000000,0X10000000,0X10000000,0X001000001
`
`0x00100000,0x10100000,0x10100000,0x00100000,0x00100000,0x10100000,0x10100000,};
`
`static long ip18[l6]
`OXOOOOOOOOI
`
`= {
`
`0x00000800,0x00000000,0x00000800,0x00000008,0x00000808,0x00000008,0x00000808,0x00000000,
`
`OXOOOOO800,0XOOOOOOO0,0X00000800,0X00000008,0X00000808,0X00000008,0XOOOOO808,}i
`
`static long iph8[l6]
`OXOOOOOOOOI
`
`= {
`
`431
`
`OXOOOOOOOO,OXOOOOO8OO,OXOOOOO8OO,OXOOOOOOOO,OXOOOOOOOO,OXOOOOO8OO,OX00000800,0X000000081
`432
`OXOOOOOOOB,OXOOOOO808,0X00000808,0X00000008,0X00000008,0X00000808,0XOOOOO808,}i
`
`'8'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 59
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`433
`
`static long ipl9[l6] = {
`OXOOOOOOOOI
`
`OXO8OOOOOO,OXOOOOOOOO,OXO8OOOOOO,OXOOO8OOOO,OXO8O8OOOO,OXOOO8OOOO,0X08080000,0X000000001
`
`OXO8000OO0,0XOOOOOOO0,0XO8000OO0,0XOOO80000,0X08080000,0XOOO80000,0XO8080000,}7
`
`static long iph9[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXO8OOOOOO,OXO8OOOOOO,OXOOOOOOOO,OXOOOOOOOO,OXO8OOOOOO,OXO8OOOOOO,OXOOO8OOOOI
`
`OXOOO80000,0XO8080000,0XO8080000,0XOOO80000,0X00080000,0X08080000,0X08080000,}7
`
`static long ipla[l6] = {
`OXOOOOOOOOI
`
`OXOOOOO4OO,OXOOOOOOOO,OXOOOOO4OO,OXOOOOOOO4,OXOOOOO4O4,OXOOOOOOO4,OXOOOOO4O4IOXOOOOOOOOI
`
`OXOOOOO400,0XOOOOOOO0,0XOOOOO400,0XOOOOOOO4,0XOOOOO404,0XOOOOOOO4,0x00000404,}i
`
`static long ipha[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXOOOOO4OO,OXOOOOO4OO,OXOOOOOOOO,0X00000000,0X00000400,0X00000400,0X000000041
`
`OXOOOOOOO4,0XOOOOO404,0xOOOOO404,0XOOOOOOO4,0XOOOOOOO4,0XOOOOO404,0XOOOOO404,}i
`
`static long iplb[l6] = {
`OXOOOOOOOOI
`
`OXO4OOOOOO,OXOOOOOOOO,0XO4OOOOOO,0X00040000,0X04040000,0X00040000,0X04040000,0X000000001
`
`OXO4000OO0,0XOOOOOOO0,0X04000000,0X00040000,0X04040000,0X00040000,0X04040000,}i
`
`static long iphb[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,0XO4OOOOOO,0XO4OOOOOO,OXOOOOOOOO,OXOOOOOOOO,0XO4OOOOOO,OXO4OOOOOO,0XOOO4OOOOI
`
`OXOOO40000,0X04040000,0X04040000,0X00040000,0X00040000,0X04040000,0X04040000,}i
`
`static long iplc[l6] = {
`OXOOOOOOOOI
`
`OXOOOOO2OO,OXOOOOOOOO,OXOOOOOZOO,OXOOOOOOOZ,0x00000202,0X00000002,OXOOOOOZOZIOXOOOOOOOOI
`
`0x00000200,0x00000000,0x00000200,0x00000002,0x00000202,0x00000002,0x00000202,};
`
`static long iphc[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXOOOOOZOO,OXOOOOOZOO,OXOOOOOOOO,OX00000000,0X00000200,0X00000200,0X000000021
`
`OXOOOOOOOZ,OXOOOOOZOZ,0x00000202,0X00000002,OXOOOOOOOZ,OX00000202,OXOOOOOZOZI}i
`
`static long ipld[l6] = {
`OXOOOOOOOOI
`
`OXOZOOOOOO,OXOOOOOOOO,OXOZOOOOOO,OXOOOZOOOO,0X02020000,0X00020000,0X02020000,0X000000001
`
`OXOZOOOOOO,OXOOOOOOOO,0X02000000,0X00020000,0X02020000,0X00020000,OXOZOZOOOOI}7
`
`static long iphd[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,OXOZOOOOOO,OXOZOOOOOO,OXOOOOOOOO,OX00000000,0X02000000,0X02000000,0X000200001
`
`OXOOOZOOOO,OXOZOZOOOO,0X02020000,0X00020000,0X00020000,0X02020000,OXOZOZOOOOI}7
`
`static long iple[l6] = {
`OXOOOOOOOOI
`
`0X00000100,OXOOOOOOOO,0X00000100,OXOOOOOOOl,OX0000010110x0000000110X0000010110X00000000,
`
`0x00000100,0x00000000,0xOOOOOlO0,0xOOOOOOOl.0x00000101.0xOOOOOOOl.OxOOOOOlOl,};
`
`static long iphe[l6]
`OXOOOOOOOOI
`
`= {
`
`OXOOOOOOOO,0X00000100,0X00000100,OXOOOOOOOO,0X00000000,0X00000100,0X00000100,0X000000011
`
`0x00000001,0x00000101.0x0000010110x00000001,0x00000001.0x0000010110x00000101,};
`
`static long iplf[l6] = {
`OXOOOOOOOOI
`
`OX01OOOOOO,OXOOOOOOOO,0X01OOOOOO,0X00010000,0X01010000,0X00010000,0X01010000,0X000000001
`
`OX01000OO0,0XOOOOOOO0,0X01000000,0X00010000,0X01010000,0X00010000,0X01010000,}7
`
`434
`
`435
`
`436
`
`437
`
`438
`
`439
`
`440
`441
`
`442
`
`443
`444
`
`445
`
`446
`447
`
`448
`
`449
`
`450
`
`451
`
`452
`
`453
`
`454
`
`455
`
`456
`
`457
`
`458
`
`459
`
`460
`
`461
`
`462
`
`463
`
`464
`
`465
`
`466
`
`467
`
`468
`
`469
`
`470
`471
`
`472
`
`473
`474
`
`475
`
`476
`477
`
`478
`
`479
`
`480
`
`481
`
`482
`
`483
`
`484
`
`485
`
`static long iphf[l6] = {
`486
`OXOOOOOOOOI
`
`'9'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 60
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`487
`OXOOOOOOO0,0xOlOOOOO0,0xOlOOOOO0,0x00000000,0x00000000,0x01000000,0xOlOOOOO0,0xOOOlOOOO,
`
`488
`489
`
`490
`
`491
`492
`
`493
`494
`495
`
`496
`
`497
`
`498
`
`499
`
`500
`
`501
`
`502
`
`503
`
`504
`
`505
`506
`
`507
`
`508
`
`509
`
`510
`
`511
`512
`
`513
`514
`
`0x00010000,0x01010000,0x01010000,0XOOOlOOO0,0XOOOlOOO0,0xOlOlOOO0,0xOlOlOOOO,};
`
`static long
`
`ip_low(block)
`register char block[8];
`
`{
`
`}
`
`register long 1;
`
`1
`
`1
`
`l
`
`1
`
`1
`
`1
`
`1
`
`l
`
`1
`
`l
`1
`
`l
`
`1
`
`l
`
`1
`
`= ip11[block[O] & Oxf];
`
`|= ip10[(block[0] >> 4) & Oxf];
`
`|= ipl3[block[l] & Oxf];
`
`|= ip12[(block[l] >> 4) & Oxf];
`
`|= ip15[block[2] & Oxf];
`
`|= ipl4[(block[2] >> 4) & Oxf];
`
`|= ipl7[block[3] & Oxf];
`
`|= ip16[(block[3] >> 4) & Oxf];
`
`|= ipl9[block[4] & Oxf];
`
`|= ip18[(block[4] >> 4) & Oxf];
`= iplb[block[5] & Oxf];
`
`= ip1a[(block[5] >> 4) & Oxf];
`
`= ipld[block[6] & Oxf];
`
`= ip1e[(block[6] >> 4) & Oxf];
`
`= ip1f[block[7] & Oxf];
`
`= ip1e[(block[7] >> 4) & Oxf];
`1
`return 1;
`
`static long
`
`515
`
`516
`517
`
`519
`520
`
`ip_high(block)
`
`{
`
`register long 1;
`
`register char block[8]; 518
`
`521
`
`522
`
`1
`
`1
`
`= iphl[block[0] & Oxf];
`
`|= iph0[(block[0] >> 4) & Oxf];
`
`1
`
`1
`
`1
`
`1
`
`1
`
`l
`
`1
`
`1
`1
`
`l
`
`1
`
`l
`
`1
`
`|= iph3[block[l] & Oxf];
`
`|= iph2[(block[l] >> 4) & Oxf];
`
`|= iph5[block[2] & Oxf];
`
`|= iph4[(block[2] >> 4) & Oxf];
`
`|= iph7[block[3] & Oxf];
`
`|= iph6[(block[3] >> 4) & Oxf];
`
`|= iph9[block[4] & Oxf];
`
`|= iph8[(block[4] >> 4) & Oxf];
`= iphb[block[5] & Oxf];
`
`= ipha[(block[5] >> 4) & Oxf];
`
`= iphd[block[6] & Oxf];
`
`= iphc[(block[6] >> 4) & Oxf];
`
`= iphf[block[7] & Oxf];
`
`= iphe[(block[7] >> 4) & Oxf];
`1
`return 1;
`
`523
`
`524
`
`525
`
`526
`
`527
`
`528
`
`529
`
`530
`531
`
`532
`
`533
`
`534
`
`535
`
`536
`537
`
`538
`539
`
`}
`
`
`
`540 /*
`
`40-
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 61
`
`
`
`C:\cfs-1.3.3\cfs_des.c
`
`541
`
`542
`543
`
`544
`
`545
`546
`
`547
`
`548
`549
`
`550
`551
`
`552
`553
`
`554
`555
`
`556
`
`557
`
`558
`
`559
`560
`
`561
`
`562
`
`563
`
`564
`
`565
`
`566
`567
`
`568
`
`569
`57o
`
`571
`
`572
`
`573
`
`* Key set—up
`
`*/
`
`void
`
`des_key_setup(key, subkeys)
`char key[8];
`
`char *subkeys;
`
`{
`
`register octet;
`
`register char *kp;
`
`kp = subkeys;
`octet = 16;
`
`do {
`
`*kp++ =
`
`*kp++ =
`
`*kp++ =
`
`*kp++ =
`
`;
`
`;
`
`;
`
`;
`
`*kp++ = O;
`
`*kp++ = O;
`
`*kp++ = O;
`
`*kp++ = O;
`
`} while (——octet);
`kp = subkeys;
`
`octet = key[O];
`
`if (octet & 0x80)
`
`{
`
`kp[
`
`3]
`
`=
`
`2; kp[
`
`9]
`
`8; kp[ 18]
`
`I:
`
`8;
`
`kp[ 27]
`
`|= 32; kp[ 33]
`
`2; kp[ 42]
`
`|= 16;
`
`kp[ 48]
`
`kp[ 80]
`kp[1o4]
`
`=
`
`=
`=
`
`; kp[ 65]
`
`16; kp[ 74]
`
`|=
`
`2;
`
`2; kp[ 89]
`4; kp[122]
`
`4; kp[ 99]
`32;
`
`I: 16;
`
`}
`
`{
`if (octet & 0x40)
`kp[
`1]
`=
`4; kp[
`
`8]
`
`1; kp[ 181
`
`kp[ 25]
`
`|= 32; kp[ 34]
`
`32; kp[ 41]
`
`|=
`
`|=
`
`4:
`
`8;
`
`kp[ 50]
`
`kp[ 75]
`
`=
`
`=
`
`; kp[ 59]
`
`32; kp[ 64]
`
`|= 16;
`
`4; kp[ 9o]
`
`1; kp[ 97]
`
`|= 16;
`
`|=
`
`1;
`
`574
`
`575
`
`576
`
`577
`
`578
`
`579
`
`580
`
`581
`
`582
`
`583
`
`584
`
`585
`
`586
`
`587
`
`588
`
`589
`590
`
`591
`
`592
`
`kp[lO6]
`
`=
`
`2; kp[112]
`
`2; kp[123]
`
`}
`
`if (octet & 0x20)
`
`{
`
`1; kp[ 19]
`
`1; kp[ 5o]
`
`8; kp[ 35]
`
`l:
`
`1;
`
`4; kp[ 57]
`
`|= 32;
`
`kp[
`
`2]
`
`kp[ 40]
`
`kp[ 75]
`
`=
`
`=
`
`=
`
`2; kp[ 8o]
`
`32; kp[ 89]
`
`kp[ 96]
`
`|= 16; kp[lO7]
`
`4; kp[12o]
`
`|=
`
`|=
`
`|=
`
`|=
`
`I:
`
`|=