~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/fcl-base/tests/testbf.pp

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $
 
3
    This file is part of the Free Component Library (FCL)
 
4
    Copyright (c) 1999-2000 by the Free Pascal development team
 
5
 
 
6
    See the file COPYING.FPC, included in this distribution,
 
7
    for details about the copyright.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
12
 
 
13
 **********************************************************************}
 
14
 
 
15
{ short test for blowfish unit }
 
16
 
 
17
{$mode objfpc}
 
18
{$h+}
 
19
 
 
20
program testbf;
 
21
 
 
22
uses blowfish;
 
23
 
 
24
Var
 
25
  i : integer;
 
26
  L,R : TBFBlock;
 
27
  K : TBlowFishKey;
 
28
 
 
29
begin
 
30
  L[0]:=$DEAD;
 
31
  L[1]:=$BEEF;
 
32
  R:=L;
 
33
  For I:=0 to 55 do
 
34
    K[i]:=Random(255)+1;
 
35
  With TBlowfish.Create(K,56) do
 
36
    Try
 
37
    Encrypt(L);
 
38
    Decrypt(L);
 
39
    If (L[0]<>R[0]) or (L[1]<>R[1]) then
 
40
      Writeln('Error');
 
41
    finally
 
42
      Free;
 
43
    end;
 
44
end.
 
 
b'\\ No newline at end of file'