mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 18:02:25 +00:00
ulmCiphers added
This commit is contained in:
parent
7fee90885b
commit
2ae37f223d
11 changed files with 101 additions and 0 deletions
1
makefile
1
makefile
|
|
@ -206,6 +206,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,7 @@ stage6:
|
||||||
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
$(VOCSTATIC) -sP ulmTimeConditions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
$(VOCSTATIC) -sP ulmSysConversions.Mod
|
||||||
$(VOCSTATIC) -sP ulmSysStat.Mod
|
$(VOCSTATIC) -sP ulmSysStat.Mod
|
||||||
|
$(VOCSTATIC) -sP ulmCiphers.Mod
|
||||||
|
|
||||||
|
|
||||||
#pow32 libs
|
#pow32 libs
|
||||||
|
|
|
||||||
BIN
ocat
BIN
ocat
Binary file not shown.
BIN
showdef
BIN
showdef
Binary file not shown.
94
src/lib/ulm/ulmCiphers.Mod
Normal file
94
src/lib/ulm/ulmCiphers.Mod
Normal file
|
|
@ -0,0 +1,94 @@
|
||||||
|
(* Ulm's Oberon Library
|
||||||
|
Copyright (C) 1989-1997 by University of Ulm, SAI, D-89069 Ulm, Germany
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
Ulm's Oberon Library is free software; you can redistribute it
|
||||||
|
and/or modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either version
|
||||||
|
2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
Ulm's Oberon Library is distributed in the hope that it will be
|
||||||
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||||
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
E-mail contact: oberon@mathematik.uni-ulm.de
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
$Id: Ciphers.om,v 1.1 1997/04/02 11:51:15 borchert Exp $
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
$Log: Ciphers.om,v $
|
||||||
|
Revision 1.1 1997/04/02 11:51:15 borchert
|
||||||
|
Initial revision
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
*)
|
||||||
|
|
||||||
|
(* abstraction for the use of ciphers and cryptographic methods *)
|
||||||
|
MODULE ulmCiphers;
|
||||||
|
|
||||||
|
IMPORT Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, PersistentDisciplines := ulmPersistentDisciplines, Services := ulmServices,
|
||||||
|
Streams := ulmStreams, Write := ulmWrite;
|
||||||
|
|
||||||
|
TYPE
|
||||||
|
Cipher* = POINTER TO CipherRec;
|
||||||
|
|
||||||
|
TYPE
|
||||||
|
CryptProc* = PROCEDURE (in: Streams.Stream; key: Cipher;
|
||||||
|
length: INTEGER; out: Streams.Stream) : BOOLEAN;
|
||||||
|
|
||||||
|
TYPE
|
||||||
|
Interface* = POINTER TO InterfaceRec;
|
||||||
|
InterfaceRec* = RECORD
|
||||||
|
(Objects.ObjectRec)
|
||||||
|
(* public *)
|
||||||
|
encrypt*, decrypt : CryptProc;
|
||||||
|
END;
|
||||||
|
|
||||||
|
TYPE
|
||||||
|
CipherRec* = RECORD
|
||||||
|
(PersistentDisciplines.ObjectRec)
|
||||||
|
(* private *)
|
||||||
|
if : Interface
|
||||||
|
END;
|
||||||
|
|
||||||
|
VAR
|
||||||
|
cipherType, interfaceType : Services.Type;
|
||||||
|
|
||||||
|
PROCEDURE Init*(key: Cipher; if: Interface);
|
||||||
|
BEGIN
|
||||||
|
ASSERT(if # NIL);
|
||||||
|
ASSERT(if.encrypt # NIL);
|
||||||
|
key.if := if;
|
||||||
|
END Init;
|
||||||
|
|
||||||
|
PROCEDURE Encrypt*(in: Streams.Stream; key: Cipher;
|
||||||
|
out: Streams.Stream) : BOOLEAN;
|
||||||
|
BEGIN
|
||||||
|
RETURN key.if.encrypt(in, key, -1, out);
|
||||||
|
END Encrypt;
|
||||||
|
|
||||||
|
PROCEDURE Decrypt*(in: Streams.Stream; key: Cipher;
|
||||||
|
out: Streams.Stream) : BOOLEAN;
|
||||||
|
BEGIN
|
||||||
|
RETURN key.if.decrypt(in, key, -1, out);
|
||||||
|
END Decrypt;
|
||||||
|
|
||||||
|
PROCEDURE EncryptPart*(in: Streams.Stream; key: Cipher;
|
||||||
|
length: INTEGER; out: Streams.Stream) : BOOLEAN;
|
||||||
|
BEGIN
|
||||||
|
RETURN key.if.encrypt(in, key, length, out);
|
||||||
|
END EncryptPart;
|
||||||
|
|
||||||
|
PROCEDURE DecryptPart*(in: Streams.Stream; key: Cipher;
|
||||||
|
length: INTEGER; out: Streams.Stream) : BOOLEAN;
|
||||||
|
BEGIN
|
||||||
|
RETURN key.if.decrypt(in, key, length, out);
|
||||||
|
END DecryptPart;
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
PersistentObjects.RegisterType(cipherType, "Ciphers.Cipher",
|
||||||
|
"PersistentDisciplines.Object", NIL);
|
||||||
|
END ulmCiphers.
|
||||||
BIN
voc
BIN
voc
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue