diff --git a/makefile b/makefile index 9fe833e8..2b86155b 100644 --- a/makefile +++ b/makefile @@ -206,6 +206,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/makefile.gnuc.armv6j b/makefile.gnuc.armv6j index 1b0875c2..d5373020 100644 --- a/makefile.gnuc.armv6j +++ b/makefile.gnuc.armv6j @@ -205,6 +205,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/makefile.gnuc.armv6j_hardfp b/makefile.gnuc.armv6j_hardfp index e6d46142..95e16fdd 100644 --- a/makefile.gnuc.armv6j_hardfp +++ b/makefile.gnuc.armv6j_hardfp @@ -205,6 +205,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/makefile.gnuc.armv7a_hardfp b/makefile.gnuc.armv7a_hardfp index 059a9d8b..645f394c 100644 --- a/makefile.gnuc.armv7a_hardfp +++ b/makefile.gnuc.armv7a_hardfp @@ -205,6 +205,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/makefile.gnuc.powerpc b/makefile.gnuc.powerpc index 968af564..47c17fdd 100644 --- a/makefile.gnuc.powerpc +++ b/makefile.gnuc.powerpc @@ -205,6 +205,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/makefile.gnuc.x86 b/makefile.gnuc.x86 index a08c8c58..0ac63bb1 100644 --- a/makefile.gnuc.x86 +++ b/makefile.gnuc.x86 @@ -205,6 +205,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/makefile.gnuc.x86_64 b/makefile.gnuc.x86_64 index a30d9df9..aa3261cb 100644 --- a/makefile.gnuc.x86_64 +++ b/makefile.gnuc.x86_64 @@ -205,6 +205,7 @@ stage6: $(VOCSTATIC) -sP ulmTimeConditions.Mod $(VOCSTATIC) -sP ulmSysConversions.Mod $(VOCSTATIC) -sP ulmSysStat.Mod + $(VOCSTATIC) -sP ulmCiphers.Mod #pow32 libs diff --git a/ocat b/ocat index 0427650d..73621ad1 100755 Binary files a/ocat and b/ocat differ diff --git a/showdef.REMOVED.git-id b/showdef.REMOVED.git-id index e667c6d0..11be13b6 100644 --- a/showdef.REMOVED.git-id +++ b/showdef.REMOVED.git-id @@ -1 +1 @@ -4defe4c7e72c85a151137ba3aa8993836fbb6340 \ No newline at end of file +f29f352c8e611105fde30173648f16fe61d936be \ No newline at end of file diff --git a/src/lib/ulm/ulmCiphers.Mod b/src/lib/ulm/ulmCiphers.Mod new file mode 100644 index 00000000..aeb85438 --- /dev/null +++ b/src/lib/ulm/ulmCiphers.Mod @@ -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. diff --git a/voc.REMOVED.git-id b/voc.REMOVED.git-id index df30639e..9014520d 100644 --- a/voc.REMOVED.git-id +++ b/voc.REMOVED.git-id @@ -1 +1 @@ -685238d2fdf5c7fca23acb75dba7cff77f0eef8c \ No newline at end of file +618780429002771779782b951c5686945ebbb889 \ No newline at end of file