Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
06676266
Commit
06676266
authored
Nov 01, 1993
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace <<-13 by >>13. Leave old code in #ifdef BUGGY_CODE_BW_COMPAT.
parent
13ecc7a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
Modules/rotormodule.c
Modules/rotormodule.c
+15
-0
No files found.
Modules/rotormodule.c
View file @
06676266
...
...
@@ -158,11 +158,26 @@ char *key;
int
i
;
int
len
=
strlen
(
key
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
#ifdef BUGGY_CODE_BW_COMPAT
/* This is the code as it was originally released.
It causes warnings on many systems and can generate
different results as well. If you have files
encrypted using an older version you may want to
#define BUGGY_CODE_BW_COMPAT so as to be able to
decrypt them... */
k1
=
(((
k1
<<
3
|
k1
<<-
13
)
+
key
[
i
])
&
65535
);
k2
=
(((
k2
<<
3
|
k2
<<-
13
)
^
key
[
i
])
&
65535
);
k3
=
(((
k3
<<
3
|
k3
<<-
13
)
-
key
[
i
])
&
65535
);
k4
=
((
key
[
i
]
-
(
k4
<<
3
|
k4
<<-
13
))
&
65535
);
k5
=
(((
k5
<<
3
|
k5
<<-
13
)
^
~
key
[
i
])
&
65535
);
#else
/* This code should be more portable */
k1
=
(((
k1
<<
3
|
k1
>>
13
)
+
key
[
i
])
&
65535
);
k2
=
(((
k2
<<
3
|
k2
>>
13
)
^
key
[
i
])
&
65535
);
k3
=
(((
k3
<<
3
|
k3
>>
13
)
-
key
[
i
])
&
65535
);
k4
=
((
key
[
i
]
-
(
k4
<<
3
|
k4
>>
13
))
&
65535
);
k5
=
(((
k5
<<
3
|
k5
>>
13
)
^
~
key
[
i
])
&
65535
);
#endif
}
r
->
key
[
0
]
=
(
short
)
k1
;
r
->
key
[
1
]
=
(
short
)(
k2
|
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment