repo.or.cz
/
debian-nspark.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Add missing break
[debian-nspark.git]
/
garble.c
blob
e33dae63d3e7d0c9a6dd30295678a6b7d74dab3f
1
#include
"garble.h"
2
3
static char
*
password
;
4
static char
*
passp
;
5
6
void
7
set_password
(
char
*
p
)
8
{
9
password
=
p
;
10
}
11
12
void
13
init_garble
()
14
{
15
passp
=
password
;
16
}
17
18
Byte
19
ungarble
(
Byte byte
)
20
{
21
if
(
password
) {
22
byte
^= *
passp
++;
23
if
(!*
passp
) {
24
passp
=
password
;
25
}
26
}
27
28
return
byte
;
29
}
30
31
Byte
32
garble
(
Byte byte
)
33
{
34
/* Garble and ungarble are the same thing */
35
return
ungarble
(
byte
);
36
}