<s>
The	O
BSD	B-Algorithm
checksum	I-Algorithm
algorithm	O
was	O
a	O
commonly	O
used	O
,	O
legacy	O
checksum	B-Algorithm
algorithm	O
.	O
</s>
<s>
It	O
has	O
been	O
implemented	O
in	O
old	O
BSD	B-Operating_System
and	O
is	O
also	O
available	O
through	O
the	O
sum	O
command	O
line	O
utility	O
.	O
</s>
<s>
This	O
algorithm	O
is	O
useless	O
from	O
a	O
security	O
perspective	O
,	O
and	O
is	O
weaker	O
than	O
the	O
CRC-32	O
cksum	B-Device
for	O
error	O
detection	O
.	O
</s>
<s>
Below	O
is	O
the	O
relevant	O
part	O
of	O
the	O
GNU	B-Operating_System
sum	O
source	O
code	O
(	O
GPL	B-License
licensed	O
)	O
.	O
</s>
<s>
It	O
computes	O
a	O
16-bit	O
checksum	B-Algorithm
by	O
adding	O
up	O
all	O
bytes	O
(	O
8-bit	O
words	O
)	O
of	O
the	O
input	O
data	O
stream	O
.	O
</s>
<s>
In	O
order	O
to	O
avoid	O
many	O
of	O
the	O
weaknesses	O
of	O
simply	O
adding	O
the	O
data	O
,	O
the	O
checksum	B-Algorithm
accumulator	O
is	O
circular	O
rotated	O
to	O
the	O
right	O
by	O
one	O
bit	O
at	O
each	O
step	O
before	O
the	O
new	O
char	O
is	O
added	O
.	O
</s>
<s>
As	O
mentioned	O
above	O
,	O
this	O
algorithm	O
computes	O
a	O
checksum	B-Algorithm
by	O
segmenting	O
the	O
data	O
and	O
adding	O
it	O
to	O
an	O
accumulator	O
that	O
is	O
circular	O
right	O
shifted	O
between	O
each	O
summation	O
.	O
</s>
<s>
a	O
)	O
Apply	O
circular	O
shift	O
to	O
the	O
checksum	B-Algorithm
:	O
</s>
<s>
b	O
)	O
Add	O
checksum	B-Algorithm
and	O
segment	O
together	O
,	O
apply	O
bitmask	O
onto	O
the	O
obtained	O
result	O
:	O
</s>
<s>
a	O
)	O
Apply	O
circular	O
shift	O
to	O
the	O
checksum	B-Algorithm
:	O
</s>
<s>
b	O
)	O
Add	O
checksum	B-Algorithm
and	O
segment	O
together	O
,	O
apply	O
bitmask	O
onto	O
the	O
obtained	O
result	O
:	O
</s>
<s>
a	O
)	O
Apply	O
circular	O
shift	O
to	O
the	O
checksum	B-Algorithm
:	O
</s>
<s>
b	O
)	O
Add	O
checksum	B-Algorithm
and	O
segment	O
together	O
,	O
apply	O
bitmask	O
onto	O
the	O
obtained	O
result	O
:	O
</s>
