diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e25b7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.image +*.changes +*.sources +pharo-local/ +github-cache/ +image.*/ +pharo +pharo-ui +pharo-vm/ +PharoDebug.log diff --git a/.travis.yml b/.travis.yml index a6055c7..4c579e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,3 @@ matrix: smalltalk_config: .smalltalk.ston - smalltalk: Pharo-6.1 smalltalk_config: .smalltalk.ston - - smalltalk: Pharo-5.0 - smalltalk_config: .smalltalk.ston - - smalltalk: Pharo-4.0 - smalltalk_config: .smalltalk-legacy.ston diff --git a/source/.filetree b/source/.filetree deleted file mode 100644 index c6704e5..0000000 --- a/source/.filetree +++ /dev/null @@ -1,2 +0,0 @@ -{"packageExtension" : ".package", -"propertyFileExtension" : ".json" } \ No newline at end of file diff --git a/source/.properties b/source/.properties index c2bedd4..ad0471d 100644 --- a/source/.properties +++ b/source/.properties @@ -1,3 +1,3 @@ { - #format : #filetree + #format : #tonel } \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/.filetree b/source/ASN1-Readers-Tests.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/ASN1-Readers-Tests.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/README.md b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/derKeys.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/derKeys.st deleted file mode 100644 index b25f059..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/derKeys.st +++ /dev/null @@ -1,7 +0,0 @@ -RSA -derKeys - - | key64 | - key64 := self encodedBase64Keys. - - ^(Base64MimeConverter mimeDecodeToBytes: key64 readStream ) contents. diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/encodedBase64Keys.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/encodedBase64Keys.st deleted file mode 100644 index 623f0b9..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/encodedBase64Keys.st +++ /dev/null @@ -1,20 +0,0 @@ -RSA -encodedBase64Keys - - ^ 'MIICXgIBAAKBgQDkI45GM6mYLlbxrKozE6bXWMoxvtVuIWOIF1KcGLED+4Gipriw -Nt0hkosuil513/CMjn9XBSZtaSsiIOLkXLZtbKYhATtvODR1nD/dl0JpFH7BLcD9 -NGGRKOow0jg8fcPtXhLTy6Dsl7rfmVPJYuc4IlzZImTdErllmhzrTKT3YQIDAQAB -AoGBALPQjogomii3hZHQ3QmLGLqtYhjZaBH4wSF3+IXONF+GMcRIklNZuuuGPKt/ -JjrUOh4fBqFJDuO3u+aXcx45MRMLVHuQIuUbegJXVS+rnxXI3I6I4SLBkoV7Jqn/ -J9T9biOXrzq/xN8XVJQm7zq/FXaHR6l+Wo50LaBj7llY+CMBAkEA8bfsbySseTbI -D7tR/bytEz/DhQ1knKS3nFo83NYwDm7YcdGC+f0rQIUuS30lKApeoygBUiLOSs7K -euxEi6wC0QJBAPGePI59Fc5alAivyTkYdV4sbIL+SL5oXEERRyezogEgRqCGJtyd -MbnVviwREF4MiGTYQIIOx4aFrM/U4q9DL5ECQH+/QImMzEpTlXAbA74iFSZzMJYE -+gN/WjqbxkbAPC2kj2e33ozYLB+xQ0JKJXT/5fw8jFYoZvZKS+CjNabLhcECQQDp -bgrrToXGu1PRoKMzeiHKPfkIBUuaSZD3fA3WmYGmvNv/MhxRf70O4SW9xS6e7lTH -uPV5sXWqzXLLx8zJrotBAkEAgAoiR+5uOW9CgfWkblJ/YIgGbLiLQoFNZbwxXDfr -jcosTQvBjrc//rCnb2Pgm8QRGeN/CXKc9kKoWNqUQSYchQ== -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkI45GM6mYLlbxrKozE6bXWMox -vtVuIWOIF1KcGLED+4GipriwNt0hkosuil513/CMjn9XBSZtaSsiIOLkXLZtbKYh -ATtvODR1nD/dl0JpFH7BLcD9NGGRKOow0jg8fcPtXhLTy6Dsl7rfmVPJYuc4IlzZ -ImTdErllmhzrTKT3YQIDAQAB'. \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/genericRSATest..st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/genericRSATest..st deleted file mode 100644 index 08aabbc..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/genericRSATest..st +++ /dev/null @@ -1,11 +0,0 @@ -tests -genericRSATest: bits - | generator public private msg c | - generator := RSAKeyPairGenerator new bits: bits. - public := generator publicKey. "this may take a while" - private := generator privateKey. - - msg := 1234567890987654321. "the plaintext" - -c := public crypt: msg. "the ciphertext (print it and take a look)" - self assert: (private crypt: c) = msg \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/setUp.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/setUp.st deleted file mode 100644 index 5499c4c..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/setUp.st +++ /dev/null @@ -1,10 +0,0 @@ -running -setUp - | reader | - super setUp. - - reader := RSAPrivateKeyFileReader new. - reader decryptedBytes: self derKeys. - privateKey := reader asPrivateKey. - publicKey := reader asPublicKey. - \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSA128.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSA128.st deleted file mode 100644 index a690aa8..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSA128.st +++ /dev/null @@ -1,3 +0,0 @@ -tests -testRSA128 - self genericRSATest: 128 \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSA64.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSA64.st deleted file mode 100644 index 7e8ca6f..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSA64.st +++ /dev/null @@ -1,3 +0,0 @@ -tests -testRSA64 - self genericRSATest: 64 \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSASHASignVerification.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSASHASignVerification.st deleted file mode 100644 index f8a1494..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSASHASignVerification.st +++ /dev/null @@ -1,8 +0,0 @@ -tests -testRSASHASignVerification - - | signBytes | - - signBytes := privateKey v15SignMessage: 'hello'. - - self assert: (publicKey v15Verify: signBytes isSignatureOf: 'hello') \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSASHASigning.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSASHASigning.st deleted file mode 100644 index 9f1aba3..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testRSASHASigning.st +++ /dev/null @@ -1,9 +0,0 @@ -tests -testRSASHASigning - - | signBytes | - - signBytes := privateKey v15SignMessage: 'hello'. - - self assert: signBytes = -#[217 255 224 189 56 76 46 39 224 98 134 191 90 24 145 47 7 195 143 29 131 44 93 172 118 161 3 217 231 74 82 55 37 193 86 114 7 137 22 207 107 27 26 121 40 155 185 172 20 23 27 27 187 162 97 64 151 41 173 230 53 54 174 53 73 76 252 145 252 215 166 53 37 21 174 21 185 171 201 163 197 43 15 202 40 48 150 9 233 126 34 221 219 27 215 142 161 15 225 230 238 150 82 130 2 51 197 124 242 211 222 60 145 93 145 198 48 122 160 232 31 75 161 244 8 194 143 170] \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testSignVerificationByGeneratedKeys.st b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testSignVerificationByGeneratedKeys.st deleted file mode 100644 index 6beb985..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/instance/testSignVerificationByGeneratedKeys.st +++ /dev/null @@ -1,10 +0,0 @@ -tests -testSignVerificationByGeneratedKeys - - | signBytes gen | - gen := RSAKeyPairGenerator bits: 1024. - gen computePrimes. - - signBytes := gen privateKey v15SignMessage: 'hello'. - - self assert: (gen publicKey v15Verify: signBytes isSignatureOf: 'hello') \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/properties.json b/source/ASN1-Readers-Tests.package/CryptoRSATest.class/properties.json deleted file mode 100644 index 4de7398..0000000 --- a/source/ASN1-Readers-Tests.package/CryptoRSATest.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "ASN1-Readers-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "privateKey", - "publicKey" - ], - "name" : "CryptoRSATest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/monticello.meta/categories.st b/source/ASN1-Readers-Tests.package/monticello.meta/categories.st deleted file mode 100644 index 1ff9c41..0000000 --- a/source/ASN1-Readers-Tests.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #'ASN1-Readers-Tests'! diff --git a/source/ASN1-Readers-Tests.package/monticello.meta/initializers.st b/source/ASN1-Readers-Tests.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers-Tests.package/monticello.meta/package b/source/ASN1-Readers-Tests.package/monticello.meta/package deleted file mode 100644 index 7891506..0000000 --- a/source/ASN1-Readers-Tests.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'ASN1-Readers-Tests') \ No newline at end of file diff --git a/source/ASN1-Readers-Tests.package/properties.json b/source/ASN1-Readers-Tests.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/ASN1-Readers-Tests.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/ASN1-Readers-Tests/CryptoRSATest.class.st b/source/ASN1-Readers-Tests/CryptoRSATest.class.st new file mode 100644 index 0000000..ab9a46f --- /dev/null +++ b/source/ASN1-Readers-Tests/CryptoRSATest.class.st @@ -0,0 +1,109 @@ +Class { + #name : #CryptoRSATest, + #superclass : #TestCase, + #instVars : [ + 'privateKey', + 'publicKey' + ], + #category : 'ASN1-Readers-Tests' +} + +{ #category : #RSA } +CryptoRSATest >> derKeys [ + + | key64 | + key64 := self encodedBase64Keys. + + ^(Base64MimeConverter mimeDecodeToBytes: key64 readStream ) contents. + +] + +{ #category : #RSA } +CryptoRSATest >> encodedBase64Keys [ + + ^ 'MIICXgIBAAKBgQDkI45GM6mYLlbxrKozE6bXWMoxvtVuIWOIF1KcGLED+4Gipriw +Nt0hkosuil513/CMjn9XBSZtaSsiIOLkXLZtbKYhATtvODR1nD/dl0JpFH7BLcD9 +NGGRKOow0jg8fcPtXhLTy6Dsl7rfmVPJYuc4IlzZImTdErllmhzrTKT3YQIDAQAB +AoGBALPQjogomii3hZHQ3QmLGLqtYhjZaBH4wSF3+IXONF+GMcRIklNZuuuGPKt/ +JjrUOh4fBqFJDuO3u+aXcx45MRMLVHuQIuUbegJXVS+rnxXI3I6I4SLBkoV7Jqn/ +J9T9biOXrzq/xN8XVJQm7zq/FXaHR6l+Wo50LaBj7llY+CMBAkEA8bfsbySseTbI +D7tR/bytEz/DhQ1knKS3nFo83NYwDm7YcdGC+f0rQIUuS30lKApeoygBUiLOSs7K +euxEi6wC0QJBAPGePI59Fc5alAivyTkYdV4sbIL+SL5oXEERRyezogEgRqCGJtyd +MbnVviwREF4MiGTYQIIOx4aFrM/U4q9DL5ECQH+/QImMzEpTlXAbA74iFSZzMJYE ++gN/WjqbxkbAPC2kj2e33ozYLB+xQ0JKJXT/5fw8jFYoZvZKS+CjNabLhcECQQDp +bgrrToXGu1PRoKMzeiHKPfkIBUuaSZD3fA3WmYGmvNv/MhxRf70O4SW9xS6e7lTH +uPV5sXWqzXLLx8zJrotBAkEAgAoiR+5uOW9CgfWkblJ/YIgGbLiLQoFNZbwxXDfr +jcosTQvBjrc//rCnb2Pgm8QRGeN/CXKc9kKoWNqUQSYchQ== +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkI45GM6mYLlbxrKozE6bXWMox +vtVuIWOIF1KcGLED+4GipriwNt0hkosuil513/CMjn9XBSZtaSsiIOLkXLZtbKYh +ATtvODR1nD/dl0JpFH7BLcD9NGGRKOow0jg8fcPtXhLTy6Dsl7rfmVPJYuc4IlzZ +ImTdErllmhzrTKT3YQIDAQAB'. +] + +{ #category : #tests } +CryptoRSATest >> genericRSATest: bits [ + | generator public private msg c | + generator := RSAKeyPairGenerator new bits: bits. + public := generator publicKey. "this may take a while" + private := generator privateKey. + + msg := 1234567890987654321. "the plaintext" + +c := public crypt: msg. "the ciphertext (print it and take a look)" + self assert: (private crypt: c) = msg +] + +{ #category : #running } +CryptoRSATest >> setUp [ + | reader | + super setUp. + + reader := RSAPrivateKeyFileReader new. + reader decryptedBytes: self derKeys. + privateKey := reader asPrivateKey. + publicKey := reader asPublicKey. + +] + +{ #category : #tests } +CryptoRSATest >> testRSA128 [ + self genericRSATest: 128 +] + +{ #category : #tests } +CryptoRSATest >> testRSA64 [ + self genericRSATest: 64 +] + +{ #category : #tests } +CryptoRSATest >> testRSASHASignVerification [ + + | signBytes | + + signBytes := privateKey v15SignMessage: 'hello'. + + self assert: (publicKey v15Verify: signBytes isSignatureOf: 'hello') +] + +{ #category : #tests } +CryptoRSATest >> testRSASHASigning [ + + | signBytes | + + signBytes := privateKey v15SignMessage: 'hello'. + + self assert: signBytes = +#[217 255 224 189 56 76 46 39 224 98 134 191 90 24 145 47 7 195 143 29 131 44 93 172 118 161 3 217 231 74 82 55 37 193 86 114 7 137 22 207 107 27 26 121 40 155 185 172 20 23 27 27 187 162 97 64 151 41 173 230 53 54 174 53 73 76 252 145 252 215 166 53 37 21 174 21 185 171 201 163 197 43 15 202 40 48 150 9 233 126 34 221 219 27 215 142 161 15 225 230 238 150 82 130 2 51 197 124 242 211 222 60 145 93 145 198 48 122 160 232 31 75 161 244 8 194 143 170] +] + +{ #category : #tests } +CryptoRSATest >> testSignVerificationByGeneratedKeys [ + + | signBytes gen | + gen := RSAKeyPairGenerator bits: 1024. + gen computePrimes. + + signBytes := gen privateKey v15SignMessage: 'hello'. + + self assert: (gen publicKey v15Verify: signBytes isSignatureOf: 'hello') +] diff --git a/source/ASN1-Readers-Tests/package.st b/source/ASN1-Readers-Tests/package.st new file mode 100644 index 0000000..99b214c --- /dev/null +++ b/source/ASN1-Readers-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'ASN1-Readers-Tests' } diff --git a/source/ASN1-Readers.package/.filetree b/source/ASN1-Readers.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/ASN1-Readers.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/README.md b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/class/fromFile..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/class/fromFile..st deleted file mode 100644 index fe40bdf..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/class/fromFile..st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -fromFile: filename - "(DSAPrivateKeyFileReader fromFile: '/usr/local/ssl/private/dsa.key')" - "(DSAPrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/dsa.key')" - - | fs data | - fs := StandardFileStream fileNamed: filename. - data := fs contentsOfEntireFile. - ^ self new initializeFromFileContents: data. diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asASN1Value.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asASN1Value.st deleted file mode 100644 index 7b7a772..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asASN1Value.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asASN1Value - - self decryptedBytes isNil - ifTrue: [self decrypt]. - ^ ASN1Stream decodeBytes: self decryptedBytes diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asPrivateKey.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asPrivateKey.st deleted file mode 100644 index 9c21706..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asPrivateKey.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asPrivateKey - - | asn1 | - asn1 := self asASN1Value. - ^ DSAPrivateKey p: (asn1 at: 2) q: (asn1 at: 3) g: (asn1 at: 4) x: (asn1 at: 6). diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asPublicKey.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asPublicKey.st deleted file mode 100644 index c70d191..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/asPublicKey.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asPublicKey - - | asn1 | - asn1 := self asASN1Value. - ^ DSAPublicKey p: (asn1 at: 2) q: (asn1 at: 3) g: (asn1 at: 4) y: (asn1 at: 5). diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/bytes..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/bytes..st deleted file mode 100644 index 65abecd..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/bytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes: anObject - "Set the value of bytes" - - bytes := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/bytes.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/bytes.st deleted file mode 100644 index 93c857b..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/bytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes - "Answer the value of bytes" - - ^ bytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decrypt.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decrypt.st deleted file mode 100644 index 450c0f8..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decrypt.st +++ /dev/null @@ -1,18 +0,0 @@ -initialization -decrypt - - | cipher key block encryptedStream decryptedStream | - self password isNil - ifTrue: [self password: (FillInTheBlank requestPassword: 'Enter your password')]. - key := OpenSSLKeyDerivationFunction new - derivedKeyFromPassword: self password - salt: self iv - size: 24. - cipher := (TripleDES key: key) cbc initialVector: iv. - encryptedStream := self bytes readStream. - decryptedStream := ReadWriteStream on: (ByteArray new: encryptedStream size). - [encryptedStream atEnd] whileFalse: - [block := encryptedStream next: 8. - cipher decryptBlock: block. - decryptedStream nextPutAll: block]. - self decryptedBytes: decryptedStream contents. diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decryptedBytes..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decryptedBytes..st deleted file mode 100644 index 8b8ecaa..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decryptedBytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decryptedBytes: anObject - "Set the value of decryptedBytes" - - decryptedBytes := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decryptedBytes.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decryptedBytes.st deleted file mode 100644 index 0fae2df..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/decryptedBytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decryptedBytes - "Answer the value of decryptedBytes" - - ^ decryptedBytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/initializeFromFileContents..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/initializeFromFileContents..st deleted file mode 100644 index ac2800c..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/initializeFromFileContents..st +++ /dev/null @@ -1,19 +0,0 @@ -initialization -initializeFromFileContents: data - - | i j theData | - i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. - i = 0 ifTrue: [self bytes: data asByteArray. ^ self]. - i := data indexOfSubCollection: 'KEY--' startingAt: i. - i := data findAnySubStr: String crlf startingAt: i. - j := data findAnySubStr: String crlf startingAt: i + 1. - self processProcType: (data copyFrom: i + 1 to: j). - i := j. - j := data findAnySubStr: String crlf startingAt: i + 1. - self processDEKInfo: (data copyFrom: i + 1 to: j). - i := j. - j := data indexOfSubCollection: '--END ' startingAt: i. - theData := (data copyFrom: i to: j) - reject: [:c | (c = $-) or: [c isSeparator]]. - theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. - self bytes: theData. diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/iv..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/iv..st deleted file mode 100644 index da9cd8e..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/iv..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -iv: anObject - "Set the value of iv" - - iv := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/iv.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/iv.st deleted file mode 100644 index e198fdb..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/iv.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -iv - "Answer the value of iv" - - ^ iv \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/password..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/password..st deleted file mode 100644 index 432aa09..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/password..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -password: anObject - "Set the value of password" - - password := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/password.st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/password.st deleted file mode 100644 index 03b8c53..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/password.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -password - "Answer the value of password" - - ^ password \ No newline at end of file diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/processDEKInfo..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/processDEKInfo..st deleted file mode 100644 index 054acbd..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/processDEKInfo..st +++ /dev/null @@ -1,8 +0,0 @@ -initialization -processDEKInfo: data - - | stream algorithm | - stream := data readStream. - stream upTo: $:. - algorithm := (stream upTo: $,) withBlanksTrimmed. - self iv: (Integer readFrom: stream base: 16) asByteArray. diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/processProcType..st b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/processProcType..st deleted file mode 100644 index 539959d..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/instance/processProcType..st +++ /dev/null @@ -1,2 +0,0 @@ -initialization -processProcType: data diff --git a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/properties.json b/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/properties.json deleted file mode 100644 index c9f4684..0000000 --- a/source/ASN1-Readers.package/DSAPrivateKeyFileReader.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Readers", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "bytes", - "decryptedBytes", - "iv", - "password" - ], - "name" : "DSAPrivateKeyFileReader", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/README.md b/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/instance/derivedKeyFromPassword.salt.size..st b/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/instance/derivedKeyFromPassword.salt.size..st deleted file mode 100644 index 7e2c233..0000000 --- a/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/instance/derivedKeyFromPassword.salt.size..st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -derivedKeyFromPassword: password salt: salt size: size - - | result block digest | - result := ByteArray new. - digest := ByteArray new. - (size + 15 // 16) timesRepeat: [ - block := digest, password, salt. - digest := MD5 hashMessage: block. - result := result, digest]. - ^ result readStream next: size. - diff --git a/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/properties.json b/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/properties.json deleted file mode 100644 index 19577a9..0000000 --- a/source/ASN1-Readers.package/OpenSSLKeyDerivationFunction.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Readers", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "OpenSSLKeyDerivationFunction", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/README.md b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/class/fromFile..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/class/fromFile..st deleted file mode 100644 index 8960421..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/class/fromFile..st +++ /dev/null @@ -1,9 +0,0 @@ -instance creation -fromFile: filename - "(RSAPrivateKeyFileReader fromFile: '/usr/local/ssl/private/CA.key')" - "(RSAPrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/rsa.key')" - - | fs data | - fs := StandardFileStream fileNamed: filename. - data := fs contentsOfEntireFile. - ^ self new initializeFromFileContents: data. diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asASN1Value.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asASN1Value.st deleted file mode 100644 index 1591fd5..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asASN1Value.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asASN1Value - - self decryptedBytes isNil - ifTrue: [self decrypt]. - ^ ASN1Stream decodeBytes: self decryptedBytes. diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asPrivateKey.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asPrivateKey.st deleted file mode 100644 index 156e714..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asPrivateKey.st +++ /dev/null @@ -1,8 +0,0 @@ -converting -asPrivateKey - - | asn1 | - asn1 := self asASN1Value. - (asn1 at: 1) > 0 - ifTrue: [^ RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 1)]. - ^ RSAPrivateKey p: (asn1 at: 5) q: (asn1 at: 6) dP: (asn1 at: 7) dQ: (asn1 at: 8) qInv: (asn1 at: 9) \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asPublicKey.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asPublicKey.st deleted file mode 100644 index 1ffea12..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/asPublicKey.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asPublicKey - - | asn1 | - asn1 := self asASN1Value. - ^ RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 2) \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/bytes..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/bytes..st deleted file mode 100644 index 65abecd..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/bytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes: anObject - "Set the value of bytes" - - bytes := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/bytes.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/bytes.st deleted file mode 100644 index 93c857b..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/bytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes - "Answer the value of bytes" - - ^ bytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decrypt.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decrypt.st deleted file mode 100644 index 450c0f8..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decrypt.st +++ /dev/null @@ -1,18 +0,0 @@ -initialization -decrypt - - | cipher key block encryptedStream decryptedStream | - self password isNil - ifTrue: [self password: (FillInTheBlank requestPassword: 'Enter your password')]. - key := OpenSSLKeyDerivationFunction new - derivedKeyFromPassword: self password - salt: self iv - size: 24. - cipher := (TripleDES key: key) cbc initialVector: iv. - encryptedStream := self bytes readStream. - decryptedStream := ReadWriteStream on: (ByteArray new: encryptedStream size). - [encryptedStream atEnd] whileFalse: - [block := encryptedStream next: 8. - cipher decryptBlock: block. - decryptedStream nextPutAll: block]. - self decryptedBytes: decryptedStream contents. diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decryptedBytes..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decryptedBytes..st deleted file mode 100644 index 8b8ecaa..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decryptedBytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decryptedBytes: anObject - "Set the value of decryptedBytes" - - decryptedBytes := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decryptedBytes.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decryptedBytes.st deleted file mode 100644 index 0fae2df..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/decryptedBytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decryptedBytes - "Answer the value of decryptedBytes" - - ^ decryptedBytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/initializeFromFileContents..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/initializeFromFileContents..st deleted file mode 100644 index 6387df0..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/initializeFromFileContents..st +++ /dev/null @@ -1,19 +0,0 @@ -initialization -initializeFromFileContents: data - - | i j theData | - i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. - i = 0 ifTrue: [self derBytes: data asByteArray. ^ self]. - i := data indexOfSubCollection: 'KEY--' startingAt: i. - i := data findAnySubStr: String crlf startingAt: i. - j := data findAnySubStr: String crlf startingAt: i + 1. - self processProcType: (data copyFrom: i + 1 to: j). - i := j. - j := data findAnySubStr: String crlf startingAt: i + 1. - self processDEKInfo: (data copyFrom: i + 1 to: j). - i := j. - j := data indexOfSubCollection: '--END ' startingAt: i. - theData := (data copyFrom: i to: j) - reject: [:c | (c = $-) or: [c isSeparator]]. - theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. - self bytes: theData. diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/iv..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/iv..st deleted file mode 100644 index da9cd8e..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/iv..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -iv: anObject - "Set the value of iv" - - iv := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/iv.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/iv.st deleted file mode 100644 index e198fdb..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/iv.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -iv - "Answer the value of iv" - - ^ iv \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/password..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/password..st deleted file mode 100644 index 432aa09..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/password..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -password: anObject - "Set the value of password" - - password := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/password.st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/password.st deleted file mode 100644 index 03b8c53..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/password.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -password - "Answer the value of password" - - ^ password \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/processDEKInfo..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/processDEKInfo..st deleted file mode 100644 index 054acbd..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/processDEKInfo..st +++ /dev/null @@ -1,8 +0,0 @@ -initialization -processDEKInfo: data - - | stream algorithm | - stream := data readStream. - stream upTo: $:. - algorithm := (stream upTo: $,) withBlanksTrimmed. - self iv: (Integer readFrom: stream base: 16) asByteArray. diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/processProcType..st b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/processProcType..st deleted file mode 100644 index 539959d..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/instance/processProcType..st +++ /dev/null @@ -1,2 +0,0 @@ -initialization -processProcType: data diff --git a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/properties.json b/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/properties.json deleted file mode 100644 index e8e7353..0000000 --- a/source/ASN1-Readers.package/RSAPrivateKeyFileReader.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Readers", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "bytes", - "decryptedBytes", - "iv", - "password" - ], - "name" : "RSAPrivateKeyFileReader", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/README.md b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/class/fromFile..st b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/class/fromFile..st deleted file mode 100644 index 8960421..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/class/fromFile..st +++ /dev/null @@ -1,9 +0,0 @@ -instance creation -fromFile: filename - "(RSAPrivateKeyFileReader fromFile: '/usr/local/ssl/private/CA.key')" - "(RSAPrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/rsa.key')" - - | fs data | - fs := StandardFileStream fileNamed: filename. - data := fs contentsOfEntireFile. - ^ self new initializeFromFileContents: data. diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/asASN1Value.st b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/asASN1Value.st deleted file mode 100644 index d5f9bb4..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/asASN1Value.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asASN1Value - - | asn1 | - asn1 := ASN1Stream decodeBytes: self bytes. - ^ ASN1Stream decodeBytes: (asn1 at: 2) bytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/asPublicKey.st b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/asPublicKey.st deleted file mode 100644 index 49aa29f..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/asPublicKey.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asPublicKey - - | asn1 | - asn1 := self asASN1Value. - ^ RSAPublicKey exponent: (asn1 at: 2) modulo: (asn1 at: 1) \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/bytes..st b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/bytes..st deleted file mode 100644 index 65abecd..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/bytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes: anObject - "Set the value of bytes" - - bytes := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/bytes.st b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/bytes.st deleted file mode 100644 index 93c857b..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/bytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes - "Answer the value of bytes" - - ^ bytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/initializeFromFileContents..st b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/initializeFromFileContents..st deleted file mode 100644 index 120101d..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/instance/initializeFromFileContents..st +++ /dev/null @@ -1,19 +0,0 @@ -initialize-release -initializeFromFileContents: data - - | i j theData | - i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. - i = 0 ifTrue: [self derBytes: data asByteArray. ^ self]. - i := data indexOfSubCollection: 'KEY--' startingAt: i. - i := data findAnySubStr: String crlf startingAt: i. - j := data findAnySubStr: String crlf startingAt: i + 1. -" self processProcType: (data copyFrom: i + 1 to: j)." - i := j. - j := data findAnySubStr: String crlf startingAt: i + 1. -" self processDEKInfo: (data copyFrom: i + 1 to: j)." - i := j. - j := data indexOfSubCollection: '--END ' startingAt: i. - theData := (data copyFrom: i to: j) - reject: [:c | (c = $-) or: [c isSeparator]]. - theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. - self bytes: theData. diff --git a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/properties.json b/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/properties.json deleted file mode 100644 index 60c6070..0000000 --- a/source/ASN1-Readers.package/RSAPublicKeyFileReader.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Readers", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "bytes" - ], - "name" : "RSAPublicKeyFileReader", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/README.md b/source/ASN1-Readers.package/X509CertificateDerReader.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/class/fromDerBytes..st b/source/ASN1-Readers.package/X509CertificateDerReader.class/class/fromDerBytes..st deleted file mode 100644 index 6551022..0000000 --- a/source/ASN1-Readers.package/X509CertificateDerReader.class/class/fromDerBytes..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -fromDerBytes: bytes - - ^ self new - derBytes: bytes; - yourself. diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/class/fromFile..st b/source/ASN1-Readers.package/X509CertificateDerReader.class/class/fromFile..st deleted file mode 100644 index 8d26b15..0000000 --- a/source/ASN1-Readers.package/X509CertificateDerReader.class/class/fromFile..st +++ /dev/null @@ -1,11 +0,0 @@ -instance creation -fromFile: filename - "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/rsa.cert') asCertificate" - "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/dsa.cert') asCertificate" - "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/class3cacert.crt') asCertificate" - "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/class1cacert.crt') asCertificate" - - | fs data | - fs := StandardFileStream fileNamed: filename. - data := fs contentsOfEntireFile. - ^ self new initializeFromFileContents: data. diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/derBytes..st b/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/derBytes..st deleted file mode 100644 index 5e08be7..0000000 --- a/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/derBytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -derBytes: anObject - "Set the value of derBytes" - - derBytes := anObject \ No newline at end of file diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/derBytes.st b/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/derBytes.st deleted file mode 100644 index 4e6b749..0000000 --- a/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/derBytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -derBytes - "Answer the value of derBytes" - - ^ derBytes \ No newline at end of file diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/initializeFromFileContents..st b/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/initializeFromFileContents..st deleted file mode 100644 index 251dee0..0000000 --- a/source/ASN1-Readers.package/X509CertificateDerReader.class/instance/initializeFromFileContents..st +++ /dev/null @@ -1,15 +0,0 @@ -initialize-release -initializeFromFileContents: data - - | i j theData | - i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. - i = 0 - ifTrue: [theData := data reject: [:c | (c = $-) or: [c isSeparator]]] - ifFalse: [ - i := data indexOfSubCollection: 'CERTIFICATE--' startingAt: i. - j := data indexOfSubCollection: '--END ' startingAt: i. - i := data findAnySubStr: String crlf startingAt: i. - theData := (data copyFrom: i to: j) - reject: [:c | (c = $-) or: [c isSeparator]]]. - theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. - self derBytes: theData. diff --git a/source/ASN1-Readers.package/X509CertificateDerReader.class/properties.json b/source/ASN1-Readers.package/X509CertificateDerReader.class/properties.json deleted file mode 100644 index 64d236a..0000000 --- a/source/ASN1-Readers.package/X509CertificateDerReader.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Readers", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "derBytes" - ], - "name" : "X509CertificateDerReader", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Readers.package/monticello.meta/categories.st b/source/ASN1-Readers.package/monticello.meta/categories.st deleted file mode 100644 index 3b416d2..0000000 --- a/source/ASN1-Readers.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #'ASN1-Readers'! diff --git a/source/ASN1-Readers.package/monticello.meta/initializers.st b/source/ASN1-Readers.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Readers.package/monticello.meta/package b/source/ASN1-Readers.package/monticello.meta/package deleted file mode 100644 index e905b58..0000000 --- a/source/ASN1-Readers.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'ASN1-Readers') \ No newline at end of file diff --git a/source/ASN1-Readers.package/properties.json b/source/ASN1-Readers.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/ASN1-Readers.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/ASN1-Readers/DSAPrivateKeyFileReader.class.st b/source/ASN1-Readers/DSAPrivateKeyFileReader.class.st new file mode 100644 index 0000000..3ad8e34 --- /dev/null +++ b/source/ASN1-Readers/DSAPrivateKeyFileReader.class.st @@ -0,0 +1,165 @@ +Class { + #name : #DSAPrivateKeyFileReader, + #superclass : #Object, + #instVars : [ + 'bytes', + 'decryptedBytes', + 'iv', + 'password' + ], + #category : 'ASN1-Readers' +} + +{ #category : #'as yet unclassified' } +DSAPrivateKeyFileReader class >> fromFile: filename [ + "(DSAPrivateKeyFileReader fromFile: '/usr/local/ssl/private/dsa.key')" + "(DSAPrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/dsa.key')" + + | fs data | + fs := StandardFileStream fileNamed: filename. + data := fs contentsOfEntireFile. + ^ self new initializeFromFileContents: data. + +] + +{ #category : #converting } +DSAPrivateKeyFileReader >> asASN1Value [ + + self decryptedBytes isNil + ifTrue: [self decrypt]. + ^ ASN1Stream decodeBytes: self decryptedBytes + +] + +{ #category : #converting } +DSAPrivateKeyFileReader >> asPrivateKey [ + + | asn1 | + asn1 := self asASN1Value. + ^ DSAPrivateKey p: (asn1 at: 2) q: (asn1 at: 3) g: (asn1 at: 4) x: (asn1 at: 6). + +] + +{ #category : #converting } +DSAPrivateKeyFileReader >> asPublicKey [ + + | asn1 | + asn1 := self asASN1Value. + ^ DSAPublicKey p: (asn1 at: 2) q: (asn1 at: 3) g: (asn1 at: 4) y: (asn1 at: 5). + +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> bytes [ + "Answer the value of bytes" + + ^ bytes +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> bytes: anObject [ + "Set the value of bytes" + + bytes := anObject +] + +{ #category : #initialization } +DSAPrivateKeyFileReader >> decrypt [ + + | cipher key block encryptedStream decryptedStream | + self password isNil + ifTrue: [self password: (FillInTheBlank requestPassword: 'Enter your password')]. + key := OpenSSLKeyDerivationFunction new + derivedKeyFromPassword: self password + salt: self iv + size: 24. + cipher := (TripleDES key: key) cbc initialVector: iv. + encryptedStream := self bytes readStream. + decryptedStream := ReadWriteStream on: (ByteArray new: encryptedStream size). + [encryptedStream atEnd] whileFalse: + [block := encryptedStream next: 8. + cipher decryptBlock: block. + decryptedStream nextPutAll: block]. + self decryptedBytes: decryptedStream contents. + +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> decryptedBytes [ + "Answer the value of decryptedBytes" + + ^ decryptedBytes +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> decryptedBytes: anObject [ + "Set the value of decryptedBytes" + + decryptedBytes := anObject +] + +{ #category : #initialization } +DSAPrivateKeyFileReader >> initializeFromFileContents: data [ + + | i j theData | + i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. + i = 0 ifTrue: [self bytes: data asByteArray. ^ self]. + i := data indexOfSubCollection: 'KEY--' startingAt: i. + i := data findAnySubStr: String crlf startingAt: i. + j := data findAnySubStr: String crlf startingAt: i + 1. + self processProcType: (data copyFrom: i + 1 to: j). + i := j. + j := data findAnySubStr: String crlf startingAt: i + 1. + self processDEKInfo: (data copyFrom: i + 1 to: j). + i := j. + j := data indexOfSubCollection: '--END ' startingAt: i. + theData := (data copyFrom: i to: j) + reject: [:c | (c = $-) or: [c isSeparator]]. + theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. + self bytes: theData. + +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> iv [ + "Answer the value of iv" + + ^ iv +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> iv: anObject [ + "Set the value of iv" + + iv := anObject +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> password [ + "Answer the value of password" + + ^ password +] + +{ #category : #accessing } +DSAPrivateKeyFileReader >> password: anObject [ + "Set the value of password" + + password := anObject +] + +{ #category : #initialization } +DSAPrivateKeyFileReader >> processDEKInfo: data [ + + | stream algorithm | + stream := data readStream. + stream upTo: $:. + algorithm := (stream upTo: $,) withBlanksTrimmed. + self iv: (Integer readFrom: stream base: 16) asByteArray. + +] + +{ #category : #initialization } +DSAPrivateKeyFileReader >> processProcType: data [ + +] diff --git a/source/ASN1-Readers/OpenSSLKeyDerivationFunction.class.st b/source/ASN1-Readers/OpenSSLKeyDerivationFunction.class.st new file mode 100644 index 0000000..0bfb5a9 --- /dev/null +++ b/source/ASN1-Readers/OpenSSLKeyDerivationFunction.class.st @@ -0,0 +1,20 @@ +Class { + #name : #OpenSSLKeyDerivationFunction, + #superclass : #Object, + #category : 'ASN1-Readers' +} + +{ #category : #'as yet unclassified' } +OpenSSLKeyDerivationFunction >> derivedKeyFromPassword: password salt: salt size: size [ + + | result block digest | + result := ByteArray new. + digest := ByteArray new. + (size + 15 // 16) timesRepeat: [ + block := digest, password, salt. + digest := MD5 hashMessage: block. + result := result, digest]. + ^ result readStream next: size. + + +] diff --git a/source/ASN1-Readers/RSAPrivateKeyFileReader.class.st b/source/ASN1-Readers/RSAPrivateKeyFileReader.class.st new file mode 100644 index 0000000..3d8d37c --- /dev/null +++ b/source/ASN1-Readers/RSAPrivateKeyFileReader.class.st @@ -0,0 +1,165 @@ +Class { + #name : #RSAPrivateKeyFileReader, + #superclass : #Object, + #instVars : [ + 'bytes', + 'decryptedBytes', + 'iv', + 'password' + ], + #category : 'ASN1-Readers' +} + +{ #category : #'instance creation' } +RSAPrivateKeyFileReader class >> fromFile: filename [ + "(RSAPrivateKeyFileReader fromFile: '/usr/local/ssl/private/CA.key')" + "(RSAPrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/rsa.key')" + + | fs data | + fs := StandardFileStream fileNamed: filename. + data := fs contentsOfEntireFile. + ^ self new initializeFromFileContents: data. + +] + +{ #category : #converting } +RSAPrivateKeyFileReader >> asASN1Value [ + + self decryptedBytes isNil + ifTrue: [self decrypt]. + ^ ASN1Stream decodeBytes: self decryptedBytes. + +] + +{ #category : #converting } +RSAPrivateKeyFileReader >> asPrivateKey [ + + | asn1 | + asn1 := self asASN1Value. + (asn1 at: 1) > 0 + ifTrue: [^ RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 1)]. + ^ RSAPrivateKey p: (asn1 at: 5) q: (asn1 at: 6) dP: (asn1 at: 7) dQ: (asn1 at: 8) qInv: (asn1 at: 9) +] + +{ #category : #converting } +RSAPrivateKeyFileReader >> asPublicKey [ + + | asn1 | + asn1 := self asASN1Value. + ^ RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 2) +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> bytes [ + "Answer the value of bytes" + + ^ bytes +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> bytes: anObject [ + "Set the value of bytes" + + bytes := anObject +] + +{ #category : #initialization } +RSAPrivateKeyFileReader >> decrypt [ + + | cipher key block encryptedStream decryptedStream | + self password isNil + ifTrue: [self password: (FillInTheBlank requestPassword: 'Enter your password')]. + key := OpenSSLKeyDerivationFunction new + derivedKeyFromPassword: self password + salt: self iv + size: 24. + cipher := (TripleDES key: key) cbc initialVector: iv. + encryptedStream := self bytes readStream. + decryptedStream := ReadWriteStream on: (ByteArray new: encryptedStream size). + [encryptedStream atEnd] whileFalse: + [block := encryptedStream next: 8. + cipher decryptBlock: block. + decryptedStream nextPutAll: block]. + self decryptedBytes: decryptedStream contents. + +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> decryptedBytes [ + "Answer the value of decryptedBytes" + + ^ decryptedBytes +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> decryptedBytes: anObject [ + "Set the value of decryptedBytes" + + decryptedBytes := anObject +] + +{ #category : #initialization } +RSAPrivateKeyFileReader >> initializeFromFileContents: data [ + + | i j theData | + i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. + i = 0 ifTrue: [self derBytes: data asByteArray. ^ self]. + i := data indexOfSubCollection: 'KEY--' startingAt: i. + i := data findAnySubStr: String crlf startingAt: i. + j := data findAnySubStr: String crlf startingAt: i + 1. + self processProcType: (data copyFrom: i + 1 to: j). + i := j. + j := data findAnySubStr: String crlf startingAt: i + 1. + self processDEKInfo: (data copyFrom: i + 1 to: j). + i := j. + j := data indexOfSubCollection: '--END ' startingAt: i. + theData := (data copyFrom: i to: j) + reject: [:c | (c = $-) or: [c isSeparator]]. + theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. + self bytes: theData. + +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> iv [ + "Answer the value of iv" + + ^ iv +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> iv: anObject [ + "Set the value of iv" + + iv := anObject +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> password [ + "Answer the value of password" + + ^ password +] + +{ #category : #accessing } +RSAPrivateKeyFileReader >> password: anObject [ + "Set the value of password" + + password := anObject +] + +{ #category : #initialization } +RSAPrivateKeyFileReader >> processDEKInfo: data [ + + | stream algorithm | + stream := data readStream. + stream upTo: $:. + algorithm := (stream upTo: $,) withBlanksTrimmed. + self iv: (Integer readFrom: stream base: 16) asByteArray. + +] + +{ #category : #initialization } +RSAPrivateKeyFileReader >> processProcType: data [ + +] diff --git a/source/ASN1-Readers/RSAPublicKeyFileReader.class.st b/source/ASN1-Readers/RSAPublicKeyFileReader.class.st new file mode 100644 index 0000000..9d87c1c --- /dev/null +++ b/source/ASN1-Readers/RSAPublicKeyFileReader.class.st @@ -0,0 +1,72 @@ +Class { + #name : #RSAPublicKeyFileReader, + #superclass : #Object, + #instVars : [ + 'bytes' + ], + #category : 'ASN1-Readers' +} + +{ #category : #'instance creation' } +RSAPublicKeyFileReader class >> fromFile: filename [ + "(RSAPrivateKeyFileReader fromFile: '/usr/local/ssl/private/CA.key')" + "(RSAPrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/rsa.key')" + + | fs data | + fs := StandardFileStream fileNamed: filename. + data := fs contentsOfEntireFile. + ^ self new initializeFromFileContents: data. + +] + +{ #category : #converting } +RSAPublicKeyFileReader >> asASN1Value [ + + | asn1 | + asn1 := ASN1Stream decodeBytes: self bytes. + ^ ASN1Stream decodeBytes: (asn1 at: 2) bytes +] + +{ #category : #converting } +RSAPublicKeyFileReader >> asPublicKey [ + + | asn1 | + asn1 := self asASN1Value. + ^ RSAPublicKey exponent: (asn1 at: 2) modulo: (asn1 at: 1) +] + +{ #category : #accessing } +RSAPublicKeyFileReader >> bytes [ + "Answer the value of bytes" + + ^ bytes +] + +{ #category : #accessing } +RSAPublicKeyFileReader >> bytes: anObject [ + "Set the value of bytes" + + bytes := anObject +] + +{ #category : #'initialize-release' } +RSAPublicKeyFileReader >> initializeFromFileContents: data [ + + | i j theData | + i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. + i = 0 ifTrue: [self derBytes: data asByteArray. ^ self]. + i := data indexOfSubCollection: 'KEY--' startingAt: i. + i := data findAnySubStr: String crlf startingAt: i. + j := data findAnySubStr: String crlf startingAt: i + 1. +" self processProcType: (data copyFrom: i + 1 to: j)." + i := j. + j := data findAnySubStr: String crlf startingAt: i + 1. +" self processDEKInfo: (data copyFrom: i + 1 to: j)." + i := j. + j := data indexOfSubCollection: '--END ' startingAt: i. + theData := (data copyFrom: i to: j) + reject: [:c | (c = $-) or: [c isSeparator]]. + theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. + self bytes: theData. + +] diff --git a/source/ASN1-Readers/X509CertificateDerReader.class.st b/source/ASN1-Readers/X509CertificateDerReader.class.st new file mode 100644 index 0000000..7be9615 --- /dev/null +++ b/source/ASN1-Readers/X509CertificateDerReader.class.st @@ -0,0 +1,63 @@ +Class { + #name : #X509CertificateDerReader, + #superclass : #Object, + #instVars : [ + 'derBytes' + ], + #category : 'ASN1-Readers' +} + +{ #category : #'instance creation' } +X509CertificateDerReader class >> fromDerBytes: bytes [ + + ^ self new + derBytes: bytes; + yourself. + +] + +{ #category : #'instance creation' } +X509CertificateDerReader class >> fromFile: filename [ + "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/rsa.cert') asCertificate" + "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/dsa.cert') asCertificate" + "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/class3cacert.crt') asCertificate" + "(X509CertificateDerReader fromFile: '/Users/slosher/Desktop/squeak/certificates/class1cacert.crt') asCertificate" + + | fs data | + fs := StandardFileStream fileNamed: filename. + data := fs contentsOfEntireFile. + ^ self new initializeFromFileContents: data. + +] + +{ #category : #accessing } +X509CertificateDerReader >> derBytes [ + "Answer the value of derBytes" + + ^ derBytes +] + +{ #category : #accessing } +X509CertificateDerReader >> derBytes: anObject [ + "Set the value of derBytes" + + derBytes := anObject +] + +{ #category : #'initialize-release' } +X509CertificateDerReader >> initializeFromFileContents: data [ + + | i j theData | + i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. + i = 0 + ifTrue: [theData := data reject: [:c | (c = $-) or: [c isSeparator]]] + ifFalse: [ + i := data indexOfSubCollection: 'CERTIFICATE--' startingAt: i. + j := data indexOfSubCollection: '--END ' startingAt: i. + i := data findAnySubStr: String crlf startingAt: i. + theData := (data copyFrom: i to: j) + reject: [:c | (c = $-) or: [c isSeparator]]]. + theData := (Base64MimeConverter mimeDecodeToBytes: theData readStream) contents. + self derBytes: theData. + +] diff --git a/source/ASN1-Readers/package.st b/source/ASN1-Readers/package.st new file mode 100644 index 0000000..6ddfcb5 --- /dev/null +++ b/source/ASN1-Readers/package.st @@ -0,0 +1 @@ +Package { #name : #'ASN1-Readers' } diff --git a/source/ASN1-Tests.package/.filetree b/source/ASN1-Tests.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/ASN1-Tests.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/ASN1-Tests.package/ASN1TestModel.class/README.md b/source/ASN1-Tests.package/ASN1TestModel.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot1..st b/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot1..st deleted file mode 100644 index 3c5b49a..0000000 --- a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot1..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -testSlot1: anObject - "Set the value of testSlot1" - - testSlot1 := anObject \ No newline at end of file diff --git a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot1.st b/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot1.st deleted file mode 100644 index 0a466ff..0000000 --- a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot1.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -testSlot1 - "Answer the value of testSlot1" - - ^ testSlot1 \ No newline at end of file diff --git a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot2..st b/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot2..st deleted file mode 100644 index ac9914e..0000000 --- a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot2..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -testSlot2: anObject - "Set the value of testSlot2" - - testSlot2 := anObject \ No newline at end of file diff --git a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot2.st b/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot2.st deleted file mode 100644 index 52eb171..0000000 --- a/source/ASN1-Tests.package/ASN1TestModel.class/instance/testSlot2.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -testSlot2 - "Answer the value of testSlot2" - - ^ testSlot2 \ No newline at end of file diff --git a/source/ASN1-Tests.package/ASN1TestModel.class/properties.json b/source/ASN1-Tests.package/ASN1TestModel.class/properties.json deleted file mode 100644 index 8acc988..0000000 --- a/source/ASN1-Tests.package/ASN1TestModel.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "testSlot1", - "testSlot2" - ], - "name" : "ASN1TestModel", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/README.md b/source/ASN1-Tests.package/CryptoASN1Test.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBMPString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBMPString.st deleted file mode 100644 index 9f490b9..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBMPString.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testBMPString - - | bytes obj newBytes testObj | - bytes := #(30 11 104 101 108 108 111 32 119 111 114 108 100). - testObj := 'hello world'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseExplicitType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseExplicitType.st deleted file mode 100644 index 837f803..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseExplicitType.st +++ /dev/null @@ -1,12 +0,0 @@ -tests - defined types -testBaseExplicitType - - | bytes obj newBytes type | - (ASN1Module name: #test) explicit: #TestExplicit type: #ASN1IntegerType tag: 0. - - type := (ASN1Module name: #test) find: #TestExplicit. - bytes := #(160 4 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseImplicitConstructedType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseImplicitConstructedType.st deleted file mode 100644 index 636b681..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseImplicitConstructedType.st +++ /dev/null @@ -1,12 +0,0 @@ -tests - defined types -testBaseImplicitConstructedType - - | bytes obj newBytes type | - (ASN1Module name: #test) implicit: #TestImplicit type: #ASN1SequenceType tag: 0. - - type := (ASN1Module name: #test) find: #TestImplicit. - bytes := #(160 4 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj = (OrderedCollection with: 789)). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseImplicitPrimitiveType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseImplicitPrimitiveType.st deleted file mode 100644 index e023e6d..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBaseImplicitPrimitiveType.st +++ /dev/null @@ -1,12 +0,0 @@ -tests - defined types -testBaseImplicitPrimitiveType - - | bytes obj newBytes type | - (ASN1Module name: #test) implicit: #TestImplicit type: #ASN1IntegerType tag: 0. - - type := (ASN1Module name: #test) find: #TestImplicit. - bytes := #(128 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBitString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBitString.st deleted file mode 100644 index e6f3747..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBitString.st +++ /dev/null @@ -1,13 +0,0 @@ -tests - base -testBitString - - | bytes obj newBytes testObj | - bytes := #(3 3 3 168 121). - testObj := ASN1BitString new - bytes: #(168 121); - bitsPadding: 3; - yourself. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBoolean.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBoolean.st deleted file mode 100644 index 26155c7..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testBoolean.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testBoolean - - | bytes obj newBytes testObj | - bytes := #(1 1 255). - testObj := true. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testByteArray.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testByteArray.st deleted file mode 100644 index 6102fdb..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testByteArray.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testByteArray - - | bytes obj newBytes testObj | - bytes := #(4 5 3 21 55 43 76). - testObj := #(3 21 55 43 76) asByteArray. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedBMPString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedBMPString.st deleted file mode 100644 index 6241135..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedBMPString.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedBMPString - - | bytes obj testObj | - bytes := #(62 15 30 5 84 101 115 116 32 30 6 85 115 101 114 32 49). - testObj := 'Test User 1'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedBitString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedBitString.st deleted file mode 100644 index 4da7d27..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedBitString.st +++ /dev/null @@ -1,11 +0,0 @@ -tests - BER -testConstructedBitString - - | bytes obj testObj | - bytes := #(35 9 3 3 0 110 93 3 2 6 192). - testObj := ASN1BitString new - bytes: #(110 93 192) asByteArray; - bitsPadding: 6; - yourself. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedByteArray.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedByteArray.st deleted file mode 100644 index 5b68ac8..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedByteArray.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedByteArray - - | bytes obj testObj | - bytes := #(36 12 4 4 1 35 69 103 4 4 137 171 205 239). - testObj :=#(1 35 69 103 137 171 205 239) asByteArray. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedIA5String.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedIA5String.st deleted file mode 100644 index 4db6ead..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedIA5String.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedIA5String - - | bytes obj testObj | - bytes := #(54 15 22 5 84 101 115 116 32 22 6 85 115 101 114 32 49). - testObj := 'Test User 1'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedPrintableString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedPrintableString.st deleted file mode 100644 index cde4fb6..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedPrintableString.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedPrintableString - - | bytes obj testObj | - bytes := #(51 15 19 5 84 101 115 116 32 19 6 85 115 101 114 32 49). - testObj := 'Test User 1'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedTeletexString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedTeletexString.st deleted file mode 100644 index 62f0771..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedTeletexString.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedTeletexString - - | bytes obj testObj | - bytes := #(52 15 20 5 84 101 115 116 32 20 6 85 115 101 114 32 49). - testObj := 'Test User 1'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedUTF8String.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedUTF8String.st deleted file mode 100644 index c507a63..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedUTF8String.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedUTF8String - - | bytes obj testObj | - bytes := #(44 15 12 5 84 101 115 116 32 12 6 85 115 101 114 32 49). - testObj := 'Test User 1'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedUniversalString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedUniversalString.st deleted file mode 100644 index ccad52d..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testConstructedUniversalString.st +++ /dev/null @@ -1,8 +0,0 @@ -tests - BER -testConstructedUniversalString - - | bytes obj testObj | - bytes := #(60 15 28 5 84 101 115 116 32 28 6 85 115 101 114 32 49). - testObj := 'Test User 1'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedAnyDefinedByType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedAnyDefinedByType.st deleted file mode 100644 index fc51eda..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedAnyDefinedByType.st +++ /dev/null @@ -1,30 +0,0 @@ -tests - defined types -testDefinedAnyDefinedByType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1ObjectIdentifierType; - add: #testSlot2 type: #TestAnyDefinedBy; - yourself. - ((ASN1Module name: #test) any: #TestAnyDefinedBy definedBy: #testSlot1) - at: (ASN1ObjectId fromString: '1.1') put: #ASN1BooleanType; - at: (ASN1ObjectId fromString: '1.2') put: #ASN1IntegerType; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - - bytes := #(48 6 6 1 41 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = (ASN1ObjectId fromString: '1.1')). - self assert: (obj testSlot2 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). - - bytes := #(48 7 6 1 42 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = (ASN1ObjectId fromString: '1.2')). - self assert: (obj testSlot2 = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedAnyType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedAnyType.st deleted file mode 100644 index b20e258..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedAnyType.st +++ /dev/null @@ -1,23 +0,0 @@ -tests - defined types -testDefinedAnyType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1AnyType; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - - bytes := #(48 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). - - bytes := #(48 4 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedChoiceType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedChoiceType.st deleted file mode 100644 index 2c268bf..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedChoiceType.st +++ /dev/null @@ -1,27 +0,0 @@ -tests - defined types -testDefinedChoiceType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #TestChoice; - yourself. - ((ASN1Module name: #test) choice: #TestChoice) - add: #boolean type: #ASN1BooleanType; - add: #integer type: #ASN1IntegerType; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - - bytes := #(48 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). - - bytes := #(48 4 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedExplicitType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedExplicitType.st deleted file mode 100644 index 0d83fe8..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedExplicitType.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedExplicitType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1IntegerType explicitTag: 0; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 6 160 4 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedImplicitConstructedType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedImplicitConstructedType.st deleted file mode 100644 index 97641cc..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedImplicitConstructedType.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedImplicitConstructedType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1SequenceType implicitTag: 0; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 6 160 4 2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = (OrderedCollection with: 789)). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedImplicitPrimitiveType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedImplicitPrimitiveType.st deleted file mode 100644 index 2edd3bd..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedImplicitPrimitiveType.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedImplicitPrimitiveType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1IntegerType implicitTag: 0; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 4 128 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedBMPStringType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedBMPStringType.st deleted file mode 100644 index b306a8c..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedBMPStringType.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - mapped -testDefinedMappedBMPStringType - - | bytes obj newBytes type | - ((ASN1Module name: #test) mapped: #TestMapped) - mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1BMPStringType. - type := (ASN1Module name: #test) find: #TestMapped. - - bytes := #(30 11 104 101 108 108 111 32 119 111 114 108 100). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 'hello world'). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedBooleanType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedBooleanType.st deleted file mode 100644 index a58aaf4..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedBooleanType.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - mapped -testDefinedMappedBooleanType - - | bytes obj newBytes type | - ((ASN1Module name: #test) mapped: #TestMapped) - mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1BooleanType. - type := (ASN1Module name: #test) find: #TestMapped. - - bytes := #(1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedIntegerType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedIntegerType.st deleted file mode 100644 index 0e871c7..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedIntegerType.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - mapped -testDefinedMappedIntegerType - - | bytes obj newBytes type | - ((ASN1Module name: #test) mapped: #TestMapped) - mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1IntegerType. - type := (ASN1Module name: #test) find: #TestMapped. - - bytes := #(2 2 3 21). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 789). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedSequenceType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedSequenceType.st deleted file mode 100644 index e29306e..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedSequenceType.st +++ /dev/null @@ -1,17 +0,0 @@ -tests - mapped -testDefinedMappedSequenceType - - | bytes obj newBytes type | - ((ASN1Module name: #test) mapped: #TestMapped) - mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #TestSequence. - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1BooleanType. - type := (ASN1Module name: #test) find: #TestMapped. - - bytes := #(48 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 isKindOf: ASN1TestModel). - self assert: (obj testSlot1 testSlot1 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedUTF8StringType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedUTF8StringType.st deleted file mode 100644 index b53b741..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedMappedUTF8StringType.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - mapped -testDefinedMappedUTF8StringType - - | bytes obj newBytes type | - ((ASN1Module name: #test) mapped: #TestMapped) - mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1StringType. - type := (ASN1Module name: #test) find: #TestMapped. - - bytes := #(12 11 104 101 108 108 111 32 119 111 114 108 100). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = 'hello world'). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceOfType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceOfType.st deleted file mode 100644 index a665cb7..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceOfType.st +++ /dev/null @@ -1,13 +0,0 @@ -tests - defined types -testDefinedSequenceOfType - - | bytes obj newBytes type | - (ASN1Module name: #test) sequence: #TestSequence of: #ASN1BooleanType. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: OrderedCollection). - self assert: (obj first = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceType.st deleted file mode 100644 index 6e5926c..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceType.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedSequenceType - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1BooleanType; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeDefault.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeDefault.st deleted file mode 100644 index b4ec81d..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeDefault.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedSequenceTypeDefault - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1BooleanType default: false; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 0). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = false). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeOptional.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeOptional.st deleted file mode 100644 index 6b100bc..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeOptional.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - defined types -testDefinedSequenceTypeOptional - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - addOptional: #testSlot1 type: #ASN1BooleanType; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 0). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeOptionalDefault.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeOptionalDefault.st deleted file mode 100644 index 4eeb67c..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSequenceTypeOptionalDefault.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedSequenceTypeOptionalDefault - - | bytes obj newBytes type | - ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) - addOptional: #testSlot1 type: #ASN1BooleanType default: false; - yourself. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 0). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = false). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSetType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSetType.st deleted file mode 100644 index 442f94e..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedSetType.st +++ /dev/null @@ -1,15 +0,0 @@ -tests - defined types -testDefinedSetType - - | bytes obj newBytes type | - ((ASN1Module name: #test) set: #TestSet mapping: ASN1TestModel) - add: #testSlot1 type: #ASN1BooleanType; - yourself. - - type := (ASN1Module name: #test) find: #TestSet. - bytes := #(49 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: ASN1TestModel). - self assert: (obj testSlot1 = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedUnmappedSequenceType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedUnmappedSequenceType.st deleted file mode 100644 index 9c3a064..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedUnmappedSequenceType.st +++ /dev/null @@ -1,13 +0,0 @@ -tests - defined types -testDefinedUnmappedSequenceType - - | bytes obj newBytes type | - (ASN1Module name: #test) sequence: #TestSequence. - - type := (ASN1Module name: #test) find: #TestSequence. - bytes := #(48 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: OrderedCollection). - self assert: (obj first = true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedUnmappedSetType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedUnmappedSetType.st deleted file mode 100644 index 5acbc48..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testDefinedUnmappedSetType.st +++ /dev/null @@ -1,13 +0,0 @@ -tests - defined types -testDefinedUnmappedSetType - - | bytes obj newBytes type | - (ASN1Module name: #test) set: #TestSet. - - type := (ASN1Module name: #test) find: #TestSet. - bytes := #(49 3 1 1 255). - obj := ASN1Stream decodeBytes: bytes withType: type. - self assert: (obj isKindOf: OrderedSet). - self assert: (obj includes: true). - newBytes := ASN1Stream encode: obj withType: type. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testEqualsChecksType.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testEqualsChecksType.st deleted file mode 100644 index 2b78549..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testEqualsChecksType.st +++ /dev/null @@ -1,4 +0,0 @@ -tests - base -testEqualsChecksType - - self deny: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.8.5') = Object new diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testIA5String.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testIA5String.st deleted file mode 100644 index b088b90..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testIA5String.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testIA5String - - | bytes obj newBytes testObj | - bytes := #(22 11 104 101 108 108 111 32 119 111 114 108 100). - testObj := 'hello world'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testIndefiniteLengthSequence.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testIndefiniteLengthSequence.st deleted file mode 100644 index 136ae68..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testIndefiniteLengthSequence.st +++ /dev/null @@ -1,12 +0,0 @@ -tests - BER -testIndefiniteLengthSequence - - | bytes obj testObj | - bytes := #(48 128 1 1 255 2 2 3 21 4 2 108 100 0 0). - testObj := OrderedCollection new - add: true; - add: 789; - add: #(108 100) asByteArray; - yourself. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testInteger.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testInteger.st deleted file mode 100644 index 40ba655..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testInteger.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testInteger - - | bytes obj newBytes testObj | - bytes := #(2 2 3 21). - testObj := 789. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testNull.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testNull.st deleted file mode 100644 index 19af559..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testNull.st +++ /dev/null @@ -1,9 +0,0 @@ -tests - base -testNull - - | bytes obj newBytes | - bytes := #(5 0). - obj := ASN1Stream decodeBytes: bytes. - self assert: obj isNil. - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testObjectIdentifier.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testObjectIdentifier.st deleted file mode 100644 index b84328f..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testObjectIdentifier.st +++ /dev/null @@ -1,12 +0,0 @@ -tests - base -testObjectIdentifier - - | bytes obj newBytes testObj | - bytes := #(6 8 43 6 1 5 5 7 8 5). - testObj := ASN1ObjectId new - oid: '1.3.6.1.5.5.7.8.5'; - yourself. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testPrintableString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testPrintableString.st deleted file mode 100644 index 14dda86..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testPrintableString.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testPrintableString - - | bytes obj newBytes testObj | - bytes := #(19 11 104 101 108 108 111 32 119 111 114 108 100). - testObj := 'hello world'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testSequence.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testSequence.st deleted file mode 100644 index df8f0bd..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testSequence.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - base -testSequence - - | bytes obj newBytes testObj | - bytes := #(48 11 1 1 255 2 2 3 21 4 2 108 100). - testObj := OrderedCollection new - add: true; - add: 789; - add: #(108 100) asByteArray; - yourself. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testSet.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testSet.st deleted file mode 100644 index 261f373..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testSet.st +++ /dev/null @@ -1,14 +0,0 @@ -tests - base -testSet - - | bytes obj newBytes testObj | - bytes := #(49 11 1 1 255 4 2 108 100 2 2 3 21 ). - testObj := OrderedSet new - add: true; - add: #(108 100) asByteArray; - add: 789; - yourself. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testString.st deleted file mode 100644 index b783d56..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testString.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testString - - | bytes obj newBytes testObj | - bytes := #(12 11 104 101 108 108 111 32 119 111 114 108 100). - testObj := 'hello world'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testTeletexString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testTeletexString.st deleted file mode 100644 index e5ab080..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testTeletexString.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testTeletexString - - | bytes obj newBytes testObj | - bytes := #(20 11 104 101 108 108 111 32 119 111 114 108 100). - testObj := 'hello world'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testUTCTime.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testUTCTime.st deleted file mode 100644 index 2cd7a13..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testUTCTime.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testUTCTime - - | bytes obj newBytes testObj | - bytes := #(23 13 48 55 48 51 50 50 49 53 53 56 49 55 90). - obj := ASN1Stream decodeBytes: bytes. - testObj := DateAndTime fromString: '2007-03-22T15:58:17+00:00'. - self assert: obj rounded equals: testObj rounded. - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testUniversalString.st b/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testUniversalString.st deleted file mode 100644 index 5842d50..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/instance/testUniversalString.st +++ /dev/null @@ -1,10 +0,0 @@ -tests - base -testUniversalString - - | bytes obj newBytes testObj | - bytes := #(28 11 104 101 108 108 111 32 119 111 114 108 100). - testObj := 'hello world'. - obj := ASN1Stream decodeBytes: bytes. - self assert: (obj = testObj). - newBytes := ASN1Stream encode: obj. - self assert: (bytes asByteArray = newBytes). diff --git a/source/ASN1-Tests.package/CryptoASN1Test.class/properties.json b/source/ASN1-Tests.package/CryptoASN1Test.class/properties.json deleted file mode 100644 index a9c6234..0000000 --- a/source/ASN1-Tests.package/CryptoASN1Test.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "ASN1-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoASN1Test", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1-Tests.package/monticello.meta/categories.st b/source/ASN1-Tests.package/monticello.meta/categories.st deleted file mode 100644 index 6daa107..0000000 --- a/source/ASN1-Tests.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #'ASN1-Tests'! diff --git a/source/ASN1-Tests.package/monticello.meta/initializers.st b/source/ASN1-Tests.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1-Tests.package/monticello.meta/package b/source/ASN1-Tests.package/monticello.meta/package deleted file mode 100644 index 44f2dbf..0000000 --- a/source/ASN1-Tests.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'ASN1-Tests') \ No newline at end of file diff --git a/source/ASN1-Tests.package/properties.json b/source/ASN1-Tests.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/ASN1-Tests.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/ASN1-Tests/ASN1TestModel.class.st b/source/ASN1-Tests/ASN1TestModel.class.st new file mode 100644 index 0000000..6f3ecb8 --- /dev/null +++ b/source/ASN1-Tests/ASN1TestModel.class.st @@ -0,0 +1,37 @@ +Class { + #name : #ASN1TestModel, + #superclass : #Object, + #instVars : [ + 'testSlot1', + 'testSlot2' + ], + #category : 'ASN1-Tests' +} + +{ #category : #accessing } +ASN1TestModel >> testSlot1 [ + "Answer the value of testSlot1" + + ^ testSlot1 +] + +{ #category : #accessing } +ASN1TestModel >> testSlot1: anObject [ + "Set the value of testSlot1" + + testSlot1 := anObject +] + +{ #category : #accessing } +ASN1TestModel >> testSlot2 [ + "Answer the value of testSlot2" + + ^ testSlot2 +] + +{ #category : #accessing } +ASN1TestModel >> testSlot2: anObject [ + "Set the value of testSlot2" + + testSlot2 := anObject +] diff --git a/source/ASN1-Tests/CryptoASN1Test.class.st b/source/ASN1-Tests/CryptoASN1Test.class.st new file mode 100644 index 0000000..89f282d --- /dev/null +++ b/source/ASN1-Tests/CryptoASN1Test.class.st @@ -0,0 +1,738 @@ +Class { + #name : #CryptoASN1Test, + #superclass : #TestCase, + #category : 'ASN1-Tests' +} + +{ #category : #'tests - base' } +CryptoASN1Test >> testBMPString [ + + | bytes obj newBytes testObj | + bytes := #(30 11 104 101 108 108 111 32 119 111 114 108 100). + testObj := 'hello world'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testBaseExplicitType [ + + | bytes obj newBytes type | + (ASN1Module name: #test) explicit: #TestExplicit type: #ASN1IntegerType tag: 0. + + type := (ASN1Module name: #test) find: #TestExplicit. + bytes := #(160 4 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testBaseImplicitConstructedType [ + + | bytes obj newBytes type | + (ASN1Module name: #test) implicit: #TestImplicit type: #ASN1SequenceType tag: 0. + + type := (ASN1Module name: #test) find: #TestImplicit. + bytes := #(160 4 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj = (OrderedCollection with: 789)). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testBaseImplicitPrimitiveType [ + + | bytes obj newBytes type | + (ASN1Module name: #test) implicit: #TestImplicit type: #ASN1IntegerType tag: 0. + + type := (ASN1Module name: #test) find: #TestImplicit. + bytes := #(128 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testBitString [ + + | bytes obj newBytes testObj | + bytes := #(3 3 3 168 121). + testObj := ASN1BitString new + bytes: #(168 121); + bitsPadding: 3; + yourself. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testBoolean [ + + | bytes obj newBytes testObj | + bytes := #(1 1 255). + testObj := true. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testByteArray [ + + | bytes obj newBytes testObj | + bytes := #(4 5 3 21 55 43 76). + testObj := #(3 21 55 43 76) asByteArray. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedBMPString [ + + | bytes obj testObj | + bytes := #(62 15 30 5 84 101 115 116 32 30 6 85 115 101 114 32 49). + testObj := 'Test User 1'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedBitString [ + + | bytes obj testObj | + bytes := #(35 9 3 3 0 110 93 3 2 6 192). + testObj := ASN1BitString new + bytes: #(110 93 192) asByteArray; + bitsPadding: 6; + yourself. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedByteArray [ + + | bytes obj testObj | + bytes := #(36 12 4 4 1 35 69 103 4 4 137 171 205 239). + testObj :=#(1 35 69 103 137 171 205 239) asByteArray. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedIA5String [ + + | bytes obj testObj | + bytes := #(54 15 22 5 84 101 115 116 32 22 6 85 115 101 114 32 49). + testObj := 'Test User 1'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedPrintableString [ + + | bytes obj testObj | + bytes := #(51 15 19 5 84 101 115 116 32 19 6 85 115 101 114 32 49). + testObj := 'Test User 1'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedTeletexString [ + + | bytes obj testObj | + bytes := #(52 15 20 5 84 101 115 116 32 20 6 85 115 101 114 32 49). + testObj := 'Test User 1'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedUTF8String [ + + | bytes obj testObj | + bytes := #(44 15 12 5 84 101 115 116 32 12 6 85 115 101 114 32 49). + testObj := 'Test User 1'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testConstructedUniversalString [ + + | bytes obj testObj | + bytes := #(60 15 28 5 84 101 115 116 32 28 6 85 115 101 114 32 49). + testObj := 'Test User 1'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedAnyDefinedByType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1ObjectIdentifierType; + add: #testSlot2 type: #TestAnyDefinedBy; + yourself. + ((ASN1Module name: #test) any: #TestAnyDefinedBy definedBy: #testSlot1) + at: (ASN1ObjectId fromString: '1.1') put: #ASN1BooleanType; + at: (ASN1ObjectId fromString: '1.2') put: #ASN1IntegerType; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + + bytes := #(48 6 6 1 41 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = (ASN1ObjectId fromString: '1.1')). + self assert: (obj testSlot2 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + + bytes := #(48 7 6 1 42 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = (ASN1ObjectId fromString: '1.2')). + self assert: (obj testSlot2 = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedAnyType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1AnyType; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + + bytes := #(48 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + + bytes := #(48 4 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedChoiceType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #TestChoice; + yourself. + ((ASN1Module name: #test) choice: #TestChoice) + add: #boolean type: #ASN1BooleanType; + add: #integer type: #ASN1IntegerType; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + + bytes := #(48 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + + bytes := #(48 4 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedExplicitType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1IntegerType explicitTag: 0; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 6 160 4 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedImplicitConstructedType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1SequenceType implicitTag: 0; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 6 160 4 2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = (OrderedCollection with: 789)). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedImplicitPrimitiveType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1IntegerType implicitTag: 0; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 4 128 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - mapped' } +CryptoASN1Test >> testDefinedMappedBMPStringType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) mapped: #TestMapped) + mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1BMPStringType. + type := (ASN1Module name: #test) find: #TestMapped. + + bytes := #(30 11 104 101 108 108 111 32 119 111 114 108 100). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 'hello world'). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - mapped' } +CryptoASN1Test >> testDefinedMappedBooleanType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) mapped: #TestMapped) + mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1BooleanType. + type := (ASN1Module name: #test) find: #TestMapped. + + bytes := #(1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - mapped' } +CryptoASN1Test >> testDefinedMappedIntegerType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) mapped: #TestMapped) + mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1IntegerType. + type := (ASN1Module name: #test) find: #TestMapped. + + bytes := #(2 2 3 21). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 789). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - mapped' } +CryptoASN1Test >> testDefinedMappedSequenceType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) mapped: #TestMapped) + mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #TestSequence. + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1BooleanType. + type := (ASN1Module name: #test) find: #TestMapped. + + bytes := #(48 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 isKindOf: ASN1TestModel). + self assert: (obj testSlot1 testSlot1 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - mapped' } +CryptoASN1Test >> testDefinedMappedUTF8StringType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) mapped: #TestMapped) + mapping: ASN1TestModel mappingSymbol: #testSlot1 type: #ASN1StringType. + type := (ASN1Module name: #test) find: #TestMapped. + + bytes := #(12 11 104 101 108 108 111 32 119 111 114 108 100). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = 'hello world'). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedSequenceOfType [ + + | bytes obj newBytes type | + (ASN1Module name: #test) sequence: #TestSequence of: #ASN1BooleanType. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: OrderedCollection). + self assert: (obj first = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedSequenceType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1BooleanType; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedSequenceTypeDefault [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1BooleanType default: false; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 0). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = false). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedSequenceTypeOptional [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + addOptional: #testSlot1 type: #ASN1BooleanType; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 0). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedSequenceTypeOptionalDefault [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) sequence: #TestSequence mapping: ASN1TestModel) + addOptional: #testSlot1 type: #ASN1BooleanType default: false; + yourself. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 0). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = false). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedSetType [ + + | bytes obj newBytes type | + ((ASN1Module name: #test) set: #TestSet mapping: ASN1TestModel) + add: #testSlot1 type: #ASN1BooleanType; + yourself. + + type := (ASN1Module name: #test) find: #TestSet. + bytes := #(49 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: ASN1TestModel). + self assert: (obj testSlot1 = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedUnmappedSequenceType [ + + | bytes obj newBytes type | + (ASN1Module name: #test) sequence: #TestSequence. + + type := (ASN1Module name: #test) find: #TestSequence. + bytes := #(48 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: OrderedCollection). + self assert: (obj first = true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - defined types' } +CryptoASN1Test >> testDefinedUnmappedSetType [ + + | bytes obj newBytes type | + (ASN1Module name: #test) set: #TestSet. + + type := (ASN1Module name: #test) find: #TestSet. + bytes := #(49 3 1 1 255). + obj := ASN1Stream decodeBytes: bytes withType: type. + self assert: (obj isKindOf: OrderedSet). + self assert: (obj includes: true). + newBytes := ASN1Stream encode: obj withType: type. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testEqualsChecksType [ + + self deny: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.8.5') = Object new + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testIA5String [ + + | bytes obj newBytes testObj | + bytes := #(22 11 104 101 108 108 111 32 119 111 114 108 100). + testObj := 'hello world'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - BER' } +CryptoASN1Test >> testIndefiniteLengthSequence [ + + | bytes obj testObj | + bytes := #(48 128 1 1 255 2 2 3 21 4 2 108 100 0 0). + testObj := OrderedCollection new + add: true; + add: 789; + add: #(108 100) asByteArray; + yourself. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testInteger [ + + | bytes obj newBytes testObj | + bytes := #(2 2 3 21). + testObj := 789. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testNull [ + + | bytes obj newBytes | + bytes := #(5 0). + obj := ASN1Stream decodeBytes: bytes. + self assert: obj isNil. + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testObjectIdentifier [ + + | bytes obj newBytes testObj | + bytes := #(6 8 43 6 1 5 5 7 8 5). + testObj := ASN1ObjectId new + oid: '1.3.6.1.5.5.7.8.5'; + yourself. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testPrintableString [ + + | bytes obj newBytes testObj | + bytes := #(19 11 104 101 108 108 111 32 119 111 114 108 100). + testObj := 'hello world'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testSequence [ + + | bytes obj newBytes testObj | + bytes := #(48 11 1 1 255 2 2 3 21 4 2 108 100). + testObj := OrderedCollection new + add: true; + add: 789; + add: #(108 100) asByteArray; + yourself. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testSet [ + + | bytes obj newBytes testObj | + bytes := #(49 11 1 1 255 4 2 108 100 2 2 3 21 ). + testObj := OrderedSet new + add: true; + add: #(108 100) asByteArray; + add: 789; + yourself. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testString [ + + | bytes obj newBytes testObj | + bytes := #(12 11 104 101 108 108 111 32 119 111 114 108 100). + testObj := 'hello world'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testTeletexString [ + + | bytes obj newBytes testObj | + bytes := #(20 11 104 101 108 108 111 32 119 111 114 108 100). + testObj := 'hello world'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testUTCTime [ + + | bytes obj newBytes testObj | + bytes := #(23 13 48 55 48 51 50 50 49 53 53 56 49 55 90). + obj := ASN1Stream decodeBytes: bytes. + testObj := DateAndTime fromString: '2007-03-22T15:58:17+00:00'. + self assert: obj rounded equals: testObj rounded. + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] + +{ #category : #'tests - base' } +CryptoASN1Test >> testUniversalString [ + + | bytes obj newBytes testObj | + bytes := #(28 11 104 101 108 108 111 32 119 111 114 108 100). + testObj := 'hello world'. + obj := ASN1Stream decodeBytes: bytes. + self assert: (obj = testObj). + newBytes := ASN1Stream encode: obj. + self assert: (bytes asByteArray = newBytes). + +] diff --git a/source/ASN1-Tests/package.st b/source/ASN1-Tests/package.st new file mode 100644 index 0000000..101d177 --- /dev/null +++ b/source/ASN1-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'ASN1-Tests' } diff --git a/source/ASN1.package/.filetree b/source/ASN1.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/ASN1.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/README.md b/source/ASN1.package/ASN1AbstractString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1AbstractString.class/class/fromString..st b/source/ASN1.package/ASN1AbstractString.class/class/fromString..st deleted file mode 100644 index a94f8ff..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/class/fromString..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -fromString: aString - - ^ self new - string: aString; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/^comma.st b/source/ASN1.package/ASN1AbstractString.class/instance/^comma.st deleted file mode 100644 index 9365832..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/^comma.st +++ /dev/null @@ -1,6 +0,0 @@ -printing -, aString - - ^ self class new - string: self string, aString string; - yourself diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/^equals.st b/source/ASN1.package/ASN1AbstractString.class/instance/^equals.st deleted file mode 100644 index a564048..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/^equals.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -= aString - - ^ self asString = aString asString diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/asString.st b/source/ASN1.package/ASN1AbstractString.class/instance/asString.st deleted file mode 100644 index 78bb837..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/asString.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -asString - - ^ self string \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/hash.st b/source/ASN1.package/ASN1AbstractString.class/instance/hash.st deleted file mode 100644 index a35cd1e..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/hash.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -hash - - ^ self asString hash \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/initialize.st b/source/ASN1.package/ASN1AbstractString.class/instance/initialize.st deleted file mode 100644 index 42b01c9..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initialize - - self string: ''. diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/printOn..st b/source/ASN1.package/ASN1AbstractString.class/instance/printOn..st deleted file mode 100644 index 7287303..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/printOn..st +++ /dev/null @@ -1,5 +0,0 @@ -printing -printOn: aStream - - self string printOn: aStream. - \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/string..st b/source/ASN1.package/ASN1AbstractString.class/instance/string..st deleted file mode 100644 index 41f5094..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/string..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -string: anObject - "Set the value of string" - - string := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/instance/string.st b/source/ASN1.package/ASN1AbstractString.class/instance/string.st deleted file mode 100644 index 1b9f672..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/instance/string.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -string - "Answer the value of string" - - ^ string \ No newline at end of file diff --git a/source/ASN1.package/ASN1AbstractString.class/properties.json b/source/ASN1.package/ASN1AbstractString.class/properties.json deleted file mode 100644 index fe2e321..0000000 --- a/source/ASN1.package/ASN1AbstractString.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Value", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "string" - ], - "name" : "ASN1AbstractString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/README.md b/source/ASN1.package/ASN1AnyDefinedByType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/at..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/at..st deleted file mode 100644 index 7aef67c..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/at..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -at: key - - ^self typeMap at: key ifAbsent: [self defaultType] \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/at.put..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/at.put..st deleted file mode 100644 index f7eac10..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/at.put..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -at: key put: typeSpec - - ^self typeMap at: key put: (self typeFrom: typeSpec) \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/decodeWithDERStream..st deleted file mode 100644 index bb5aaf3..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeWithDERStream: derStream - - self error: 'must decode in the scope of a structured container'. diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/decodeWithDERStream.owner.ownerType..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/decodeWithDERStream.owner.ownerType..st deleted file mode 100644 index a558af7..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/decodeWithDERStream.owner.ownerType..st +++ /dev/null @@ -1,8 +0,0 @@ -decoding -decodeWithDERStream: derStream owner: owner ownerType: ownerType - - | keyValue type | - keyValue := (ownerType elementWithSymbol: self definedBy) - valueFrom: owner. - type := self at: keyValue. - ^ type decodeWithDERStream: derStream. diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/defaultType..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/defaultType..st deleted file mode 100644 index 3c66e65..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/defaultType..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -defaultType: anObject - "Set the value of defaultType" - - defaultType := self typeFrom: anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/defaultType.st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/defaultType.st deleted file mode 100644 index 328d331..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/defaultType.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -defaultType - "Answer the value of defaultType" - - ^ defaultType \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/definedBy..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/definedBy..st deleted file mode 100644 index d902e96..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/definedBy..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -definedBy: anObject - "Set the value of definedBy" - - definedBy := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/definedBy.st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/definedBy.st deleted file mode 100644 index d38773d..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/definedBy.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -definedBy - "Answer the value of definedBy" - - ^ definedBy \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/encode.withDERStream..st deleted file mode 100644 index ca28bcb..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: obj withDERStream: derStream - - self error: 'must encode in the scope of a structured container'. diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/encode.withDERStream.owner.ownerType..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/encode.withDERStream.owner.ownerType..st deleted file mode 100644 index c1d309c..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/encode.withDERStream.owner.ownerType..st +++ /dev/null @@ -1,8 +0,0 @@ -encoding -encode: anObject withDERStream: derStream owner: owner ownerType: ownerType - - | keyValue type | - keyValue := (ownerType elementWithSymbol: self definedBy) - valueFrom: owner. - type := self at: keyValue. - ^ type encode: anObject withDERStream: derStream. diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/initialize.st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/initialize.st deleted file mode 100644 index c2a69a1..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initialize - - self typeMap: Dictionary new. diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/matchesTag..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/matchesTag..st deleted file mode 100644 index 5c2160e..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/matchesTag..st +++ /dev/null @@ -1,6 +0,0 @@ -testing -matchesTag: anInteger - - ^ (self typeMap - detect: [:each | each matchesTag: anInteger] - ifNone: [nil]) notNil diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/typeMap..st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/typeMap..st deleted file mode 100644 index 327cae7..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/typeMap..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -typeMap: anObject - "Set the value of typeMap" - - typeMap := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/typeMap.st b/source/ASN1.package/ASN1AnyDefinedByType.class/instance/typeMap.st deleted file mode 100644 index ebd8c4c..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/instance/typeMap.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -typeMap - "Answer the value of typeMap" - - ^ typeMap \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyDefinedByType.class/properties.json b/source/ASN1.package/ASN1AnyDefinedByType.class/properties.json deleted file mode 100644 index 96c782a..0000000 --- a/source/ASN1.package/ASN1AnyDefinedByType.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "definedBy", - "typeMap", - "defaultType" - ], - "name" : "ASN1AnyDefinedByType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyType.class/README.md b/source/ASN1.package/ASN1AnyType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1AnyType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1AnyType.class/instance/decodeWithDERStream..st deleted file mode 100644 index dd536bd..0000000 --- a/source/ASN1.package/ASN1AnyType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeWithDERStream: derStream - - ^ derStream decode. diff --git a/source/ASN1.package/ASN1AnyType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1AnyType.class/instance/encode.withDERStream..st deleted file mode 100644 index 9e5f2b6..0000000 --- a/source/ASN1.package/ASN1AnyType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - derStream encode: anObject. diff --git a/source/ASN1.package/ASN1AnyType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1AnyType.class/instance/isTypeFor..st deleted file mode 100644 index 444a40f..0000000 --- a/source/ASN1.package/ASN1AnyType.class/instance/isTypeFor..st +++ /dev/null @@ -1,6 +0,0 @@ -testing -isTypeFor: anObject - - ^ (ASN1Stream tagToTypeDispatchTable - detect: [:eachType | eachType isTypeFor: anObject] - ifNone: [nil]) notNil diff --git a/source/ASN1.package/ASN1AnyType.class/instance/matchesTag..st b/source/ASN1.package/ASN1AnyType.class/instance/matchesTag..st deleted file mode 100644 index 8c480a6..0000000 --- a/source/ASN1.package/ASN1AnyType.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^ (anInteger bitAnd: 2r11000000) isZero diff --git a/source/ASN1.package/ASN1AnyType.class/instance/tag.st b/source/ASN1.package/ASN1AnyType.class/instance/tag.st deleted file mode 100644 index d2e0f93..0000000 --- a/source/ASN1.package/ASN1AnyType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ nil \ No newline at end of file diff --git a/source/ASN1.package/ASN1AnyType.class/properties.json b/source/ASN1.package/ASN1AnyType.class/properties.json deleted file mode 100644 index 6cd99d3..0000000 --- a/source/ASN1.package/ASN1AnyType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1AnyType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1AssignmentSubType.class/README.md b/source/ASN1.package/ASN1AssignmentSubType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1AssignmentSubType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1AssignmentSubType.class/instance/decodeWithDERStream..st deleted file mode 100644 index 4654a10..0000000 --- a/source/ASN1.package/ASN1AssignmentSubType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeWithDERStream: derStream - - ^ self parent decodeWithDERStream: derStream. diff --git a/source/ASN1.package/ASN1AssignmentSubType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1AssignmentSubType.class/instance/encode.withDERStream..st deleted file mode 100644 index c4563c3..0000000 --- a/source/ASN1.package/ASN1AssignmentSubType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - ^ self parent encode: anObject withDERStream: derStream. diff --git a/source/ASN1.package/ASN1AssignmentSubType.class/instance/matchesTag..st b/source/ASN1.package/ASN1AssignmentSubType.class/instance/matchesTag..st deleted file mode 100644 index 5060fa4..0000000 --- a/source/ASN1.package/ASN1AssignmentSubType.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^ self parent matchesTag: anInteger \ No newline at end of file diff --git a/source/ASN1.package/ASN1AssignmentSubType.class/properties.json b/source/ASN1.package/ASN1AssignmentSubType.class/properties.json deleted file mode 100644 index e4bbea2..0000000 --- a/source/ASN1.package/ASN1AssignmentSubType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1SubType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1AssignmentSubType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1BMPString.class/README.md b/source/ASN1.package/ASN1BMPString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1BMPString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1BMPString.class/instance/asn1Tag.st deleted file mode 100644 index f3eece7..0000000 --- a/source/ASN1.package/ASN1BMPString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -asn1Tag - - ^ 30 \ No newline at end of file diff --git a/source/ASN1.package/ASN1BMPString.class/properties.json b/source/ASN1.package/ASN1BMPString.class/properties.json deleted file mode 100644 index 254e7ba..0000000 --- a/source/ASN1.package/ASN1BMPString.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1BMPString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1BMPStringType.class/README.md b/source/ASN1.package/ASN1BMPStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1BMPStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1BMPStringType.class/instance/isTypeFor..st deleted file mode 100644 index 8a90a85..0000000 --- a/source/ASN1.package/ASN1BMPStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1BMPString \ No newline at end of file diff --git a/source/ASN1.package/ASN1BMPStringType.class/instance/tag.st b/source/ASN1.package/ASN1BMPStringType.class/instance/tag.st deleted file mode 100644 index e7dfdcb..0000000 --- a/source/ASN1.package/ASN1BMPStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 30 \ No newline at end of file diff --git a/source/ASN1.package/ASN1BMPStringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1BMPStringType.class/instance/wrapperClass.st deleted file mode 100644 index 9a7455b..0000000 --- a/source/ASN1.package/ASN1BMPStringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1BMPString diff --git a/source/ASN1.package/ASN1BMPStringType.class/properties.json b/source/ASN1.package/ASN1BMPStringType.class/properties.json deleted file mode 100644 index 5742c36..0000000 --- a/source/ASN1.package/ASN1BMPStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1BMPStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1BasicType.class/README.md b/source/ASN1.package/ASN1BasicType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1BasicType.class/properties.json b/source/ASN1.package/ASN1BasicType.class/properties.json deleted file mode 100644 index 90fc9d9..0000000 --- a/source/ASN1.package/ASN1BasicType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Type", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1BasicType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/README.md b/source/ASN1.package/ASN1BitString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1BitString.class/class/fromByteArray..st b/source/ASN1.package/ASN1BitString.class/class/fromByteArray..st deleted file mode 100644 index 93d2fd9..0000000 --- a/source/ASN1.package/ASN1BitString.class/class/fromByteArray..st +++ /dev/null @@ -1,6 +0,0 @@ -asn -fromByteArray: bytes - - ^ self new - bytes: bytes; - yourself. diff --git a/source/ASN1.package/ASN1BitString.class/instance/^comma.st b/source/ASN1.package/ASN1BitString.class/instance/^comma.st deleted file mode 100644 index f22befb..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/^comma.st +++ /dev/null @@ -1,7 +0,0 @@ -initialize-release -, bitString - - ^ self class new - bytes: self bytes, bitString bytes; - bitsPadding: bitString bitsPadding; - yourself. diff --git a/source/ASN1.package/ASN1BitString.class/instance/^equals.st b/source/ASN1.package/ASN1BitString.class/instance/^equals.st deleted file mode 100644 index e3b7d9f..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/^equals.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -= anotherBitString - - ^ self bytes = anotherBitString bytes \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1BitString.class/instance/asn1Tag.st deleted file mode 100644 index cd0127e..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 3 diff --git a/source/ASN1.package/ASN1BitString.class/instance/bitsPadding..st b/source/ASN1.package/ASN1BitString.class/instance/bitsPadding..st deleted file mode 100644 index 43e232e..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/bitsPadding..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bitsPadding: anObject - "Set the value of bitsPadding" - - bitsPadding := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/instance/bitsPadding.st b/source/ASN1.package/ASN1BitString.class/instance/bitsPadding.st deleted file mode 100644 index 1e7566a..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/bitsPadding.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bitsPadding - "Answer the value of bitsPadding" - - ^ bitsPadding \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/instance/bytes..st b/source/ASN1.package/ASN1BitString.class/instance/bytes..st deleted file mode 100644 index a3e369e..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/bytes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes: anObject - "Set the receiver's instance variable bytes to anObject." - - bytes := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/instance/bytes.st b/source/ASN1.package/ASN1BitString.class/instance/bytes.st deleted file mode 100644 index d918340..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/bytes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bytes - "Answer the receiver's instance variable bytes." - - ^bytes \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/instance/initialize.st b/source/ASN1.package/ASN1BitString.class/instance/initialize.st deleted file mode 100644 index 47a981f..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -initialize-release -initialize - - self bitsPadding: 0. - self bytes: (ByteArray new). diff --git a/source/ASN1.package/ASN1BitString.class/instance/printOn..st b/source/ASN1.package/ASN1BitString.class/instance/printOn..st deleted file mode 100644 index dd0f024..0000000 --- a/source/ASN1.package/ASN1BitString.class/instance/printOn..st +++ /dev/null @@ -1,6 +0,0 @@ -private - parsing -printOn: aStream - - 1 to: bytes size - 1 do: [:idx | - aStream nextPutAll: ((self bytes at: idx) printStringBase: 2)]. - aStream nextPutAll: ((160 printStringBase: 2) copyFrom: 1 to: (8 - self bitsPadding)) \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitString.class/properties.json b/source/ASN1.package/ASN1BitString.class/properties.json deleted file mode 100644 index 69fa48b..0000000 --- a/source/ASN1.package/ASN1BitString.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Value", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "bytes", - "bitsPadding" - ], - "name" : "ASN1BitString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitStringType.class/README.md b/source/ASN1.package/ASN1BitStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1BitStringType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1BitStringType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 44e69e9..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,8 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | bitString | - bitString := ASN1BitString new. - bitString bitsPadding: derStream next. - bitString bytes: (derStream next: length - 1). - ^ bitString diff --git a/source/ASN1.package/ASN1BitStringType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1BitStringType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 7f6377c..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,6 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - derStream - nextPut: anObject bitsPadding; - nextPutAll: anObject bytes asByteArray. diff --git a/source/ASN1.package/ASN1BitStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1BitStringType.class/instance/isTypeFor..st deleted file mode 100644 index 1d322f2..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1BitString \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitStringType.class/instance/octetsClass.st b/source/ASN1.package/ASN1BitStringType.class/instance/octetsClass.st deleted file mode 100644 index 2eff954..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/instance/octetsClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -octetsClass - - ^ ASN1BitString \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitStringType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1BitStringType.class/instance/sizeOfObject..st deleted file mode 100644 index eea99c8..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ anObject bytes size + 1 \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitStringType.class/instance/tag.st b/source/ASN1.package/ASN1BitStringType.class/instance/tag.st deleted file mode 100644 index 49f5581..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 3 \ No newline at end of file diff --git a/source/ASN1.package/ASN1BitStringType.class/properties.json b/source/ASN1.package/ASN1BitStringType.class/properties.json deleted file mode 100644 index 43c60d8..0000000 --- a/source/ASN1.package/ASN1BitStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1OctetsType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1BitStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1BooleanType.class/README.md b/source/ASN1.package/ASN1BooleanType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1BooleanType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1BooleanType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index cc4bc60..0000000 --- a/source/ASN1.package/ASN1BooleanType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - ^ derStream next > 0 \ No newline at end of file diff --git a/source/ASN1.package/ASN1BooleanType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1BooleanType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 6b788dc..0000000 --- a/source/ASN1.package/ASN1BooleanType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,6 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - anObject - ifTrue: [derStream nextPut: 255] - ifFalse: [derStream nextPut: 0]. diff --git a/source/ASN1.package/ASN1BooleanType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1BooleanType.class/instance/isTypeFor..st deleted file mode 100644 index 30f147e..0000000 --- a/source/ASN1.package/ASN1BooleanType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: Boolean \ No newline at end of file diff --git a/source/ASN1.package/ASN1BooleanType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1BooleanType.class/instance/sizeOfObject..st deleted file mode 100644 index 163f23e..0000000 --- a/source/ASN1.package/ASN1BooleanType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ 1 diff --git a/source/ASN1.package/ASN1BooleanType.class/instance/tag.st b/source/ASN1.package/ASN1BooleanType.class/instance/tag.st deleted file mode 100644 index 81194b3..0000000 --- a/source/ASN1.package/ASN1BooleanType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 1 \ No newline at end of file diff --git a/source/ASN1.package/ASN1BooleanType.class/properties.json b/source/ASN1.package/ASN1BooleanType.class/properties.json deleted file mode 100644 index c89d39c..0000000 --- a/source/ASN1.package/ASN1BooleanType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1BooleanType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ByteArrayType.class/README.md b/source/ASN1.package/ASN1ByteArrayType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ByteArrayType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1ByteArrayType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 14faa66..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - ^(derStream next: length) asByteArray \ No newline at end of file diff --git a/source/ASN1.package/ASN1ByteArrayType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1ByteArrayType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 0e10a3f..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - derStream nextPutAll: anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ByteArrayType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1ByteArrayType.class/instance/isTypeFor..st deleted file mode 100644 index 08181ff..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ByteArray \ No newline at end of file diff --git a/source/ASN1.package/ASN1ByteArrayType.class/instance/octetsClass.st b/source/ASN1.package/ASN1ByteArrayType.class/instance/octetsClass.st deleted file mode 100644 index 10593b1..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/instance/octetsClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -octetsClass - - ^ ByteArray \ No newline at end of file diff --git a/source/ASN1.package/ASN1ByteArrayType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1ByteArrayType.class/instance/sizeOfObject..st deleted file mode 100644 index 8acdfe1..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ anObject size diff --git a/source/ASN1.package/ASN1ByteArrayType.class/instance/tag.st b/source/ASN1.package/ASN1ByteArrayType.class/instance/tag.st deleted file mode 100644 index f501b33..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 4 \ No newline at end of file diff --git a/source/ASN1.package/ASN1ByteArrayType.class/properties.json b/source/ASN1.package/ASN1ByteArrayType.class/properties.json deleted file mode 100644 index cef3315..0000000 --- a/source/ASN1.package/ASN1ByteArrayType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1OctetsType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1ByteArrayType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/README.md b/source/ASN1.package/ASN1ChoiceElement.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/addedTo..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/addedTo..st deleted file mode 100644 index 2b7fbf7..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/addedTo..st +++ /dev/null @@ -1,4 +0,0 @@ -private -addedTo: aType - - owner := aType. diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/decodeWithDERStream..st deleted file mode 100644 index bc5ea18..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,9 +0,0 @@ -decoding -decodeWithDERStream: derStream - - | tag | - derStream atEnd ifTrue: [^ self error: 'missing element']. - tag := derStream peekTag. - (self matchesTag: tag) - ifTrue: [^ type decodeWithDERStream: derStream] - ifFalse: [^ self error: 'bad choice']. diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/encode.withDERStream..st deleted file mode 100644 index f0515fc..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - self type encode: anObject withDERStream: derStream. \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/explicitTag..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/explicitTag..st deleted file mode 100644 index e48ef54..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/explicitTag..st +++ /dev/null @@ -1,5 +0,0 @@ -subtype utilities -explicitTag: integer - - self type: self type explicitSubType. - ^ self type tag: integer. diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/implicitTag..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/implicitTag..st deleted file mode 100644 index f8f4659..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/implicitTag..st +++ /dev/null @@ -1,5 +0,0 @@ -subtype utilities -implicitTag: integer - - self type: self type implicitSubType. - ^ self type tag: integer. diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/isTypeFor..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/isTypeFor..st deleted file mode 100644 index 7c9e373..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^self type isTypeFor: anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/matchesTag..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/matchesTag..st deleted file mode 100644 index 5df294c..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^self type matchesTag: anInteger \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/owner..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/owner..st deleted file mode 100644 index c96a4df..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/owner..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -owner: anObject - "Set the value of owner" - - owner := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/owner.st b/source/ASN1.package/ASN1ChoiceElement.class/instance/owner.st deleted file mode 100644 index ebce9d4..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/owner.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -owner - "Answer the value of owner" - - ^ owner \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/symbol..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/symbol..st deleted file mode 100644 index d233ff9..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/symbol..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -symbol: anObject - "Set the value of symbol" - - symbol := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/symbol.st b/source/ASN1.package/ASN1ChoiceElement.class/instance/symbol.st deleted file mode 100644 index 67a9e9f..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/symbol.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -symbol - "Answer the value of symbol" - - ^ symbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/type..st b/source/ASN1.package/ASN1ChoiceElement.class/instance/type..st deleted file mode 100644 index 2ae4f80..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/type..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -type: anObject - "Set the value of type" - - type := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/instance/type.st b/source/ASN1.package/ASN1ChoiceElement.class/instance/type.st deleted file mode 100644 index 14d5d33..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/instance/type.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -type - "Answer the value of type" - - ^ type \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceElement.class/properties.json b/source/ASN1.package/ASN1ChoiceElement.class/properties.json deleted file mode 100644 index 97a9401..0000000 --- a/source/ASN1.package/ASN1ChoiceElement.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "owner", - "symbol", - "type" - ], - "name" : "ASN1ChoiceElement", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceType.class/README.md b/source/ASN1.package/ASN1ChoiceType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ChoiceType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1ChoiceType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index d2abdf6..0000000 --- a/source/ASN1.package/ASN1ChoiceType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,9 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | aTag ele | - aTag := derStream currentTag bitAnd: 2r00011111. - ele := self elements - detect: [:x | x matchesTag: aTag] - ifNone: [self error: 'no choice']. - ^ ele decodeValueWithDERStream: derStream length: length. diff --git a/source/ASN1.package/ASN1ChoiceType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1ChoiceType.class/instance/decodeWithDERStream..st deleted file mode 100644 index 5008475..0000000 --- a/source/ASN1.package/ASN1ChoiceType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,9 +0,0 @@ -decoding -decodeWithDERStream: derStream - - | aTag ele | - aTag := derStream peekTag. - ele := self elements - detect: [:x | x matchesTag: aTag] - ifNone: [self error: 'no choice']. - ^ ele decodeWithDERStream: derStream. diff --git a/source/ASN1.package/ASN1ChoiceType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1ChoiceType.class/instance/encode.withDERStream..st deleted file mode 100644 index 6b6b754..0000000 --- a/source/ASN1.package/ASN1ChoiceType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,8 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - | ele | - ele := self elements - detect: [:x | x isTypeFor: anObject] - ifNone: [self error: 'no choice']. - ele encode: anObject withDERStream: derStream. diff --git a/source/ASN1.package/ASN1ChoiceType.class/instance/matchesTag..st b/source/ASN1.package/ASN1ChoiceType.class/instance/matchesTag..st deleted file mode 100644 index 1d0e3a5..0000000 --- a/source/ASN1.package/ASN1ChoiceType.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: aTag - - ^ elements anySatisfy: [:e | e matchesTag: aTag] \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceType.class/instance/newElement.st b/source/ASN1.package/ASN1ChoiceType.class/instance/newElement.st deleted file mode 100644 index a58887d..0000000 --- a/source/ASN1.package/ASN1ChoiceType.class/instance/newElement.st +++ /dev/null @@ -1,4 +0,0 @@ -private -newElement - - ^ ASN1ChoiceElement new \ No newline at end of file diff --git a/source/ASN1.package/ASN1ChoiceType.class/properties.json b/source/ASN1.package/ASN1ChoiceType.class/properties.json deleted file mode 100644 index 64d1eb0..0000000 --- a/source/ASN1.package/ASN1ChoiceType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1StructuredType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1ChoiceType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ConstructedType.class/README.md b/source/ASN1.package/ASN1ConstructedType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ConstructedType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1ConstructedType.class/instance/encode.withDERStream..st deleted file mode 100644 index ba69efb..0000000 --- a/source/ASN1.package/ASN1ConstructedType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,10 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - | tempStream | - derStream nextPutTag: self asn1Tag. - tempStream := derStream newStream. - self encodeValue: anObject withDERStream: tempStream. - derStream nextPutLength: tempStream size. - derStream nextPutAll: tempStream contents. - ^ derStream diff --git a/source/ASN1.package/ASN1ConstructedType.class/instance/isConstructed.st b/source/ASN1.package/ASN1ConstructedType.class/instance/isConstructed.st deleted file mode 100644 index 1746050..0000000 --- a/source/ASN1.package/ASN1ConstructedType.class/instance/isConstructed.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isConstructed - - ^ true \ No newline at end of file diff --git a/source/ASN1.package/ASN1ConstructedType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1ConstructedType.class/instance/sizeOfObject..st deleted file mode 100644 index 931b3a5..0000000 --- a/source/ASN1.package/ASN1ConstructedType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ nil \ No newline at end of file diff --git a/source/ASN1.package/ASN1ConstructedType.class/properties.json b/source/ASN1.package/ASN1ConstructedType.class/properties.json deleted file mode 100644 index e4c1c94..0000000 --- a/source/ASN1.package/ASN1ConstructedType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Type", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1ConstructedType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/README.md b/source/ASN1.package/ASN1DefinitionModel.class/README.md deleted file mode 100644 index 3ee981d..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/README.md +++ /dev/null @@ -1,10 +0,0 @@ -This class is used to parse an asn1Definition of a class. - -Use the prama syntax to define the asn1 encoding - - -for example: - \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/class/LICENSE.st b/source/ASN1.package/ASN1DefinitionModel.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/ASN1.package/ASN1DefinitionModel.class/class/on..st b/source/ASN1.package/ASN1DefinitionModel.class/class/on..st deleted file mode 100644 index 4f6aeb8..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/class/on..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -on: aClassWithASN1Definitions - - ^self new - subject: aClassWithASN1Definitions; - yourself. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1ClassName..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1ClassName..st deleted file mode 100644 index 1d0c044..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1ClassName..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asn1ClassName: anObject - "Set the value of asn1ClassName" - - asn1ClassName := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1ClassName.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1ClassName.st deleted file mode 100644 index dedc076..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1ClassName.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asn1ClassName - "Answer the value of asn1ClassName" - - ^ asn1ClassName ifNil: [asn1ClassName := self parseASN1ClassName. asn1ClassName] \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1DefinitionString..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1DefinitionString..st deleted file mode 100644 index 9d633fd..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1DefinitionString..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asn1DefinitionString: anObject - "Set the value of asn1DefinitionString" - - asn1DefinitionString := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1DefinitionString.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1DefinitionString.st deleted file mode 100644 index 4ed2fce..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/asn1DefinitionString.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asn1DefinitionString - "Answer the value of asn1DefinitionString" - - ^ asn1DefinitionString ifNil: [asn1DefinitionString := self parseASN1DefinitionString. asn1DefinitionString] \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/createObjectsAndPushFields.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/createObjectsAndPushFields.st deleted file mode 100644 index 15b19db..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/createObjectsAndPushFields.st +++ /dev/null @@ -1,11 +0,0 @@ -services parsing -createObjectsAndPushFields - self resultObject ifNil: - [self setRootObject]. - self currentObject ifNil: - [self setCurrentObject]. - self currentField isNil - ifTrue: [self setCurrentField] - ifFalse: [self pushNextField]. - self setCurrentMutator. - \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentAccessor..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentAccessor..st deleted file mode 100644 index 29560f7..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentAccessor..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentAccessor: anObject - "Set the value of currentAccessor" - - currentAccessor := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentAccessor.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentAccessor.st deleted file mode 100644 index 6191d34..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentAccessor.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentAccessor - "Answer the value of currentAccessor" - - ^ currentAccessor \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentField..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentField..st deleted file mode 100644 index 77082be..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentField..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentField: anObject - "Set the value of currentField" - - currentField := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentField.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentField.st deleted file mode 100644 index 1584ba6..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentField.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentField - "Answer the value of currentField" - - ^ currentField \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentMutator..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentMutator..st deleted file mode 100644 index 5807770..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentMutator..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentMutator: anObject - "Set the value of currentMutator" - - currentMutator := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentMutator.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentMutator.st deleted file mode 100644 index 8520bf1..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentMutator.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentMutator - "Answer the value of currentMutator" - - ^ currentMutator \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentObject..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentObject..st deleted file mode 100644 index 13b4743..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentObject..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentObject: anObject - "Set the value of currentObject" - - currentObject := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentObject.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/currentObject.st deleted file mode 100644 index feef03d..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/currentObject.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentObject - "Answer the value of currentObject" - - ^ currentObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/fieldStack..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/fieldStack..st deleted file mode 100644 index 95139f2..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/fieldStack..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -fieldStack: anObject - "Set the value of fieldStack" - - fieldStack := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/fieldStack.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/fieldStack.st deleted file mode 100644 index db17279..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/fieldStack.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -fieldStack - "Answer the value of fieldStack" - - ^ fieldStack ifNil: [fieldStack := Stack new]. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/fields..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/fields..st deleted file mode 100644 index b36bfc4..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/fields..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -fields: anObject - "Set the value of fields" - - fields := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/fields.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/fields.st deleted file mode 100644 index 6f8ec85..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/fields.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -fields - "Answer the value of fields" - - ^ fields ifNil: [fields := self parseFieldNames. fields]. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/getPragmaAccessors.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/getPragmaAccessors.st deleted file mode 100644 index fc82c3d..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/getPragmaAccessors.st +++ /dev/null @@ -1,16 +0,0 @@ -services pragma -getPragmaAccessors - "return the pragmas defined on this class. These values are usually put in the accessor of the ivar, but could be in other regular methods if it is appropriate. The form of the pragma is . - for example if you have an ivar named: #title that has a definition - MyASN1Object ::= Sequence { - asn1Title DisplayableString - } - then the accessor for title should look like this: - title - - - ^title - - Every field definition in the asn1Defintion string must have a corresponding pragma" - - ^(Pragma allNamed: #asn1FieldAccessor: in: self subject) collect: [:aPragma | ASN1PragmaAccessor fromPragma: aPragma]. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/getPragmaMutators.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/getPragmaMutators.st deleted file mode 100644 index cd5d712..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/getPragmaMutators.st +++ /dev/null @@ -1,16 +0,0 @@ -services pragma -getPragmaMutators - "return the pragmas defined on this class. These values are usually put in the mutator of the ivar, but could be in other regular methods if it is appropriate. The form of the pragma is . Use symbol for class because of monticello loading problems. - for example if you have an ivar named: #title that has a definition - MyASN1Object ::= Sequence { - asn1Title DisplayableString - } - then the mutaotr for title should look like this: - title: aTitle - - - title := aTitle. - - Every field definition in the asn1Defintion string must have a corresponding pragma" - - ^(Pragma allNamed: #asn1FieldMutator:class: in: self subject) collect: [:aPragma | ASN1PragmaMutator fromPragma: aPragma]. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseASN1ClassName.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/parseASN1ClassName.st deleted file mode 100644 index 659d50a..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseASN1ClassName.st +++ /dev/null @@ -1,8 +0,0 @@ -services parsing -parseASN1ClassName - "return the ans1definition argument string" - | aDefString classSepIndex | - aDefString := self asn1DefinitionString ifNil: [^nil]. - classSepIndex := aDefString indexOfSubCollection: '::='. - classSepIndex = 0 ifTrue: [^nil]. - ^(aDefString copyFrom: 1 to: classSepIndex - 1) withBlanksTrimmed. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseASN1DefinitionString.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/parseASN1DefinitionString.st deleted file mode 100644 index 3ef497f..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseASN1DefinitionString.st +++ /dev/null @@ -1,10 +0,0 @@ -services parsing -parseASN1DefinitionString - "return the ans1definition argument string" - | aPragma aCollection | - aCollection := Pragma allNamed: #asn1Definition: in: self subject class. - ^ aCollection isEmpty - ifFalse: [aPragma := aCollection first. - aPragma arguments - at: 1 - ifAbsent: []] \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseFieldNames.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/parseFieldNames.st deleted file mode 100644 index cb3a8b7..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseFieldNames.st +++ /dev/null @@ -1,11 +0,0 @@ -services parsing -parseFieldNames - | aString fields | - aString := self asn1DefinitionString. - fields := OrderedCollection new. - (aString copyFrom: (aString indexOf: ${) + 1 to: (aString indexOf: $}) - 1) linesDo: [:aLine | - (((aLine indexOfSubCollection: '--') > 0) or: [aLine withBlanksTrimmed isEmpty])ifFalse: [ - fields add: aLine subStrings first - ]. - ]. - ^fields \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseRootObjectType.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/parseRootObjectType.st deleted file mode 100644 index 00357f8..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/parseRootObjectType.st +++ /dev/null @@ -1,14 +0,0 @@ -services parsing -parseRootObjectType - "parse the definition string and figure out if this object is a subject or a - collection of subjects" - | aString aType | - aString := self asn1DefinitionString. - aType := (aString copyFrom: (aString indexOfSubCollection: '::=') - + 4 to: (aString indexOf: ${) - - 1) withBlanksTrimmed. - ^aType isEmpty - ifTrue: [self subject] - ifFalse: [aType = 'SEQUENCE' - ifTrue: [OrderedCollection] - ifFalse: [self error: 'new root type']] \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/resultObject..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/resultObject..st deleted file mode 100644 index 72c7a77..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/resultObject..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -resultObject: anObject - "Set the value of resultObject" - - resultObject := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/resultObject.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/resultObject.st deleted file mode 100644 index 61e22b5..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/resultObject.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -resultObject - "Answer the value of resultObject" - - ^ resultObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/setCurrentObject.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/setCurrentObject.st deleted file mode 100644 index 551813b..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/setCurrentObject.st +++ /dev/null @@ -1,3 +0,0 @@ -services parsing -setCurrentObject - self currentObject: self subject new. \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/setRootObject.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/setRootObject.st deleted file mode 100644 index 7fd4592..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/setRootObject.st +++ /dev/null @@ -1,6 +0,0 @@ -services parsing -setRootObject - self resultObject: self parseRootObjectType new. - self resultObject isCollection - ifTrue: [self currentObject: self subject new] - ifFalse: [self currentObject: self resultObject] \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/subject..st b/source/ASN1.package/ASN1DefinitionModel.class/instance/subject..st deleted file mode 100644 index f9f8273..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/subject..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subject: anObject - "Set the value of subject" - - subject := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/subject.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/subject.st deleted file mode 100644 index 288400b..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/subject.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subject - "Answer the value of subject" - - ^ subject \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/instance/verifyFieldAccessorsAndMutators.st b/source/ASN1.package/ASN1DefinitionModel.class/instance/verifyFieldAccessorsAndMutators.st deleted file mode 100644 index c25ade4..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/instance/verifyFieldAccessorsAndMutators.st +++ /dev/null @@ -1,10 +0,0 @@ -services verifying -verifyFieldAccessorsAndMutators - "check to see that the ans1 definition is represented by all the appropriate accessor and mutator definitions" - | myAccessors myMutators | - myAccessors := self getPragmaAccessors. - myMutators := self getPragmaMutators. - ^self parseFieldNames allSatisfy: [:aField | - (myAccessors anySatisfy: [:anAccessor | anAccessor asn1name = aField]) and: [ - (myMutators anySatisfy: [:aMutator | aMutator asn1name = aField])]]. - \ No newline at end of file diff --git a/source/ASN1.package/ASN1DefinitionModel.class/properties.json b/source/ASN1.package/ASN1DefinitionModel.class/properties.json deleted file mode 100644 index 5f3ae93..0000000 --- a/source/ASN1.package/ASN1DefinitionModel.class/properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "commentStamp" : "RJT 9/2/2006 23:09", - "super" : "Object", - "category" : "ASN1-DefinitionModel", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "subject", - "asn1ClassName", - "asn1DefinitionString", - "fields", - "resultObject", - "currentObject", - "currentField", - "currentMutator", - "currentAccessor", - "fieldStack" - ], - "name" : "ASN1DefinitionModel", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthMarker.class/README.md b/source/ASN1.package/ASN1EndOfIndefiniteLengthMarker.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthMarker.class/properties.json b/source/ASN1.package/ASN1EndOfIndefiniteLengthMarker.class/properties.json deleted file mode 100644 index 190d398..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthMarker.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1EndOfIndefiniteLengthMarker", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/README.md b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 65aeace..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - ^ ASN1EndOfIndefiniteLengthMarker new \ No newline at end of file diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 8516a71..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,2 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/isTypeFor..st deleted file mode 100644 index c965c70..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ false \ No newline at end of file diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/sizeOfObject..st deleted file mode 100644 index 4e8131e..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ 0 diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/tag.st b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/tag.st deleted file mode 100644 index c5d39ef..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 0 \ No newline at end of file diff --git a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/properties.json b/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/properties.json deleted file mode 100644 index fec35d9..0000000 --- a/source/ASN1.package/ASN1EndOfIndefiniteLengthType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1EndOfIndefiniteLengthType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/README.md b/source/ASN1.package/ASN1Entity.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Entity.class/class/name..st b/source/ASN1.package/ASN1Entity.class/class/name..st deleted file mode 100644 index 93f2904..0000000 --- a/source/ASN1.package/ASN1Entity.class/class/name..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -name: aSymbol - - ^self new - name: aSymbol; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/class/name.in..st b/source/ASN1.package/ASN1Entity.class/class/name.in..st deleted file mode 100644 index 579eb29..0000000 --- a/source/ASN1.package/ASN1Entity.class/class/name.in..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -name: aSymbol in: aModule - - ^aModule add: (self name: aSymbol) \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/instance/explicitSubType.st b/source/ASN1.package/ASN1Entity.class/instance/explicitSubType.st deleted file mode 100644 index 3b2ee96..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/explicitSubType.st +++ /dev/null @@ -1,6 +0,0 @@ -subtype utilities -explicitSubType - - ^ (ASN1ExplicitSubType name: nil) - parent: self; - yourself. diff --git a/source/ASN1.package/ASN1Entity.class/instance/implicitSubType.st b/source/ASN1.package/ASN1Entity.class/instance/implicitSubType.st deleted file mode 100644 index d311e02..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/implicitSubType.st +++ /dev/null @@ -1,6 +0,0 @@ -subtype utilities -implicitSubType - - ^ (ASN1ImplicitSubType name: nil) - parent: self; - yourself. diff --git a/source/ASN1.package/ASN1Entity.class/instance/module..st b/source/ASN1.package/ASN1Entity.class/instance/module..st deleted file mode 100644 index 13f1c57..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/module..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -module: anObject - "Set the value of module" - - module := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/instance/module.st b/source/ASN1.package/ASN1Entity.class/instance/module.st deleted file mode 100644 index f99bb12..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/module.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -module - "Answer the value of module" - - ^ module \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/instance/name..st b/source/ASN1.package/ASN1Entity.class/instance/name..st deleted file mode 100644 index 0d4b199..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/name..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -name: anObject - "Set the value of symbol" - - symbol := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/instance/name.st b/source/ASN1.package/ASN1Entity.class/instance/name.st deleted file mode 100644 index f846bf7..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/name.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -name - "Answer the value of symbol" - - ^ symbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/instance/typeFrom..st b/source/ASN1.package/ASN1Entity.class/instance/typeFrom..st deleted file mode 100644 index b0cd4ae..0000000 --- a/source/ASN1.package/ASN1Entity.class/instance/typeFrom..st +++ /dev/null @@ -1,8 +0,0 @@ -private -typeFrom: typeSpec - - ^ self module - ifNil: [typeSpec isBehavior - ifTrue: [typeSpec new] - ifFalse: [typeSpec]] - ifNotNil: [self module typeFrom: typeSpec] \ No newline at end of file diff --git a/source/ASN1.package/ASN1Entity.class/properties.json b/source/ASN1.package/ASN1Entity.class/properties.json deleted file mode 100644 index 7679899..0000000 --- a/source/ASN1.package/ASN1Entity.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "symbol", - "module" - ], - "name" : "ASN1Entity", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/README.md b/source/ASN1.package/ASN1ExplicitContextValue.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/class/LICENSE.st b/source/ASN1.package/ASN1ExplicitContextValue.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/asn1Tag.st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/asn1Tag.st deleted file mode 100644 index 3f11ccd..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/asn1Tag.st +++ /dev/null @@ -1,6 +0,0 @@ -parsing -asn1Tag - - ^ self tagIsPrimitive - ifTrue: [128 bitOr: self tagIndex] - ifFalse: [160 bitOr: self tagIndex]. diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/printOn..st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/printOn..st deleted file mode 100644 index c18d5b8..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/printOn..st +++ /dev/null @@ -1,4 +0,0 @@ -printing -printOn: aStream - - aStream nextPutAll: '[', self tagIndex asString, ']', (self tagValue printString). diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIndex..st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIndex..st deleted file mode 100644 index b776620..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIndex..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagIndex: anObject - "Set the value of tagIndex" - - tagIndex := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIndex.st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIndex.st deleted file mode 100644 index 321497c..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIndex.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagIndex - "Answer the value of tagIndex" - - ^ tagIndex \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIsPrimitive..st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIsPrimitive..st deleted file mode 100644 index 1e39f9e..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIsPrimitive..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagIsPrimitive: anObject - "Set the value of tagIsPrimitive" - - tagIsPrimitive := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIsPrimitive.st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIsPrimitive.st deleted file mode 100644 index d915672..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagIsPrimitive.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagIsPrimitive - "Answer the value of tagIsPrimitive" - - ^ tagIsPrimitive \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagValue..st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagValue..st deleted file mode 100644 index 25ee09a..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagValue: anObject - "Set the value of tagValue" - - tagValue := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagValue.st b/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagValue.st deleted file mode 100644 index 772aa45..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/instance/tagValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagValue - "Answer the value of tagValue" - - ^ tagValue \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitContextValue.class/properties.json b/source/ASN1.package/ASN1ExplicitContextValue.class/properties.json deleted file mode 100644 index 362ced7..0000000 --- a/source/ASN1.package/ASN1ExplicitContextValue.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Value", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "tagIndex", - "tagValue", - "tagIsPrimitive" - ], - "name" : "ASN1ExplicitContextValue", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ExplicitSubType.class/README.md b/source/ASN1.package/ASN1ExplicitSubType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ExplicitSubType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1ExplicitSubType.class/instance/decodeWithDERStream..st deleted file mode 100644 index 4f6d386..0000000 --- a/source/ASN1.package/ASN1ExplicitSubType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,6 +0,0 @@ -decoding -decodeWithDERStream: derStream - - derStream nextTag. - derStream nextLength. - ^ self parent decodeWithDERStream: derStream. diff --git a/source/ASN1.package/ASN1ExplicitSubType.class/instance/decodeWithDERStream.owner.ownerType..st b/source/ASN1.package/ASN1ExplicitSubType.class/instance/decodeWithDERStream.owner.ownerType..st deleted file mode 100644 index 17af20e..0000000 --- a/source/ASN1.package/ASN1ExplicitSubType.class/instance/decodeWithDERStream.owner.ownerType..st +++ /dev/null @@ -1,6 +0,0 @@ -decoding -decodeWithDERStream: derStream owner: owner ownerType: ownerType - - derStream nextTag. - derStream nextLength. - ^ self parent decodeWithDERStream: derStream owner: owner ownerType: ownerType. diff --git a/source/ASN1.package/ASN1ExplicitSubType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1ExplicitSubType.class/instance/encode.withDERStream..st deleted file mode 100644 index 984840b..0000000 --- a/source/ASN1.package/ASN1ExplicitSubType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,9 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - | tempStream | - derStream nextPutTag: (self asn1Tag bitOr: 160). - tempStream := derStream newStream. - self parent encode: anObject withDERStream: tempStream. - derStream nextPutLength: tempStream size. - derStream nextPutAll: tempStream contents. diff --git a/source/ASN1.package/ASN1ExplicitSubType.class/instance/encode.withDERStream.owner.ownerType..st b/source/ASN1.package/ASN1ExplicitSubType.class/instance/encode.withDERStream.owner.ownerType..st deleted file mode 100644 index 98d3fa2..0000000 --- a/source/ASN1.package/ASN1ExplicitSubType.class/instance/encode.withDERStream.owner.ownerType..st +++ /dev/null @@ -1,9 +0,0 @@ -encoding -encode: anObject withDERStream: derStream owner: owner ownerType: ownerType - - | tempStream | - derStream nextPutTag: (self asn1Tag bitOr: 160). - tempStream := derStream newStream. - self parent encode: anObject withDERStream: tempStream owner: owner ownerType: ownerType. - derStream nextPutLength: tempStream size. - derStream nextPutAll: tempStream contents. diff --git a/source/ASN1.package/ASN1ExplicitSubType.class/properties.json b/source/ASN1.package/ASN1ExplicitSubType.class/properties.json deleted file mode 100644 index 02e334e..0000000 --- a/source/ASN1.package/ASN1ExplicitSubType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1SubType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1ExplicitSubType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/README.md b/source/ASN1.package/ASN1FieldDefinition.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1FieldDefinition.class/class/forField.onDefinition..st b/source/ASN1.package/ASN1FieldDefinition.class/class/forField.onDefinition..st deleted file mode 100644 index e059155..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/class/forField.onDefinition..st +++ /dev/null @@ -1,18 +0,0 @@ -instance creation -forField: aFieldName onDefinition: aDefinitionString - "Return to the sender an object created from aDefintionString with the - field name aFieldName" - | fieldInfo definitionContents noCommentsString | - - definitionContents := aDefinitionString copyFrom: (aDefinitionString indexOf: ${) - + 1 to: (aDefinitionString indexOf: $}) - - 1. - noCommentsString := String new. - definitionContents linesDo: [:aLine | - ((aLine indexOfSubCollection: '--') > 0 or: [aLine withBlanksTrimmed isEmpty]) - ifFalse: [noCommentsString := noCommentsString, aLine]. - ]. - fieldInfo := (noCommentsString explode: $,) - detect: [:aField | aField subStrings first = aFieldName] ifNone: [^nil]. - ^ self new parseFieldInfo: fieldInfo; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/class/testCreate.st b/source/ASN1.package/ASN1FieldDefinition.class/class/testCreate.st deleted file mode 100644 index b3b10d8..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/class/testCreate.st +++ /dev/null @@ -1,18 +0,0 @@ -testing -testCreate - ^#('version' 'serialNumber' 'signature' 'issuer' 'validity' 'subject' 'subjectPublicKeyInfo' 'issuerUniqueID' 'subjectUniqueID' 'extensions') collect: [:aField | - self forField: aField onDefinition: 'TBSCertificate ::= SEQUENCE { - version [0] EXPLICIT Version DEFAULT v1, - serialNumber CertificateSerialNumber, - signature AlgorithmIdentifier, - issuer Name, - validity Validity, - subject Name, - subjectPublicKeyInfo SubjectPublicKeyInfo, - issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, - -- If present, version shall be v2 or v3 - subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, - -- If present, version shall be v2 or v3 - extensions [3] EXPLICIT Extensions OPTIONAL - -- If present, version shall be v3 - }']. \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/defaultValue..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/defaultValue..st deleted file mode 100644 index f15b2fa..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/defaultValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -defaultValue: anObject - "Set the value of defaultValue" - - defaultValue := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/defaultValue.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/defaultValue.st deleted file mode 100644 index 3b53256..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/defaultValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -defaultValue - "Answer the value of defaultValue" - - ^ defaultValue \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/explicitFieldDefinition..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/explicitFieldDefinition..st deleted file mode 100644 index b960696..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/explicitFieldDefinition..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -explicitFieldDefinition: anObject - "Set the value of explicitFieldDefinition" - - explicitFieldDefinition := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/explicitFieldDefinition.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/explicitFieldDefinition.st deleted file mode 100644 index 906014e..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/explicitFieldDefinition.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -explicitFieldDefinition - "Answer the value of explicitFieldDefinition" - - ^ explicitFieldDefinition \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/fieldName..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/fieldName..st deleted file mode 100644 index 23543ee..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/fieldName..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -fieldName: anObject - "Set the value of fieldName" - - fieldName := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/fieldName.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/fieldName.st deleted file mode 100644 index f71d29f..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/fieldName.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -fieldName - "Answer the value of fieldName" - - ^ fieldName \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/implicitFieldDefinition..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/implicitFieldDefinition..st deleted file mode 100644 index f3c719c..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/implicitFieldDefinition..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -implicitFieldDefinition: anObject - "Set the value of implicitFieldDefinition" - - implicitFieldDefinition := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/implicitFieldDefinition.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/implicitFieldDefinition.st deleted file mode 100644 index ce1721b..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/implicitFieldDefinition.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -implicitFieldDefinition - "Answer the value of implicitFieldDefinition" - - ^ implicitFieldDefinition \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/isExplicit..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/isExplicit..st deleted file mode 100644 index ef358be..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/isExplicit..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -isExplicit: anObject - "Set the value of isExplicit" - - isExplicit := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/isExplicit.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/isExplicit.st deleted file mode 100644 index 0ac4dd5..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/isExplicit.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -isExplicit - "Answer the value of isExplicit" - - ^ isExplicit \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/isOptional..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/isOptional..st deleted file mode 100644 index 4cdd961..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/isOptional..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -isOptional: anObject - "Set the value of isOptional" - - isOptional := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/isOptional.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/isOptional.st deleted file mode 100644 index d026328..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/isOptional.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -isOptional - "Answer the value of isOptional" - - ^ isOptional \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/parseFieldInfo..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/parseFieldInfo..st deleted file mode 100644 index e3d1fe8..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/parseFieldInfo..st +++ /dev/null @@ -1,27 +0,0 @@ -parsing -parseFieldInfo: fieldInfo - "fill the current instance with fieldInformation" - | subStrings explodedString noTagIndexString | - subStrings := fieldInfo subStrings. - self fieldName: subStrings first. - noTagIndexString := (fieldInfo includes: $[) ifTrue: [ - self tagIndex: (fieldInfo copyFrom: (fieldInfo indexOf: $[) + 1 to: (fieldInfo indexOf: $]) - 1). - (fieldInfo copyFrom: 1 to: (fieldInfo indexOf: $[) -1), (fieldInfo copyFrom: (fieldInfo indexOf: $]) +1 to: fieldInfo size). - ] ifFalse: [ - fieldInfo - ]. - explodedString := noTagIndexString subStrings asOrderedCollection. - (explodedString includes: 'EXPLICIT') ifTrue: [ - explodedString := explodedString remove: 'EXPLICIT'; yourself. - self isExplicit: true. - ]. - (explodedString includes: 'OPTIONAL') ifTrue: [ - explodedString := explodedString remove: 'OPTIONAL'; yourself. - self isOptional: true. - ]. - (explodedString includes: 'DEFAULT') ifTrue: [ - explodedString := explodedString remove: 'DEFAULT'; yourself. - self defaultValue: explodedString last. - explodedString remove: explodedString last. - ]. - self tagType: explodedString last. \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagIndex..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/tagIndex..st deleted file mode 100644 index b776620..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagIndex..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagIndex: anObject - "Set the value of tagIndex" - - tagIndex := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagIndex.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/tagIndex.st deleted file mode 100644 index 321497c..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagIndex.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagIndex - "Answer the value of tagIndex" - - ^ tagIndex \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagType..st b/source/ASN1.package/ASN1FieldDefinition.class/instance/tagType..st deleted file mode 100644 index f77c78b..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagType..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagType: anObject - "Set the value of tagType" - - tagType := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagType.st b/source/ASN1.package/ASN1FieldDefinition.class/instance/tagType.st deleted file mode 100644 index f89f536..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/instance/tagType.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tagType - "Answer the value of tagType" - - ^ tagType \ No newline at end of file diff --git a/source/ASN1.package/ASN1FieldDefinition.class/properties.json b/source/ASN1.package/ASN1FieldDefinition.class/properties.json deleted file mode 100644 index a8df165..0000000 --- a/source/ASN1.package/ASN1FieldDefinition.class/properties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Value", - "category" : "ASN1-DefinitionModel", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "fieldName", - "tagIndex", - "tagType", - "explicitFieldDefinition", - "implicitFieldDefinition", - "defaultValue", - "isExplicit", - "isOptional" - ], - "name" : "ASN1FieldDefinition", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1GeneralString.class/README.md b/source/ASN1.package/ASN1GeneralString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1GeneralString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1GeneralString.class/instance/asn1Tag.st deleted file mode 100644 index 2259c9d..0000000 --- a/source/ASN1.package/ASN1GeneralString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 27 \ No newline at end of file diff --git a/source/ASN1.package/ASN1GeneralString.class/properties.json b/source/ASN1.package/ASN1GeneralString.class/properties.json deleted file mode 100644 index 6c38c24..0000000 --- a/source/ASN1.package/ASN1GeneralString.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1GeneralString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1GeneralStringType.class/README.md b/source/ASN1.package/ASN1GeneralStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1GeneralStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1GeneralStringType.class/instance/isTypeFor..st deleted file mode 100644 index 48f9fbe..0000000 --- a/source/ASN1.package/ASN1GeneralStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1GeneralString \ No newline at end of file diff --git a/source/ASN1.package/ASN1GeneralStringType.class/instance/tag.st b/source/ASN1.package/ASN1GeneralStringType.class/instance/tag.st deleted file mode 100644 index 788b471..0000000 --- a/source/ASN1.package/ASN1GeneralStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 27 \ No newline at end of file diff --git a/source/ASN1.package/ASN1GeneralStringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1GeneralStringType.class/instance/wrapperClass.st deleted file mode 100644 index b71d824..0000000 --- a/source/ASN1.package/ASN1GeneralStringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1GeneralString diff --git a/source/ASN1.package/ASN1GeneralStringType.class/properties.json b/source/ASN1.package/ASN1GeneralStringType.class/properties.json deleted file mode 100644 index fd9dbd7..0000000 --- a/source/ASN1.package/ASN1GeneralStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1GeneralStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1IA5String.class/README.md b/source/ASN1.package/ASN1IA5String.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1IA5String.class/instance/asn1Tag.st b/source/ASN1.package/ASN1IA5String.class/instance/asn1Tag.st deleted file mode 100644 index 20ec142..0000000 --- a/source/ASN1.package/ASN1IA5String.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -asn1Tag - - ^ 22 diff --git a/source/ASN1.package/ASN1IA5String.class/properties.json b/source/ASN1.package/ASN1IA5String.class/properties.json deleted file mode 100644 index dd7df31..0000000 --- a/source/ASN1.package/ASN1IA5String.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1IA5String", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1IA5StringType.class/README.md b/source/ASN1.package/ASN1IA5StringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1IA5StringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1IA5StringType.class/instance/isTypeFor..st deleted file mode 100644 index 7d4e887..0000000 --- a/source/ASN1.package/ASN1IA5StringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1IA5String \ No newline at end of file diff --git a/source/ASN1.package/ASN1IA5StringType.class/instance/tag.st b/source/ASN1.package/ASN1IA5StringType.class/instance/tag.st deleted file mode 100644 index 8ee077a..0000000 --- a/source/ASN1.package/ASN1IA5StringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 22 \ No newline at end of file diff --git a/source/ASN1.package/ASN1IA5StringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1IA5StringType.class/instance/wrapperClass.st deleted file mode 100644 index a0a2b1f..0000000 --- a/source/ASN1.package/ASN1IA5StringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1IA5String diff --git a/source/ASN1.package/ASN1IA5StringType.class/properties.json b/source/ASN1.package/ASN1IA5StringType.class/properties.json deleted file mode 100644 index fc8eba6..0000000 --- a/source/ASN1.package/ASN1IA5StringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1IA5StringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ImplicitSubType.class/README.md b/source/ASN1.package/ASN1ImplicitSubType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ImplicitSubType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1ImplicitSubType.class/instance/decodeWithDERStream..st deleted file mode 100644 index c73ab44..0000000 --- a/source/ASN1.package/ASN1ImplicitSubType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,12 +0,0 @@ -decoding -decodeWithDERStream: derStream - - | thisTag | - thisTag := derStream nextTag. - (self parent isConstructed not and: [(thisTag bitAnd: 2r00100000) > 0]) - ifTrue: [^ self parent - decodeConstructedValueWithDERStream: derStream - length: derStream nextLength] - ifFalse: [^ self parent - decodeValueWithDERStream: derStream - length: derStream nextLength]. diff --git a/source/ASN1.package/ASN1ImplicitSubType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1ImplicitSubType.class/instance/encode.withDERStream..st deleted file mode 100644 index 2320f28..0000000 --- a/source/ASN1.package/ASN1ImplicitSubType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,15 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - | myTag tempStream | - myTag := self asn1Tag bitOr: 128. - self parent isConstructed - ifTrue: [myTag := myTag bitOr: 32]. - derStream nextPutTag: myTag. - tempStream := derStream newStream. - self parent encodeValue: anObject withDERStream: tempStream. - derStream nextPutLength: tempStream size. - derStream nextPutAll: tempStream contents. - - - diff --git a/source/ASN1.package/ASN1ImplicitSubType.class/properties.json b/source/ASN1.package/ASN1ImplicitSubType.class/properties.json deleted file mode 100644 index 9f937d4..0000000 --- a/source/ASN1.package/ASN1ImplicitSubType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1SubType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1ImplicitSubType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1IntegerType.class/README.md b/source/ASN1.package/ASN1IntegerType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1IntegerType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1IntegerType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index aa0c4d3..0000000 --- a/source/ASN1.package/ASN1IntegerType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,10 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | integer | - integer := Integer new: length neg: false. - length to: 1 by: -1 do: [:index | - integer digitAt: index put: derStream next]. - ((integer digitAt: length) allMask: 16r80) - ifTrue: [^integer twosComplement negated normalize] - ifFalse: [^integer normalize]. diff --git a/source/ASN1.package/ASN1IntegerType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1IntegerType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index b820806..0000000 --- a/source/ASN1.package/ASN1IntegerType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,15 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - | integer | - integer := anObject. - integer positive - ifTrue: [ - (integer lastDigit allMask: 16r80) - ifTrue: [derStream nextPut: 0]] - ifFalse: [ - integer := integer negated twosComplement. - (integer lastDigit noMask: 16r80) - ifTrue: [derStream nextPut: 16rFF]]. - integer digitLength to: 1 by: -1 do: [:digitIndex | - derStream nextPut: (integer digitAt: digitIndex)]. diff --git a/source/ASN1.package/ASN1IntegerType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1IntegerType.class/instance/isTypeFor..st deleted file mode 100644 index 9969c90..0000000 --- a/source/ASN1.package/ASN1IntegerType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isInteger \ No newline at end of file diff --git a/source/ASN1.package/ASN1IntegerType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1IntegerType.class/instance/sizeOfObject..st deleted file mode 100644 index 045b4ab..0000000 --- a/source/ASN1.package/ASN1IntegerType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,14 +0,0 @@ -encoding -sizeOfObject: anObject - - | twosComplement | - ^ anObject positive - ifTrue: [(anObject lastDigit allMask: 16r80) - ifTrue: [anObject digitLength + 1] - ifFalse: [anObject digitLength]] - ifFalse: [ - twosComplement := anObject negated twosComplement. - (twosComplement lastDigit noMask: 16r80) - ifTrue: [twosComplement digitLength+1] - ifFalse: [twosComplement digitLength]]. - diff --git a/source/ASN1.package/ASN1IntegerType.class/instance/tag.st b/source/ASN1.package/ASN1IntegerType.class/instance/tag.st deleted file mode 100644 index df35dcd..0000000 --- a/source/ASN1.package/ASN1IntegerType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 2 \ No newline at end of file diff --git a/source/ASN1.package/ASN1IntegerType.class/properties.json b/source/ASN1.package/ASN1IntegerType.class/properties.json deleted file mode 100644 index 17787aa..0000000 --- a/source/ASN1.package/ASN1IntegerType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1IntegerType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedSequenceType.class/README.md b/source/ASN1.package/ASN1MappedSequenceType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1MappedSequenceType.class/instance/tag.st b/source/ASN1.package/ASN1MappedSequenceType.class/instance/tag.st deleted file mode 100644 index 44bfdff..0000000 --- a/source/ASN1.package/ASN1MappedSequenceType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 48 \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedSequenceType.class/properties.json b/source/ASN1.package/ASN1MappedSequenceType.class/properties.json deleted file mode 100644 index 972e04e..0000000 --- a/source/ASN1.package/ASN1MappedSequenceType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1MappedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1MappedSequenceType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedSetType.class/README.md b/source/ASN1.package/ASN1MappedSetType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1MappedSetType.class/instance/tag.st b/source/ASN1.package/ASN1MappedSetType.class/instance/tag.st deleted file mode 100644 index 11a868c..0000000 --- a/source/ASN1.package/ASN1MappedSetType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 49 \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedSetType.class/properties.json b/source/ASN1.package/ASN1MappedSetType.class/properties.json deleted file mode 100644 index 39f7d87..0000000 --- a/source/ASN1.package/ASN1MappedSetType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1MappedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1MappedSetType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedType.class/README.md b/source/ASN1.package/ASN1MappedType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1MappedType.class/instance/add.type.default..st b/source/ASN1.package/ASN1MappedType.class/instance/add.type.default..st deleted file mode 100644 index 08bdf00..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/add.type.default..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -add: aSymbol type: type default: anObject - - ^(self add: aSymbol type: type) - default: anObject; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/add.type.explicitTag.default..st b/source/ASN1.package/ASN1MappedType.class/instance/add.type.explicitTag.default..st deleted file mode 100644 index 19316de..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/add.type.explicitTag.default..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -add: aSymbol type: type explicitTag: integer default: anObject - - ^(self add: aSymbol type: type explicitTag: integer) - default: anObject; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/add.type.implicitTag.default..st b/source/ASN1.package/ASN1MappedType.class/instance/add.type.implicitTag.default..st deleted file mode 100644 index f075318..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/add.type.implicitTag.default..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -add: aSymbol type: type implicitTag: integer default: anObject - - ^(self add: aSymbol type: type implicitTag: integer) - default: anObject; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type..st b/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type..st deleted file mode 100644 index d89705a..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -addOptional: aSymbol type: type - - ^(self add: aSymbol type: type) - optional: true; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.default..st b/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.default..st deleted file mode 100644 index 4a9b4de..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.default..st +++ /dev/null @@ -1,7 +0,0 @@ -accessing - element construction -addOptional: aSymbol type: type default: anObject - - ^(self add: aSymbol type: type) - optional: true; - default: anObject; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.explicitTag..st b/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.explicitTag..st deleted file mode 100644 index 7815106..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.explicitTag..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -addOptional: aSymbol type: type explicitTag: integer - - ^(self add: aSymbol type: type explicitTag: integer) - optional: true; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.implicitTag..st b/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.implicitTag..st deleted file mode 100644 index 540e8e2..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/addOptional.type.implicitTag..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -addOptional: aSymbol type: type implicitTag: integer - - ^(self add: aSymbol type: type implicitTag: integer) - optional: true; - yourself. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st b/source/ASN1.package/ASN1MappedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st deleted file mode 100644 index ae52773..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st +++ /dev/null @@ -1,17 +0,0 @@ -decoding -decodeValueIndefiniteLengthWithDERStream: derStream - - | target elementStream ele value | - target := self mapping new. - elementStream := self elements readStream. - [derStream peekTag = 0 - ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] - ifFalse: [value := elementStream next decode: target withDERStream: derStream]. - value isKindOf: ASN1EndOfIndefiniteLengthMarker] whileFalse. - [elementStream atEnd] - whileFalse: [ - ele := elementStream next. - ele hasDefault ifTrue: [ele value: ele default into: target]. - ele hasDefaultOrIsOptional - ifFalse: [self error: 'missing element'] ]. - ^ target diff --git a/source/ASN1.package/ASN1MappedType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1MappedType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 0aaf808..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,21 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | stopPosition target elementStream ele | - length = -1 - ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. - stopPosition := derStream position + length. - target := self mapping new. - elementStream := self elements readStream. - [elementStream atEnd or: [derStream position >= stopPosition]] - whileFalse: [ - ele := elementStream next. - ele decode: target withDERStream: derStream]. - [elementStream atEnd] - whileFalse: [ - ele := elementStream next. - ele hasDefault ifTrue: [ele value: ele default into: target]. - ele hasDefaultOrIsOptional - ifFalse: [self error: 'missing element'] ]. - derStream position < stopPosition ifTrue: [self error: 'invalid length']. - ^ target diff --git a/source/ASN1.package/ASN1MappedType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1MappedType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index db1e53a..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,5 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - self elements do: [:each | - each encode: anObject withDERStream: derStream]. diff --git a/source/ASN1.package/ASN1MappedType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1MappedType.class/instance/isTypeFor..st deleted file mode 100644 index 78a18bd..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/isTypeFor..st +++ /dev/null @@ -1,6 +0,0 @@ -testing -isTypeFor: anObject - - ^ self mapping notNil - ifTrue: [anObject isKindOf: self mapping] - ifFalse: [anObject asn1Tag = self tag] diff --git a/source/ASN1.package/ASN1MappedType.class/instance/mapping..st b/source/ASN1.package/ASN1MappedType.class/instance/mapping..st deleted file mode 100644 index 8fc72a5..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/mapping..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mapping: anObject - "Set the value of mapping" - - mapping := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedType.class/instance/mapping.st b/source/ASN1.package/ASN1MappedType.class/instance/mapping.st deleted file mode 100644 index ded82b7..0000000 --- a/source/ASN1.package/ASN1MappedType.class/instance/mapping.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mapping - "Answer the value of mapping" - - ^ mapping \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappedType.class/properties.json b/source/ASN1.package/ASN1MappedType.class/properties.json deleted file mode 100644 index 6f32914..0000000 --- a/source/ASN1.package/ASN1MappedType.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1StructuredType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "mapping" - ], - "name" : "ASN1MappedType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/README.md b/source/ASN1.package/ASN1MappingSubType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/accessor.st b/source/ASN1.package/ASN1MappingSubType.class/instance/accessor.st deleted file mode 100644 index 71942b6..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/accessor.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -accessor - - ^self mappingSymbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1MappingSubType.class/instance/decodeWithDERStream..st deleted file mode 100644 index 960c5c8..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,8 +0,0 @@ -decoding -decodeWithDERStream: derStream - - | target val | - target := self mapping new. - val := self parent decodeWithDERStream: derStream. - target perform: self mutator with: val. - ^ target diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/decodeWithDERStream.owner.ownerType..st b/source/ASN1.package/ASN1MappingSubType.class/instance/decodeWithDERStream.owner.ownerType..st deleted file mode 100644 index 0a1b515..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/decodeWithDERStream.owner.ownerType..st +++ /dev/null @@ -1,11 +0,0 @@ -decoding -decodeWithDERStream: derStream owner: owner ownerType: ownerType - - | target val | - target := self mapping new. - val := self parent - decodeWithDERStream: derStream - owner: owner - ownerType: ownerType. - target perform: self mutator with: val. - ^ target diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1MappingSubType.class/instance/encode.withDERStream..st deleted file mode 100644 index 044ccb2..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,6 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - ^ self parent - encode: (anObject perform: self accessor) - withDERStream: derStream diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/encode.withDERStream.owner.ownerType..st b/source/ASN1.package/ASN1MappingSubType.class/instance/encode.withDERStream.owner.ownerType..st deleted file mode 100644 index 3b2266b..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/encode.withDERStream.owner.ownerType..st +++ /dev/null @@ -1,8 +0,0 @@ -encoding -encode: anObject withDERStream: derStream owner: owner ownerType: ownerType - - ^ self parent - encode: (anObject perform: self accessor) - withDERStream: derStream - owner: owner - ownerType: ownerType diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/mapping..st b/source/ASN1.package/ASN1MappingSubType.class/instance/mapping..st deleted file mode 100644 index 8fc72a5..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/mapping..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mapping: anObject - "Set the value of mapping" - - mapping := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/mapping.mappingSymbol.type..st b/source/ASN1.package/ASN1MappingSubType.class/instance/mapping.mappingSymbol.type..st deleted file mode 100644 index 4036bf2..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/mapping.mappingSymbol.type..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -mapping: aClass mappingSymbol: aSymbol type: aType - - self mapping: aClass. - self mappingSymbol: aSymbol. - self parent: aType. diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/mapping.st b/source/ASN1.package/ASN1MappingSubType.class/instance/mapping.st deleted file mode 100644 index ded82b7..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/mapping.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mapping - "Answer the value of mapping" - - ^ mapping \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/mappingSymbol..st b/source/ASN1.package/ASN1MappingSubType.class/instance/mappingSymbol..st deleted file mode 100644 index f7ed97e..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/mappingSymbol..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mappingSymbol: anObject - "Set the value of mappingSymbol" - - mappingSymbol := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/mappingSymbol.st b/source/ASN1.package/ASN1MappingSubType.class/instance/mappingSymbol.st deleted file mode 100644 index c50cc9c..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/mappingSymbol.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mappingSymbol - "Answer the value of mappingSymbol" - - ^ mappingSymbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/matchesTag..st b/source/ASN1.package/ASN1MappingSubType.class/instance/matchesTag..st deleted file mode 100644 index 5060fa4..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^ self parent matchesTag: anInteger \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/instance/mutator.st b/source/ASN1.package/ASN1MappingSubType.class/instance/mutator.st deleted file mode 100644 index e5bf7b3..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/instance/mutator.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -mutator - - ^(self mappingSymbol copyWith: $:) asSymbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1MappingSubType.class/properties.json b/source/ASN1.package/ASN1MappingSubType.class/properties.json deleted file mode 100644 index e40fdb7..0000000 --- a/source/ASN1.package/ASN1MappingSubType.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1SubType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "mapping", - "mappingSymbol" - ], - "name" : "ASN1MappingSubType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/README.md b/source/ASN1.package/ASN1Module.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Module.class/class/initialize.st b/source/ASN1.package/ASN1Module.class/class/initialize.st deleted file mode 100644 index 63e3e50..0000000 --- a/source/ASN1.package/ASN1Module.class/class/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -initialize - - Modules := Dictionary new. diff --git a/source/ASN1.package/ASN1Module.class/class/modules.st b/source/ASN1.package/ASN1Module.class/class/modules.st deleted file mode 100644 index 71170c3..0000000 --- a/source/ASN1.package/ASN1Module.class/class/modules.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -modules - - ^ Modules \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/class/name..st b/source/ASN1.package/ASN1Module.class/class/name..st deleted file mode 100644 index 5272a98..0000000 --- a/source/ASN1.package/ASN1Module.class/class/name..st +++ /dev/null @@ -1,13 +0,0 @@ -instance creation -name: aSymbol - "ASN1Module name: #x509" - - | mod | - ^ self modules - at: aSymbol - ifAbsent: [ - mod := self new - name: aSymbol; - yourself. - self modules at: mod name put: mod. - mod]. diff --git a/source/ASN1.package/ASN1Module.class/instance/add..st b/source/ASN1.package/ASN1Module.class/instance/add..st deleted file mode 100644 index f2f2b59..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/add..st +++ /dev/null @@ -1,8 +0,0 @@ -services -add: aType - - | old | - old := self definitions at: aType name ifAbsent: [nil]. - aType module: self. - old ifNotNil: [old becomeForward: aType]. - ^self definitions at: aType name put: aType. diff --git a/source/ASN1.package/ASN1Module.class/instance/addImport..st b/source/ASN1.package/ASN1Module.class/instance/addImport..st deleted file mode 100644 index a2e75d3..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/addImport..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -addImport: aModule - - (self imports includes: aModule) - ifFalse: [self imports add: aModule]. diff --git a/source/ASN1.package/ASN1Module.class/instance/any..st b/source/ASN1.package/ASN1Module.class/instance/any..st deleted file mode 100644 index 8d5e03b..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/any..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -any: aSymbol - - ^ASN1AnyType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/any.definedBy..st b/source/ASN1.package/ASN1Module.class/instance/any.definedBy..st deleted file mode 100644 index 6b0986a..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/any.definedBy..st +++ /dev/null @@ -1,6 +0,0 @@ -definitions - mapped -any: aSymbol definedBy: slotSymbol - - ^ (ASN1AnyDefinedByType name: aSymbol in: self) - definedBy: slotSymbol; - yourself. diff --git a/source/ASN1.package/ASN1Module.class/instance/assign.from..st b/source/ASN1.package/ASN1Module.class/instance/assign.from..st deleted file mode 100644 index 65d3cc9..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/assign.from..st +++ /dev/null @@ -1,6 +0,0 @@ -definitions - mapped -assign: aSymbol from: otherSymbol - - ^ (ASN1AssignmentSubType name: aSymbol in: self) - parent: otherSymbol; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/bitString..st b/source/ASN1.package/ASN1Module.class/instance/bitString..st deleted file mode 100644 index 46dd517..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/bitString..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -bitString: aSymbol - - ^ASN1BitStringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/bmpString..st b/source/ASN1.package/ASN1Module.class/instance/bmpString..st deleted file mode 100644 index d992298..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/bmpString..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -bmpString: aSymbol - - ^ASN1BMPStringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/boolean..st b/source/ASN1.package/ASN1Module.class/instance/boolean..st deleted file mode 100644 index e2f88c1..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/boolean..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -boolean: aSymbol - - ^ASN1BooleanType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/byteArray..st b/source/ASN1.package/ASN1Module.class/instance/byteArray..st deleted file mode 100644 index 7b42abc..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/byteArray..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -byteArray: aSymbol - - ^ASN1ByteArrayType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/choice..st b/source/ASN1.package/ASN1Module.class/instance/choice..st deleted file mode 100644 index b16e314..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/choice..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -choice: aSymbol - - ^ASN1ChoiceType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/definitions..st b/source/ASN1.package/ASN1Module.class/instance/definitions..st deleted file mode 100644 index 1421f98..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/definitions..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -definitions: anObject - "Set the value of definitions" - - definitions := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/definitions.st b/source/ASN1.package/ASN1Module.class/instance/definitions.st deleted file mode 100644 index 0fa5b15..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/definitions.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -definitions - "Answer the value of definitions" - - ^ definitions \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/enumerated..st b/source/ASN1.package/ASN1Module.class/instance/enumerated..st deleted file mode 100644 index 3ec16ad..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/enumerated..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -enumerated: aSymbol - - ^self notYetImplemented diff --git a/source/ASN1.package/ASN1Module.class/instance/explicit.type.tag..st b/source/ASN1.package/ASN1Module.class/instance/explicit.type.tag..st deleted file mode 100644 index 003bd93..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/explicit.type.tag..st +++ /dev/null @@ -1,7 +0,0 @@ -definitions - mapped -explicit: aSymbol type: type tag: tag - - ^ (ASN1ExplicitSubType name: aSymbol in: self) - parent: type; - tag: tag; - yourself diff --git a/source/ASN1.package/ASN1Module.class/instance/find..st b/source/ASN1.package/ASN1Module.class/instance/find..st deleted file mode 100644 index 7594c6f..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/find..st +++ /dev/null @@ -1,18 +0,0 @@ -services -find: aSymbol - "check the following sources: - - ASN1Type subclasses - - my definitions - - import definitions - otherwise create a ASN1TypeReference" - - | type | - type := self primitiveTypeFind: aSymbol. - type notNil ifTrue: [^ type]. - type := self localFind: aSymbol. - type notNil ifTrue: [^ type]. - self imports - do: [:eachImportModule | - type := eachImportModule localFind: aSymbol. - type notNil ifTrue: [^ type]]. - ^ ASN1TypeReference name: aSymbol in: self. diff --git a/source/ASN1.package/ASN1Module.class/instance/ia5String..st b/source/ASN1.package/ASN1Module.class/instance/ia5String..st deleted file mode 100644 index a483227..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/ia5String..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -ia5String: aSymbol - - ^ASN1IA5StringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/implicit.type.tag..st b/source/ASN1.package/ASN1Module.class/instance/implicit.type.tag..st deleted file mode 100644 index 0a3ce52..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/implicit.type.tag..st +++ /dev/null @@ -1,7 +0,0 @@ -definitions - mapped -implicit: aSymbol type: type tag: tag - - ^ (ASN1ImplicitSubType name: aSymbol in: self) - parent: type; - tag: tag; - yourself diff --git a/source/ASN1.package/ASN1Module.class/instance/imports..st b/source/ASN1.package/ASN1Module.class/instance/imports..st deleted file mode 100644 index e7aaec8..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/imports..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -imports: anObject - "Set the value of imports" - - imports := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/imports.st b/source/ASN1.package/ASN1Module.class/instance/imports.st deleted file mode 100644 index 6000959..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/imports.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -imports - "Answer the value of imports" - - ^ imports \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/initialize.st b/source/ASN1.package/ASN1Module.class/instance/initialize.st deleted file mode 100644 index 6aa3e44..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -initialize-release -initialize - - self definitions: Dictionary new. - self imports: OrderedCollection new. diff --git a/source/ASN1.package/ASN1Module.class/instance/integer..st b/source/ASN1.package/ASN1Module.class/instance/integer..st deleted file mode 100644 index 99d55e7..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/integer..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -integer: aSymbol - - ^ASN1IntegerType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/localFind..st b/source/ASN1.package/ASN1Module.class/instance/localFind..st deleted file mode 100644 index cb915c7..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/localFind..st +++ /dev/null @@ -1,6 +0,0 @@ -services -localFind: aSymbol - - ^ self definitions - at: aSymbol - ifAbsent: [^ nil]. diff --git a/source/ASN1.package/ASN1Module.class/instance/mapped..st b/source/ASN1.package/ASN1Module.class/instance/mapped..st deleted file mode 100644 index a983947..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/mapped..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -mapped: aSymbol - - ^ ASN1MappingSubType name: aSymbol in: self diff --git a/source/ASN1.package/ASN1Module.class/instance/name..st b/source/ASN1.package/ASN1Module.class/instance/name..st deleted file mode 100644 index e56388a..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/name..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -name: anObject - "Set the value of name" - - name := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/name.st b/source/ASN1.package/ASN1Module.class/instance/name.st deleted file mode 100644 index 4b7f350..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/name.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -name - - ^ name \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/null..st b/source/ASN1.package/ASN1Module.class/instance/null..st deleted file mode 100644 index de24c22..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/null..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -null: aSymbol - - ^ASN1NullType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/objectIdentifier..st b/source/ASN1.package/ASN1Module.class/instance/objectIdentifier..st deleted file mode 100644 index 839f91c..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/objectIdentifier..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -objectIdentifier: aSymbol - - ^ASN1ObjectIdentifierType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/primitiveTypeFind..st b/source/ASN1.package/ASN1Module.class/instance/primitiveTypeFind..st deleted file mode 100644 index aec240e..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/primitiveTypeFind..st +++ /dev/null @@ -1,6 +0,0 @@ -services -primitiveTypeFind: aSymbol - - ^ (ASN1Type allSubclasses - detect: [:class | class name asSymbol = aSymbol] - ifNone: [^ nil]) new diff --git a/source/ASN1.package/ASN1Module.class/instance/printableString..st b/source/ASN1.package/ASN1Module.class/instance/printableString..st deleted file mode 100644 index 30d90ca..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/printableString..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -printableString: aSymbol - - ^ASN1PrintableStringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/remove..st b/source/ASN1.package/ASN1Module.class/instance/remove..st deleted file mode 100644 index 1e02e71..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/remove..st +++ /dev/null @@ -1,6 +0,0 @@ -services -remove: aType - - self definitions removeKey: aType name. - aType module: nil. - ^aType \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/sequence..st b/source/ASN1.package/ASN1Module.class/instance/sequence..st deleted file mode 100644 index 3e75129..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/sequence..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -sequence: aSymbol - - ^ASN1SequenceType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/sequence.mapping..st b/source/ASN1.package/ASN1Module.class/instance/sequence.mapping..st deleted file mode 100644 index 2385da6..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/sequence.mapping..st +++ /dev/null @@ -1,6 +0,0 @@ -definitions - mapped -sequence: aSymbol mapping: mappingClass - - ^ (ASN1MappedSequenceType name: aSymbol in: self) - mapping: mappingClass; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/sequence.of..st b/source/ASN1.package/ASN1Module.class/instance/sequence.of..st deleted file mode 100644 index 4519d0f..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/sequence.of..st +++ /dev/null @@ -1,6 +0,0 @@ -definitions - mapped -sequence: aSymbol of: typeSpec - - ^ (ASN1SequenceOfType name: aSymbol in: self) - elementType: typeSpec; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/set..st b/source/ASN1.package/ASN1Module.class/instance/set..st deleted file mode 100644 index 67aa118..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/set..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -set: aSymbol - - ^ASN1SetType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/set.mapping..st b/source/ASN1.package/ASN1Module.class/instance/set.mapping..st deleted file mode 100644 index 9ebbb35..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/set.mapping..st +++ /dev/null @@ -1,6 +0,0 @@ -definitions - mapped -set: aSymbol mapping: mappingClass - - ^ (ASN1MappedSetType name: aSymbol in: self) - mapping: mappingClass; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/set.of..st b/source/ASN1.package/ASN1Module.class/instance/set.of..st deleted file mode 100644 index e39e242..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/set.of..st +++ /dev/null @@ -1,6 +0,0 @@ -definitions - mapped -set: aSymbol of: typeSpec - - ^ (ASN1SetOfType name: aSymbol in: self) - elementType: typeSpec; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/teletextString..st b/source/ASN1.package/ASN1Module.class/instance/teletextString..st deleted file mode 100644 index 0356ef9..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/teletextString..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -teletextString: aSymbol - - ^ASN1TeletexStringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/typeFrom..st b/source/ASN1.package/ASN1Module.class/instance/typeFrom..st deleted file mode 100644 index 72034f1..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/typeFrom..st +++ /dev/null @@ -1,6 +0,0 @@ -services -typeFrom: aTypeSpec - - (aTypeSpec isKindOf: ASN1Type) ifTrue: [^ aTypeSpec]. - aTypeSpec isBehavior ifTrue: [^ aTypeSpec new]. - ^self find: aTypeSpec \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/universalString..st b/source/ASN1.package/ASN1Module.class/instance/universalString..st deleted file mode 100644 index 39f5ad0..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/universalString..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -universalString: aSymbol - - ^ASN1UniversalStringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/utcTime..st b/source/ASN1.package/ASN1Module.class/instance/utcTime..st deleted file mode 100644 index d885ebb..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/utcTime..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -utcTime: aSymbol - - ^ASN1UTCTimeType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/instance/utf8String..st b/source/ASN1.package/ASN1Module.class/instance/utf8String..st deleted file mode 100644 index 2d54a15..0000000 --- a/source/ASN1.package/ASN1Module.class/instance/utf8String..st +++ /dev/null @@ -1,4 +0,0 @@ -definitions - mapped -utf8String: aSymbol - - ^ASN1StringType name: aSymbol in: self \ No newline at end of file diff --git a/source/ASN1.package/ASN1Module.class/properties.json b/source/ASN1.package/ASN1Module.class/properties.json deleted file mode 100644 index 09fd276..0000000 --- a/source/ASN1.package/ASN1Module.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "Modules" - ], - "instvars" : [ - "name", - "definitions", - "imports" - ], - "name" : "ASN1Module", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Null.class/README.md b/source/ASN1.package/ASN1Null.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Null.class/instance/asn1Tag.st b/source/ASN1.package/ASN1Null.class/instance/asn1Tag.st deleted file mode 100644 index 8407a23..0000000 --- a/source/ASN1.package/ASN1Null.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -asn1Tag - - ^ 5 diff --git a/source/ASN1.package/ASN1Null.class/instance/isNil.st b/source/ASN1.package/ASN1Null.class/instance/isNil.st deleted file mode 100644 index 1667ef5..0000000 --- a/source/ASN1.package/ASN1Null.class/instance/isNil.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -isNil - - ^ true \ No newline at end of file diff --git a/source/ASN1.package/ASN1Null.class/properties.json b/source/ASN1.package/ASN1Null.class/properties.json deleted file mode 100644 index 3d5bd76..0000000 --- a/source/ASN1.package/ASN1Null.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Value", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1Null", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1NullType.class/README.md b/source/ASN1.package/ASN1NullType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1NullType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1NullType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 9f759ba..0000000 --- a/source/ASN1.package/ASN1NullType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - ^ ASN1Null new \ No newline at end of file diff --git a/source/ASN1.package/ASN1NullType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1NullType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 0ed579e..0000000 --- a/source/ASN1.package/ASN1NullType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,3 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - diff --git a/source/ASN1.package/ASN1NullType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1NullType.class/instance/isTypeFor..st deleted file mode 100644 index e80d66d..0000000 --- a/source/ASN1.package/ASN1NullType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isNil \ No newline at end of file diff --git a/source/ASN1.package/ASN1NullType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1NullType.class/instance/sizeOfObject..st deleted file mode 100644 index c30e054..0000000 --- a/source/ASN1.package/ASN1NullType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ 0 \ No newline at end of file diff --git a/source/ASN1.package/ASN1NullType.class/instance/tag.st b/source/ASN1.package/ASN1NullType.class/instance/tag.st deleted file mode 100644 index 2b85ce0..0000000 --- a/source/ASN1.package/ASN1NullType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 5 \ No newline at end of file diff --git a/source/ASN1.package/ASN1NullType.class/properties.json b/source/ASN1.package/ASN1NullType.class/properties.json deleted file mode 100644 index 87d4483..0000000 --- a/source/ASN1.package/ASN1NullType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1NullType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/README.md b/source/ASN1.package/ASN1ObjectId.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ObjectId.class/class/fromString..st b/source/ASN1.package/ASN1ObjectId.class/class/fromString..st deleted file mode 100644 index d1d9d3f..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/class/fromString..st +++ /dev/null @@ -1,7 +0,0 @@ -asn -fromString: oidString - - ^ self new - oid: oidString; - initializeDescription; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/^equals.st b/source/ASN1.package/ASN1ObjectId.class/instance/^equals.st deleted file mode 100644 index 4493303..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/^equals.st +++ /dev/null @@ -1,3 +0,0 @@ -private - parsing -= anotherOid - ^anotherOid class = self class and: [self oid = anotherOid oid] \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/asByteArray.st b/source/ASN1.package/ASN1ObjectId.class/instance/asByteArray.st deleted file mode 100644 index fe60540..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/asByteArray.st +++ /dev/null @@ -1,23 +0,0 @@ -private - parsing -asByteArray - - | dataStream oidTokens b n lengthStream bytes | - dataStream := WriteStream on: (ByteArray new: 16). - oidTokens := self oid tokensBasedOn: $.. - dataStream nextPut: (((oidTokens at: 1) asInteger * 40) + (oidTokens at: 2) asInteger). - 3 to: oidTokens size do: [:i | - b := (oidTokens at: i) asInteger. - (b <= 16r7F) - ifTrue: [dataStream nextPut: b] - ifFalse: [ - n := b. - lengthStream := WriteStream on: (ByteArray new: 4). - lengthStream nextPut: (n \\ 128). - [n := n bitShift: -7. - (n bitShift: -7) = 0] - whileFalse: [lengthStream nextPut: ((n \\ 128) bitOr: 16r80)]. - lengthStream nextPut: ((n \\ 128) bitOr: 16r80). - bytes := lengthStream contents reversed. - dataStream - nextPutAll: bytes ]]. - ^ dataStream contents. diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/asn1Tag.st b/source/ASN1.package/ASN1ObjectId.class/instance/asn1Tag.st deleted file mode 100644 index 972f971..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 6 diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/description..st b/source/ASN1.package/ASN1ObjectId.class/instance/description..st deleted file mode 100644 index 56d2e67..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/description..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -description: anObject - "Set the receiver's instance variable description to anObject." - - description := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/description.st b/source/ASN1.package/ASN1ObjectId.class/instance/description.st deleted file mode 100644 index 7b314e8..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/description.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -description - "Answer the receiver's instance variable description." - - ^description \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/hash.st b/source/ASN1.package/ASN1ObjectId.class/instance/hash.st deleted file mode 100644 index 3f2f698..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/hash.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -hash - - ^ self oid hash \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/initializeDescription.st b/source/ASN1.package/ASN1ObjectId.class/instance/initializeDescription.st deleted file mode 100644 index 5de2a92..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/initializeDescription.st +++ /dev/null @@ -1,15 +0,0 @@ -private - parsing -initializeDescription - - -" oid := 'x', self getOID. - ix := 1. - [ix < oid size] - whileTrue: [ - ((oid at: ix) = $.) - ifTrue: [oid at: ix put: $x]. - ix := ix + 1. - ]. - (ASN1ObjectIdentifiers includesKey: oid asSymbol) - ifTrue: [^ASN1ObjectIdentifiers at: oid asSymbol] - ifFalse: [^self getOID]" \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/oid..st b/source/ASN1.package/ASN1ObjectId.class/instance/oid..st deleted file mode 100644 index 3ce8295..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/oid..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -oid: anObject - "Set the receiver's instance variable oid to anObject." - - oid := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/oid.st b/source/ASN1.package/ASN1ObjectId.class/instance/oid.st deleted file mode 100644 index a613042..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/oid.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -oid - "Answer the receiver's instance variable oid." - - ^oid \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/instance/printOn..st b/source/ASN1.package/ASN1ObjectId.class/instance/printOn..st deleted file mode 100644 index 655fbd7..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/instance/printOn..st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -printOn: aStream - - aStream nextPutAll: self oid \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectId.class/properties.json b/source/ASN1.package/ASN1ObjectId.class/properties.json deleted file mode 100644 index b364421..0000000 --- a/source/ASN1.package/ASN1ObjectId.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Value", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "oid", - "description" - ], - "name" : "ASN1ObjectId", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/README.md b/source/ASN1.package/ASN1ObjectIdentifierType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index a4f3c9d..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,16 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | b oid len | - b := derStream next. - oid := ((b // 40) asString) , '.' ,((b rem:40) asString). - len := 0. - 2 to: length do: [:i | - b := derStream next. - ((b bitAnd: 16r80) = 16r80) - ifTrue: [len := ((len bitShift: 7) + (b bitAnd: 16r7F))] - ifFalse: [ - len := (len bitShift: 7) + b. - oid := oid , '.', (len asString). - len := 0]]. - ^ ASN1ObjectId fromString: oid. \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/encode.withDERStream..st deleted file mode 100644 index 8147bb7..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,10 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - "For a speedup" - - | bytes | - derStream nextPutTag: anObject asn1Tag. - bytes := anObject asByteArray. - derStream nextPutLength: bytes size. - derStream nextPutAll: bytes. - ^ derStream diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 4cf0363..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,7 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - | bytes | - bytes := anObject asByteArray. - derStream nextPutAll: bytes. - ^ derStream diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/isTypeFor..st deleted file mode 100644 index 9c4724b..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1ObjectId \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/sizeOfObject..st deleted file mode 100644 index d83793d..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ anObject asByteArray size. diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/tag.st b/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/tag.st deleted file mode 100644 index 7059c04..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 6 \ No newline at end of file diff --git a/source/ASN1.package/ASN1ObjectIdentifierType.class/properties.json b/source/ASN1.package/ASN1ObjectIdentifierType.class/properties.json deleted file mode 100644 index 5c9d138..0000000 --- a/source/ASN1.package/ASN1ObjectIdentifierType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1ObjectIdentifierType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1OctetsType.class/README.md b/source/ASN1.package/ASN1OctetsType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1OctetsType.class/instance/decodeConstructedValueWithDERStream.length..st b/source/ASN1.package/ASN1OctetsType.class/instance/decodeConstructedValueWithDERStream.length..st deleted file mode 100644 index afa9f35..0000000 --- a/source/ASN1.package/ASN1OctetsType.class/instance/decodeConstructedValueWithDERStream.length..st +++ /dev/null @@ -1,11 +0,0 @@ -decoding -decodeConstructedValueWithDERStream: derStream length: length - - | octets stopPosition | - length = -1 - ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. - octets := self octetsClass new. - stopPosition := derStream position + length. - [derStream position < stopPosition] whileTrue: [ - octets := octets, (self decodeWithDERStream: derStream)]. - ^ octets \ No newline at end of file diff --git a/source/ASN1.package/ASN1OctetsType.class/instance/decodeValueIndefiniteLengthWithDERStream..st b/source/ASN1.package/ASN1OctetsType.class/instance/decodeValueIndefiniteLengthWithDERStream..st deleted file mode 100644 index 3c54999..0000000 --- a/source/ASN1.package/ASN1OctetsType.class/instance/decodeValueIndefiniteLengthWithDERStream..st +++ /dev/null @@ -1,11 +0,0 @@ -decoding -decodeValueIndefiniteLengthWithDERStream: derStream - - | octets value | - octets := self octetsClass new. - [derStream peekTag = 0 - ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] - ifFalse: [value := self decodeWithDERStream: derStream]. - value isKindOf: ASN1EndOfIndefiniteLengthMarker] whileFalse: [ - octets := octets, value]. - ^ octets \ No newline at end of file diff --git a/source/ASN1.package/ASN1OctetsType.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1OctetsType.class/instance/decodeWithDERStream..st deleted file mode 100644 index 97a3fda..0000000 --- a/source/ASN1.package/ASN1OctetsType.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,17 +0,0 @@ -decoding -decodeWithDERStream: derStream - - | tag numericTag object | - tag := derStream peekTag. - numericTag := tag bitAnd: 2r00011111. - numericTag = (self asn1Tag bitAnd: 2r00011111) - ifFalse: [self error: 'asn1 decoder: bad tag']. - derStream nextTag. - (tag bitAnd: 2r00100000) > 0 - ifTrue: [object := self - decodeConstructedValueWithDERStream: derStream - length: derStream nextLength] - ifFalse: [object := self - decodeValueWithDERStream: derStream - length: derStream nextLength]. - ^ object \ No newline at end of file diff --git a/source/ASN1.package/ASN1OctetsType.class/instance/octetsClass.st b/source/ASN1.package/ASN1OctetsType.class/instance/octetsClass.st deleted file mode 100644 index 1330ce9..0000000 --- a/source/ASN1.package/ASN1OctetsType.class/instance/octetsClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -octetsClass - - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/ASN1.package/ASN1OctetsType.class/properties.json b/source/ASN1.package/ASN1OctetsType.class/properties.json deleted file mode 100644 index 159f954..0000000 --- a/source/ASN1.package/ASN1OctetsType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1OctetsType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/README.md b/source/ASN1.package/ASN1Pragma.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Pragma.class/class/LICENSE.st b/source/ASN1.package/ASN1Pragma.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/ASN1.package/ASN1Pragma.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/ASN1.package/ASN1Pragma.class/class/fromPragma..st b/source/ASN1.package/ASN1Pragma.class/class/fromPragma..st deleted file mode 100644 index de9b064..0000000 --- a/source/ASN1.package/ASN1Pragma.class/class/fromPragma..st +++ /dev/null @@ -1,5 +0,0 @@ -instance creation -fromPragma: aPragma - | aClass | - aClass := (self isAccessorPragma: aPragma) ifTrue: [ASN1PragmaAccessor] ifFalse: [ASN1PragmaMutator]. - ^aClass fromPragma: aPragma \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/class/isAccessorPragma..st b/source/ASN1.package/ASN1Pragma.class/class/isAccessorPragma..st deleted file mode 100644 index 250e8df..0000000 --- a/source/ASN1.package/ASN1Pragma.class/class/isAccessorPragma..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -isAccessorPragma: aPragma - ^aPragma keyword = #asn1FieldAccessor: \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/asn1name..st b/source/ASN1.package/ASN1Pragma.class/instance/asn1name..st deleted file mode 100644 index f2f5afb..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/asn1name..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asn1name: anObject - "Set the value of asn1name" - - asn1name := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/asn1name.st b/source/ASN1.package/ASN1Pragma.class/instance/asn1name.st deleted file mode 100644 index 6737427..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/asn1name.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asn1name - "Answer the value of asn1name" - - ^ asn1name \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/method..st b/source/ASN1.package/ASN1Pragma.class/instance/method..st deleted file mode 100644 index ce460c4..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/method..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -method: anObject - "Set the value of method" - - method := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/method.st b/source/ASN1.package/ASN1Pragma.class/instance/method.st deleted file mode 100644 index f681db4..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/method.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -method - "Answer the value of method" - - ^ method \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/pragma..st b/source/ASN1.package/ASN1Pragma.class/instance/pragma..st deleted file mode 100644 index 886b977..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/pragma..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -pragma: anObject - "Set the value of pragma" - - pragma := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/pragma.st b/source/ASN1.package/ASN1Pragma.class/instance/pragma.st deleted file mode 100644 index 27ff8b4..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/pragma.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -pragma - "Answer the value of pragma" - - ^ pragma \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/systemClass..st b/source/ASN1.package/ASN1Pragma.class/instance/systemClass..st deleted file mode 100644 index e739f57..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/systemClass..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -systemClass: anObject - "Set the value of systemClass" - - systemClass := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/instance/systemClass.st b/source/ASN1.package/ASN1Pragma.class/instance/systemClass.st deleted file mode 100644 index aaf1c0a..0000000 --- a/source/ASN1.package/ASN1Pragma.class/instance/systemClass.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -systemClass - "Answer the value of systemClass" - - ^ systemClass \ No newline at end of file diff --git a/source/ASN1.package/ASN1Pragma.class/properties.json b/source/ASN1.package/ASN1Pragma.class/properties.json deleted file mode 100644 index 8764c46..0000000 --- a/source/ASN1.package/ASN1Pragma.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-DefinitionModel", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "pragma", - "asn1name", - "systemClass", - "method" - ], - "name" : "ASN1Pragma", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaAccessor.class/README.md b/source/ASN1.package/ASN1PragmaAccessor.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1PragmaAccessor.class/class/LICENSE.st b/source/ASN1.package/ASN1PragmaAccessor.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/ASN1.package/ASN1PragmaAccessor.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/ASN1.package/ASN1PragmaAccessor.class/class/fromPragma..st b/source/ASN1.package/ASN1PragmaAccessor.class/class/fromPragma..st deleted file mode 100644 index 813e631..0000000 --- a/source/ASN1.package/ASN1PragmaAccessor.class/class/fromPragma..st +++ /dev/null @@ -1,9 +0,0 @@ -instance creation -fromPragma: aPragma - ^self new - pragma: aPragma; - asn1name: aPragma arguments first; - method: aPragma method methodReference methodSymbol; - systemClass: aPragma method methodReference classSymbol; - yourself - \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaAccessor.class/instance/printOn..st b/source/ASN1.package/ASN1PragmaAccessor.class/instance/printOn..st deleted file mode 100644 index 76442b3..0000000 --- a/source/ASN1.package/ASN1PragmaAccessor.class/instance/printOn..st +++ /dev/null @@ -1,3 +0,0 @@ -printing -printOn: aWS - aWS nextPutAll: self asn1name asString, String tab, self systemClass asString, '>>', self method asString. \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaAccessor.class/properties.json b/source/ASN1.package/ASN1PragmaAccessor.class/properties.json deleted file mode 100644 index 1574928..0000000 --- a/source/ASN1.package/ASN1PragmaAccessor.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Pragma", - "category" : "ASN1-DefinitionModel", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1PragmaAccessor", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaMutator.class/README.md b/source/ASN1.package/ASN1PragmaMutator.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1PragmaMutator.class/class/LICENSE.st b/source/ASN1.package/ASN1PragmaMutator.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/ASN1.package/ASN1PragmaMutator.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/ASN1.package/ASN1PragmaMutator.class/class/fromPragma..st b/source/ASN1.package/ASN1PragmaMutator.class/class/fromPragma..st deleted file mode 100644 index 3cd63fb..0000000 --- a/source/ASN1.package/ASN1PragmaMutator.class/class/fromPragma..st +++ /dev/null @@ -1,9 +0,0 @@ -instance creation -fromPragma: aPragma - ^self new - pragma: aPragma; - asn1name: aPragma arguments first; - method: aPragma method methodReference methodSymbol; - systemClass: aPragma method methodReference classSymbol; - classOfMutatorArgument: aPragma arguments second; - yourself \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaMutator.class/instance/classOfMutatorArgument..st b/source/ASN1.package/ASN1PragmaMutator.class/instance/classOfMutatorArgument..st deleted file mode 100644 index 3366a03..0000000 --- a/source/ASN1.package/ASN1PragmaMutator.class/instance/classOfMutatorArgument..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -classOfMutatorArgument: anObject - "Set the value of classOfMutatorArgument" - - classOfMutatorArgument := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaMutator.class/instance/classOfMutatorArgument.st b/source/ASN1.package/ASN1PragmaMutator.class/instance/classOfMutatorArgument.st deleted file mode 100644 index 606b538..0000000 --- a/source/ASN1.package/ASN1PragmaMutator.class/instance/classOfMutatorArgument.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -classOfMutatorArgument - "Answer the value of classOfMutatorArgument" - - ^ classOfMutatorArgument \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaMutator.class/instance/printOn..st b/source/ASN1.package/ASN1PragmaMutator.class/instance/printOn..st deleted file mode 100644 index 08d98a3..0000000 --- a/source/ASN1.package/ASN1PragmaMutator.class/instance/printOn..st +++ /dev/null @@ -1,6 +0,0 @@ -printing -printOn: aWS - | classString article | - classString := self classOfMutatorArgument asString. - article := classString first isVowel ifTrue: [' an '] ifFalse: [' a ']. - aWS nextPutAll: self asn1name asString, String tab, self systemClass asString, '>>', self method asString, article, classString. \ No newline at end of file diff --git a/source/ASN1.package/ASN1PragmaMutator.class/properties.json b/source/ASN1.package/ASN1PragmaMutator.class/properties.json deleted file mode 100644 index 925f9ea..0000000 --- a/source/ASN1.package/ASN1PragmaMutator.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Pragma", - "category" : "ASN1-DefinitionModel", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "classOfMutatorArgument" - ], - "name" : "ASN1PragmaMutator", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1PrintableString.class/README.md b/source/ASN1.package/ASN1PrintableString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1PrintableString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1PrintableString.class/instance/asn1Tag.st deleted file mode 100644 index ed8a13c..0000000 --- a/source/ASN1.package/ASN1PrintableString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 19 \ No newline at end of file diff --git a/source/ASN1.package/ASN1PrintableString.class/properties.json b/source/ASN1.package/ASN1PrintableString.class/properties.json deleted file mode 100644 index aa0adde..0000000 --- a/source/ASN1.package/ASN1PrintableString.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1PrintableString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1PrintableStringType.class/README.md b/source/ASN1.package/ASN1PrintableStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1PrintableStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1PrintableStringType.class/instance/isTypeFor..st deleted file mode 100644 index cf9d38c..0000000 --- a/source/ASN1.package/ASN1PrintableStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1PrintableString \ No newline at end of file diff --git a/source/ASN1.package/ASN1PrintableStringType.class/instance/tag.st b/source/ASN1.package/ASN1PrintableStringType.class/instance/tag.st deleted file mode 100644 index 0b627a8..0000000 --- a/source/ASN1.package/ASN1PrintableStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 19 \ No newline at end of file diff --git a/source/ASN1.package/ASN1PrintableStringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1PrintableStringType.class/instance/wrapperClass.st deleted file mode 100644 index e19783c..0000000 --- a/source/ASN1.package/ASN1PrintableStringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1PrintableString diff --git a/source/ASN1.package/ASN1PrintableStringType.class/properties.json b/source/ASN1.package/ASN1PrintableStringType.class/properties.json deleted file mode 100644 index 9cdbb42..0000000 --- a/source/ASN1.package/ASN1PrintableStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1PrintableStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1SequenceOfType.class/README.md b/source/ASN1.package/ASN1SequenceOfType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1SequenceOfType.class/instance/containerClass.st b/source/ASN1.package/ASN1SequenceOfType.class/instance/containerClass.st deleted file mode 100644 index df3b4b2..0000000 --- a/source/ASN1.package/ASN1SequenceOfType.class/instance/containerClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -containerClass - - ^ OrderedCollection \ No newline at end of file diff --git a/source/ASN1.package/ASN1SequenceOfType.class/instance/tag.st b/source/ASN1.package/ASN1SequenceOfType.class/instance/tag.st deleted file mode 100644 index 44bfdff..0000000 --- a/source/ASN1.package/ASN1SequenceOfType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 48 \ No newline at end of file diff --git a/source/ASN1.package/ASN1SequenceOfType.class/properties.json b/source/ASN1.package/ASN1SequenceOfType.class/properties.json deleted file mode 100644 index 9e3c751..0000000 --- a/source/ASN1.package/ASN1SequenceOfType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1UnstructuredType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1SequenceOfType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1SequenceType.class/README.md b/source/ASN1.package/ASN1SequenceType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1SequenceType.class/instance/containerClass.st b/source/ASN1.package/ASN1SequenceType.class/instance/containerClass.st deleted file mode 100644 index df3b4b2..0000000 --- a/source/ASN1.package/ASN1SequenceType.class/instance/containerClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -containerClass - - ^ OrderedCollection \ No newline at end of file diff --git a/source/ASN1.package/ASN1SequenceType.class/instance/tag.st b/source/ASN1.package/ASN1SequenceType.class/instance/tag.st deleted file mode 100644 index 44bfdff..0000000 --- a/source/ASN1.package/ASN1SequenceType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 48 \ No newline at end of file diff --git a/source/ASN1.package/ASN1SequenceType.class/properties.json b/source/ASN1.package/ASN1SequenceType.class/properties.json deleted file mode 100644 index 7209c14..0000000 --- a/source/ASN1.package/ASN1SequenceType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1UnmappedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1SequenceType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1SetOfType.class/README.md b/source/ASN1.package/ASN1SetOfType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1SetOfType.class/instance/containerClass.st b/source/ASN1.package/ASN1SetOfType.class/instance/containerClass.st deleted file mode 100644 index a6a4a1a..0000000 --- a/source/ASN1.package/ASN1SetOfType.class/instance/containerClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -containerClass - - ^ OrderedSet \ No newline at end of file diff --git a/source/ASN1.package/ASN1SetOfType.class/instance/tag.st b/source/ASN1.package/ASN1SetOfType.class/instance/tag.st deleted file mode 100644 index 11a868c..0000000 --- a/source/ASN1.package/ASN1SetOfType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 49 \ No newline at end of file diff --git a/source/ASN1.package/ASN1SetOfType.class/properties.json b/source/ASN1.package/ASN1SetOfType.class/properties.json deleted file mode 100644 index 8156bc9..0000000 --- a/source/ASN1.package/ASN1SetOfType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1UnstructuredType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1SetOfType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1SetType.class/README.md b/source/ASN1.package/ASN1SetType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1SetType.class/instance/containerClass.st b/source/ASN1.package/ASN1SetType.class/instance/containerClass.st deleted file mode 100644 index a6a4a1a..0000000 --- a/source/ASN1.package/ASN1SetType.class/instance/containerClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -containerClass - - ^ OrderedSet \ No newline at end of file diff --git a/source/ASN1.package/ASN1SetType.class/instance/tag.st b/source/ASN1.package/ASN1SetType.class/instance/tag.st deleted file mode 100644 index 11a868c..0000000 --- a/source/ASN1.package/ASN1SetType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 49 \ No newline at end of file diff --git a/source/ASN1.package/ASN1SetType.class/properties.json b/source/ASN1.package/ASN1SetType.class/properties.json deleted file mode 100644 index e586b13..0000000 --- a/source/ASN1.package/ASN1SetType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1UnmappedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1SetType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/README.md b/source/ASN1.package/ASN1Stream.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Stream.class/class/decodeBytes..st b/source/ASN1.package/ASN1Stream.class/class/decodeBytes..st deleted file mode 100644 index c403922..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/decodeBytes..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeBytes: bytes - - ^ (self onBytes: bytes) decode \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/class/decodeBytes.withType..st b/source/ASN1.package/ASN1Stream.class/class/decodeBytes.withType..st deleted file mode 100644 index 3b9a942..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/decodeBytes.withType..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeBytes: bytes withType: type - - ^ (self onBytes: bytes) decodeWithType: type \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/class/encode..st b/source/ASN1.package/ASN1Stream.class/class/encode..st deleted file mode 100644 index 840d7f8..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/encode..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: object - - ^ self new encode: object \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/class/encode.withType..st b/source/ASN1.package/ASN1Stream.class/class/encode.withType..st deleted file mode 100644 index 1d1cf6a..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/encode.withType..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: object withType: type - - ^ self new encode: object withType: type \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/class/initializeTagToTypeDispatchTable.st b/source/ASN1.package/ASN1Stream.class/class/initializeTagToTypeDispatchTable.st deleted file mode 100644 index 4ab39f6..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/initializeTagToTypeDispatchTable.st +++ /dev/null @@ -1,24 +0,0 @@ -class initialization -initializeTagToTypeDispatchTable - - TagToTypeDispatchTable := Dictionary new. - TagToTypeDispatchTable -" at: 0 put: ASN1EndOfIndefiniteLengthType new;" - at: 1 put: ASN1BooleanType new; - at: 2 put: ASN1IntegerType new; - at: 3 put: ASN1BitStringType new; - at: 4 put: ASN1ByteArrayType new; - at: 5 put: ASN1NullType new; - at: 6 put: ASN1ObjectIdentifierType new; - at: 12 put: ASN1StringType new; - at: 16 put: ASN1SequenceType new; - at: 17 put: ASN1SetType new; - at: 19 put: ASN1PrintableStringType new; - at: 20 put: ASN1TeletexStringType new; - at: 22 put: ASN1IA5StringType new; - at: 23 put: ASN1UTCTimeType new; - at: 26 put: ASN1VisibleStringType new; - at: 27 put: ASN1GeneralStringType new; - at: 28 put: ASN1UniversalStringType new; - at: 30 put: ASN1BMPStringType new; - yourself. diff --git a/source/ASN1.package/ASN1Stream.class/class/new.st b/source/ASN1.package/ASN1Stream.class/class/new.st deleted file mode 100644 index 40a0641..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/new.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -new - - ^ self onStream: (ByteArray new: 100) writeStream. diff --git a/source/ASN1.package/ASN1Stream.class/class/onBytes..st b/source/ASN1.package/ASN1Stream.class/class/onBytes..st deleted file mode 100644 index 9595f3d..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/onBytes..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -onBytes: bytes - - ^ self onStream: bytes readStream. diff --git a/source/ASN1.package/ASN1Stream.class/class/onStream..st b/source/ASN1.package/ASN1Stream.class/class/onStream..st deleted file mode 100644 index dda00c4..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/onStream..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -onStream: aStream - - ^ super new - stream: aStream; - yourself. diff --git a/source/ASN1.package/ASN1Stream.class/class/tagToTypeDispatchTable.st b/source/ASN1.package/ASN1Stream.class/class/tagToTypeDispatchTable.st deleted file mode 100644 index 5551187..0000000 --- a/source/ASN1.package/ASN1Stream.class/class/tagToTypeDispatchTable.st +++ /dev/null @@ -1,5 +0,0 @@ -class initialization -tagToTypeDispatchTable - - TagToTypeDispatchTable isNil ifTrue: [self initializeTagToTypeDispatchTable]. - ^ TagToTypeDispatchTable diff --git a/source/ASN1.package/ASN1Stream.class/instance/atEnd.st b/source/ASN1.package/ASN1Stream.class/instance/atEnd.st deleted file mode 100644 index 7b98765..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/atEnd.st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -atEnd - - ^ self stream atEnd \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/contents.st b/source/ASN1.package/ASN1Stream.class/instance/contents.st deleted file mode 100644 index e5f7ccd..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/contents.st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -contents - - ^ self stream contents \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/currentTag..st b/source/ASN1.package/ASN1Stream.class/instance/currentTag..st deleted file mode 100644 index cadded2..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/currentTag..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentTag: anObject - "Set the value of currentTag" - - currentTag := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/currentTag.st b/source/ASN1.package/ASN1Stream.class/instance/currentTag.st deleted file mode 100644 index bcb43c7..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/currentTag.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -currentTag - "Answer the value of currentTag" - - ^ currentTag \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/decode.st b/source/ASN1.package/ASN1Stream.class/instance/decode.st deleted file mode 100644 index 82d055e..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/decode.st +++ /dev/null @@ -1,14 +0,0 @@ -decoding -decode - - | tag numericTag type tagClass isConstructed | - tag := self peekTag. - numericTag := tag bitAnd: 2r00011111. - tagClass := tag bitAnd: 2r11000000. - isConstructed := (tag bitAnd: 2r00100000) > 0. - tagClass > 0 - ifTrue: [isConstructed - ifTrue: [type := ASN1WrapperConstructedType new] - ifFalse: [type := ASN1WrapperPrimitiveType new]] - ifFalse: [type := self class tagToTypeDispatchTable at: numericTag]. - ^ self decodeWithType: type. diff --git a/source/ASN1.package/ASN1Stream.class/instance/decodeWithType..st b/source/ASN1.package/ASN1Stream.class/instance/decodeWithType..st deleted file mode 100644 index 863bd51..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/decodeWithType..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeWithType: type - - ^ type decodeWithDERStream: self. diff --git a/source/ASN1.package/ASN1Stream.class/instance/encode..st b/source/ASN1.package/ASN1Stream.class/instance/encode..st deleted file mode 100644 index 812548c..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/encode..st +++ /dev/null @@ -1,14 +0,0 @@ -encoding -encode: anObject - - | type tag numericTag tagClass isConstructed | - tag := anObject asn1Tag. - numericTag := tag bitAnd: 2r00011111. - tagClass := tag bitAnd: 2r11000000. - isConstructed := (tag bitAnd: 2r00100000) > 0. - tagClass > 0 - ifTrue: [isConstructed - ifTrue: [type := ASN1WrapperConstructedType new] - ifFalse: [type := ASN1WrapperPrimitiveType new]] - ifFalse: [type := self class tagToTypeDispatchTable at: numericTag]. - ^ self encode: anObject withType: type. diff --git a/source/ASN1.package/ASN1Stream.class/instance/encode.withType..st b/source/ASN1.package/ASN1Stream.class/instance/encode.withType..st deleted file mode 100644 index af8d251..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/encode.withType..st +++ /dev/null @@ -1,5 +0,0 @@ -encoding -encode: anObject withType: type - - type encode: anObject withDERStream: self. - ^ self contents diff --git a/source/ASN1.package/ASN1Stream.class/instance/newStream.st b/source/ASN1.package/ASN1Stream.class/instance/newStream.st deleted file mode 100644 index ba5083f..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/newStream.st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -newStream - - ^ self class new \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/next..st b/source/ASN1.package/ASN1Stream.class/instance/next..st deleted file mode 100644 index 6c4208d..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/next..st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -next: num - - ^ self stream next: num \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/next.st b/source/ASN1.package/ASN1Stream.class/instance/next.st deleted file mode 100644 index 39e5ded..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/next.st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -next - - ^ self stream next \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/nextLength.st b/source/ASN1.package/ASN1Stream.class/instance/nextLength.st deleted file mode 100644 index 516927e..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/nextLength.st +++ /dev/null @@ -1,14 +0,0 @@ -stream - api -nextLength - - | tag val | - tag := self stream next. - tag = 2r10000000 - ifTrue: [^ -1]. - ((tag bitAnd: 2r10000000) > 0) - ifTrue: [ - val := 0. - (tag bitClear: 2r10000000) timesRepeat: [ - val := (val bitShift: 8) + self stream next]. - ^ val] - ifFalse: [^ tag]. diff --git a/source/ASN1.package/ASN1Stream.class/instance/nextPut..st b/source/ASN1.package/ASN1Stream.class/instance/nextPut..st deleted file mode 100644 index e637d2b..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/nextPut..st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -nextPut: byte - - ^ self stream nextPut: byte \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/nextPutAll..st b/source/ASN1.package/ASN1Stream.class/instance/nextPutAll..st deleted file mode 100644 index 2171f1c..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/nextPutAll..st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -nextPutAll: bytes - - ^ self stream nextPutAll: bytes \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/nextPutLength..st b/source/ASN1.package/ASN1Stream.class/instance/nextPutLength..st deleted file mode 100644 index 1cccc34..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/nextPutLength..st +++ /dev/null @@ -1,9 +0,0 @@ -stream - api -nextPutLength: size - - size <= 127 - ifTrue: [self nextPut: size] - ifFalse: [ - self nextPut: ((size digitLength) bitOr: 16r80). - size digitLength to: 1 by: -1 do: [:digitIndex | - self nextPut: (size digitAt: digitIndex)]] diff --git a/source/ASN1.package/ASN1Stream.class/instance/nextPutTag..st b/source/ASN1.package/ASN1Stream.class/instance/nextPutTag..st deleted file mode 100644 index 32d1943..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/nextPutTag..st +++ /dev/null @@ -1,5 +0,0 @@ -stream - api -nextPutTag: tag - "It's not clear how to encode a tag whose numerical value is greater than 30" - - self nextPut: tag. diff --git a/source/ASN1.package/ASN1Stream.class/instance/nextTag.st b/source/ASN1.package/ASN1Stream.class/instance/nextTag.st deleted file mode 100644 index 6b82feb..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/nextTag.st +++ /dev/null @@ -1,15 +0,0 @@ -stream - api -nextTag - - | tag octet | - tag := self stream next. - ((tag bitAnd: 2r00011111) == 2r00011111) - ifTrue: [ - tag := 0. - [ - octet := self stream next. - tag := (tag bitShift: 7) bitOr: (octet bitClear: 2r10000000). - (octet bitAnd: 2r10000000) > 0] - whileTrue]. - self currentTag: tag. - ^ tag \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/peekTag.st b/source/ASN1.package/ASN1Stream.class/instance/peekTag.st deleted file mode 100644 index e2e677b..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/peekTag.st +++ /dev/null @@ -1,6 +0,0 @@ -stream - api -peekTag - - | start | - start := self position. - ^[self nextTag] ensure: [self position: start] \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/position..st b/source/ASN1.package/ASN1Stream.class/instance/position..st deleted file mode 100644 index fb22406..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/position..st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -position: pos - - ^ self stream position: pos \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/position.st b/source/ASN1.package/ASN1Stream.class/instance/position.st deleted file mode 100644 index 8281efa..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/position.st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -position - - ^ self stream position \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/size.st b/source/ASN1.package/ASN1Stream.class/instance/size.st deleted file mode 100644 index f4b244f..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/size.st +++ /dev/null @@ -1,4 +0,0 @@ -stream - api -size - - ^ self stream size \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/stream..st b/source/ASN1.package/ASN1Stream.class/instance/stream..st deleted file mode 100644 index d2feb37..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/stream..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -stream: anObject - "Set the value of stream" - - stream := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/instance/stream.st b/source/ASN1.package/ASN1Stream.class/instance/stream.st deleted file mode 100644 index 6d0ff3a..0000000 --- a/source/ASN1.package/ASN1Stream.class/instance/stream.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -stream - "Answer the value of stream" - - ^ stream \ No newline at end of file diff --git a/source/ASN1.package/ASN1Stream.class/properties.json b/source/ASN1.package/ASN1Stream.class/properties.json deleted file mode 100644 index 4713fe6..0000000 --- a/source/ASN1.package/ASN1Stream.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "TagToTypeDispatchTable" - ], - "instvars" : [ - "stream", - "currentTag" - ], - "name" : "ASN1Stream", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1StringType.class/README.md b/source/ASN1.package/ASN1StringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1StringType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1StringType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index d3ca5f9..0000000 --- a/source/ASN1.package/ASN1StringType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - ^(derStream next: length) asByteArray asString. diff --git a/source/ASN1.package/ASN1StringType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1StringType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 48afe4d..0000000 --- a/source/ASN1.package/ASN1StringType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - derStream nextPutAll: anObject asByteArray \ No newline at end of file diff --git a/source/ASN1.package/ASN1StringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1StringType.class/instance/isTypeFor..st deleted file mode 100644 index 417cdb4..0000000 --- a/source/ASN1.package/ASN1StringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isString \ No newline at end of file diff --git a/source/ASN1.package/ASN1StringType.class/instance/octetsClass.st b/source/ASN1.package/ASN1StringType.class/instance/octetsClass.st deleted file mode 100644 index 03b0334..0000000 --- a/source/ASN1.package/ASN1StringType.class/instance/octetsClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -octetsClass - - ^ String \ No newline at end of file diff --git a/source/ASN1.package/ASN1StringType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1StringType.class/instance/sizeOfObject..st deleted file mode 100644 index 761a8bd..0000000 --- a/source/ASN1.package/ASN1StringType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ anObject size. diff --git a/source/ASN1.package/ASN1StringType.class/instance/tag.st b/source/ASN1.package/ASN1StringType.class/instance/tag.st deleted file mode 100644 index 8b3e990..0000000 --- a/source/ASN1.package/ASN1StringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 12 \ No newline at end of file diff --git a/source/ASN1.package/ASN1StringType.class/properties.json b/source/ASN1.package/ASN1StringType.class/properties.json deleted file mode 100644 index 4459ae6..0000000 --- a/source/ASN1.package/ASN1StringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1OctetsType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1StringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/README.md b/source/ASN1.package/ASN1StructureElement.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/decode.withDERStream..st b/source/ASN1.package/ASN1StructureElement.class/instance/decode.withDERStream..st deleted file mode 100644 index aee4f11..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/decode.withDERStream..st +++ /dev/null @@ -1,21 +0,0 @@ -decoding -decode: aTarget withDERStream: derStream - - | tag val | - derStream atEnd ifTrue: [ - self hasDefault ifTrue: [^self value: self default into: aTarget]. - self isOptional ifTrue: [^self]. - ^ self error: 'missing element']. - tag := derStream peekTag. - (self matchesTag: tag) - ifTrue: [ - val := type - decodeWithDERStream: derStream - owner: aTarget - ownerType: self owner. - self value: val into: aTarget. - ^ val ] - ifFalse: [ - self hasDefault ifTrue: [^self value: self default into: aTarget]. - self isOptional ifTrue: [^self]. - ^ self error: 'missing element']. diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/default..st b/source/ASN1.package/ASN1StructureElement.class/instance/default..st deleted file mode 100644 index a2db182..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/default..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -default: anObject - "Set the value of default" - - default := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/default.st b/source/ASN1.package/ASN1StructureElement.class/instance/default.st deleted file mode 100644 index 8ebf251..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/default.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -default - "Answer the value of default" - - ^ default \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1StructureElement.class/instance/encode.withDERStream..st deleted file mode 100644 index 07c439e..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,14 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - | val | - val := self valueFrom: anObject. - (val == nil and: [self isOptional]) - ifTrue: [^self]. - (self hasDefault and: [self default = val]) - ifTrue: [^self]. - self type - encode: val - withDERStream: derStream - owner: anObject - ownerType: self owner. diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/hasDefault.st b/source/ASN1.package/ASN1StructureElement.class/instance/hasDefault.st deleted file mode 100644 index 8f6084d..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/hasDefault.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -hasDefault - - ^ self default notNil \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/hasDefaultOrIsOptional.st b/source/ASN1.package/ASN1StructureElement.class/instance/hasDefaultOrIsOptional.st deleted file mode 100644 index 139921d..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/hasDefaultOrIsOptional.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -hasDefaultOrIsOptional - - ^ self default notNil or: [ self optional ] \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/initialize.st b/source/ASN1.package/ASN1StructureElement.class/instance/initialize.st deleted file mode 100644 index 512bb4f..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initialize - - self optional: false. \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/isOptional.st b/source/ASN1.package/ASN1StructureElement.class/instance/isOptional.st deleted file mode 100644 index 97eca10..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/isOptional.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isOptional - - ^ self optional \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/isTypeFor..st b/source/ASN1.package/ASN1StructureElement.class/instance/isTypeFor..st deleted file mode 100644 index 06f1a36..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/isTypeFor..st +++ /dev/null @@ -1,6 +0,0 @@ -testing -isTypeFor: anObject - - | val | - val := self valueFrom: anObject. - ^self type isTypeFor: val \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/mutator.st b/source/ASN1.package/ASN1StructureElement.class/instance/mutator.st deleted file mode 100644 index f2919dc..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/mutator.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -mutator - - ^(self symbol copyWith: $:) asSymbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/optional..st b/source/ASN1.package/ASN1StructureElement.class/instance/optional..st deleted file mode 100644 index d6a2818..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/optional..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -optional: anObject - "Set the value of optional" - - optional := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/optional.st b/source/ASN1.package/ASN1StructureElement.class/instance/optional.st deleted file mode 100644 index ec31bf4..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/optional.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -optional - "Answer the value of optional" - - ^ optional \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/value.into..st b/source/ASN1.package/ASN1StructureElement.class/instance/value.into..st deleted file mode 100644 index a733fc1..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/value.into..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -value: aValue into: anObject - - anObject perform: self mutator with: aValue \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/instance/valueFrom..st b/source/ASN1.package/ASN1StructureElement.class/instance/valueFrom..st deleted file mode 100644 index 2112874..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/instance/valueFrom..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -valueFrom: anObject - - ^ anObject perform: self symbol \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructureElement.class/properties.json b/source/ASN1.package/ASN1StructureElement.class/properties.json deleted file mode 100644 index 2a40424..0000000 --- a/source/ASN1.package/ASN1StructureElement.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1ChoiceElement", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "default", - "optional" - ], - "name" : "ASN1StructureElement", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/README.md b/source/ASN1.package/ASN1StructuredType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/add.type..st b/source/ASN1.package/ASN1StructuredType.class/instance/add.type..st deleted file mode 100644 index cd874f7..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/add.type..st +++ /dev/null @@ -1,7 +0,0 @@ -accessing - element construction -add: aSymbol type: type - - ^self addElement: ( - self newElement - symbol: aSymbol; - type: (self typeFrom: type)) \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/add.type.explicitTag..st b/source/ASN1.package/ASN1StructuredType.class/instance/add.type.explicitTag..st deleted file mode 100644 index b36211e..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/add.type.explicitTag..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -add: aSymbol type: type explicitTag: integer - - ^(self add: aSymbol type: type) - explicitTag: integer; - yourself. diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/add.type.implicitTag..st b/source/ASN1.package/ASN1StructuredType.class/instance/add.type.implicitTag..st deleted file mode 100644 index 48c0a6d..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/add.type.implicitTag..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing - element construction -add: aSymbol type: type implicitTag: integer - - ^(self add: aSymbol type: type) - implicitTag: integer; - yourself. diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/addElement..st b/source/ASN1.package/ASN1StructuredType.class/instance/addElement..st deleted file mode 100644 index 767d5aa..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/addElement..st +++ /dev/null @@ -1,6 +0,0 @@ -private -addElement: element - - self elements addLast: element. - element addedTo: self. - ^element \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/elementWithSymbol..st b/source/ASN1.package/ASN1StructuredType.class/instance/elementWithSymbol..st deleted file mode 100644 index 87da407..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/elementWithSymbol..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -elementWithSymbol: aSymbol - - ^ self elements - detect: [:each | each symbol == aSymbol] - ifNone: [self error: 'no element specified in structured type']. diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/elements..st b/source/ASN1.package/ASN1StructuredType.class/instance/elements..st deleted file mode 100644 index 5f5c11e..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/elements..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -elements: anObject - "Set the value of elements" - - elements := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/elements.st b/source/ASN1.package/ASN1StructuredType.class/instance/elements.st deleted file mode 100644 index 8d3f973..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/elements.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -elements - "Answer the value of elements" - - ^ elements \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/hasElements.st b/source/ASN1.package/ASN1StructuredType.class/instance/hasElements.st deleted file mode 100644 index 93cf0d4..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/hasElements.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -hasElements - - ^ self elements notEmpty \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/initialize.st b/source/ASN1.package/ASN1StructuredType.class/instance/initialize.st deleted file mode 100644 index 04719fc..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -initialize-release -initialize - - super initialize. - self elements: (OrderedCollection new: 5). diff --git a/source/ASN1.package/ASN1StructuredType.class/instance/newElement.st b/source/ASN1.package/ASN1StructuredType.class/instance/newElement.st deleted file mode 100644 index 1f90e9c..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/instance/newElement.st +++ /dev/null @@ -1,4 +0,0 @@ -private -newElement - - ^ ASN1StructureElement new \ No newline at end of file diff --git a/source/ASN1.package/ASN1StructuredType.class/properties.json b/source/ASN1.package/ASN1StructuredType.class/properties.json deleted file mode 100644 index 3fe790a..0000000 --- a/source/ASN1.package/ASN1StructuredType.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1ConstructedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "elements" - ], - "name" : "ASN1StructuredType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1SubType.class/README.md b/source/ASN1.package/ASN1SubType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1SubType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1SubType.class/instance/isTypeFor..st deleted file mode 100644 index 338e45b..0000000 --- a/source/ASN1.package/ASN1SubType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^self parent isTypeFor: anObject diff --git a/source/ASN1.package/ASN1SubType.class/instance/matchesTag..st b/source/ASN1.package/ASN1SubType.class/instance/matchesTag..st deleted file mode 100644 index 02693d7..0000000 --- a/source/ASN1.package/ASN1SubType.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^ ((tag bitXor: anInteger) bitAnd: 2r00011111) isZero diff --git a/source/ASN1.package/ASN1SubType.class/instance/parent..st b/source/ASN1.package/ASN1SubType.class/instance/parent..st deleted file mode 100644 index 605ab1a..0000000 --- a/source/ASN1.package/ASN1SubType.class/instance/parent..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -parent: anObject - "Set the value of parent" - - parent := self typeFrom: anObject. \ No newline at end of file diff --git a/source/ASN1.package/ASN1SubType.class/instance/parent.st b/source/ASN1.package/ASN1SubType.class/instance/parent.st deleted file mode 100644 index d333263..0000000 --- a/source/ASN1.package/ASN1SubType.class/instance/parent.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -parent - "Answer the value of parent" - - ^ parent \ No newline at end of file diff --git a/source/ASN1.package/ASN1SubType.class/instance/tag..st b/source/ASN1.package/ASN1SubType.class/instance/tag..st deleted file mode 100644 index ee96ced..0000000 --- a/source/ASN1.package/ASN1SubType.class/instance/tag..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tag: anObject - "Set the value of tag" - - tag := anObject \ No newline at end of file diff --git a/source/ASN1.package/ASN1SubType.class/instance/tag.st b/source/ASN1.package/ASN1SubType.class/instance/tag.st deleted file mode 100644 index 91d7646..0000000 --- a/source/ASN1.package/ASN1SubType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ tag \ No newline at end of file diff --git a/source/ASN1.package/ASN1SubType.class/properties.json b/source/ASN1.package/ASN1SubType.class/properties.json deleted file mode 100644 index be4b84e..0000000 --- a/source/ASN1.package/ASN1SubType.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Type", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "parent", - "tag" - ], - "name" : "ASN1SubType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1TeletexString.class/README.md b/source/ASN1.package/ASN1TeletexString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1TeletexString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1TeletexString.class/instance/asn1Tag.st deleted file mode 100644 index 1381dac..0000000 --- a/source/ASN1.package/ASN1TeletexString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 20 diff --git a/source/ASN1.package/ASN1TeletexString.class/properties.json b/source/ASN1.package/ASN1TeletexString.class/properties.json deleted file mode 100644 index 9f28c96..0000000 --- a/source/ASN1.package/ASN1TeletexString.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1TeletexString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1TeletexStringType.class/README.md b/source/ASN1.package/ASN1TeletexStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1TeletexStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1TeletexStringType.class/instance/isTypeFor..st deleted file mode 100644 index 509ccba..0000000 --- a/source/ASN1.package/ASN1TeletexStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1TeletexString \ No newline at end of file diff --git a/source/ASN1.package/ASN1TeletexStringType.class/instance/tag.st b/source/ASN1.package/ASN1TeletexStringType.class/instance/tag.st deleted file mode 100644 index e143b12..0000000 --- a/source/ASN1.package/ASN1TeletexStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 20 \ No newline at end of file diff --git a/source/ASN1.package/ASN1TeletexStringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1TeletexStringType.class/instance/wrapperClass.st deleted file mode 100644 index 97d4cc8..0000000 --- a/source/ASN1.package/ASN1TeletexStringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1TeletexString diff --git a/source/ASN1.package/ASN1TeletexStringType.class/properties.json b/source/ASN1.package/ASN1TeletexStringType.class/properties.json deleted file mode 100644 index e33a6a4..0000000 --- a/source/ASN1.package/ASN1TeletexStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1TeletexStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/README.md b/source/ASN1.package/ASN1Type.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Type.class/instance/asn1Tag.st b/source/ASN1.package/ASN1Type.class/instance/asn1Tag.st deleted file mode 100644 index 4b6ca45..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -asn1Tag - - ^ self tag \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1Type.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index e7c5eda..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/decodeWithDERStream..st b/source/ASN1.package/ASN1Type.class/instance/decodeWithDERStream..st deleted file mode 100644 index 6e446b6..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/decodeWithDERStream..st +++ /dev/null @@ -1,11 +0,0 @@ -decoding -decodeWithDERStream: derStream - - | tag | - tag := derStream nextTag. - (self matchesTag: tag) - ifFalse: [self error: 'asn1 decoder: bad tag']. - ^ self - decodeValueWithDERStream: derStream - length: derStream nextLength. - diff --git a/source/ASN1.package/ASN1Type.class/instance/decodeWithDERStream.owner.ownerType..st b/source/ASN1.package/ASN1Type.class/instance/decodeWithDERStream.owner.ownerType..st deleted file mode 100644 index 1f171dd..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/decodeWithDERStream.owner.ownerType..st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -decodeWithDERStream: derStream owner: owner ownerType: ownerType - - ^ self decodeWithDERStream: derStream. diff --git a/source/ASN1.package/ASN1Type.class/instance/encode.withDERStream..st b/source/ASN1.package/ASN1Type.class/instance/encode.withDERStream..st deleted file mode 100644 index 1810e12..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/encode.withDERStream..st +++ /dev/null @@ -1,9 +0,0 @@ -encoding -encode: anObject withDERStream: derStream - - | size | - derStream nextPutTag: anObject asn1Tag. - size := self sizeOfObject: anObject. - derStream nextPutLength: size. - self encodeValue: anObject withDERStream: derStream. - ^ derStream diff --git a/source/ASN1.package/ASN1Type.class/instance/encode.withDERStream.owner.ownerType..st b/source/ASN1.package/ASN1Type.class/instance/encode.withDERStream.owner.ownerType..st deleted file mode 100644 index 67f5ff8..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/encode.withDERStream.owner.ownerType..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encode: anObject withDERStream: derStream owner: owner ownerType: ownerType - - ^ self encode: anObject withDERStream: derStream diff --git a/source/ASN1.package/ASN1Type.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1Type.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index ae8c1b3..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/isConstructed.st b/source/ASN1.package/ASN1Type.class/instance/isConstructed.st deleted file mode 100644 index fdf8253..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/isConstructed.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isConstructed - - ^ false \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/isTypeFor..st b/source/ASN1.package/ASN1Type.class/instance/isTypeFor..st deleted file mode 100644 index aff7756..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^((self asn1Tag bitXor: anObject asn1Tag) bitAnd: 2r00011111) isZero \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/matchesTag..st b/source/ASN1.package/ASN1Type.class/instance/matchesTag..st deleted file mode 100644 index c9f292a..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^((self asn1Tag bitXor: anInteger) bitAnd: 2r00011111) isZero \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/parent.st b/source/ASN1.package/ASN1Type.class/instance/parent.st deleted file mode 100644 index a574709..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/parent.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -parent - - ^ nil \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1Type.class/instance/sizeOfObject..st deleted file mode 100644 index 931b3a5..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ nil \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/instance/tag.st b/source/ASN1.package/ASN1Type.class/instance/tag.st deleted file mode 100644 index b024e61..0000000 --- a/source/ASN1.package/ASN1Type.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/ASN1.package/ASN1Type.class/properties.json b/source/ASN1.package/ASN1Type.class/properties.json deleted file mode 100644 index c2faf6c..0000000 --- a/source/ASN1.package/ASN1Type.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Entity", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1Type", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1TypeReference.class/README.md b/source/ASN1.package/ASN1TypeReference.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1TypeReference.class/properties.json b/source/ASN1.package/ASN1TypeReference.class/properties.json deleted file mode 100644 index 77d018c..0000000 --- a/source/ASN1.package/ASN1TypeReference.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Entity", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1TypeReference", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1UTCTimeType.class/README.md b/source/ASN1.package/ASN1UTCTimeType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1UTCTimeType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1UTCTimeType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 2f00251..0000000 --- a/source/ASN1.package/ASN1UTCTimeType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,14 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | aUTCDateTime | - aUTCDateTime := (derStream next: length) asByteArray asString. - ^ (DateAndTime readFromString: ( - ((aUTCDateTime copyFrom: 1 to: 2) asInteger > 50 ifTrue: ['19'] ifFalse: ['20']), - (aUTCDateTime copyFrom: 1 to: 2), '-', - (aUTCDateTime copyFrom: 3 to: 4), '-', - (aUTCDateTime copyFrom: 5 to: 6), 'T', - (aUTCDateTime copyFrom: 7 to: 8), ':', - (aUTCDateTime copyFrom: 9 to: 10), ':', - (aUTCDateTime copyFrom: 11 to: 12), 'Z')) - diff --git a/source/ASN1.package/ASN1UTCTimeType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1UTCTimeType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index bc8c9e1..0000000 --- a/source/ASN1.package/ASN1UTCTimeType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,13 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - | yy mo dd hh mm ss utcDateTime | - yy := anObject year asString copyFrom: 3 to: 4. - mo := anObject month asString padded: #left to: 2 with: $0. - dd := anObject dayOfMonth asString padded: #left to: 2 with: $0. - hh := anObject hour asString padded: #left to: 2 with: $0. - mm := anObject minute asString padded: #left to: 2 with: $0. - ss := anObject seconds asString padded: #left to: 2 with: $0. - utcDateTime := (yy, mo, dd, hh, mm, ss, 'Z') asByteArray. - derStream nextPutAll: utcDateTime. - diff --git a/source/ASN1.package/ASN1UTCTimeType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1UTCTimeType.class/instance/isTypeFor..st deleted file mode 100644 index 05114dc..0000000 --- a/source/ASN1.package/ASN1UTCTimeType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: DateAndTime \ No newline at end of file diff --git a/source/ASN1.package/ASN1UTCTimeType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1UTCTimeType.class/instance/sizeOfObject..st deleted file mode 100644 index a8e99d0..0000000 --- a/source/ASN1.package/ASN1UTCTimeType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ 13. diff --git a/source/ASN1.package/ASN1UTCTimeType.class/instance/tag.st b/source/ASN1.package/ASN1UTCTimeType.class/instance/tag.st deleted file mode 100644 index 8ff215e..0000000 --- a/source/ASN1.package/ASN1UTCTimeType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 23 \ No newline at end of file diff --git a/source/ASN1.package/ASN1UTCTimeType.class/properties.json b/source/ASN1.package/ASN1UTCTimeType.class/properties.json deleted file mode 100644 index 68d56d9..0000000 --- a/source/ASN1.package/ASN1UTCTimeType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1BasicType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1UTCTimeType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1UniversalString.class/README.md b/source/ASN1.package/ASN1UniversalString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1UniversalString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1UniversalString.class/instance/asn1Tag.st deleted file mode 100644 index f7053db..0000000 --- a/source/ASN1.package/ASN1UniversalString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 28 \ No newline at end of file diff --git a/source/ASN1.package/ASN1UniversalString.class/properties.json b/source/ASN1.package/ASN1UniversalString.class/properties.json deleted file mode 100644 index b8c133d..0000000 --- a/source/ASN1.package/ASN1UniversalString.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1UniversalString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1UniversalStringType.class/README.md b/source/ASN1.package/ASN1UniversalStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1UniversalStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1UniversalStringType.class/instance/isTypeFor..st deleted file mode 100644 index 7442124..0000000 --- a/source/ASN1.package/ASN1UniversalStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1UniversalString \ No newline at end of file diff --git a/source/ASN1.package/ASN1UniversalStringType.class/instance/tag.st b/source/ASN1.package/ASN1UniversalStringType.class/instance/tag.st deleted file mode 100644 index 8d13a9b..0000000 --- a/source/ASN1.package/ASN1UniversalStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 28 \ No newline at end of file diff --git a/source/ASN1.package/ASN1UniversalStringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1UniversalStringType.class/instance/wrapperClass.st deleted file mode 100644 index bd6e15c..0000000 --- a/source/ASN1.package/ASN1UniversalStringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1UniversalString diff --git a/source/ASN1.package/ASN1UniversalStringType.class/properties.json b/source/ASN1.package/ASN1UniversalStringType.class/properties.json deleted file mode 100644 index 835befb..0000000 --- a/source/ASN1.package/ASN1UniversalStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1UniversalStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnmappedType.class/README.md b/source/ASN1.package/ASN1UnmappedType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1UnmappedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st b/source/ASN1.package/ASN1UnmappedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st deleted file mode 100644 index affbc1d..0000000 --- a/source/ASN1.package/ASN1UnmappedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st +++ /dev/null @@ -1,11 +0,0 @@ -decoding -decodeValueIndefiniteLengthWithDERStream: derStream - - | coll value | - coll := self containerClass new. - [derStream peekTag = 0 - ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] - ifFalse: [value := derStream decode]. - value isKindOf: ASN1EndOfIndefiniteLengthMarker] - whileFalse: [coll add: value]. - ^coll \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnmappedType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1UnmappedType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index f92a4d3..0000000 --- a/source/ASN1.package/ASN1UnmappedType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,12 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | coll end obj | - length = -1 - ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. - coll := self containerClass new. - end := derStream position + length. - [derStream position < end ] whileTrue: [ - obj := derStream decode. - coll add: obj]. - ^coll \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnmappedType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1UnmappedType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 29731d9..0000000 --- a/source/ASN1.package/ASN1UnmappedType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,5 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - anObject do: [:each | - derStream encode: each]. diff --git a/source/ASN1.package/ASN1UnmappedType.class/properties.json b/source/ASN1.package/ASN1UnmappedType.class/properties.json deleted file mode 100644 index 5987a36..0000000 --- a/source/ASN1.package/ASN1UnmappedType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1ConstructedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1UnmappedType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnstructuredType.class/README.md b/source/ASN1.package/ASN1UnstructuredType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1UnstructuredType.class/instance/decodeValueIndefiniteLengthWithDERStream..st b/source/ASN1.package/ASN1UnstructuredType.class/instance/decodeValueIndefiniteLengthWithDERStream..st deleted file mode 100644 index 710d48f..0000000 --- a/source/ASN1.package/ASN1UnstructuredType.class/instance/decodeValueIndefiniteLengthWithDERStream..st +++ /dev/null @@ -1,11 +0,0 @@ -decoding -decodeValueIndefiniteLengthWithDERStream: derStream - - | coll value | - coll := self containerClass new. - [derStream peekTag = 0 - ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] - ifFalse: [value := self elementType decodeWithDERStream: derStream]. - value isKindOf: ASN1EndOfIndefiniteLengthMarker] - whileFalse: [coll add: value]. - ^coll \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnstructuredType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1UnstructuredType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index ae7fc85..0000000 --- a/source/ASN1.package/ASN1UnstructuredType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,12 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | coll end obj | - length = -1 - ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. - coll := self containerClass new. - end := derStream position + length. - [derStream position < end ] whileTrue: [ - obj := self elementType decodeWithDERStream: derStream. - coll add: obj]. - ^coll \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnstructuredType.class/instance/elementType..st b/source/ASN1.package/ASN1UnstructuredType.class/instance/elementType..st deleted file mode 100644 index cb4a56d..0000000 --- a/source/ASN1.package/ASN1UnstructuredType.class/instance/elementType..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -elementType: anObject - "Set the value of elementType" - - elementType := self typeFrom: anObject. diff --git a/source/ASN1.package/ASN1UnstructuredType.class/instance/elementType.st b/source/ASN1.package/ASN1UnstructuredType.class/instance/elementType.st deleted file mode 100644 index 71230ce..0000000 --- a/source/ASN1.package/ASN1UnstructuredType.class/instance/elementType.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -elementType - "Answer the value of elementType" - - ^ elementType \ No newline at end of file diff --git a/source/ASN1.package/ASN1UnstructuredType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1UnstructuredType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index af0228f..0000000 --- a/source/ASN1.package/ASN1UnstructuredType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,7 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - anObject do: [:each | - self elementType - encode: each - withDERStream: derStream]. diff --git a/source/ASN1.package/ASN1UnstructuredType.class/properties.json b/source/ASN1.package/ASN1UnstructuredType.class/properties.json deleted file mode 100644 index b60fc05..0000000 --- a/source/ASN1.package/ASN1UnstructuredType.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1ConstructedType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "elementType" - ], - "name" : "ASN1UnstructuredType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1Value.class/README.md b/source/ASN1.package/ASN1Value.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1Value.class/instance/asAsn1Bytes.st b/source/ASN1.package/ASN1Value.class/instance/asAsn1Bytes.st deleted file mode 100644 index cd82813..0000000 --- a/source/ASN1.package/ASN1Value.class/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asAsn1Bytes - - ^ ASN1Stream encode: self diff --git a/source/ASN1.package/ASN1Value.class/properties.json b/source/ASN1.package/ASN1Value.class/properties.json deleted file mode 100644 index f4aa858..0000000 --- a/source/ASN1.package/ASN1Value.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1Value", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1VisibleString.class/README.md b/source/ASN1.package/ASN1VisibleString.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1VisibleString.class/instance/asn1Tag.st b/source/ASN1.package/ASN1VisibleString.class/instance/asn1Tag.st deleted file mode 100644 index 9534275..0000000 --- a/source/ASN1.package/ASN1VisibleString.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -private - parsing -asn1Tag - - ^ 26 \ No newline at end of file diff --git a/source/ASN1.package/ASN1VisibleString.class/properties.json b/source/ASN1.package/ASN1VisibleString.class/properties.json deleted file mode 100644 index 451bccb..0000000 --- a/source/ASN1.package/ASN1VisibleString.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1AbstractString", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1VisibleString", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1VisibleStringType.class/README.md b/source/ASN1.package/ASN1VisibleStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1VisibleStringType.class/instance/isTypeFor..st b/source/ASN1.package/ASN1VisibleStringType.class/instance/isTypeFor..st deleted file mode 100644 index bb8b8ed..0000000 --- a/source/ASN1.package/ASN1VisibleStringType.class/instance/isTypeFor..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTypeFor: anObject - - ^ anObject isKindOf: ASN1VisibleString \ No newline at end of file diff --git a/source/ASN1.package/ASN1VisibleStringType.class/instance/tag.st b/source/ASN1.package/ASN1VisibleStringType.class/instance/tag.st deleted file mode 100644 index e77623c..0000000 --- a/source/ASN1.package/ASN1VisibleStringType.class/instance/tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -tag - - ^ 26 \ No newline at end of file diff --git a/source/ASN1.package/ASN1VisibleStringType.class/instance/wrapperClass.st b/source/ASN1.package/ASN1VisibleStringType.class/instance/wrapperClass.st deleted file mode 100644 index 02aa5d3..0000000 --- a/source/ASN1.package/ASN1VisibleStringType.class/instance/wrapperClass.st +++ /dev/null @@ -1,4 +0,0 @@ -decoding -wrapperClass - - ^ ASN1VisibleString diff --git a/source/ASN1.package/ASN1VisibleStringType.class/properties.json b/source/ASN1.package/ASN1VisibleStringType.class/properties.json deleted file mode 100644 index 07ad6f4..0000000 --- a/source/ASN1.package/ASN1VisibleStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrappedStringType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1VisibleStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrappedStringType.class/README.md b/source/ASN1.package/ASN1WrappedStringType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1WrappedStringType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1WrappedStringType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 30d9c74..0000000 --- a/source/ASN1.package/ASN1WrappedStringType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,6 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | string | - string := (derStream next: length) asByteArray asString. - ^ self wrapperClass fromString: string. diff --git a/source/ASN1.package/ASN1WrappedStringType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1WrappedStringType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 1489be2..0000000 --- a/source/ASN1.package/ASN1WrappedStringType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - derStream nextPutAll: anObject string asByteArray \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrappedStringType.class/instance/octetsClass.st b/source/ASN1.package/ASN1WrappedStringType.class/instance/octetsClass.st deleted file mode 100644 index 61a0e8e..0000000 --- a/source/ASN1.package/ASN1WrappedStringType.class/instance/octetsClass.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -octetsClass - - ^ self wrapperClass \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrappedStringType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1WrappedStringType.class/instance/sizeOfObject..st deleted file mode 100644 index 8eb43db..0000000 --- a/source/ASN1.package/ASN1WrappedStringType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -sizeOfObject: anObject - - ^ anObject string size. diff --git a/source/ASN1.package/ASN1WrappedStringType.class/properties.json b/source/ASN1.package/ASN1WrappedStringType.class/properties.json deleted file mode 100644 index a2aadc8..0000000 --- a/source/ASN1.package/ASN1WrappedStringType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1OctetsType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1WrappedStringType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrapperConstructedType.class/README.md b/source/ASN1.package/ASN1WrapperConstructedType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st b/source/ASN1.package/ASN1WrapperConstructedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st deleted file mode 100644 index 85fe8c6..0000000 --- a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/decodeValueIndefiniteLengthWithDERStream..st +++ /dev/null @@ -1,16 +0,0 @@ -decoding -decodeValueIndefiniteLengthWithDERStream: derStream - - | contextValue sequence value | - contextValue := ASN1ExplicitContextValue new. - contextValue tagIndex: (derStream currentTag bitAnd: 2r00011111). - contextValue tagIsPrimitive: false. - sequence := OrderedCollection new. - [derStream peekTag = 0 - ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] - ifFalse: [value := derStream decode]. - value isKindOf: ASN1EndOfIndefiniteLengthMarker] - whileFalse: [sequence add: value]. - contextValue tagValue: sequence. - ^contextValue - diff --git a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1WrapperConstructedType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index 8de1052..0000000 --- a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,16 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | aValue sequence stopPosition | - length = -1 - ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. - aValue := ASN1ExplicitContextValue new. - aValue tagIndex: (derStream currentTag bitAnd: 2r00011111). - aValue tagIsPrimitive: false. - sequence := OrderedCollection new. - stopPosition := derStream position + length. - [derStream position < stopPosition] whileTrue: [ - sequence add: derStream decode]. - aValue tagValue: sequence. - ^aValue - diff --git a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1WrapperConstructedType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index c19f601..0000000 --- a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,6 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - anObject tagValue do: [:each | - derStream encode: each]. - diff --git a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/sizeOfObject..st b/source/ASN1.package/ASN1WrapperConstructedType.class/instance/sizeOfObject..st deleted file mode 100644 index 87686c8..0000000 --- a/source/ASN1.package/ASN1WrapperConstructedType.class/instance/sizeOfObject..st +++ /dev/null @@ -1,8 +0,0 @@ -encoding -sizeOfObject: anObject - - | derStream | - derStream := ASN1Stream new. - anObject tagValue do: [:each | - derStream encode: each]. - ^ derStream size \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrapperConstructedType.class/properties.json b/source/ASN1.package/ASN1WrapperConstructedType.class/properties.json deleted file mode 100644 index 2268232..0000000 --- a/source/ASN1.package/ASN1WrapperConstructedType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrapperType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1WrapperConstructedType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrapperPrimitiveType.class/README.md b/source/ASN1.package/ASN1WrapperPrimitiveType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1WrapperPrimitiveType.class/instance/decodeValueWithDERStream.length..st b/source/ASN1.package/ASN1WrapperPrimitiveType.class/instance/decodeValueWithDERStream.length..st deleted file mode 100644 index ccac133..0000000 --- a/source/ASN1.package/ASN1WrapperPrimitiveType.class/instance/decodeValueWithDERStream.length..st +++ /dev/null @@ -1,10 +0,0 @@ -decoding -decodeValueWithDERStream: derStream length: length - - | aValue | - aValue := ASN1ExplicitContextValue new. - aValue tagIndex: (derStream currentTag bitAnd: 2r00011111). - aValue tagIsPrimitive: true. - aValue tagValue: (derStream next: length). - ^aValue - diff --git a/source/ASN1.package/ASN1WrapperPrimitiveType.class/instance/encodeValue.withDERStream..st b/source/ASN1.package/ASN1WrapperPrimitiveType.class/instance/encodeValue.withDERStream..st deleted file mode 100644 index 3dcc877..0000000 --- a/source/ASN1.package/ASN1WrapperPrimitiveType.class/instance/encodeValue.withDERStream..st +++ /dev/null @@ -1,4 +0,0 @@ -encoding -encodeValue: anObject withDERStream: derStream - - derStream nextPutAll: anObject tagValue. diff --git a/source/ASN1.package/ASN1WrapperPrimitiveType.class/properties.json b/source/ASN1.package/ASN1WrapperPrimitiveType.class/properties.json deleted file mode 100644 index 5dd52e8..0000000 --- a/source/ASN1.package/ASN1WrapperPrimitiveType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1WrapperType", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1WrapperPrimitiveType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ASN1WrapperType.class/README.md b/source/ASN1.package/ASN1WrapperType.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/ASN1WrapperType.class/instance/matchesTag..st b/source/ASN1.package/ASN1WrapperType.class/instance/matchesTag..st deleted file mode 100644 index 01e14ca..0000000 --- a/source/ASN1.package/ASN1WrapperType.class/instance/matchesTag..st +++ /dev/null @@ -1,4 +0,0 @@ -testing -matchesTag: anInteger - - ^ (anInteger bitAnd: 2r11000000) isZero not diff --git a/source/ASN1.package/ASN1WrapperType.class/properties.json b/source/ASN1.package/ASN1WrapperType.class/properties.json deleted file mode 100644 index 91c3401..0000000 --- a/source/ASN1.package/ASN1WrapperType.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "ASN1Type", - "category" : "ASN1-Types", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "ASN1WrapperType", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/Boolean.extension/instance/asAsn1Bytes.st b/source/ASN1.package/Boolean.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 30530d7..0000000 --- a/source/ASN1.package/Boolean.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asAsn1Bytes - - ^ ASN1Stream encode: self. diff --git a/source/ASN1.package/Boolean.extension/instance/asn1Tag.st b/source/ASN1.package/Boolean.extension/instance/asn1Tag.st deleted file mode 100644 index 966918f..0000000 --- a/source/ASN1.package/Boolean.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 1 diff --git a/source/ASN1.package/Boolean.extension/properties.json b/source/ASN1.package/Boolean.extension/properties.json deleted file mode 100644 index dd25360..0000000 --- a/source/ASN1.package/Boolean.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "Boolean" -} \ No newline at end of file diff --git a/source/ASN1.package/ByteArray.extension/instance/asn1Tag.st b/source/ASN1.package/ByteArray.extension/instance/asn1Tag.st deleted file mode 100644 index 31dc9de..0000000 --- a/source/ASN1.package/ByteArray.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 4 diff --git a/source/ASN1.package/ByteArray.extension/properties.json b/source/ASN1.package/ByteArray.extension/properties.json deleted file mode 100644 index f81bcb8..0000000 --- a/source/ASN1.package/ByteArray.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "ByteArray" -} \ No newline at end of file diff --git a/source/ASN1.package/DSAPublicKey.extension/class/fromAsnDerBytes..st b/source/ASN1.package/DSAPublicKey.extension/class/fromAsnDerBytes..st deleted file mode 100644 index 764817e..0000000 --- a/source/ASN1.package/DSAPublicKey.extension/class/fromAsnDerBytes..st +++ /dev/null @@ -1,13 +0,0 @@ -*ASN1 -fromAsnDerBytes: bytes - - | collection algorithm dssSig p q g y | - collection := ASN1Stream decodeBytes: bytes. - algorithm := collection first. - dssSig := algorithm last. - (dssSig size = 3) ifFalse: [self error: 'incorrect number of dss parameters']. - p := dssSig at: 1. - q := dssSig at: 2. - g := dssSig at: 3. - y := ASN1Stream decodeBytes: collection last bytes. - ^ DSAPublicKey p: p q: q g: g y: y. diff --git a/source/ASN1.package/DSAPublicKey.extension/instance/asAsn1Bytes.st b/source/ASN1.package/DSAPublicKey.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 010f84c..0000000 --- a/source/ASN1.package/DSAPublicKey.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,9 +0,0 @@ -*ASN1 -asAsn1Bytes - - | algorithm keyInfo | - algorithm := OrderedCollection - with: (ASN1ObjectId fromString: '1.2.840.10040.4.1') - with: self dssSig. - keyInfo := OrderedCollection with: algorithm with: self subjectPublicKey. - ^ keyInfo asAsn1Bytes. diff --git a/source/ASN1.package/DSAPublicKey.extension/instance/subjectPublicKey.st b/source/ASN1.package/DSAPublicKey.extension/instance/subjectPublicKey.st deleted file mode 100644 index 15b5eac..0000000 --- a/source/ASN1.package/DSAPublicKey.extension/instance/subjectPublicKey.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -subjectPublicKey - - ^ ASN1BitString fromByteArray: y asAsn1Bytes \ No newline at end of file diff --git a/source/ASN1.package/DSAPublicKey.extension/properties.json b/source/ASN1.package/DSAPublicKey.extension/properties.json deleted file mode 100644 index a642d0e..0000000 --- a/source/ASN1.package/DSAPublicKey.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "DSAPublicKey" -} \ No newline at end of file diff --git a/source/ASN1.package/DateAndTime.extension/instance/asAsn1Bytes.st b/source/ASN1.package/DateAndTime.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 30530d7..0000000 --- a/source/ASN1.package/DateAndTime.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asAsn1Bytes - - ^ ASN1Stream encode: self. diff --git a/source/ASN1.package/DateAndTime.extension/instance/asn1Tag.st b/source/ASN1.package/DateAndTime.extension/instance/asn1Tag.st deleted file mode 100644 index d331690..0000000 --- a/source/ASN1.package/DateAndTime.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 23 diff --git a/source/ASN1.package/DateAndTime.extension/properties.json b/source/ASN1.package/DateAndTime.extension/properties.json deleted file mode 100644 index 2237b11..0000000 --- a/source/ASN1.package/DateAndTime.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "DateAndTime" -} \ No newline at end of file diff --git a/source/ASN1.package/HashFunction.extension/class/digestInfoAsn1DerEncodingFromMessage..st b/source/ASN1.package/HashFunction.extension/class/digestInfoAsn1DerEncodingFromMessage..st deleted file mode 100644 index 2d3aeff..0000000 --- a/source/ASN1.package/HashFunction.extension/class/digestInfoAsn1DerEncodingFromMessage..st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -digestInfoAsn1DerEncodingFromMessage: msg - - ^ (self digestInfoFromMessage: msg) asAsn1Bytes \ No newline at end of file diff --git a/source/ASN1.package/HashFunction.extension/class/digestInfoFromMessage..st b/source/ASN1.package/HashFunction.extension/class/digestInfoFromMessage..st deleted file mode 100644 index d929463..0000000 --- a/source/ASN1.package/HashFunction.extension/class/digestInfoFromMessage..st +++ /dev/null @@ -1,6 +0,0 @@ -*ASN1 -digestInfoFromMessage: msg - - ^ (OrderedCollection - with: (OrderedCollection with: self oid with: nil) - with: (self hashMessage: msg)) diff --git a/source/ASN1.package/HashFunction.extension/class/doubleHashMessage..st b/source/ASN1.package/HashFunction.extension/class/doubleHashMessage..st deleted file mode 100644 index 7432aa2..0000000 --- a/source/ASN1.package/HashFunction.extension/class/doubleHashMessage..st +++ /dev/null @@ -1,3 +0,0 @@ -*ASN1 -doubleHashMessage: aStringOrByteArray - ^ self new doubleHashMessage: aStringOrByteArray \ No newline at end of file diff --git a/source/ASN1.package/HashFunction.extension/class/oid.st b/source/ASN1.package/HashFunction.extension/class/oid.st deleted file mode 100644 index 05da076..0000000 --- a/source/ASN1.package/HashFunction.extension/class/oid.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -oid - - ^ ASN1ObjectId fromString: self oidString. diff --git a/source/ASN1.package/HashFunction.extension/class/oidString.st b/source/ASN1.package/HashFunction.extension/class/oidString.st deleted file mode 100644 index e1a822a..0000000 --- a/source/ASN1.package/HashFunction.extension/class/oidString.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -oidString - - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/ASN1.package/HashFunction.extension/properties.json b/source/ASN1.package/HashFunction.extension/properties.json deleted file mode 100644 index 2de949e..0000000 --- a/source/ASN1.package/HashFunction.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "HashFunction" -} \ No newline at end of file diff --git a/source/ASN1.package/Integer.extension/class/asnDerLengthFromHexStreamWithBytes..st b/source/ASN1.package/Integer.extension/class/asnDerLengthFromHexStreamWithBytes..st deleted file mode 100644 index 206a5bf..0000000 --- a/source/ASN1.package/Integer.extension/class/asnDerLengthFromHexStreamWithBytes..st +++ /dev/null @@ -1,13 +0,0 @@ -*ASN1 -asnDerLengthFromHexStreamWithBytes: aStream - - | byte length bytes | - bytes := OrderedCollection new. - byte := (Number readFrom: ((bytes add: aStream next) ifNil: [^0->#()]) asUppercase base: 16). - byte <= 16r80 - ifTrue: [^byte->bytes merge] - ifFalse: [ - length := 0. - (byte bitAnd: 16r7F) timesRepeat: [ - length := (length bitShift: 8) bitOr: (Number readFrom: (bytes add: aStream next) asUppercase base: 16).]. - ^ length->(bytes merge)]. \ No newline at end of file diff --git a/source/ASN1.package/Integer.extension/instance/asAsn1Bytes.st b/source/ASN1.package/Integer.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 30530d7..0000000 --- a/source/ASN1.package/Integer.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asAsn1Bytes - - ^ ASN1Stream encode: self. diff --git a/source/ASN1.package/Integer.extension/instance/asn1Tag.st b/source/ASN1.package/Integer.extension/instance/asn1Tag.st deleted file mode 100644 index a092484..0000000 --- a/source/ASN1.package/Integer.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 2 diff --git a/source/ASN1.package/Integer.extension/properties.json b/source/ASN1.package/Integer.extension/properties.json deleted file mode 100644 index a8c2b93..0000000 --- a/source/ASN1.package/Integer.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "Integer" -} \ No newline at end of file diff --git a/source/ASN1.package/OrderedSet.class/README.md b/source/ASN1.package/OrderedSet.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/OrderedSet.class/instance/asn1Tag.st b/source/ASN1.package/OrderedSet.class/instance/asn1Tag.st deleted file mode 100644 index b9ae16f..0000000 --- a/source/ASN1.package/OrderedSet.class/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -asn1Tag - - ^ 49 diff --git a/source/ASN1.package/OrderedSet.class/properties.json b/source/ASN1.package/OrderedSet.class/properties.json deleted file mode 100644 index 3b7453b..0000000 --- a/source/ASN1.package/OrderedSet.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "OrderedCollection", - "category" : "ASN1-Objects", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "OrderedSet", - "type" : "normal" -} \ No newline at end of file diff --git a/source/ASN1.package/ReadStream.extension/instance/formatASN1TabLevel..st b/source/ASN1.package/ReadStream.extension/instance/formatASN1TabLevel..st deleted file mode 100644 index 06b2beb..0000000 --- a/source/ASN1.package/ReadStream.extension/instance/formatASN1TabLevel..st +++ /dev/null @@ -1,24 +0,0 @@ -*ASN1 -formatASN1TabLevel: aTabLevel - | result tag aString size tabs sizeAndBytes bytes | - self atEnd - ifTrue: [^ String new]. - tabs := ((1 to: aTabLevel) - collect: [:i | '.' , String tab]) merge. - result := tabs , (tag := self next) , String tab. - sizeAndBytes := tag = '00' - ifTrue: [(Number readFrom: (bytes := self next: 2) merge asUppercase base: 16) -> bytes merge] - ifFalse: [Integer asnDerLengthFromHexStreamWithBytes: self]. - size := sizeAndBytes key. - aString := (self next: size) merge. - aString isEmpty - ifTrue: [aString := String new]. - (tag = '30' - or: [tag = '31' - or: [tag first asLowercase = $a or: [tag = '00']]]) - ifTrue: [result := result , sizeAndBytes value , ' (' , size asString , '): ' , String cr - , (aString formatASN1TabLevel: aTabLevel + 1)] - ifFalse: [result := result , sizeAndBytes value , ' (' , size asString , '): ' , String cr , tabs , String tab , aString , String cr - , (self formatASN1TabLevel: aTabLevel)]. - ^ result - , (self formatASN1TabLevel: aTabLevel) \ No newline at end of file diff --git a/source/ASN1.package/ReadStream.extension/properties.json b/source/ASN1.package/ReadStream.extension/properties.json deleted file mode 100644 index 888f4a1..0000000 --- a/source/ASN1.package/ReadStream.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "ReadStream" -} \ No newline at end of file diff --git a/source/ASN1.package/SequenceableCollection.extension/instance/asAsn1Bytes.st b/source/ASN1.package/SequenceableCollection.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 30530d7..0000000 --- a/source/ASN1.package/SequenceableCollection.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asAsn1Bytes - - ^ ASN1Stream encode: self. diff --git a/source/ASN1.package/SequenceableCollection.extension/instance/asn1Tag.st b/source/ASN1.package/SequenceableCollection.extension/instance/asn1Tag.st deleted file mode 100644 index 255cf11..0000000 --- a/source/ASN1.package/SequenceableCollection.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 48 diff --git a/source/ASN1.package/SequenceableCollection.extension/properties.json b/source/ASN1.package/SequenceableCollection.extension/properties.json deleted file mode 100644 index a68b7db..0000000 --- a/source/ASN1.package/SequenceableCollection.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "SequenceableCollection" -} \ No newline at end of file diff --git a/source/ASN1.package/Set.extension/instance/asAsn1Bytes.st b/source/ASN1.package/Set.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 30530d7..0000000 --- a/source/ASN1.package/Set.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asAsn1Bytes - - ^ ASN1Stream encode: self. diff --git a/source/ASN1.package/Set.extension/instance/asn1Tag.st b/source/ASN1.package/Set.extension/instance/asn1Tag.st deleted file mode 100644 index ae24785..0000000 --- a/source/ASN1.package/Set.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 49 diff --git a/source/ASN1.package/Set.extension/properties.json b/source/ASN1.package/Set.extension/properties.json deleted file mode 100644 index 9f6f455..0000000 --- a/source/ASN1.package/Set.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "Set" -} \ No newline at end of file diff --git a/source/ASN1.package/String.extension/instance/asn1Tag.st b/source/ASN1.package/String.extension/instance/asn1Tag.st deleted file mode 100644 index 1b55d9a..0000000 --- a/source/ASN1.package/String.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 12 diff --git a/source/ASN1.package/String.extension/instance/formatASN1.st b/source/ASN1.package/String.extension/instance/formatASN1.st deleted file mode 100644 index 8a79b87..0000000 --- a/source/ASN1.package/String.extension/instance/formatASN1.st +++ /dev/null @@ -1,6 +0,0 @@ -*ASN1 -formatASN1 - "return a asn1 tab formed string - '30818513818154686973206973206120313239206279746520737472696E672C2062757420746861742069732061207265616C6C79206C6F6E6720737472696E6720736F204920686176652061206C6F7420746F20747970652E20204E6F7065204920616D206E6F7420646F6E65207965742C207374696C6C206E6F7420646F6E6520616C6D6F' formatASN1 - " - ^self formatASN1TabLevel: 0 \ No newline at end of file diff --git a/source/ASN1.package/String.extension/instance/formatASN1TabLevel..st b/source/ASN1.package/String.extension/instance/formatASN1TabLevel..st deleted file mode 100644 index ba6dcca..0000000 --- a/source/ASN1.package/String.extension/instance/formatASN1TabLevel..st +++ /dev/null @@ -1,10 +0,0 @@ -*ASN1 -formatASN1TabLevel: aTabLevel - | aReadStream aWriteStream | - "return a asn1 tab formed string - '30818513818154686973206973206120313239206279746520737472696E672C2062757420746861742069732061207265616C6C79206C6F6E6720737472696E6720736F204920686176652061206C6F7420746F20747970652E20204E6F7065204920616D206E6F7420646F6E65207965742C207374696C6C206E6F7420646F6E6520616C6D6F' formatASN1 - " - aReadStream := ((self copyWithoutAll: {Character space. Character tab. Character cr}) divideBySize: 2) readStream. - aWriteStream := String new writeStream. - aWriteStream nextPutAll: (aReadStream formatASN1TabLevel: aTabLevel). - ^aWriteStream contents \ No newline at end of file diff --git a/source/ASN1.package/String.extension/instance/tokensBasedOn..st b/source/ASN1.package/String.extension/instance/tokensBasedOn..st deleted file mode 100644 index b0f0e04..0000000 --- a/source/ASN1.package/String.extension/instance/tokensBasedOn..st +++ /dev/null @@ -1,18 +0,0 @@ -*ASN1 -tokensBasedOn: aChar - "Answer an array of the substrings that compose the receiver." - | result end begin | - - result := WriteStream on: (Array new: 10). - - begin := 1. - "find one substring each time through this loop" - [ - "find the beginning of the next substring" - end := self indexOf: aChar startingAt: begin ifAbsent: [ nil ]. - end ~~ nil ] - whileTrue: [ - result nextPut: (self copyFrom: begin to: end - 1). - begin := end + 1]. - result nextPut: (self copyFrom: begin to: self size). - ^result contents diff --git a/source/ASN1.package/String.extension/properties.json b/source/ASN1.package/String.extension/properties.json deleted file mode 100644 index b20f2de..0000000 --- a/source/ASN1.package/String.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "String" -} \ No newline at end of file diff --git a/source/ASN1.package/UndefinedObject.extension/instance/asAsn1Bytes.st b/source/ASN1.package/UndefinedObject.extension/instance/asAsn1Bytes.st deleted file mode 100644 index 30530d7..0000000 --- a/source/ASN1.package/UndefinedObject.extension/instance/asAsn1Bytes.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asAsn1Bytes - - ^ ASN1Stream encode: self. diff --git a/source/ASN1.package/UndefinedObject.extension/instance/asn1Tag.st b/source/ASN1.package/UndefinedObject.extension/instance/asn1Tag.st deleted file mode 100644 index 0202f53..0000000 --- a/source/ASN1.package/UndefinedObject.extension/instance/asn1Tag.st +++ /dev/null @@ -1,4 +0,0 @@ -*ASN1 -asn1Tag - - ^ 5 \ No newline at end of file diff --git a/source/ASN1.package/UndefinedObject.extension/properties.json b/source/ASN1.package/UndefinedObject.extension/properties.json deleted file mode 100644 index b2d2e56..0000000 --- a/source/ASN1.package/UndefinedObject.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "UndefinedObject" -} \ No newline at end of file diff --git a/source/ASN1.package/monticello.meta/categories.st b/source/ASN1.package/monticello.meta/categories.st deleted file mode 100644 index 3b45200..0000000 --- a/source/ASN1.package/monticello.meta/categories.st +++ /dev/null @@ -1,4 +0,0 @@ -SystemOrganization addCategory: #ASN1! -SystemOrganization addCategory: #'ASN1-DefinitionModel'! -SystemOrganization addCategory: #'ASN1-Objects'! -SystemOrganization addCategory: #'ASN1-Types'! diff --git a/source/ASN1.package/monticello.meta/initializers.st b/source/ASN1.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/ASN1.package/monticello.meta/package b/source/ASN1.package/monticello.meta/package deleted file mode 100644 index fc426e8..0000000 --- a/source/ASN1.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'ASN1') \ No newline at end of file diff --git a/source/ASN1.package/properties.json b/source/ASN1.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/ASN1.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/ASN1/ASN1AbstractString.class.st b/source/ASN1/ASN1AbstractString.class.st new file mode 100644 index 0000000..b829a6f --- /dev/null +++ b/source/ASN1/ASN1AbstractString.class.st @@ -0,0 +1,72 @@ +Class { + #name : #ASN1AbstractString, + #superclass : #ASN1Value, + #instVars : [ + 'string' + ], + #category : 'ASN1-Objects' +} + +{ #category : #'as yet unclassified' } +ASN1AbstractString class >> fromString: aString [ + + ^ self new + string: aString; + yourself +] + +{ #category : #printing } +ASN1AbstractString >> , aString [ + + ^ self class new + string: self string, aString string; + yourself + +] + +{ #category : #printing } +ASN1AbstractString >> = aString [ + + ^ self asString = aString asString + +] + +{ #category : #printing } +ASN1AbstractString >> asString [ + + ^ self string +] + +{ #category : #printing } +ASN1AbstractString >> hash [ + + ^ self asString hash +] + +{ #category : #'initialize-release' } +ASN1AbstractString >> initialize [ + + self string: ''. + +] + +{ #category : #printing } +ASN1AbstractString >> printOn: aStream [ + + self string printOn: aStream. + +] + +{ #category : #accessing } +ASN1AbstractString >> string [ + "Answer the value of string" + + ^ string +] + +{ #category : #accessing } +ASN1AbstractString >> string: anObject [ + "Set the value of string" + + string := anObject +] diff --git a/source/ASN1/ASN1AnyDefinedByType.class.st b/source/ASN1/ASN1AnyDefinedByType.class.st new file mode 100644 index 0000000..8f3ed5e --- /dev/null +++ b/source/ASN1/ASN1AnyDefinedByType.class.st @@ -0,0 +1,116 @@ +Class { + #name : #ASN1AnyDefinedByType, + #superclass : #ASN1BasicType, + #instVars : [ + 'definedBy', + 'typeMap', + 'defaultType' + ], + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1AnyDefinedByType >> at: key [ + + ^self typeMap at: key ifAbsent: [self defaultType] +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> at: key put: typeSpec [ + + ^self typeMap at: key put: (self typeFrom: typeSpec) +] + +{ #category : #decoding } +ASN1AnyDefinedByType >> decodeWithDERStream: derStream [ + + self error: 'must decode in the scope of a structured container'. + +] + +{ #category : #decoding } +ASN1AnyDefinedByType >> decodeWithDERStream: derStream owner: owner ownerType: ownerType [ + + | keyValue type | + keyValue := (ownerType elementWithSymbol: self definedBy) + valueFrom: owner. + type := self at: keyValue. + ^ type decodeWithDERStream: derStream. + +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> defaultType [ + "Answer the value of defaultType" + + ^ defaultType +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> defaultType: anObject [ + "Set the value of defaultType" + + defaultType := self typeFrom: anObject +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> definedBy [ + "Answer the value of definedBy" + + ^ definedBy +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> definedBy: anObject [ + "Set the value of definedBy" + + definedBy := anObject +] + +{ #category : #encoding } +ASN1AnyDefinedByType >> encode: obj withDERStream: derStream [ + + self error: 'must encode in the scope of a structured container'. + +] + +{ #category : #encoding } +ASN1AnyDefinedByType >> encode: anObject withDERStream: derStream owner: owner ownerType: ownerType [ + + | keyValue type | + keyValue := (ownerType elementWithSymbol: self definedBy) + valueFrom: owner. + type := self at: keyValue. + ^ type encode: anObject withDERStream: derStream. + +] + +{ #category : #'initialize-release' } +ASN1AnyDefinedByType >> initialize [ + + self typeMap: Dictionary new. + +] + +{ #category : #testing } +ASN1AnyDefinedByType >> matchesTag: anInteger [ + + ^ (self typeMap + detect: [:each | each matchesTag: anInteger] + ifNone: [nil]) notNil + +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> typeMap [ + "Answer the value of typeMap" + + ^ typeMap +] + +{ #category : #accessing } +ASN1AnyDefinedByType >> typeMap: anObject [ + "Set the value of typeMap" + + typeMap := anObject +] diff --git a/source/ASN1/ASN1AnyType.class.st b/source/ASN1/ASN1AnyType.class.st new file mode 100644 index 0000000..c19637b --- /dev/null +++ b/source/ASN1/ASN1AnyType.class.st @@ -0,0 +1,41 @@ +Class { + #name : #ASN1AnyType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1AnyType >> decodeWithDERStream: derStream [ + + ^ derStream decode. + +] + +{ #category : #encoding } +ASN1AnyType >> encode: anObject withDERStream: derStream [ + + derStream encode: anObject. + +] + +{ #category : #testing } +ASN1AnyType >> isTypeFor: anObject [ + + ^ (ASN1Stream tagToTypeDispatchTable + detect: [:eachType | eachType isTypeFor: anObject] + ifNone: [nil]) notNil + +] + +{ #category : #testing } +ASN1AnyType >> matchesTag: anInteger [ + + ^ (anInteger bitAnd: 2r11000000) isZero + +] + +{ #category : #accessing } +ASN1AnyType >> tag [ + + ^ nil +] diff --git a/source/ASN1/ASN1AssignmentSubType.class.st b/source/ASN1/ASN1AssignmentSubType.class.st new file mode 100644 index 0000000..694ae89 --- /dev/null +++ b/source/ASN1/ASN1AssignmentSubType.class.st @@ -0,0 +1,25 @@ +Class { + #name : #ASN1AssignmentSubType, + #superclass : #ASN1SubType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1AssignmentSubType >> decodeWithDERStream: derStream [ + + ^ self parent decodeWithDERStream: derStream. + +] + +{ #category : #encoding } +ASN1AssignmentSubType >> encode: anObject withDERStream: derStream [ + + ^ self parent encode: anObject withDERStream: derStream. + +] + +{ #category : #testing } +ASN1AssignmentSubType >> matchesTag: anInteger [ + + ^ self parent matchesTag: anInteger +] diff --git a/source/ASN1/ASN1BMPString.class.st b/source/ASN1/ASN1BMPString.class.st new file mode 100644 index 0000000..11cef66 --- /dev/null +++ b/source/ASN1/ASN1BMPString.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1BMPString, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #accessing } +ASN1BMPString >> asn1Tag [ + + ^ 30 +] diff --git a/source/ASN1/ASN1BMPStringType.class.st b/source/ASN1/ASN1BMPStringType.class.st new file mode 100644 index 0000000..9ad7bac --- /dev/null +++ b/source/ASN1/ASN1BMPStringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1BMPStringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1BMPStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1BMPString +] + +{ #category : #accessing } +ASN1BMPStringType >> tag [ + + ^ 30 +] + +{ #category : #decoding } +ASN1BMPStringType >> wrapperClass [ + + ^ ASN1BMPString + +] diff --git a/source/ASN1/ASN1BasicType.class.st b/source/ASN1/ASN1BasicType.class.st new file mode 100644 index 0000000..c33a692 --- /dev/null +++ b/source/ASN1/ASN1BasicType.class.st @@ -0,0 +1,5 @@ +Class { + #name : #ASN1BasicType, + #superclass : #ASN1Type, + #category : 'ASN1-Types' +} diff --git a/source/ASN1/ASN1BitString.class.st b/source/ASN1/ASN1BitString.class.st new file mode 100644 index 0000000..0fa3371 --- /dev/null +++ b/source/ASN1/ASN1BitString.class.st @@ -0,0 +1,85 @@ +Class { + #name : #ASN1BitString, + #superclass : #ASN1Value, + #instVars : [ + 'bytes', + 'bitsPadding' + ], + #category : 'ASN1-Objects' +} + +{ #category : #asn } +ASN1BitString class >> fromByteArray: bytes [ + + ^ self new + bytes: bytes; + yourself. + +] + +{ #category : #'initialize-release' } +ASN1BitString >> , bitString [ + + ^ self class new + bytes: self bytes, bitString bytes; + bitsPadding: bitString bitsPadding; + yourself. + +] + +{ #category : #'private - parsing' } +ASN1BitString >> = anotherBitString [ + + ^ self bytes = anotherBitString bytes +] + +{ #category : #'private - parsing' } +ASN1BitString >> asn1Tag [ + + ^ 3 + +] + +{ #category : #accessing } +ASN1BitString >> bitsPadding [ + "Answer the value of bitsPadding" + + ^ bitsPadding +] + +{ #category : #accessing } +ASN1BitString >> bitsPadding: anObject [ + "Set the value of bitsPadding" + + bitsPadding := anObject +] + +{ #category : #accessing } +ASN1BitString >> bytes [ + "Answer the receiver's instance variable bytes." + + ^bytes +] + +{ #category : #accessing } +ASN1BitString >> bytes: anObject [ + "Set the receiver's instance variable bytes to anObject." + + bytes := anObject +] + +{ #category : #'initialize-release' } +ASN1BitString >> initialize [ + + self bitsPadding: 0. + self bytes: (ByteArray new). + +] + +{ #category : #'private - parsing' } +ASN1BitString >> printOn: aStream [ + + 1 to: bytes size - 1 do: [:idx | + aStream nextPutAll: ((self bytes at: idx) printStringBase: 2)]. + aStream nextPutAll: ((160 printStringBase: 2) copyFrom: 1 to: (8 - self bitsPadding)) +] diff --git a/source/ASN1/ASN1BitStringType.class.st b/source/ASN1/ASN1BitStringType.class.st new file mode 100644 index 0000000..204b97d --- /dev/null +++ b/source/ASN1/ASN1BitStringType.class.st @@ -0,0 +1,49 @@ +Class { + #name : #ASN1BitStringType, + #superclass : #ASN1OctetsType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1BitStringType >> decodeValueWithDERStream: derStream length: length [ + + | bitString | + bitString := ASN1BitString new. + bitString bitsPadding: derStream next. + bitString bytes: (derStream next: length - 1). + ^ bitString + +] + +{ #category : #encoding } +ASN1BitStringType >> encodeValue: anObject withDERStream: derStream [ + + derStream + nextPut: anObject bitsPadding; + nextPutAll: anObject bytes asByteArray. + +] + +{ #category : #testing } +ASN1BitStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1BitString +] + +{ #category : #accessing } +ASN1BitStringType >> octetsClass [ + + ^ ASN1BitString +] + +{ #category : #encoding } +ASN1BitStringType >> sizeOfObject: anObject [ + + ^ anObject bytes size + 1 +] + +{ #category : #accessing } +ASN1BitStringType >> tag [ + + ^ 3 +] diff --git a/source/ASN1/ASN1BooleanType.class.st b/source/ASN1/ASN1BooleanType.class.st new file mode 100644 index 0000000..0002290 --- /dev/null +++ b/source/ASN1/ASN1BooleanType.class.st @@ -0,0 +1,39 @@ +Class { + #name : #ASN1BooleanType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1BooleanType >> decodeValueWithDERStream: derStream length: length [ + + ^ derStream next > 0 +] + +{ #category : #encoding } +ASN1BooleanType >> encodeValue: anObject withDERStream: derStream [ + + anObject + ifTrue: [derStream nextPut: 255] + ifFalse: [derStream nextPut: 0]. + +] + +{ #category : #testing } +ASN1BooleanType >> isTypeFor: anObject [ + + ^ anObject isKindOf: Boolean +] + +{ #category : #encoding } +ASN1BooleanType >> sizeOfObject: anObject [ + + ^ 1 + +] + +{ #category : #accessing } +ASN1BooleanType >> tag [ + + ^ 1 +] diff --git a/source/ASN1/ASN1ByteArrayType.class.st b/source/ASN1/ASN1ByteArrayType.class.st new file mode 100644 index 0000000..f6baef1 --- /dev/null +++ b/source/ASN1/ASN1ByteArrayType.class.st @@ -0,0 +1,42 @@ +Class { + #name : #ASN1ByteArrayType, + #superclass : #ASN1OctetsType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1ByteArrayType >> decodeValueWithDERStream: derStream length: length [ + + ^(derStream next: length) asByteArray +] + +{ #category : #encoding } +ASN1ByteArrayType >> encodeValue: anObject withDERStream: derStream [ + + derStream nextPutAll: anObject +] + +{ #category : #testing } +ASN1ByteArrayType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ByteArray +] + +{ #category : #accessing } +ASN1ByteArrayType >> octetsClass [ + + ^ ByteArray +] + +{ #category : #encoding } +ASN1ByteArrayType >> sizeOfObject: anObject [ + + ^ anObject size + +] + +{ #category : #accessing } +ASN1ByteArrayType >> tag [ + + ^ 4 +] diff --git a/source/ASN1/ASN1ChoiceElement.class.st b/source/ASN1/ASN1ChoiceElement.class.st new file mode 100644 index 0000000..6c9de6a --- /dev/null +++ b/source/ASN1/ASN1ChoiceElement.class.st @@ -0,0 +1,105 @@ +Class { + #name : #ASN1ChoiceElement, + #superclass : #Object, + #instVars : [ + 'owner', + 'symbol', + 'type' + ], + #category : 'ASN1-Types' +} + +{ #category : #private } +ASN1ChoiceElement >> addedTo: aType [ + + owner := aType. + +] + +{ #category : #decoding } +ASN1ChoiceElement >> decodeWithDERStream: derStream [ + + | tag | + derStream atEnd ifTrue: [^ self error: 'missing element']. + tag := derStream peekTag. + (self matchesTag: tag) + ifTrue: [^ type decodeWithDERStream: derStream] + ifFalse: [^ self error: 'bad choice']. + +] + +{ #category : #encoding } +ASN1ChoiceElement >> encode: anObject withDERStream: derStream [ + + self type encode: anObject withDERStream: derStream. +] + +{ #category : #'subtype utilities' } +ASN1ChoiceElement >> explicitTag: integer [ + + self type: self type explicitSubType. + ^ self type tag: integer. + +] + +{ #category : #'subtype utilities' } +ASN1ChoiceElement >> implicitTag: integer [ + + self type: self type implicitSubType. + ^ self type tag: integer. + +] + +{ #category : #testing } +ASN1ChoiceElement >> isTypeFor: anObject [ + + ^self type isTypeFor: anObject +] + +{ #category : #testing } +ASN1ChoiceElement >> matchesTag: anInteger [ + + ^self type matchesTag: anInteger +] + +{ #category : #accessing } +ASN1ChoiceElement >> owner [ + "Answer the value of owner" + + ^ owner +] + +{ #category : #accessing } +ASN1ChoiceElement >> owner: anObject [ + "Set the value of owner" + + owner := anObject +] + +{ #category : #accessing } +ASN1ChoiceElement >> symbol [ + "Answer the value of symbol" + + ^ symbol +] + +{ #category : #accessing } +ASN1ChoiceElement >> symbol: anObject [ + "Set the value of symbol" + + symbol := anObject +] + +{ #category : #accessing } +ASN1ChoiceElement >> type [ + "Answer the value of type" + + ^ type +] + +{ #category : #accessing } +ASN1ChoiceElement >> type: anObject [ + "Set the value of type" + + type := anObject +] diff --git a/source/ASN1/ASN1ChoiceType.class.st b/source/ASN1/ASN1ChoiceType.class.st new file mode 100644 index 0000000..238b882 --- /dev/null +++ b/source/ASN1/ASN1ChoiceType.class.st @@ -0,0 +1,52 @@ +Class { + #name : #ASN1ChoiceType, + #superclass : #ASN1StructuredType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1ChoiceType >> decodeValueWithDERStream: derStream length: length [ + + | aTag ele | + aTag := derStream currentTag bitAnd: 2r00011111. + ele := self elements + detect: [:x | x matchesTag: aTag] + ifNone: [self error: 'no choice']. + ^ ele decodeValueWithDERStream: derStream length: length. + +] + +{ #category : #decoding } +ASN1ChoiceType >> decodeWithDERStream: derStream [ + + | aTag ele | + aTag := derStream peekTag. + ele := self elements + detect: [:x | x matchesTag: aTag] + ifNone: [self error: 'no choice']. + ^ ele decodeWithDERStream: derStream. + +] + +{ #category : #encoding } +ASN1ChoiceType >> encode: anObject withDERStream: derStream [ + + | ele | + ele := self elements + detect: [:x | x isTypeFor: anObject] + ifNone: [self error: 'no choice']. + ele encode: anObject withDERStream: derStream. + +] + +{ #category : #testing } +ASN1ChoiceType >> matchesTag: aTag [ + + ^ elements anySatisfy: [:e | e matchesTag: aTag] +] + +{ #category : #private } +ASN1ChoiceType >> newElement [ + + ^ ASN1ChoiceElement new +] diff --git a/source/ASN1/ASN1ConstructedType.class.st b/source/ASN1/ASN1ConstructedType.class.st new file mode 100644 index 0000000..d5f1d2d --- /dev/null +++ b/source/ASN1/ASN1ConstructedType.class.st @@ -0,0 +1,30 @@ +Class { + #name : #ASN1ConstructedType, + #superclass : #ASN1Type, + #category : 'ASN1-Types' +} + +{ #category : #encoding } +ASN1ConstructedType >> encode: anObject withDERStream: derStream [ + + | tempStream | + derStream nextPutTag: self asn1Tag. + tempStream := derStream newStream. + self encodeValue: anObject withDERStream: tempStream. + derStream nextPutLength: tempStream size. + derStream nextPutAll: tempStream contents. + ^ derStream + +] + +{ #category : #testing } +ASN1ConstructedType >> isConstructed [ + + ^ true +] + +{ #category : #encoding } +ASN1ConstructedType >> sizeOfObject: anObject [ + + ^ nil +] diff --git a/source/ASN1/ASN1DefinitionModel.class.st b/source/ASN1/ASN1DefinitionModel.class.st new file mode 100644 index 0000000..ec55e3c --- /dev/null +++ b/source/ASN1/ASN1DefinitionModel.class.st @@ -0,0 +1,315 @@ +" +This class is used to parse an asn1Definition of a class. + +Use the prama syntax to define the asn1 encoding + + +for example: + +" +Class { + #name : #ASN1DefinitionModel, + #superclass : #Object, + #instVars : [ + 'subject', + 'asn1ClassName', + 'asn1DefinitionString', + 'fields', + 'resultObject', + 'currentObject', + 'currentField', + 'currentMutator', + 'currentAccessor', + 'fieldStack' + ], + #category : 'ASN1-DefinitionModel' +} + +{ #category : #LICENSE } +ASN1DefinitionModel class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #'instance creation' } +ASN1DefinitionModel class >> on: aClassWithASN1Definitions [ + + ^self new + subject: aClassWithASN1Definitions; + yourself. +] + +{ #category : #accessing } +ASN1DefinitionModel >> asn1ClassName [ + "Answer the value of asn1ClassName" + + ^ asn1ClassName ifNil: [asn1ClassName := self parseASN1ClassName. asn1ClassName] +] + +{ #category : #accessing } +ASN1DefinitionModel >> asn1ClassName: anObject [ + "Set the value of asn1ClassName" + + asn1ClassName := anObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> asn1DefinitionString [ + "Answer the value of asn1DefinitionString" + + ^ asn1DefinitionString ifNil: [asn1DefinitionString := self parseASN1DefinitionString. asn1DefinitionString] +] + +{ #category : #accessing } +ASN1DefinitionModel >> asn1DefinitionString: anObject [ + "Set the value of asn1DefinitionString" + + asn1DefinitionString := anObject +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> createObjectsAndPushFields [ + self resultObject ifNil: + [self setRootObject]. + self currentObject ifNil: + [self setCurrentObject]. + self currentField isNil + ifTrue: [self setCurrentField] + ifFalse: [self pushNextField]. + self setCurrentMutator. + +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentAccessor [ + "Answer the value of currentAccessor" + + ^ currentAccessor +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentAccessor: anObject [ + "Set the value of currentAccessor" + + currentAccessor := anObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentField [ + "Answer the value of currentField" + + ^ currentField +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentField: anObject [ + "Set the value of currentField" + + currentField := anObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentMutator [ + "Answer the value of currentMutator" + + ^ currentMutator +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentMutator: anObject [ + "Set the value of currentMutator" + + currentMutator := anObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentObject [ + "Answer the value of currentObject" + + ^ currentObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> currentObject: anObject [ + "Set the value of currentObject" + + currentObject := anObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> fieldStack [ + "Answer the value of fieldStack" + + ^ fieldStack ifNil: [fieldStack := Stack new]. +] + +{ #category : #accessing } +ASN1DefinitionModel >> fieldStack: anObject [ + "Set the value of fieldStack" + + fieldStack := anObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> fields [ + "Answer the value of fields" + + ^ fields ifNil: [fields := self parseFieldNames. fields]. +] + +{ #category : #accessing } +ASN1DefinitionModel >> fields: anObject [ + "Set the value of fields" + + fields := anObject +] + +{ #category : #'services pragma' } +ASN1DefinitionModel >> getPragmaAccessors [ + "return the pragmas defined on this class. These values are usually put in the accessor of the ivar, but could be in other regular methods if it is appropriate. The form of the pragma is . + for example if you have an ivar named: #title that has a definition + MyASN1Object ::= Sequence { + asn1Title DisplayableString + } + then the accessor for title should look like this: + title + + + ^title + + Every field definition in the asn1Defintion string must have a corresponding pragma" + + ^(Pragma allNamed: #asn1FieldAccessor: in: self subject) collect: [:aPragma | ASN1PragmaAccessor fromPragma: aPragma]. +] + +{ #category : #'services pragma' } +ASN1DefinitionModel >> getPragmaMutators [ + "return the pragmas defined on this class. These values are usually put in the mutator of the ivar, but could be in other regular methods if it is appropriate. The form of the pragma is . Use symbol for class because of monticello loading problems. + for example if you have an ivar named: #title that has a definition + MyASN1Object ::= Sequence { + asn1Title DisplayableString + } + then the mutaotr for title should look like this: + title: aTitle + + + title := aTitle. + + Every field definition in the asn1Defintion string must have a corresponding pragma" + + ^(Pragma allNamed: #asn1FieldMutator:class: in: self subject) collect: [:aPragma | ASN1PragmaMutator fromPragma: aPragma]. +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> parseASN1ClassName [ + "return the ans1definition argument string" + | aDefString classSepIndex | + aDefString := self asn1DefinitionString ifNil: [^nil]. + classSepIndex := aDefString indexOfSubCollection: '::='. + classSepIndex = 0 ifTrue: [^nil]. + ^(aDefString copyFrom: 1 to: classSepIndex - 1) withBlanksTrimmed. +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> parseASN1DefinitionString [ + "return the ans1definition argument string" + | aPragma aCollection | + aCollection := Pragma allNamed: #asn1Definition: in: self subject class. + ^ aCollection isEmpty + ifFalse: [aPragma := aCollection first. + aPragma arguments + at: 1 + ifAbsent: []] +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> parseFieldNames [ + | aString fields | + aString := self asn1DefinitionString. + fields := OrderedCollection new. + (aString copyFrom: (aString indexOf: ${) + 1 to: (aString indexOf: $}) - 1) linesDo: [:aLine | + (((aLine indexOfSubCollection: '--') > 0) or: [aLine withBlanksTrimmed isEmpty])ifFalse: [ + fields add: aLine subStrings first + ]. + ]. + ^fields +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> parseRootObjectType [ + "parse the definition string and figure out if this object is a subject or a + collection of subjects" + | aString aType | + aString := self asn1DefinitionString. + aType := (aString copyFrom: (aString indexOfSubCollection: '::=') + + 4 to: (aString indexOf: ${) + - 1) withBlanksTrimmed. + ^aType isEmpty + ifTrue: [self subject] + ifFalse: [aType = 'SEQUENCE' + ifTrue: [OrderedCollection] + ifFalse: [self error: 'new root type']] +] + +{ #category : #accessing } +ASN1DefinitionModel >> resultObject [ + "Answer the value of resultObject" + + ^ resultObject +] + +{ #category : #accessing } +ASN1DefinitionModel >> resultObject: anObject [ + "Set the value of resultObject" + + resultObject := anObject +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> setCurrentObject [ + self currentObject: self subject new. +] + +{ #category : #'services parsing' } +ASN1DefinitionModel >> setRootObject [ + self resultObject: self parseRootObjectType new. + self resultObject isCollection + ifTrue: [self currentObject: self subject new] + ifFalse: [self currentObject: self resultObject] +] + +{ #category : #accessing } +ASN1DefinitionModel >> subject [ + "Answer the value of subject" + + ^ subject +] + +{ #category : #accessing } +ASN1DefinitionModel >> subject: anObject [ + "Set the value of subject" + + subject := anObject +] + +{ #category : #'services verifying' } +ASN1DefinitionModel >> verifyFieldAccessorsAndMutators [ + "check to see that the ans1 definition is represented by all the appropriate accessor and mutator definitions" + | myAccessors myMutators | + myAccessors := self getPragmaAccessors. + myMutators := self getPragmaMutators. + ^self parseFieldNames allSatisfy: [:aField | + (myAccessors anySatisfy: [:anAccessor | anAccessor asn1name = aField]) and: [ + (myMutators anySatisfy: [:aMutator | aMutator asn1name = aField])]]. + +] diff --git a/source/ASN1/ASN1EndOfIndefiniteLengthMarker.class.st b/source/ASN1/ASN1EndOfIndefiniteLengthMarker.class.st new file mode 100644 index 0000000..2b0362a --- /dev/null +++ b/source/ASN1/ASN1EndOfIndefiniteLengthMarker.class.st @@ -0,0 +1,5 @@ +Class { + #name : #ASN1EndOfIndefiniteLengthMarker, + #superclass : #Object, + #category : 'ASN1-Types' +} diff --git a/source/ASN1/ASN1EndOfIndefiniteLengthType.class.st b/source/ASN1/ASN1EndOfIndefiniteLengthType.class.st new file mode 100644 index 0000000..51f9d32 --- /dev/null +++ b/source/ASN1/ASN1EndOfIndefiniteLengthType.class.st @@ -0,0 +1,35 @@ +Class { + #name : #ASN1EndOfIndefiniteLengthType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1EndOfIndefiniteLengthType >> decodeValueWithDERStream: derStream length: length [ + + ^ ASN1EndOfIndefiniteLengthMarker new +] + +{ #category : #encoding } +ASN1EndOfIndefiniteLengthType >> encodeValue: anObject withDERStream: derStream [ + +] + +{ #category : #testing } +ASN1EndOfIndefiniteLengthType >> isTypeFor: anObject [ + + ^ false +] + +{ #category : #encoding } +ASN1EndOfIndefiniteLengthType >> sizeOfObject: anObject [ + + ^ 0 + +] + +{ #category : #accessing } +ASN1EndOfIndefiniteLengthType >> tag [ + + ^ 0 +] diff --git a/source/ASN1/ASN1Entity.class.st b/source/ASN1/ASN1Entity.class.st new file mode 100644 index 0000000..6d62eeb --- /dev/null +++ b/source/ASN1/ASN1Entity.class.st @@ -0,0 +1,79 @@ +Class { + #name : #ASN1Entity, + #superclass : #Object, + #instVars : [ + 'symbol', + 'module' + ], + #category : 'ASN1-Types' +} + +{ #category : #'instance creation' } +ASN1Entity class >> name: aSymbol [ + + ^self new + name: aSymbol; + yourself +] + +{ #category : #'instance creation' } +ASN1Entity class >> name: aSymbol in: aModule [ + + ^aModule add: (self name: aSymbol) +] + +{ #category : #'subtype utilities' } +ASN1Entity >> explicitSubType [ + + ^ (ASN1ExplicitSubType name: nil) + parent: self; + yourself. + +] + +{ #category : #'subtype utilities' } +ASN1Entity >> implicitSubType [ + + ^ (ASN1ImplicitSubType name: nil) + parent: self; + yourself. + +] + +{ #category : #accessing } +ASN1Entity >> module [ + "Answer the value of module" + + ^ module +] + +{ #category : #accessing } +ASN1Entity >> module: anObject [ + "Set the value of module" + + module := anObject +] + +{ #category : #accessing } +ASN1Entity >> name [ + "Answer the value of symbol" + + ^ symbol +] + +{ #category : #accessing } +ASN1Entity >> name: anObject [ + "Set the value of symbol" + + symbol := anObject +] + +{ #category : #private } +ASN1Entity >> typeFrom: typeSpec [ + + ^ self module + ifNil: [typeSpec isBehavior + ifTrue: [typeSpec new] + ifFalse: [typeSpec]] + ifNotNil: [self module typeFrom: typeSpec] +] diff --git a/source/ASN1/ASN1ExplicitContextValue.class.st b/source/ASN1/ASN1ExplicitContextValue.class.st new file mode 100644 index 0000000..22b2fb9 --- /dev/null +++ b/source/ASN1/ASN1ExplicitContextValue.class.st @@ -0,0 +1,81 @@ +Class { + #name : #ASN1ExplicitContextValue, + #superclass : #ASN1Value, + #instVars : [ + 'tagIndex', + 'tagValue', + 'tagIsPrimitive' + ], + #category : 'ASN1-Objects' +} + +{ #category : #LICENSE } +ASN1ExplicitContextValue class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #parsing } +ASN1ExplicitContextValue >> asn1Tag [ + + ^ self tagIsPrimitive + ifTrue: [128 bitOr: self tagIndex] + ifFalse: [160 bitOr: self tagIndex]. + +] + +{ #category : #printing } +ASN1ExplicitContextValue >> printOn: aStream [ + + aStream nextPutAll: '[', self tagIndex asString, ']', (self tagValue printString). + +] + +{ #category : #accessing } +ASN1ExplicitContextValue >> tagIndex [ + "Answer the value of tagIndex" + + ^ tagIndex +] + +{ #category : #accessing } +ASN1ExplicitContextValue >> tagIndex: anObject [ + "Set the value of tagIndex" + + tagIndex := anObject +] + +{ #category : #accessing } +ASN1ExplicitContextValue >> tagIsPrimitive [ + "Answer the value of tagIsPrimitive" + + ^ tagIsPrimitive +] + +{ #category : #accessing } +ASN1ExplicitContextValue >> tagIsPrimitive: anObject [ + "Set the value of tagIsPrimitive" + + tagIsPrimitive := anObject +] + +{ #category : #accessing } +ASN1ExplicitContextValue >> tagValue [ + "Answer the value of tagValue" + + ^ tagValue +] + +{ #category : #accessing } +ASN1ExplicitContextValue >> tagValue: anObject [ + "Set the value of tagValue" + + tagValue := anObject +] diff --git a/source/ASN1/ASN1ExplicitSubType.class.st b/source/ASN1/ASN1ExplicitSubType.class.st new file mode 100644 index 0000000..a93aaff --- /dev/null +++ b/source/ASN1/ASN1ExplicitSubType.class.st @@ -0,0 +1,47 @@ +Class { + #name : #ASN1ExplicitSubType, + #superclass : #ASN1SubType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1ExplicitSubType >> decodeWithDERStream: derStream [ + + derStream nextTag. + derStream nextLength. + ^ self parent decodeWithDERStream: derStream. + +] + +{ #category : #decoding } +ASN1ExplicitSubType >> decodeWithDERStream: derStream owner: owner ownerType: ownerType [ + + derStream nextTag. + derStream nextLength. + ^ self parent decodeWithDERStream: derStream owner: owner ownerType: ownerType. + +] + +{ #category : #encoding } +ASN1ExplicitSubType >> encode: anObject withDERStream: derStream [ + + | tempStream | + derStream nextPutTag: (self asn1Tag bitOr: 160). + tempStream := derStream newStream. + self parent encode: anObject withDERStream: tempStream. + derStream nextPutLength: tempStream size. + derStream nextPutAll: tempStream contents. + +] + +{ #category : #encoding } +ASN1ExplicitSubType >> encode: anObject withDERStream: derStream owner: owner ownerType: ownerType [ + + | tempStream | + derStream nextPutTag: (self asn1Tag bitOr: 160). + tempStream := derStream newStream. + self parent encode: anObject withDERStream: tempStream owner: owner ownerType: ownerType. + derStream nextPutLength: tempStream size. + derStream nextPutAll: tempStream contents. + +] diff --git a/source/ASN1/ASN1FieldDefinition.class.st b/source/ASN1/ASN1FieldDefinition.class.st new file mode 100644 index 0000000..05e31bc --- /dev/null +++ b/source/ASN1/ASN1FieldDefinition.class.st @@ -0,0 +1,196 @@ +Class { + #name : #ASN1FieldDefinition, + #superclass : #ASN1Value, + #instVars : [ + 'fieldName', + 'tagIndex', + 'tagType', + 'explicitFieldDefinition', + 'implicitFieldDefinition', + 'defaultValue', + 'isExplicit', + 'isOptional' + ], + #category : 'ASN1-DefinitionModel' +} + +{ #category : #'instance creation' } +ASN1FieldDefinition class >> forField: aFieldName onDefinition: aDefinitionString [ + "Return to the sender an object created from aDefintionString with the + field name aFieldName" + | fieldInfo definitionContents noCommentsString | + + definitionContents := aDefinitionString copyFrom: (aDefinitionString indexOf: ${) + + 1 to: (aDefinitionString indexOf: $}) + - 1. + noCommentsString := String new. + definitionContents linesDo: [:aLine | + ((aLine indexOfSubCollection: '--') > 0 or: [aLine withBlanksTrimmed isEmpty]) + ifFalse: [noCommentsString := noCommentsString, aLine]. + ]. + fieldInfo := (noCommentsString explode: $,) + detect: [:aField | aField subStrings first = aFieldName] ifNone: [^nil]. + ^ self new parseFieldInfo: fieldInfo; + yourself +] + +{ #category : #testing } +ASN1FieldDefinition class >> testCreate [ + ^#('version' 'serialNumber' 'signature' 'issuer' 'validity' 'subject' 'subjectPublicKeyInfo' 'issuerUniqueID' 'subjectUniqueID' 'extensions') collect: [:aField | + self forField: aField onDefinition: 'TBSCertificate ::= SEQUENCE { + version [0] EXPLICIT Version DEFAULT v1, + serialNumber CertificateSerialNumber, + signature AlgorithmIdentifier, + issuer Name, + validity Validity, + subject Name, + subjectPublicKeyInfo SubjectPublicKeyInfo, + issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, + -- If present, version shall be v2 or v3 + subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, + -- If present, version shall be v2 or v3 + extensions [3] EXPLICIT Extensions OPTIONAL + -- If present, version shall be v3 + }']. +] + +{ #category : #accessing } +ASN1FieldDefinition >> defaultValue [ + "Answer the value of defaultValue" + + ^ defaultValue +] + +{ #category : #accessing } +ASN1FieldDefinition >> defaultValue: anObject [ + "Set the value of defaultValue" + + defaultValue := anObject +] + +{ #category : #accessing } +ASN1FieldDefinition >> explicitFieldDefinition [ + "Answer the value of explicitFieldDefinition" + + ^ explicitFieldDefinition +] + +{ #category : #accessing } +ASN1FieldDefinition >> explicitFieldDefinition: anObject [ + "Set the value of explicitFieldDefinition" + + explicitFieldDefinition := anObject +] + +{ #category : #accessing } +ASN1FieldDefinition >> fieldName [ + "Answer the value of fieldName" + + ^ fieldName +] + +{ #category : #accessing } +ASN1FieldDefinition >> fieldName: anObject [ + "Set the value of fieldName" + + fieldName := anObject +] + +{ #category : #accessing } +ASN1FieldDefinition >> implicitFieldDefinition [ + "Answer the value of implicitFieldDefinition" + + ^ implicitFieldDefinition +] + +{ #category : #accessing } +ASN1FieldDefinition >> implicitFieldDefinition: anObject [ + "Set the value of implicitFieldDefinition" + + implicitFieldDefinition := anObject +] + +{ #category : #accessing } +ASN1FieldDefinition >> isExplicit [ + "Answer the value of isExplicit" + + ^ isExplicit +] + +{ #category : #accessing } +ASN1FieldDefinition >> isExplicit: anObject [ + "Set the value of isExplicit" + + isExplicit := anObject +] + +{ #category : #accessing } +ASN1FieldDefinition >> isOptional [ + "Answer the value of isOptional" + + ^ isOptional +] + +{ #category : #accessing } +ASN1FieldDefinition >> isOptional: anObject [ + "Set the value of isOptional" + + isOptional := anObject +] + +{ #category : #parsing } +ASN1FieldDefinition >> parseFieldInfo: fieldInfo [ + "fill the current instance with fieldInformation" + | subStrings explodedString noTagIndexString | + subStrings := fieldInfo subStrings. + self fieldName: subStrings first. + noTagIndexString := (fieldInfo includes: $[) ifTrue: [ + self tagIndex: (fieldInfo copyFrom: (fieldInfo indexOf: $[) + 1 to: (fieldInfo indexOf: $]) - 1). + (fieldInfo copyFrom: 1 to: (fieldInfo indexOf: $[) -1), (fieldInfo copyFrom: (fieldInfo indexOf: $]) +1 to: fieldInfo size). + ] ifFalse: [ + fieldInfo + ]. + explodedString := noTagIndexString subStrings asOrderedCollection. + (explodedString includes: 'EXPLICIT') ifTrue: [ + explodedString := explodedString remove: 'EXPLICIT'; yourself. + self isExplicit: true. + ]. + (explodedString includes: 'OPTIONAL') ifTrue: [ + explodedString := explodedString remove: 'OPTIONAL'; yourself. + self isOptional: true. + ]. + (explodedString includes: 'DEFAULT') ifTrue: [ + explodedString := explodedString remove: 'DEFAULT'; yourself. + self defaultValue: explodedString last. + explodedString remove: explodedString last. + ]. + self tagType: explodedString last. +] + +{ #category : #accessing } +ASN1FieldDefinition >> tagIndex [ + "Answer the value of tagIndex" + + ^ tagIndex +] + +{ #category : #accessing } +ASN1FieldDefinition >> tagIndex: anObject [ + "Set the value of tagIndex" + + tagIndex := anObject +] + +{ #category : #accessing } +ASN1FieldDefinition >> tagType [ + "Answer the value of tagType" + + ^ tagType +] + +{ #category : #accessing } +ASN1FieldDefinition >> tagType: anObject [ + "Set the value of tagType" + + tagType := anObject +] diff --git a/source/ASN1/ASN1GeneralString.class.st b/source/ASN1/ASN1GeneralString.class.st new file mode 100644 index 0000000..3d23581 --- /dev/null +++ b/source/ASN1/ASN1GeneralString.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1GeneralString, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #'private - parsing' } +ASN1GeneralString >> asn1Tag [ + + ^ 27 +] diff --git a/source/ASN1/ASN1GeneralStringType.class.st b/source/ASN1/ASN1GeneralStringType.class.st new file mode 100644 index 0000000..5fb5ba8 --- /dev/null +++ b/source/ASN1/ASN1GeneralStringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1GeneralStringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1GeneralStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1GeneralString +] + +{ #category : #accessing } +ASN1GeneralStringType >> tag [ + + ^ 27 +] + +{ #category : #decoding } +ASN1GeneralStringType >> wrapperClass [ + + ^ ASN1GeneralString + +] diff --git a/source/ASN1/ASN1IA5String.class.st b/source/ASN1/ASN1IA5String.class.st new file mode 100644 index 0000000..e7dec1d --- /dev/null +++ b/source/ASN1/ASN1IA5String.class.st @@ -0,0 +1,12 @@ +Class { + #name : #ASN1IA5String, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #accessing } +ASN1IA5String >> asn1Tag [ + + ^ 22 + +] diff --git a/source/ASN1/ASN1IA5StringType.class.st b/source/ASN1/ASN1IA5StringType.class.st new file mode 100644 index 0000000..bdaefaf --- /dev/null +++ b/source/ASN1/ASN1IA5StringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1IA5StringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1IA5StringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1IA5String +] + +{ #category : #accessing } +ASN1IA5StringType >> tag [ + + ^ 22 +] + +{ #category : #decoding } +ASN1IA5StringType >> wrapperClass [ + + ^ ASN1IA5String + +] diff --git a/source/ASN1/ASN1ImplicitSubType.class.st b/source/ASN1/ASN1ImplicitSubType.class.st new file mode 100644 index 0000000..c5b785d --- /dev/null +++ b/source/ASN1/ASN1ImplicitSubType.class.st @@ -0,0 +1,38 @@ +Class { + #name : #ASN1ImplicitSubType, + #superclass : #ASN1SubType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1ImplicitSubType >> decodeWithDERStream: derStream [ + + | thisTag | + thisTag := derStream nextTag. + (self parent isConstructed not and: [(thisTag bitAnd: 2r00100000) > 0]) + ifTrue: [^ self parent + decodeConstructedValueWithDERStream: derStream + length: derStream nextLength] + ifFalse: [^ self parent + decodeValueWithDERStream: derStream + length: derStream nextLength]. + +] + +{ #category : #encoding } +ASN1ImplicitSubType >> encode: anObject withDERStream: derStream [ + + | myTag tempStream | + myTag := self asn1Tag bitOr: 128. + self parent isConstructed + ifTrue: [myTag := myTag bitOr: 32]. + derStream nextPutTag: myTag. + tempStream := derStream newStream. + self parent encodeValue: anObject withDERStream: tempStream. + derStream nextPutLength: tempStream size. + derStream nextPutAll: tempStream contents. + + + + +] diff --git a/source/ASN1/ASN1IntegerType.class.st b/source/ASN1/ASN1IntegerType.class.st new file mode 100644 index 0000000..93aee74 --- /dev/null +++ b/source/ASN1/ASN1IntegerType.class.st @@ -0,0 +1,65 @@ +Class { + #name : #ASN1IntegerType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1IntegerType >> decodeValueWithDERStream: derStream length: length [ + + | integer | + integer := Integer new: length neg: false. + length to: 1 by: -1 do: [:index | + integer digitAt: index put: derStream next]. + ((integer digitAt: length) allMask: 16r80) + ifTrue: [^integer twosComplement negated normalize] + ifFalse: [^integer normalize]. + +] + +{ #category : #encoding } +ASN1IntegerType >> encodeValue: anObject withDERStream: derStream [ + + | integer | + integer := anObject. + integer positive + ifTrue: [ + (integer lastDigit allMask: 16r80) + ifTrue: [derStream nextPut: 0]] + ifFalse: [ + integer := integer negated twosComplement. + (integer lastDigit noMask: 16r80) + ifTrue: [derStream nextPut: 16rFF]]. + integer digitLength to: 1 by: -1 do: [:digitIndex | + derStream nextPut: (integer digitAt: digitIndex)]. + +] + +{ #category : #testing } +ASN1IntegerType >> isTypeFor: anObject [ + + ^ anObject isInteger +] + +{ #category : #encoding } +ASN1IntegerType >> sizeOfObject: anObject [ + + | twosComplement | + ^ anObject positive + ifTrue: [(anObject lastDigit allMask: 16r80) + ifTrue: [anObject digitLength + 1] + ifFalse: [anObject digitLength]] + ifFalse: [ + twosComplement := anObject negated twosComplement. + (twosComplement lastDigit noMask: 16r80) + ifTrue: [twosComplement digitLength+1] + ifFalse: [twosComplement digitLength]]. + + +] + +{ #category : #accessing } +ASN1IntegerType >> tag [ + + ^ 2 +] diff --git a/source/ASN1/ASN1MappedSequenceType.class.st b/source/ASN1/ASN1MappedSequenceType.class.st new file mode 100644 index 0000000..3037591 --- /dev/null +++ b/source/ASN1/ASN1MappedSequenceType.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1MappedSequenceType, + #superclass : #ASN1MappedType, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1MappedSequenceType >> tag [ + + ^ 48 +] diff --git a/source/ASN1/ASN1MappedSetType.class.st b/source/ASN1/ASN1MappedSetType.class.st new file mode 100644 index 0000000..fe424a9 --- /dev/null +++ b/source/ASN1/ASN1MappedSetType.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1MappedSetType, + #superclass : #ASN1MappedType, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1MappedSetType >> tag [ + + ^ 49 +] diff --git a/source/ASN1/ASN1MappedType.class.st b/source/ASN1/ASN1MappedType.class.st new file mode 100644 index 0000000..c90e0aa --- /dev/null +++ b/source/ASN1/ASN1MappedType.class.st @@ -0,0 +1,147 @@ +Class { + #name : #ASN1MappedType, + #superclass : #ASN1StructuredType, + #instVars : [ + 'mapping' + ], + #category : 'ASN1-Types' +} + +{ #category : #'accessing - element construction' } +ASN1MappedType >> add: aSymbol type: type default: anObject [ + + ^(self add: aSymbol type: type) + default: anObject; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1MappedType >> add: aSymbol type: type explicitTag: integer default: anObject [ + + ^(self add: aSymbol type: type explicitTag: integer) + default: anObject; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1MappedType >> add: aSymbol type: type implicitTag: integer default: anObject [ + + ^(self add: aSymbol type: type implicitTag: integer) + default: anObject; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1MappedType >> addOptional: aSymbol type: type [ + + ^(self add: aSymbol type: type) + optional: true; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1MappedType >> addOptional: aSymbol type: type default: anObject [ + + ^(self add: aSymbol type: type) + optional: true; + default: anObject; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1MappedType >> addOptional: aSymbol type: type explicitTag: integer [ + + ^(self add: aSymbol type: type explicitTag: integer) + optional: true; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1MappedType >> addOptional: aSymbol type: type implicitTag: integer [ + + ^(self add: aSymbol type: type implicitTag: integer) + optional: true; + yourself. + +] + +{ #category : #decoding } +ASN1MappedType >> decodeValueIndefiniteLengthWithDERStream: derStream [ + + | target elementStream ele value | + target := self mapping new. + elementStream := self elements readStream. + [derStream peekTag = 0 + ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] + ifFalse: [value := elementStream next decode: target withDERStream: derStream]. + value isKindOf: ASN1EndOfIndefiniteLengthMarker] whileFalse. + [elementStream atEnd] + whileFalse: [ + ele := elementStream next. + ele hasDefault ifTrue: [ele value: ele default into: target]. + ele hasDefaultOrIsOptional + ifFalse: [self error: 'missing element'] ]. + ^ target + +] + +{ #category : #decoding } +ASN1MappedType >> decodeValueWithDERStream: derStream length: length [ + + | stopPosition target elementStream ele | + length = -1 + ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. + stopPosition := derStream position + length. + target := self mapping new. + elementStream := self elements readStream. + [elementStream atEnd or: [derStream position >= stopPosition]] + whileFalse: [ + ele := elementStream next. + ele decode: target withDERStream: derStream]. + [elementStream atEnd] + whileFalse: [ + ele := elementStream next. + ele hasDefault ifTrue: [ele value: ele default into: target]. + ele hasDefaultOrIsOptional + ifFalse: [self error: 'missing element'] ]. + derStream position < stopPosition ifTrue: [self error: 'invalid length']. + ^ target + +] + +{ #category : #encoding } +ASN1MappedType >> encodeValue: anObject withDERStream: derStream [ + + self elements do: [:each | + each encode: anObject withDERStream: derStream]. + +] + +{ #category : #testing } +ASN1MappedType >> isTypeFor: anObject [ + + ^ self mapping notNil + ifTrue: [anObject isKindOf: self mapping] + ifFalse: [anObject asn1Tag = self tag] + +] + +{ #category : #accessing } +ASN1MappedType >> mapping [ + "Answer the value of mapping" + + ^ mapping +] + +{ #category : #accessing } +ASN1MappedType >> mapping: anObject [ + "Set the value of mapping" + + mapping := anObject +] diff --git a/source/ASN1/ASN1MappingSubType.class.st b/source/ASN1/ASN1MappingSubType.class.st new file mode 100644 index 0000000..bb9ebf0 --- /dev/null +++ b/source/ASN1/ASN1MappingSubType.class.st @@ -0,0 +1,109 @@ +Class { + #name : #ASN1MappingSubType, + #superclass : #ASN1SubType, + #instVars : [ + 'mapping', + 'mappingSymbol' + ], + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1MappingSubType >> accessor [ + + ^self mappingSymbol +] + +{ #category : #decoding } +ASN1MappingSubType >> decodeWithDERStream: derStream [ + + | target val | + target := self mapping new. + val := self parent decodeWithDERStream: derStream. + target perform: self mutator with: val. + ^ target + +] + +{ #category : #decoding } +ASN1MappingSubType >> decodeWithDERStream: derStream owner: owner ownerType: ownerType [ + + | target val | + target := self mapping new. + val := self parent + decodeWithDERStream: derStream + owner: owner + ownerType: ownerType. + target perform: self mutator with: val. + ^ target + +] + +{ #category : #encoding } +ASN1MappingSubType >> encode: anObject withDERStream: derStream [ + + ^ self parent + encode: (anObject perform: self accessor) + withDERStream: derStream + +] + +{ #category : #encoding } +ASN1MappingSubType >> encode: anObject withDERStream: derStream owner: owner ownerType: ownerType [ + + ^ self parent + encode: (anObject perform: self accessor) + withDERStream: derStream + owner: owner + ownerType: ownerType + +] + +{ #category : #accessing } +ASN1MappingSubType >> mapping [ + "Answer the value of mapping" + + ^ mapping +] + +{ #category : #accessing } +ASN1MappingSubType >> mapping: anObject [ + "Set the value of mapping" + + mapping := anObject +] + +{ #category : #accessing } +ASN1MappingSubType >> mapping: aClass mappingSymbol: aSymbol type: aType [ + + self mapping: aClass. + self mappingSymbol: aSymbol. + self parent: aType. + +] + +{ #category : #accessing } +ASN1MappingSubType >> mappingSymbol [ + "Answer the value of mappingSymbol" + + ^ mappingSymbol +] + +{ #category : #accessing } +ASN1MappingSubType >> mappingSymbol: anObject [ + "Set the value of mappingSymbol" + + mappingSymbol := anObject +] + +{ #category : #testing } +ASN1MappingSubType >> matchesTag: anInteger [ + + ^ self parent matchesTag: anInteger +] + +{ #category : #accessing } +ASN1MappingSubType >> mutator [ + + ^(self mappingSymbol copyWith: $:) asSymbol +] diff --git a/source/ASN1/ASN1Module.class.st b/source/ASN1/ASN1Module.class.st new file mode 100644 index 0000000..f783c5b --- /dev/null +++ b/source/ASN1/ASN1Module.class.st @@ -0,0 +1,350 @@ +Class { + #name : #ASN1Module, + #superclass : #Object, + #instVars : [ + 'name', + 'definitions', + 'imports' + ], + #classVars : [ + 'Modules' + ], + #category : 'ASN1' +} + +{ #category : #'class initialization' } +ASN1Module class >> initialize [ + + Modules := Dictionary new. + +] + +{ #category : #accessing } +ASN1Module class >> modules [ + + ^ Modules +] + +{ #category : #'instance creation' } +ASN1Module class >> name: aSymbol [ + "ASN1Module name: #x509" + + | mod | + ^ self modules + at: aSymbol + ifAbsent: [ + mod := self new + name: aSymbol; + yourself. + self modules at: mod name put: mod. + mod]. + +] + +{ #category : #services } +ASN1Module >> add: aType [ + + | old | + old := self definitions at: aType name ifAbsent: [nil]. + aType module: self. + old ifNotNil: [old becomeForward: aType]. + ^self definitions at: aType name put: aType. + +] + +{ #category : #accessing } +ASN1Module >> addImport: aModule [ + + (self imports includes: aModule) + ifFalse: [self imports add: aModule]. + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> any: aSymbol [ + + ^ASN1AnyType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> any: aSymbol definedBy: slotSymbol [ + + ^ (ASN1AnyDefinedByType name: aSymbol in: self) + definedBy: slotSymbol; + yourself. + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> assign: aSymbol from: otherSymbol [ + + ^ (ASN1AssignmentSubType name: aSymbol in: self) + parent: otherSymbol; + yourself +] + +{ #category : #'definitions - mapped' } +ASN1Module >> bitString: aSymbol [ + + ^ASN1BitStringType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> bmpString: aSymbol [ + + ^ASN1BMPStringType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> boolean: aSymbol [ + + ^ASN1BooleanType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> byteArray: aSymbol [ + + ^ASN1ByteArrayType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> choice: aSymbol [ + + ^ASN1ChoiceType name: aSymbol in: self +] + +{ #category : #accessing } +ASN1Module >> definitions [ + "Answer the value of definitions" + + ^ definitions +] + +{ #category : #accessing } +ASN1Module >> definitions: anObject [ + "Set the value of definitions" + + definitions := anObject +] + +{ #category : #'definitions - mapped' } +ASN1Module >> enumerated: aSymbol [ + + ^self notYetImplemented + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> explicit: aSymbol type: type tag: tag [ + + ^ (ASN1ExplicitSubType name: aSymbol in: self) + parent: type; + tag: tag; + yourself + +] + +{ #category : #services } +ASN1Module >> find: aSymbol [ + "check the following sources: + - ASN1Type subclasses + - my definitions + - import definitions + otherwise create a ASN1TypeReference" + + | type | + type := self primitiveTypeFind: aSymbol. + type notNil ifTrue: [^ type]. + type := self localFind: aSymbol. + type notNil ifTrue: [^ type]. + self imports + do: [:eachImportModule | + type := eachImportModule localFind: aSymbol. + type notNil ifTrue: [^ type]]. + ^ ASN1TypeReference name: aSymbol in: self. + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> ia5String: aSymbol [ + + ^ASN1IA5StringType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> implicit: aSymbol type: type tag: tag [ + + ^ (ASN1ImplicitSubType name: aSymbol in: self) + parent: type; + tag: tag; + yourself + +] + +{ #category : #accessing } +ASN1Module >> imports [ + "Answer the value of imports" + + ^ imports +] + +{ #category : #accessing } +ASN1Module >> imports: anObject [ + "Set the value of imports" + + imports := anObject +] + +{ #category : #'initialize-release' } +ASN1Module >> initialize [ + + self definitions: Dictionary new. + self imports: OrderedCollection new. + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> integer: aSymbol [ + + ^ASN1IntegerType name: aSymbol in: self +] + +{ #category : #services } +ASN1Module >> localFind: aSymbol [ + + ^ self definitions + at: aSymbol + ifAbsent: [^ nil]. + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> mapped: aSymbol [ + + ^ ASN1MappingSubType name: aSymbol in: self + +] + +{ #category : #accessing } +ASN1Module >> name [ + + ^ name +] + +{ #category : #accessing } +ASN1Module >> name: anObject [ + "Set the value of name" + + name := anObject +] + +{ #category : #'definitions - mapped' } +ASN1Module >> null: aSymbol [ + + ^ASN1NullType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> objectIdentifier: aSymbol [ + + ^ASN1ObjectIdentifierType name: aSymbol in: self +] + +{ #category : #services } +ASN1Module >> primitiveTypeFind: aSymbol [ + + ^ (ASN1Type allSubclasses + detect: [:class | class name asSymbol = aSymbol] + ifNone: [^ nil]) new + +] + +{ #category : #'definitions - mapped' } +ASN1Module >> printableString: aSymbol [ + + ^ASN1PrintableStringType name: aSymbol in: self +] + +{ #category : #services } +ASN1Module >> remove: aType [ + + self definitions removeKey: aType name. + aType module: nil. + ^aType +] + +{ #category : #'definitions - mapped' } +ASN1Module >> sequence: aSymbol [ + + ^ASN1SequenceType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> sequence: aSymbol mapping: mappingClass [ + + ^ (ASN1MappedSequenceType name: aSymbol in: self) + mapping: mappingClass; + yourself +] + +{ #category : #'definitions - mapped' } +ASN1Module >> sequence: aSymbol of: typeSpec [ + + ^ (ASN1SequenceOfType name: aSymbol in: self) + elementType: typeSpec; + yourself +] + +{ #category : #'definitions - mapped' } +ASN1Module >> set: aSymbol [ + + ^ASN1SetType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> set: aSymbol mapping: mappingClass [ + + ^ (ASN1MappedSetType name: aSymbol in: self) + mapping: mappingClass; + yourself +] + +{ #category : #'definitions - mapped' } +ASN1Module >> set: aSymbol of: typeSpec [ + + ^ (ASN1SetOfType name: aSymbol in: self) + elementType: typeSpec; + yourself +] + +{ #category : #'definitions - mapped' } +ASN1Module >> teletextString: aSymbol [ + + ^ASN1TeletexStringType name: aSymbol in: self +] + +{ #category : #services } +ASN1Module >> typeFrom: aTypeSpec [ + + (aTypeSpec isKindOf: ASN1Type) ifTrue: [^ aTypeSpec]. + aTypeSpec isBehavior ifTrue: [^ aTypeSpec new]. + ^self find: aTypeSpec +] + +{ #category : #'definitions - mapped' } +ASN1Module >> universalString: aSymbol [ + + ^ASN1UniversalStringType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> utcTime: aSymbol [ + + ^ASN1UTCTimeType name: aSymbol in: self +] + +{ #category : #'definitions - mapped' } +ASN1Module >> utf8String: aSymbol [ + + ^ASN1StringType name: aSymbol in: self +] diff --git a/source/ASN1/ASN1Null.class.st b/source/ASN1/ASN1Null.class.st new file mode 100644 index 0000000..d0d7bb6 --- /dev/null +++ b/source/ASN1/ASN1Null.class.st @@ -0,0 +1,18 @@ +Class { + #name : #ASN1Null, + #superclass : #ASN1Value, + #category : 'ASN1-Objects' +} + +{ #category : #'as yet unclassified' } +ASN1Null >> asn1Tag [ + + ^ 5 + +] + +{ #category : #'as yet unclassified' } +ASN1Null >> isNil [ + + ^ true +] diff --git a/source/ASN1/ASN1NullType.class.st b/source/ASN1/ASN1NullType.class.st new file mode 100644 index 0000000..d7cfb5a --- /dev/null +++ b/source/ASN1/ASN1NullType.class.st @@ -0,0 +1,35 @@ +Class { + #name : #ASN1NullType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1NullType >> decodeValueWithDERStream: derStream length: length [ + + ^ ASN1Null new +] + +{ #category : #encoding } +ASN1NullType >> encodeValue: anObject withDERStream: derStream [ + + +] + +{ #category : #testing } +ASN1NullType >> isTypeFor: anObject [ + + ^ anObject isNil +] + +{ #category : #encoding } +ASN1NullType >> sizeOfObject: anObject [ + + ^ 0 +] + +{ #category : #accessing } +ASN1NullType >> tag [ + + ^ 5 +] diff --git a/source/ASN1/ASN1ObjectId.class.st b/source/ASN1/ASN1ObjectId.class.st new file mode 100644 index 0000000..4130552 --- /dev/null +++ b/source/ASN1/ASN1ObjectId.class.st @@ -0,0 +1,113 @@ +Class { + #name : #ASN1ObjectId, + #superclass : #ASN1Value, + #instVars : [ + 'oid', + 'description' + ], + #category : 'ASN1-Objects' +} + +{ #category : #asn } +ASN1ObjectId class >> fromString: oidString [ + + ^ self new + oid: oidString; + initializeDescription; + yourself +] + +{ #category : #'private - parsing' } +ASN1ObjectId >> = anotherOid [ + ^anotherOid class = self class and: [self oid = anotherOid oid] +] + +{ #category : #'private - parsing' } +ASN1ObjectId >> asByteArray [ + + | dataStream oidTokens b n lengthStream bytes | + dataStream := WriteStream on: (ByteArray new: 16). + oidTokens := self oid tokensBasedOn: $.. + dataStream nextPut: (((oidTokens at: 1) asInteger * 40) + (oidTokens at: 2) asInteger). + 3 to: oidTokens size do: [:i | + b := (oidTokens at: i) asInteger. + (b <= 16r7F) + ifTrue: [dataStream nextPut: b] + ifFalse: [ + n := b. + lengthStream := WriteStream on: (ByteArray new: 4). + lengthStream nextPut: (n \\ 128). + [n := n bitShift: -7. + (n bitShift: -7) = 0] + whileFalse: [lengthStream nextPut: ((n \\ 128) bitOr: 16r80)]. + lengthStream nextPut: ((n \\ 128) bitOr: 16r80). + bytes := lengthStream contents reversed. + dataStream + nextPutAll: bytes ]]. + ^ dataStream contents. + +] + +{ #category : #'private - parsing' } +ASN1ObjectId >> asn1Tag [ + + ^ 6 + +] + +{ #category : #accessing } +ASN1ObjectId >> description [ + "Answer the receiver's instance variable description." + + ^description +] + +{ #category : #accessing } +ASN1ObjectId >> description: anObject [ + "Set the receiver's instance variable description to anObject." + + description := anObject +] + +{ #category : #'private - parsing' } +ASN1ObjectId >> hash [ + + ^ self oid hash +] + +{ #category : #'private - parsing' } +ASN1ObjectId >> initializeDescription [ + + +" oid := 'x', self getOID. + ix := 1. + [ix < oid size] + whileTrue: [ + ((oid at: ix) = $.) + ifTrue: [oid at: ix put: $x]. + ix := ix + 1. + ]. + (ASN1ObjectIdentifiers includesKey: oid asSymbol) + ifTrue: [^ASN1ObjectIdentifiers at: oid asSymbol] + ifFalse: [^self getOID]" +] + +{ #category : #accessing } +ASN1ObjectId >> oid [ + "Answer the receiver's instance variable oid." + + ^oid +] + +{ #category : #accessing } +ASN1ObjectId >> oid: anObject [ + "Set the receiver's instance variable oid to anObject." + + oid := anObject +] + +{ #category : #'private - parsing' } +ASN1ObjectId >> printOn: aStream [ + + aStream nextPutAll: self oid +] diff --git a/source/ASN1/ASN1ObjectIdentifierType.class.st b/source/ASN1/ASN1ObjectIdentifierType.class.st new file mode 100644 index 0000000..c037a49 --- /dev/null +++ b/source/ASN1/ASN1ObjectIdentifierType.class.st @@ -0,0 +1,65 @@ +Class { + #name : #ASN1ObjectIdentifierType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1ObjectIdentifierType >> decodeValueWithDERStream: derStream length: length [ + + | b oid len | + b := derStream next. + oid := ((b // 40) asString) , '.' ,((b rem:40) asString). + len := 0. + 2 to: length do: [:i | + b := derStream next. + ((b bitAnd: 16r80) = 16r80) + ifTrue: [len := ((len bitShift: 7) + (b bitAnd: 16r7F))] + ifFalse: [ + len := (len bitShift: 7) + b. + oid := oid , '.', (len asString). + len := 0]]. + ^ ASN1ObjectId fromString: oid. +] + +{ #category : #encoding } +ASN1ObjectIdentifierType >> encode: anObject withDERStream: derStream [ + "For a speedup" + + | bytes | + derStream nextPutTag: anObject asn1Tag. + bytes := anObject asByteArray. + derStream nextPutLength: bytes size. + derStream nextPutAll: bytes. + ^ derStream + +] + +{ #category : #encoding } +ASN1ObjectIdentifierType >> encodeValue: anObject withDERStream: derStream [ + + | bytes | + bytes := anObject asByteArray. + derStream nextPutAll: bytes. + ^ derStream + +] + +{ #category : #testing } +ASN1ObjectIdentifierType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1ObjectId +] + +{ #category : #encoding } +ASN1ObjectIdentifierType >> sizeOfObject: anObject [ + + ^ anObject asByteArray size. + +] + +{ #category : #accessing } +ASN1ObjectIdentifierType >> tag [ + + ^ 6 +] diff --git a/source/ASN1/ASN1OctetsType.class.st b/source/ASN1/ASN1OctetsType.class.st new file mode 100644 index 0000000..bc1b376 --- /dev/null +++ b/source/ASN1/ASN1OctetsType.class.st @@ -0,0 +1,56 @@ +Class { + #name : #ASN1OctetsType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1OctetsType >> decodeConstructedValueWithDERStream: derStream length: length [ + + | octets stopPosition | + length = -1 + ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. + octets := self octetsClass new. + stopPosition := derStream position + length. + [derStream position < stopPosition] whileTrue: [ + octets := octets, (self decodeWithDERStream: derStream)]. + ^ octets +] + +{ #category : #decoding } +ASN1OctetsType >> decodeValueIndefiniteLengthWithDERStream: derStream [ + + | octets value | + octets := self octetsClass new. + [derStream peekTag = 0 + ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] + ifFalse: [value := self decodeWithDERStream: derStream]. + value isKindOf: ASN1EndOfIndefiniteLengthMarker] whileFalse: [ + octets := octets, value]. + ^ octets +] + +{ #category : #decoding } +ASN1OctetsType >> decodeWithDERStream: derStream [ + + | tag numericTag object | + tag := derStream peekTag. + numericTag := tag bitAnd: 2r00011111. + numericTag = (self asn1Tag bitAnd: 2r00011111) + ifFalse: [self error: 'asn1 decoder: bad tag']. + derStream nextTag. + (tag bitAnd: 2r00100000) > 0 + ifTrue: [object := self + decodeConstructedValueWithDERStream: derStream + length: derStream nextLength] + ifFalse: [object := self + decodeValueWithDERStream: derStream + length: derStream nextLength]. + ^ object +] + +{ #category : #accessing } +ASN1OctetsType >> octetsClass [ + + ^ self subclassResponsibility +] diff --git a/source/ASN1/ASN1Pragma.class.st b/source/ASN1/ASN1Pragma.class.st new file mode 100644 index 0000000..8ce9eca --- /dev/null +++ b/source/ASN1/ASN1Pragma.class.st @@ -0,0 +1,92 @@ +Class { + #name : #ASN1Pragma, + #superclass : #Object, + #instVars : [ + 'pragma', + 'asn1name', + 'systemClass', + 'method' + ], + #category : 'ASN1-DefinitionModel' +} + +{ #category : #LICENSE } +ASN1Pragma class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #'instance creation' } +ASN1Pragma class >> fromPragma: aPragma [ + | aClass | + aClass := (self isAccessorPragma: aPragma) ifTrue: [ASN1PragmaAccessor] ifFalse: [ASN1PragmaMutator]. + ^aClass fromPragma: aPragma +] + +{ #category : #'instance creation' } +ASN1Pragma class >> isAccessorPragma: aPragma [ + ^aPragma keyword = #asn1FieldAccessor: +] + +{ #category : #accessing } +ASN1Pragma >> asn1name [ + "Answer the value of asn1name" + + ^ asn1name +] + +{ #category : #accessing } +ASN1Pragma >> asn1name: anObject [ + "Set the value of asn1name" + + asn1name := anObject +] + +{ #category : #accessing } +ASN1Pragma >> method [ + "Answer the value of method" + + ^ method +] + +{ #category : #accessing } +ASN1Pragma >> method: anObject [ + "Set the value of method" + + method := anObject +] + +{ #category : #accessing } +ASN1Pragma >> pragma [ + "Answer the value of pragma" + + ^ pragma +] + +{ #category : #accessing } +ASN1Pragma >> pragma: anObject [ + "Set the value of pragma" + + pragma := anObject +] + +{ #category : #accessing } +ASN1Pragma >> systemClass [ + "Answer the value of systemClass" + + ^ systemClass +] + +{ #category : #accessing } +ASN1Pragma >> systemClass: anObject [ + "Set the value of systemClass" + + systemClass := anObject +] diff --git a/source/ASN1/ASN1PragmaAccessor.class.st b/source/ASN1/ASN1PragmaAccessor.class.st new file mode 100644 index 0000000..9bbb931 --- /dev/null +++ b/source/ASN1/ASN1PragmaAccessor.class.st @@ -0,0 +1,34 @@ +Class { + #name : #ASN1PragmaAccessor, + #superclass : #ASN1Pragma, + #category : 'ASN1-DefinitionModel' +} + +{ #category : #LICENSE } +ASN1PragmaAccessor class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #'instance creation' } +ASN1PragmaAccessor class >> fromPragma: aPragma [ + ^self new + pragma: aPragma; + asn1name: aPragma arguments first; + method: aPragma method methodReference methodSymbol; + systemClass: aPragma method methodReference classSymbol; + yourself + +] + +{ #category : #printing } +ASN1PragmaAccessor >> printOn: aWS [ + aWS nextPutAll: self asn1name asString, String tab, self systemClass asString, '>>', self method asString. +] diff --git a/source/ASN1/ASN1PragmaMutator.class.st b/source/ASN1/ASN1PragmaMutator.class.st new file mode 100644 index 0000000..c999661 --- /dev/null +++ b/source/ASN1/ASN1PragmaMutator.class.st @@ -0,0 +1,54 @@ +Class { + #name : #ASN1PragmaMutator, + #superclass : #ASN1Pragma, + #instVars : [ + 'classOfMutatorArgument' + ], + #category : 'ASN1-DefinitionModel' +} + +{ #category : #LICENSE } +ASN1PragmaMutator class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #'instance creation' } +ASN1PragmaMutator class >> fromPragma: aPragma [ + ^self new + pragma: aPragma; + asn1name: aPragma arguments first; + method: aPragma method methodReference methodSymbol; + systemClass: aPragma method methodReference classSymbol; + classOfMutatorArgument: aPragma arguments second; + yourself +] + +{ #category : #accessing } +ASN1PragmaMutator >> classOfMutatorArgument [ + "Answer the value of classOfMutatorArgument" + + ^ classOfMutatorArgument +] + +{ #category : #accessing } +ASN1PragmaMutator >> classOfMutatorArgument: anObject [ + "Set the value of classOfMutatorArgument" + + classOfMutatorArgument := anObject +] + +{ #category : #printing } +ASN1PragmaMutator >> printOn: aWS [ + | classString article | + classString := self classOfMutatorArgument asString. + article := classString first isVowel ifTrue: [' an '] ifFalse: [' a ']. + aWS nextPutAll: self asn1name asString, String tab, self systemClass asString, '>>', self method asString, article, classString. +] diff --git a/source/ASN1/ASN1PrintableString.class.st b/source/ASN1/ASN1PrintableString.class.st new file mode 100644 index 0000000..acd9d08 --- /dev/null +++ b/source/ASN1/ASN1PrintableString.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1PrintableString, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #'private - parsing' } +ASN1PrintableString >> asn1Tag [ + + ^ 19 +] diff --git a/source/ASN1/ASN1PrintableStringType.class.st b/source/ASN1/ASN1PrintableStringType.class.st new file mode 100644 index 0000000..d84b6cd --- /dev/null +++ b/source/ASN1/ASN1PrintableStringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1PrintableStringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1PrintableStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1PrintableString +] + +{ #category : #accessing } +ASN1PrintableStringType >> tag [ + + ^ 19 +] + +{ #category : #decoding } +ASN1PrintableStringType >> wrapperClass [ + + ^ ASN1PrintableString + +] diff --git a/source/ASN1/ASN1SequenceOfType.class.st b/source/ASN1/ASN1SequenceOfType.class.st new file mode 100644 index 0000000..d5d0c75 --- /dev/null +++ b/source/ASN1/ASN1SequenceOfType.class.st @@ -0,0 +1,17 @@ +Class { + #name : #ASN1SequenceOfType, + #superclass : #ASN1UnstructuredType, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1SequenceOfType >> containerClass [ + + ^ OrderedCollection +] + +{ #category : #accessing } +ASN1SequenceOfType >> tag [ + + ^ 48 +] diff --git a/source/ASN1/ASN1SequenceType.class.st b/source/ASN1/ASN1SequenceType.class.st new file mode 100644 index 0000000..35e8071 --- /dev/null +++ b/source/ASN1/ASN1SequenceType.class.st @@ -0,0 +1,17 @@ +Class { + #name : #ASN1SequenceType, + #superclass : #ASN1UnmappedType, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1SequenceType >> containerClass [ + + ^ OrderedCollection +] + +{ #category : #accessing } +ASN1SequenceType >> tag [ + + ^ 48 +] diff --git a/source/ASN1/ASN1SetOfType.class.st b/source/ASN1/ASN1SetOfType.class.st new file mode 100644 index 0000000..e339606 --- /dev/null +++ b/source/ASN1/ASN1SetOfType.class.st @@ -0,0 +1,17 @@ +Class { + #name : #ASN1SetOfType, + #superclass : #ASN1UnstructuredType, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1SetOfType >> containerClass [ + + ^ OrderedSet +] + +{ #category : #accessing } +ASN1SetOfType >> tag [ + + ^ 49 +] diff --git a/source/ASN1/ASN1SetType.class.st b/source/ASN1/ASN1SetType.class.st new file mode 100644 index 0000000..c337089 --- /dev/null +++ b/source/ASN1/ASN1SetType.class.st @@ -0,0 +1,17 @@ +Class { + #name : #ASN1SetType, + #superclass : #ASN1UnmappedType, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1SetType >> containerClass [ + + ^ OrderedSet +] + +{ #category : #accessing } +ASN1SetType >> tag [ + + ^ 49 +] diff --git a/source/ASN1/ASN1Stream.class.st b/source/ASN1/ASN1Stream.class.st new file mode 100644 index 0000000..8dfd09a --- /dev/null +++ b/source/ASN1/ASN1Stream.class.st @@ -0,0 +1,293 @@ +Class { + #name : #ASN1Stream, + #superclass : #Object, + #instVars : [ + 'stream', + 'currentTag' + ], + #classVars : [ + 'TagToTypeDispatchTable' + ], + #category : 'ASN1' +} + +{ #category : #decoding } +ASN1Stream class >> decodeBytes: bytes [ + + ^ (self onBytes: bytes) decode +] + +{ #category : #decoding } +ASN1Stream class >> decodeBytes: bytes withType: type [ + + ^ (self onBytes: bytes) decodeWithType: type +] + +{ #category : #encoding } +ASN1Stream class >> encode: object [ + + ^ self new encode: object +] + +{ #category : #encoding } +ASN1Stream class >> encode: object withType: type [ + + ^ self new encode: object withType: type +] + +{ #category : #'class initialization' } +ASN1Stream class >> initializeTagToTypeDispatchTable [ + + TagToTypeDispatchTable := Dictionary new. + TagToTypeDispatchTable +" at: 0 put: ASN1EndOfIndefiniteLengthType new;" + at: 1 put: ASN1BooleanType new; + at: 2 put: ASN1IntegerType new; + at: 3 put: ASN1BitStringType new; + at: 4 put: ASN1ByteArrayType new; + at: 5 put: ASN1NullType new; + at: 6 put: ASN1ObjectIdentifierType new; + at: 12 put: ASN1StringType new; + at: 16 put: ASN1SequenceType new; + at: 17 put: ASN1SetType new; + at: 19 put: ASN1PrintableStringType new; + at: 20 put: ASN1TeletexStringType new; + at: 22 put: ASN1IA5StringType new; + at: 23 put: ASN1UTCTimeType new; + at: 26 put: ASN1VisibleStringType new; + at: 27 put: ASN1GeneralStringType new; + at: 28 put: ASN1UniversalStringType new; + at: 30 put: ASN1BMPStringType new; + yourself. + +] + +{ #category : #'instance creation' } +ASN1Stream class >> new [ + + ^ self onStream: (ByteArray new: 100) writeStream. + +] + +{ #category : #'instance creation' } +ASN1Stream class >> onBytes: bytes [ + + ^ self onStream: bytes readStream. + +] + +{ #category : #'instance creation' } +ASN1Stream class >> onStream: aStream [ + + ^ super new + stream: aStream; + yourself. + +] + +{ #category : #'class initialization' } +ASN1Stream class >> tagToTypeDispatchTable [ + + TagToTypeDispatchTable isNil ifTrue: [self initializeTagToTypeDispatchTable]. + ^ TagToTypeDispatchTable + +] + +{ #category : #'stream - api' } +ASN1Stream >> atEnd [ + + ^ self stream atEnd +] + +{ #category : #'stream - api' } +ASN1Stream >> contents [ + + ^ self stream contents +] + +{ #category : #accessing } +ASN1Stream >> currentTag [ + "Answer the value of currentTag" + + ^ currentTag +] + +{ #category : #accessing } +ASN1Stream >> currentTag: anObject [ + "Set the value of currentTag" + + currentTag := anObject +] + +{ #category : #decoding } +ASN1Stream >> decode [ + + | tag numericTag type tagClass isConstructed | + tag := self peekTag. + numericTag := tag bitAnd: 2r00011111. + tagClass := tag bitAnd: 2r11000000. + isConstructed := (tag bitAnd: 2r00100000) > 0. + tagClass > 0 + ifTrue: [isConstructed + ifTrue: [type := ASN1WrapperConstructedType new] + ifFalse: [type := ASN1WrapperPrimitiveType new]] + ifFalse: [type := self class tagToTypeDispatchTable at: numericTag]. + ^ self decodeWithType: type. + +] + +{ #category : #decoding } +ASN1Stream >> decodeWithType: type [ + + ^ type decodeWithDERStream: self. + +] + +{ #category : #encoding } +ASN1Stream >> encode: anObject [ + + | type tag numericTag tagClass isConstructed | + tag := anObject asn1Tag. + numericTag := tag bitAnd: 2r00011111. + tagClass := tag bitAnd: 2r11000000. + isConstructed := (tag bitAnd: 2r00100000) > 0. + tagClass > 0 + ifTrue: [isConstructed + ifTrue: [type := ASN1WrapperConstructedType new] + ifFalse: [type := ASN1WrapperPrimitiveType new]] + ifFalse: [type := self class tagToTypeDispatchTable at: numericTag]. + ^ self encode: anObject withType: type. + +] + +{ #category : #encoding } +ASN1Stream >> encode: anObject withType: type [ + + type encode: anObject withDERStream: self. + ^ self contents + +] + +{ #category : #'stream - api' } +ASN1Stream >> newStream [ + + ^ self class new +] + +{ #category : #'stream - api' } +ASN1Stream >> next [ + + ^ self stream next +] + +{ #category : #'stream - api' } +ASN1Stream >> next: num [ + + ^ self stream next: num +] + +{ #category : #'stream - api' } +ASN1Stream >> nextLength [ + + | tag val | + tag := self stream next. + tag = 2r10000000 + ifTrue: [^ -1]. + ((tag bitAnd: 2r10000000) > 0) + ifTrue: [ + val := 0. + (tag bitClear: 2r10000000) timesRepeat: [ + val := (val bitShift: 8) + self stream next]. + ^ val] + ifFalse: [^ tag]. + +] + +{ #category : #'stream - api' } +ASN1Stream >> nextPut: byte [ + + ^ self stream nextPut: byte +] + +{ #category : #'stream - api' } +ASN1Stream >> nextPutAll: bytes [ + + ^ self stream nextPutAll: bytes +] + +{ #category : #'stream - api' } +ASN1Stream >> nextPutLength: size [ + + size <= 127 + ifTrue: [self nextPut: size] + ifFalse: [ + self nextPut: ((size digitLength) bitOr: 16r80). + size digitLength to: 1 by: -1 do: [:digitIndex | + self nextPut: (size digitAt: digitIndex)]] + +] + +{ #category : #'stream - api' } +ASN1Stream >> nextPutTag: tag [ + "It's not clear how to encode a tag whose numerical value is greater than 30" + + self nextPut: tag. + +] + +{ #category : #'stream - api' } +ASN1Stream >> nextTag [ + + | tag octet | + tag := self stream next. + ((tag bitAnd: 2r00011111) == 2r00011111) + ifTrue: [ + tag := 0. + [ + octet := self stream next. + tag := (tag bitShift: 7) bitOr: (octet bitClear: 2r10000000). + (octet bitAnd: 2r10000000) > 0] + whileTrue]. + self currentTag: tag. + ^ tag +] + +{ #category : #'stream - api' } +ASN1Stream >> peekTag [ + + | start | + start := self position. + ^[self nextTag] ensure: [self position: start] +] + +{ #category : #'stream - api' } +ASN1Stream >> position [ + + ^ self stream position +] + +{ #category : #'stream - api' } +ASN1Stream >> position: pos [ + + ^ self stream position: pos +] + +{ #category : #'stream - api' } +ASN1Stream >> size [ + + ^ self stream size +] + +{ #category : #accessing } +ASN1Stream >> stream [ + "Answer the value of stream" + + ^ stream +] + +{ #category : #accessing } +ASN1Stream >> stream: anObject [ + "Set the value of stream" + + stream := anObject +] diff --git a/source/ASN1/ASN1StringType.class.st b/source/ASN1/ASN1StringType.class.st new file mode 100644 index 0000000..2af832a --- /dev/null +++ b/source/ASN1/ASN1StringType.class.st @@ -0,0 +1,43 @@ +Class { + #name : #ASN1StringType, + #superclass : #ASN1OctetsType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1StringType >> decodeValueWithDERStream: derStream length: length [ + + ^(derStream next: length) asByteArray asString. + +] + +{ #category : #encoding } +ASN1StringType >> encodeValue: anObject withDERStream: derStream [ + + derStream nextPutAll: anObject asByteArray +] + +{ #category : #testing } +ASN1StringType >> isTypeFor: anObject [ + + ^ anObject isString +] + +{ #category : #accessing } +ASN1StringType >> octetsClass [ + + ^ String +] + +{ #category : #encoding } +ASN1StringType >> sizeOfObject: anObject [ + + ^ anObject size. + +] + +{ #category : #accessing } +ASN1StringType >> tag [ + + ^ 12 +] diff --git a/source/ASN1/ASN1StructureElement.class.st b/source/ASN1/ASN1StructureElement.class.st new file mode 100644 index 0000000..aab6e06 --- /dev/null +++ b/source/ASN1/ASN1StructureElement.class.st @@ -0,0 +1,128 @@ +Class { + #name : #ASN1StructureElement, + #superclass : #ASN1ChoiceElement, + #instVars : [ + 'default', + 'optional' + ], + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1StructureElement >> decode: aTarget withDERStream: derStream [ + + | tag val | + derStream atEnd ifTrue: [ + self hasDefault ifTrue: [^self value: self default into: aTarget]. + self isOptional ifTrue: [^self]. + ^ self error: 'missing element']. + tag := derStream peekTag. + (self matchesTag: tag) + ifTrue: [ + val := type + decodeWithDERStream: derStream + owner: aTarget + ownerType: self owner. + self value: val into: aTarget. + ^ val ] + ifFalse: [ + self hasDefault ifTrue: [^self value: self default into: aTarget]. + self isOptional ifTrue: [^self]. + ^ self error: 'missing element']. + +] + +{ #category : #accessing } +ASN1StructureElement >> default [ + "Answer the value of default" + + ^ default +] + +{ #category : #accessing } +ASN1StructureElement >> default: anObject [ + "Set the value of default" + + default := anObject +] + +{ #category : #encoding } +ASN1StructureElement >> encode: anObject withDERStream: derStream [ + + | val | + val := self valueFrom: anObject. + (val == nil and: [self isOptional]) + ifTrue: [^self]. + (self hasDefault and: [self default = val]) + ifTrue: [^self]. + self type + encode: val + withDERStream: derStream + owner: anObject + ownerType: self owner. + +] + +{ #category : #testing } +ASN1StructureElement >> hasDefault [ + + ^ self default notNil +] + +{ #category : #testing } +ASN1StructureElement >> hasDefaultOrIsOptional [ + + ^ self default notNil or: [ self optional ] +] + +{ #category : #'initialize-release' } +ASN1StructureElement >> initialize [ + + self optional: false. +] + +{ #category : #testing } +ASN1StructureElement >> isOptional [ + + ^ self optional +] + +{ #category : #testing } +ASN1StructureElement >> isTypeFor: anObject [ + + | val | + val := self valueFrom: anObject. + ^self type isTypeFor: val +] + +{ #category : #decoding } +ASN1StructureElement >> mutator [ + + ^(self symbol copyWith: $:) asSymbol +] + +{ #category : #accessing } +ASN1StructureElement >> optional [ + "Answer the value of optional" + + ^ optional +] + +{ #category : #accessing } +ASN1StructureElement >> optional: anObject [ + "Set the value of optional" + + optional := anObject +] + +{ #category : #decoding } +ASN1StructureElement >> value: aValue into: anObject [ + + anObject perform: self mutator with: aValue +] + +{ #category : #encoding } +ASN1StructureElement >> valueFrom: anObject [ + + ^ anObject perform: self symbol +] diff --git a/source/ASN1/ASN1StructuredType.class.st b/source/ASN1/ASN1StructuredType.class.st new file mode 100644 index 0000000..47a48a6 --- /dev/null +++ b/source/ASN1/ASN1StructuredType.class.st @@ -0,0 +1,86 @@ +Class { + #name : #ASN1StructuredType, + #superclass : #ASN1ConstructedType, + #instVars : [ + 'elements' + ], + #category : 'ASN1-Types' +} + +{ #category : #'accessing - element construction' } +ASN1StructuredType >> add: aSymbol type: type [ + + ^self addElement: ( + self newElement + symbol: aSymbol; + type: (self typeFrom: type)) +] + +{ #category : #'accessing - element construction' } +ASN1StructuredType >> add: aSymbol type: type explicitTag: integer [ + + ^(self add: aSymbol type: type) + explicitTag: integer; + yourself. + +] + +{ #category : #'accessing - element construction' } +ASN1StructuredType >> add: aSymbol type: type implicitTag: integer [ + + ^(self add: aSymbol type: type) + implicitTag: integer; + yourself. + +] + +{ #category : #private } +ASN1StructuredType >> addElement: element [ + + self elements addLast: element. + element addedTo: self. + ^element +] + +{ #category : #accessing } +ASN1StructuredType >> elementWithSymbol: aSymbol [ + + ^ self elements + detect: [:each | each symbol == aSymbol] + ifNone: [self error: 'no element specified in structured type']. + +] + +{ #category : #accessing } +ASN1StructuredType >> elements [ + "Answer the value of elements" + + ^ elements +] + +{ #category : #accessing } +ASN1StructuredType >> elements: anObject [ + "Set the value of elements" + + elements := anObject +] + +{ #category : #accessing } +ASN1StructuredType >> hasElements [ + + ^ self elements notEmpty +] + +{ #category : #'initialize-release' } +ASN1StructuredType >> initialize [ + + super initialize. + self elements: (OrderedCollection new: 5). + +] + +{ #category : #private } +ASN1StructuredType >> newElement [ + + ^ ASN1StructureElement new +] diff --git a/source/ASN1/ASN1SubType.class.st b/source/ASN1/ASN1SubType.class.st new file mode 100644 index 0000000..2d3eee8 --- /dev/null +++ b/source/ASN1/ASN1SubType.class.st @@ -0,0 +1,50 @@ +Class { + #name : #ASN1SubType, + #superclass : #ASN1Type, + #instVars : [ + 'parent', + 'tag' + ], + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1SubType >> isTypeFor: anObject [ + + ^self parent isTypeFor: anObject + +] + +{ #category : #testing } +ASN1SubType >> matchesTag: anInteger [ + + ^ ((tag bitXor: anInteger) bitAnd: 2r00011111) isZero + +] + +{ #category : #accessing } +ASN1SubType >> parent [ + "Answer the value of parent" + + ^ parent +] + +{ #category : #accessing } +ASN1SubType >> parent: anObject [ + "Set the value of parent" + + parent := self typeFrom: anObject. +] + +{ #category : #accessing } +ASN1SubType >> tag [ + + ^ tag +] + +{ #category : #accessing } +ASN1SubType >> tag: anObject [ + "Set the value of tag" + + tag := anObject +] diff --git a/source/ASN1/ASN1TeletexString.class.st b/source/ASN1/ASN1TeletexString.class.st new file mode 100644 index 0000000..d793be8 --- /dev/null +++ b/source/ASN1/ASN1TeletexString.class.st @@ -0,0 +1,12 @@ +Class { + #name : #ASN1TeletexString, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #'private - parsing' } +ASN1TeletexString >> asn1Tag [ + + ^ 20 + +] diff --git a/source/ASN1/ASN1TeletexStringType.class.st b/source/ASN1/ASN1TeletexStringType.class.st new file mode 100644 index 0000000..04093f4 --- /dev/null +++ b/source/ASN1/ASN1TeletexStringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1TeletexStringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1TeletexStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1TeletexString +] + +{ #category : #accessing } +ASN1TeletexStringType >> tag [ + + ^ 20 +] + +{ #category : #decoding } +ASN1TeletexStringType >> wrapperClass [ + + ^ ASN1TeletexString + +] diff --git a/source/ASN1/ASN1Type.class.st b/source/ASN1/ASN1Type.class.st new file mode 100644 index 0000000..dfaf77a --- /dev/null +++ b/source/ASN1/ASN1Type.class.st @@ -0,0 +1,99 @@ +Class { + #name : #ASN1Type, + #superclass : #ASN1Entity, + #category : 'ASN1-Types' +} + +{ #category : #accessing } +ASN1Type >> asn1Tag [ + + ^ self tag +] + +{ #category : #decoding } +ASN1Type >> decodeValueWithDERStream: derStream length: length [ + + ^ self subclassResponsibility +] + +{ #category : #decoding } +ASN1Type >> decodeWithDERStream: derStream [ + + | tag | + tag := derStream nextTag. + (self matchesTag: tag) + ifFalse: [self error: 'asn1 decoder: bad tag']. + ^ self + decodeValueWithDERStream: derStream + length: derStream nextLength. + + +] + +{ #category : #decoding } +ASN1Type >> decodeWithDERStream: derStream owner: owner ownerType: ownerType [ + + ^ self decodeWithDERStream: derStream. + +] + +{ #category : #encoding } +ASN1Type >> encode: anObject withDERStream: derStream [ + + | size | + derStream nextPutTag: anObject asn1Tag. + size := self sizeOfObject: anObject. + derStream nextPutLength: size. + self encodeValue: anObject withDERStream: derStream. + ^ derStream + +] + +{ #category : #encoding } +ASN1Type >> encode: anObject withDERStream: derStream owner: owner ownerType: ownerType [ + + ^ self encode: anObject withDERStream: derStream + +] + +{ #category : #encoding } +ASN1Type >> encodeValue: anObject withDERStream: derStream [ + + ^ self subclassResponsibility +] + +{ #category : #testing } +ASN1Type >> isConstructed [ + + ^ false +] + +{ #category : #testing } +ASN1Type >> isTypeFor: anObject [ + + ^((self asn1Tag bitXor: anObject asn1Tag) bitAnd: 2r00011111) isZero +] + +{ #category : #testing } +ASN1Type >> matchesTag: anInteger [ + + ^((self asn1Tag bitXor: anInteger) bitAnd: 2r00011111) isZero +] + +{ #category : #accessing } +ASN1Type >> parent [ + + ^ nil +] + +{ #category : #encoding } +ASN1Type >> sizeOfObject: anObject [ + + ^ nil +] + +{ #category : #accessing } +ASN1Type >> tag [ + + ^ self subclassResponsibility +] diff --git a/source/ASN1/ASN1TypeReference.class.st b/source/ASN1/ASN1TypeReference.class.st new file mode 100644 index 0000000..6d1cbf2 --- /dev/null +++ b/source/ASN1/ASN1TypeReference.class.st @@ -0,0 +1,5 @@ +Class { + #name : #ASN1TypeReference, + #superclass : #ASN1Entity, + #category : 'ASN1-Types' +} diff --git a/source/ASN1/ASN1UTCTimeType.class.st b/source/ASN1/ASN1UTCTimeType.class.st new file mode 100644 index 0000000..920ae90 --- /dev/null +++ b/source/ASN1/ASN1UTCTimeType.class.st @@ -0,0 +1,57 @@ +Class { + #name : #ASN1UTCTimeType, + #superclass : #ASN1BasicType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1UTCTimeType >> decodeValueWithDERStream: derStream length: length [ + + | aUTCDateTime | + aUTCDateTime := (derStream next: length) asByteArray asString. + ^ (DateAndTime readFromString: ( + ((aUTCDateTime copyFrom: 1 to: 2) asInteger > 50 ifTrue: ['19'] ifFalse: ['20']), + (aUTCDateTime copyFrom: 1 to: 2), '-', + (aUTCDateTime copyFrom: 3 to: 4), '-', + (aUTCDateTime copyFrom: 5 to: 6), 'T', + (aUTCDateTime copyFrom: 7 to: 8), ':', + (aUTCDateTime copyFrom: 9 to: 10), ':', + (aUTCDateTime copyFrom: 11 to: 12), 'Z')) + + +] + +{ #category : #encoding } +ASN1UTCTimeType >> encodeValue: anObject withDERStream: derStream [ + + | yy mo dd hh mm ss utcDateTime | + yy := anObject year asString copyFrom: 3 to: 4. + mo := anObject month asString padded: #left to: 2 with: $0. + dd := anObject dayOfMonth asString padded: #left to: 2 with: $0. + hh := anObject hour asString padded: #left to: 2 with: $0. + mm := anObject minute asString padded: #left to: 2 with: $0. + ss := anObject seconds asString padded: #left to: 2 with: $0. + utcDateTime := (yy, mo, dd, hh, mm, ss, 'Z') asByteArray. + derStream nextPutAll: utcDateTime. + + +] + +{ #category : #testing } +ASN1UTCTimeType >> isTypeFor: anObject [ + + ^ anObject isKindOf: DateAndTime +] + +{ #category : #encoding } +ASN1UTCTimeType >> sizeOfObject: anObject [ + + ^ 13. + +] + +{ #category : #accessing } +ASN1UTCTimeType >> tag [ + + ^ 23 +] diff --git a/source/ASN1/ASN1UniversalString.class.st b/source/ASN1/ASN1UniversalString.class.st new file mode 100644 index 0000000..3cca9ab --- /dev/null +++ b/source/ASN1/ASN1UniversalString.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1UniversalString, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #'private - parsing' } +ASN1UniversalString >> asn1Tag [ + + ^ 28 +] diff --git a/source/ASN1/ASN1UniversalStringType.class.st b/source/ASN1/ASN1UniversalStringType.class.st new file mode 100644 index 0000000..b5c514d --- /dev/null +++ b/source/ASN1/ASN1UniversalStringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1UniversalStringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1UniversalStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1UniversalString +] + +{ #category : #accessing } +ASN1UniversalStringType >> tag [ + + ^ 28 +] + +{ #category : #decoding } +ASN1UniversalStringType >> wrapperClass [ + + ^ ASN1UniversalString + +] diff --git a/source/ASN1/ASN1UnmappedType.class.st b/source/ASN1/ASN1UnmappedType.class.st new file mode 100644 index 0000000..821644b --- /dev/null +++ b/source/ASN1/ASN1UnmappedType.class.st @@ -0,0 +1,40 @@ +Class { + #name : #ASN1UnmappedType, + #superclass : #ASN1ConstructedType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1UnmappedType >> decodeValueIndefiniteLengthWithDERStream: derStream [ + + | coll value | + coll := self containerClass new. + [derStream peekTag = 0 + ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] + ifFalse: [value := derStream decode]. + value isKindOf: ASN1EndOfIndefiniteLengthMarker] + whileFalse: [coll add: value]. + ^coll +] + +{ #category : #decoding } +ASN1UnmappedType >> decodeValueWithDERStream: derStream length: length [ + + | coll end obj | + length = -1 + ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. + coll := self containerClass new. + end := derStream position + length. + [derStream position < end ] whileTrue: [ + obj := derStream decode. + coll add: obj]. + ^coll +] + +{ #category : #encoding } +ASN1UnmappedType >> encodeValue: anObject withDERStream: derStream [ + + anObject do: [:each | + derStream encode: each]. + +] diff --git a/source/ASN1/ASN1UnstructuredType.class.st b/source/ASN1/ASN1UnstructuredType.class.st new file mode 100644 index 0000000..77b5445 --- /dev/null +++ b/source/ASN1/ASN1UnstructuredType.class.st @@ -0,0 +1,60 @@ +Class { + #name : #ASN1UnstructuredType, + #superclass : #ASN1ConstructedType, + #instVars : [ + 'elementType' + ], + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1UnstructuredType >> decodeValueIndefiniteLengthWithDERStream: derStream [ + + | coll value | + coll := self containerClass new. + [derStream peekTag = 0 + ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] + ifFalse: [value := self elementType decodeWithDERStream: derStream]. + value isKindOf: ASN1EndOfIndefiniteLengthMarker] + whileFalse: [coll add: value]. + ^coll +] + +{ #category : #decoding } +ASN1UnstructuredType >> decodeValueWithDERStream: derStream length: length [ + + | coll end obj | + length = -1 + ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. + coll := self containerClass new. + end := derStream position + length. + [derStream position < end ] whileTrue: [ + obj := self elementType decodeWithDERStream: derStream. + coll add: obj]. + ^coll +] + +{ #category : #accessing } +ASN1UnstructuredType >> elementType [ + "Answer the value of elementType" + + ^ elementType +] + +{ #category : #accessing } +ASN1UnstructuredType >> elementType: anObject [ + "Set the value of elementType" + + elementType := self typeFrom: anObject. + +] + +{ #category : #encoding } +ASN1UnstructuredType >> encodeValue: anObject withDERStream: derStream [ + + anObject do: [:each | + self elementType + encode: each + withDERStream: derStream]. + +] diff --git a/source/ASN1/ASN1Value.class.st b/source/ASN1/ASN1Value.class.st new file mode 100644 index 0000000..0779f34 --- /dev/null +++ b/source/ASN1/ASN1Value.class.st @@ -0,0 +1,12 @@ +Class { + #name : #ASN1Value, + #superclass : #Object, + #category : 'ASN1-Objects' +} + +{ #category : #'private - parsing' } +ASN1Value >> asAsn1Bytes [ + + ^ ASN1Stream encode: self + +] diff --git a/source/ASN1/ASN1VisibleString.class.st b/source/ASN1/ASN1VisibleString.class.st new file mode 100644 index 0000000..8dc874a --- /dev/null +++ b/source/ASN1/ASN1VisibleString.class.st @@ -0,0 +1,11 @@ +Class { + #name : #ASN1VisibleString, + #superclass : #ASN1AbstractString, + #category : 'ASN1-Objects' +} + +{ #category : #'private - parsing' } +ASN1VisibleString >> asn1Tag [ + + ^ 26 +] diff --git a/source/ASN1/ASN1VisibleStringType.class.st b/source/ASN1/ASN1VisibleStringType.class.st new file mode 100644 index 0000000..490a8e1 --- /dev/null +++ b/source/ASN1/ASN1VisibleStringType.class.st @@ -0,0 +1,24 @@ +Class { + #name : #ASN1VisibleStringType, + #superclass : #ASN1WrappedStringType, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1VisibleStringType >> isTypeFor: anObject [ + + ^ anObject isKindOf: ASN1VisibleString +] + +{ #category : #accessing } +ASN1VisibleStringType >> tag [ + + ^ 26 +] + +{ #category : #decoding } +ASN1VisibleStringType >> wrapperClass [ + + ^ ASN1VisibleString + +] diff --git a/source/ASN1/ASN1WrappedStringType.class.st b/source/ASN1/ASN1WrappedStringType.class.st new file mode 100644 index 0000000..731faf1 --- /dev/null +++ b/source/ASN1/ASN1WrappedStringType.class.st @@ -0,0 +1,33 @@ +Class { + #name : #ASN1WrappedStringType, + #superclass : #ASN1OctetsType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1WrappedStringType >> decodeValueWithDERStream: derStream length: length [ + + | string | + string := (derStream next: length) asByteArray asString. + ^ self wrapperClass fromString: string. + +] + +{ #category : #encoding } +ASN1WrappedStringType >> encodeValue: anObject withDERStream: derStream [ + + derStream nextPutAll: anObject string asByteArray +] + +{ #category : #accessing } +ASN1WrappedStringType >> octetsClass [ + + ^ self wrapperClass +] + +{ #category : #encoding } +ASN1WrappedStringType >> sizeOfObject: anObject [ + + ^ anObject string size. + +] diff --git a/source/ASN1/ASN1WrapperConstructedType.class.st b/source/ASN1/ASN1WrapperConstructedType.class.st new file mode 100644 index 0000000..bd8b27e --- /dev/null +++ b/source/ASN1/ASN1WrapperConstructedType.class.st @@ -0,0 +1,62 @@ +Class { + #name : #ASN1WrapperConstructedType, + #superclass : #ASN1WrapperType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1WrapperConstructedType >> decodeValueIndefiniteLengthWithDERStream: derStream [ + + | contextValue sequence value | + contextValue := ASN1ExplicitContextValue new. + contextValue tagIndex: (derStream currentTag bitAnd: 2r00011111). + contextValue tagIsPrimitive: false. + sequence := OrderedCollection new. + [derStream peekTag = 0 + ifTrue: [value := ASN1EndOfIndefiniteLengthType new decodeWithDERStream: derStream] + ifFalse: [value := derStream decode]. + value isKindOf: ASN1EndOfIndefiniteLengthMarker] + whileFalse: [sequence add: value]. + contextValue tagValue: sequence. + ^contextValue + + +] + +{ #category : #decoding } +ASN1WrapperConstructedType >> decodeValueWithDERStream: derStream length: length [ + + | aValue sequence stopPosition | + length = -1 + ifTrue: [^ self decodeValueIndefiniteLengthWithDERStream: derStream]. + aValue := ASN1ExplicitContextValue new. + aValue tagIndex: (derStream currentTag bitAnd: 2r00011111). + aValue tagIsPrimitive: false. + sequence := OrderedCollection new. + stopPosition := derStream position + length. + [derStream position < stopPosition] whileTrue: [ + sequence add: derStream decode]. + aValue tagValue: sequence. + ^aValue + + +] + +{ #category : #encoding } +ASN1WrapperConstructedType >> encodeValue: anObject withDERStream: derStream [ + + anObject tagValue do: [:each | + derStream encode: each]. + + +] + +{ #category : #encoding } +ASN1WrapperConstructedType >> sizeOfObject: anObject [ + + | derStream | + derStream := ASN1Stream new. + anObject tagValue do: [:each | + derStream encode: each]. + ^ derStream size +] diff --git a/source/ASN1/ASN1WrapperPrimitiveType.class.st b/source/ASN1/ASN1WrapperPrimitiveType.class.st new file mode 100644 index 0000000..591e4f7 --- /dev/null +++ b/source/ASN1/ASN1WrapperPrimitiveType.class.st @@ -0,0 +1,25 @@ +Class { + #name : #ASN1WrapperPrimitiveType, + #superclass : #ASN1WrapperType, + #category : 'ASN1-Types' +} + +{ #category : #decoding } +ASN1WrapperPrimitiveType >> decodeValueWithDERStream: derStream length: length [ + + | aValue | + aValue := ASN1ExplicitContextValue new. + aValue tagIndex: (derStream currentTag bitAnd: 2r00011111). + aValue tagIsPrimitive: true. + aValue tagValue: (derStream next: length). + ^aValue + + +] + +{ #category : #encoding } +ASN1WrapperPrimitiveType >> encodeValue: anObject withDERStream: derStream [ + + derStream nextPutAll: anObject tagValue. + +] diff --git a/source/ASN1/ASN1WrapperType.class.st b/source/ASN1/ASN1WrapperType.class.st new file mode 100644 index 0000000..c5678e9 --- /dev/null +++ b/source/ASN1/ASN1WrapperType.class.st @@ -0,0 +1,12 @@ +Class { + #name : #ASN1WrapperType, + #superclass : #ASN1Type, + #category : 'ASN1-Types' +} + +{ #category : #testing } +ASN1WrapperType >> matchesTag: anInteger [ + + ^ (anInteger bitAnd: 2r11000000) isZero not + +] diff --git a/source/ASN1/Boolean.extension.st b/source/ASN1/Boolean.extension.st new file mode 100644 index 0000000..1c65de7 --- /dev/null +++ b/source/ASN1/Boolean.extension.st @@ -0,0 +1,15 @@ +Extension { #name : #Boolean } + +{ #category : #'*ASN1' } +Boolean >> asAsn1Bytes [ + + ^ ASN1Stream encode: self. + +] + +{ #category : #'*ASN1' } +Boolean >> asn1Tag [ + + ^ 1 + +] diff --git a/source/ASN1/ByteArray.extension.st b/source/ASN1/ByteArray.extension.st new file mode 100644 index 0000000..5c62fad --- /dev/null +++ b/source/ASN1/ByteArray.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #ByteArray } + +{ #category : #'*ASN1' } +ByteArray >> asn1Tag [ + + ^ 4 + +] diff --git a/source/ASN1/DSAPublicKey.extension.st b/source/ASN1/DSAPublicKey.extension.st new file mode 100644 index 0000000..092a45f --- /dev/null +++ b/source/ASN1/DSAPublicKey.extension.st @@ -0,0 +1,35 @@ +Extension { #name : #DSAPublicKey } + +{ #category : #'*ASN1' } +DSAPublicKey >> asAsn1Bytes [ + + | algorithm keyInfo | + algorithm := OrderedCollection + with: (ASN1ObjectId fromString: '1.2.840.10040.4.1') + with: self dssSig. + keyInfo := OrderedCollection with: algorithm with: self subjectPublicKey. + ^ keyInfo asAsn1Bytes. + +] + +{ #category : #'*ASN1' } +DSAPublicKey class >> fromAsnDerBytes: bytes [ + + | collection algorithm dssSig p q g y | + collection := ASN1Stream decodeBytes: bytes. + algorithm := collection first. + dssSig := algorithm last. + (dssSig size = 3) ifFalse: [self error: 'incorrect number of dss parameters']. + p := dssSig at: 1. + q := dssSig at: 2. + g := dssSig at: 3. + y := ASN1Stream decodeBytes: collection last bytes. + ^ DSAPublicKey p: p q: q g: g y: y. + +] + +{ #category : #'*ASN1' } +DSAPublicKey >> subjectPublicKey [ + + ^ ASN1BitString fromByteArray: y asAsn1Bytes +] diff --git a/source/ASN1/DateAndTime.extension.st b/source/ASN1/DateAndTime.extension.st new file mode 100644 index 0000000..fb99298 --- /dev/null +++ b/source/ASN1/DateAndTime.extension.st @@ -0,0 +1,15 @@ +Extension { #name : #DateAndTime } + +{ #category : #'*ASN1' } +DateAndTime >> asAsn1Bytes [ + + ^ ASN1Stream encode: self. + +] + +{ #category : #'*ASN1' } +DateAndTime >> asn1Tag [ + + ^ 23 + +] diff --git a/source/ASN1/HashFunction.extension.st b/source/ASN1/HashFunction.extension.st new file mode 100644 index 0000000..df4d232 --- /dev/null +++ b/source/ASN1/HashFunction.extension.st @@ -0,0 +1,34 @@ +Extension { #name : #HashFunction } + +{ #category : #'*ASN1' } +HashFunction class >> digestInfoAsn1DerEncodingFromMessage: msg [ + + ^ (self digestInfoFromMessage: msg) asAsn1Bytes +] + +{ #category : #'*ASN1' } +HashFunction class >> digestInfoFromMessage: msg [ + + ^ (OrderedCollection + with: (OrderedCollection with: self oid with: nil) + with: (self hashMessage: msg)) + +] + +{ #category : #'*ASN1' } +HashFunction class >> doubleHashMessage: aStringOrByteArray [ + ^ self new doubleHashMessage: aStringOrByteArray +] + +{ #category : #'*ASN1' } +HashFunction class >> oid [ + + ^ ASN1ObjectId fromString: self oidString. + +] + +{ #category : #'*ASN1' } +HashFunction class >> oidString [ + + ^ self subclassResponsibility +] diff --git a/source/ASN1/Integer.extension.st b/source/ASN1/Integer.extension.st new file mode 100644 index 0000000..0fc4901 --- /dev/null +++ b/source/ASN1/Integer.extension.st @@ -0,0 +1,30 @@ +Extension { #name : #Integer } + +{ #category : #'*ASN1' } +Integer >> asAsn1Bytes [ + + ^ ASN1Stream encode: self. + +] + +{ #category : #'*ASN1' } +Integer >> asn1Tag [ + + ^ 2 + +] + +{ #category : #'*ASN1' } +Integer class >> asnDerLengthFromHexStreamWithBytes: aStream [ + + | byte length bytes | + bytes := OrderedCollection new. + byte := (Number readFrom: ((bytes add: aStream next) ifNil: [^0->#()]) asUppercase base: 16). + byte <= 16r80 + ifTrue: [^byte->bytes merge] + ifFalse: [ + length := 0. + (byte bitAnd: 16r7F) timesRepeat: [ + length := (length bitShift: 8) bitOr: (Number readFrom: (bytes add: aStream next) asUppercase base: 16).]. + ^ length->(bytes merge)]. +] diff --git a/source/ASN1/OrderedSet.class.st b/source/ASN1/OrderedSet.class.st new file mode 100644 index 0000000..f34e029 --- /dev/null +++ b/source/ASN1/OrderedSet.class.st @@ -0,0 +1,12 @@ +Class { + #name : #OrderedSet, + #superclass : #OrderedCollection, + #category : 'ASN1-Objects' +} + +{ #category : #accessing } +OrderedSet >> asn1Tag [ + + ^ 49 + +] diff --git a/source/ASN1/ReadStream.extension.st b/source/ASN1/ReadStream.extension.st new file mode 100644 index 0000000..02a765a --- /dev/null +++ b/source/ASN1/ReadStream.extension.st @@ -0,0 +1,27 @@ +Extension { #name : #ReadStream } + +{ #category : #'*ASN1' } +ReadStream >> formatASN1TabLevel: aTabLevel [ + | result tag aString size tabs sizeAndBytes bytes | + self atEnd + ifTrue: [^ String new]. + tabs := ((1 to: aTabLevel) + collect: [:i | '.' , String tab]) merge. + result := tabs , (tag := self next) , String tab. + sizeAndBytes := tag = '00' + ifTrue: [(Number readFrom: (bytes := self next: 2) merge asUppercase base: 16) -> bytes merge] + ifFalse: [Integer asnDerLengthFromHexStreamWithBytes: self]. + size := sizeAndBytes key. + aString := (self next: size) merge. + aString isEmpty + ifTrue: [aString := String new]. + (tag = '30' + or: [tag = '31' + or: [tag first asLowercase = $a or: [tag = '00']]]) + ifTrue: [result := result , sizeAndBytes value , ' (' , size asString , '): ' , String cr + , (aString formatASN1TabLevel: aTabLevel + 1)] + ifFalse: [result := result , sizeAndBytes value , ' (' , size asString , '): ' , String cr , tabs , String tab , aString , String cr + , (self formatASN1TabLevel: aTabLevel)]. + ^ result + , (self formatASN1TabLevel: aTabLevel) +] diff --git a/source/ASN1/SequenceableCollection.extension.st b/source/ASN1/SequenceableCollection.extension.st new file mode 100644 index 0000000..729cf86 --- /dev/null +++ b/source/ASN1/SequenceableCollection.extension.st @@ -0,0 +1,15 @@ +Extension { #name : #SequenceableCollection } + +{ #category : #'*ASN1' } +SequenceableCollection >> asAsn1Bytes [ + + ^ ASN1Stream encode: self. + +] + +{ #category : #'*ASN1' } +SequenceableCollection >> asn1Tag [ + + ^ 48 + +] diff --git a/source/ASN1/Set.extension.st b/source/ASN1/Set.extension.st new file mode 100644 index 0000000..7cb597b --- /dev/null +++ b/source/ASN1/Set.extension.st @@ -0,0 +1,15 @@ +Extension { #name : #Set } + +{ #category : #'*ASN1' } +Set >> asAsn1Bytes [ + + ^ ASN1Stream encode: self. + +] + +{ #category : #'*ASN1' } +Set >> asn1Tag [ + + ^ 49 + +] diff --git a/source/ASN1/String.extension.st b/source/ASN1/String.extension.st new file mode 100644 index 0000000..5e8b2de --- /dev/null +++ b/source/ASN1/String.extension.st @@ -0,0 +1,49 @@ +Extension { #name : #String } + +{ #category : #'*ASN1' } +String >> asn1Tag [ + + ^ 12 + +] + +{ #category : #'*ASN1' } +String >> formatASN1 [ + "return a asn1 tab formed string + '30818513818154686973206973206120313239206279746520737472696E672C2062757420746861742069732061207265616C6C79206C6F6E6720737472696E6720736F204920686176652061206C6F7420746F20747970652E20204E6F7065204920616D206E6F7420646F6E65207965742C207374696C6C206E6F7420646F6E6520616C6D6F' formatASN1 + " + ^self formatASN1TabLevel: 0 +] + +{ #category : #'*ASN1' } +String >> formatASN1TabLevel: aTabLevel [ + | aReadStream aWriteStream | + "return a asn1 tab formed string + '30818513818154686973206973206120313239206279746520737472696E672C2062757420746861742069732061207265616C6C79206C6F6E6720737472696E6720736F204920686176652061206C6F7420746F20747970652E20204E6F7065204920616D206E6F7420646F6E65207965742C207374696C6C206E6F7420646F6E6520616C6D6F' formatASN1 + " + aReadStream := ((self copyWithoutAll: {Character space. Character tab. Character cr}) divideBySize: 2) readStream. + aWriteStream := String new writeStream. + aWriteStream nextPutAll: (aReadStream formatASN1TabLevel: aTabLevel). + ^aWriteStream contents +] + +{ #category : #'*ASN1' } +String >> tokensBasedOn: aChar [ + "Answer an array of the substrings that compose the receiver." + | result end begin | + + result := WriteStream on: (Array new: 10). + + begin := 1. + "find one substring each time through this loop" + [ + "find the beginning of the next substring" + end := self indexOf: aChar startingAt: begin ifAbsent: [ nil ]. + end ~~ nil ] + whileTrue: [ + result nextPut: (self copyFrom: begin to: end - 1). + begin := end + 1]. + result nextPut: (self copyFrom: begin to: self size). + ^result contents + +] diff --git a/source/ASN1/UndefinedObject.extension.st b/source/ASN1/UndefinedObject.extension.st new file mode 100644 index 0000000..c723679 --- /dev/null +++ b/source/ASN1/UndefinedObject.extension.st @@ -0,0 +1,14 @@ +Extension { #name : #UndefinedObject } + +{ #category : #'*ASN1' } +UndefinedObject >> asAsn1Bytes [ + + ^ ASN1Stream encode: self. + +] + +{ #category : #'*ASN1' } +UndefinedObject >> asn1Tag [ + + ^ 5 +] diff --git a/source/ASN1/package.st b/source/ASN1/package.st new file mode 100644 index 0000000..b5cee3e --- /dev/null +++ b/source/ASN1/package.st @@ -0,0 +1 @@ +Package { #name : #ASN1 } diff --git a/source/BaselineOfCryptography.package/.filetree b/source/BaselineOfCryptography.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/BaselineOfCryptography.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/BaselineOfCryptography.package/BaselineOfCryptography.class/README.md b/source/BaselineOfCryptography.package/BaselineOfCryptography.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/BaselineOfCryptography.package/BaselineOfCryptography.class/instance/baseline..st b/source/BaselineOfCryptography.package/BaselineOfCryptography.class/instance/baseline..st deleted file mode 100644 index d635466..0000000 --- a/source/BaselineOfCryptography.package/BaselineOfCryptography.class/instance/baseline..st +++ /dev/null @@ -1,27 +0,0 @@ -baselines -baseline: spec - - - spec for: #common do: [ - spec package: 'Cryptography'. - spec - package: 'ASN1' with: [ spec requires: #(#'Cryptography' ) ]; - package: 'ASN1-Tests' with: [ spec requires: #(#'ASN1' ) ]; - package: 'ASN1-Readers' with: [ spec requires: #(#'Cryptography' #'ASN1') ]; - package: 'ASN1-Readers-Tests' with: [ spec requires: #(#'ASN1-Readers') ]; - package: 'PKCS12' with: [ spec requires: #(#'Cryptography' #'ASN1') ]; - package: 'PKCS12-Tests' with: [ spec requires: #(#'PKCS12') ]; - package: 'X509' with: [ spec requires: #(#'Cryptography' #'ASN1' ) ]; - package: 'X509-Tests' with: [ spec requires: #(#'X509' ) ]; - package: 'PBKDF2' with: [ spec requires: #(#'Cryptography') ]; - package: 'PBKDF2-Tests' with: [ spec requires: #(#'PBKDF2' ) ]; - package: 'Blowfish' with: [ spec requires: #(#'Cryptography') ]; - package: 'OpenPGP' with: [ spec requires: #(#'Cryptography') ]; - package: 'LayeredProtocol' with: [ spec requires: #(#'Cryptography') ]. - - spec - group: 'core' with: #('Cryptography'); - group: 'default' with: #('legacy'); - group: 'legacy' with: #('Cryptography' 'ASN1-Tests' 'ASN1-Readers-Tests' 'PKCS12-Tests' 'X509-Tests' ); - group: 'all' with: #('Cryptography' 'ASN1-Tests' 'ASN1-Readers-Tests' 'PKCS12-Tests' 'X509-Tests' 'PBKDF2-Tests' 'Blowfish' 'OpenPGP' 'LayeredProtocol') - ]. \ No newline at end of file diff --git a/source/BaselineOfCryptography.package/BaselineOfCryptography.class/properties.json b/source/BaselineOfCryptography.package/BaselineOfCryptography.class/properties.json deleted file mode 100644 index bdfc7e4..0000000 --- a/source/BaselineOfCryptography.package/BaselineOfCryptography.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BaselineOf", - "category" : "BaselineOfCryptography", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "BaselineOfCryptography", - "type" : "normal" -} \ No newline at end of file diff --git a/source/BaselineOfCryptography.package/monticello.meta/categories.st b/source/BaselineOfCryptography.package/monticello.meta/categories.st deleted file mode 100644 index fd62f8e..0000000 --- a/source/BaselineOfCryptography.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #BaselineOfCryptography! diff --git a/source/BaselineOfCryptography.package/monticello.meta/initializers.st b/source/BaselineOfCryptography.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/BaselineOfCryptography.package/monticello.meta/package b/source/BaselineOfCryptography.package/monticello.meta/package deleted file mode 100644 index 83c5d77..0000000 --- a/source/BaselineOfCryptography.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'BaselineOfCryptography') \ No newline at end of file diff --git a/source/BaselineOfCryptography.package/properties.json b/source/BaselineOfCryptography.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/BaselineOfCryptography.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/BaselineOfCryptography/BaselineOfCryptography.class.st b/source/BaselineOfCryptography/BaselineOfCryptography.class.st new file mode 100644 index 0000000..f40d5c2 --- /dev/null +++ b/source/BaselineOfCryptography/BaselineOfCryptography.class.st @@ -0,0 +1,34 @@ +Class { + #name : #BaselineOfCryptography, + #superclass : #BaselineOf, + #category : 'BaselineOfCryptography' +} + +{ #category : #baselines } +BaselineOfCryptography >> baseline: spec [ + + + spec for: #common do: [ + spec package: 'Cryptography'. + spec + package: 'ASN1' with: [ spec requires: #(#'Cryptography' ) ]; + package: 'ASN1-Tests' with: [ spec requires: #(#'ASN1' ) ]; + package: 'ASN1-Readers' with: [ spec requires: #(#'Cryptography' #'ASN1') ]; + package: 'ASN1-Readers-Tests' with: [ spec requires: #(#'ASN1-Readers') ]; + package: 'PKCS12' with: [ spec requires: #(#'Cryptography' #'ASN1') ]; + package: 'PKCS12-Tests' with: [ spec requires: #(#'PKCS12') ]; + package: 'X509' with: [ spec requires: #(#'Cryptography' #'ASN1' ) ]; + package: 'X509-Tests' with: [ spec requires: #(#'X509' ) ]; + package: 'PBKDF2' with: [ spec requires: #(#'Cryptography') ]; + package: 'PBKDF2-Tests' with: [ spec requires: #(#'PBKDF2' ) ]; + package: 'Blowfish' with: [ spec requires: #(#'Cryptography') ]; + package: 'OpenPGP' with: [ spec requires: #(#'Cryptography') ]; + package: 'LayeredProtocol' with: [ spec requires: #(#'Cryptography') ]. + + spec + group: 'core' with: #('Cryptography'); + group: 'default' with: #('legacy'); + group: 'legacy' with: #('Cryptography' 'ASN1-Tests' 'ASN1-Readers-Tests' 'PKCS12-Tests' 'X509-Tests' ); + group: 'all' with: #('Cryptography' 'ASN1-Tests' 'ASN1-Readers-Tests' 'PKCS12-Tests' 'X509-Tests' 'PBKDF2-Tests' 'Blowfish' 'OpenPGP' 'LayeredProtocol') + ]. +] diff --git a/source/BaselineOfCryptography/package.st b/source/BaselineOfCryptography/package.st new file mode 100644 index 0000000..13daec7 --- /dev/null +++ b/source/BaselineOfCryptography/package.st @@ -0,0 +1 @@ +Package { #name : #BaselineOfCryptography } diff --git a/source/Blowfish.package/.filetree b/source/Blowfish.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/Blowfish.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/README.md b/source/Blowfish.package/Blowfish.class/README.md deleted file mode 100644 index 563d230..0000000 --- a/source/Blowfish.package/Blowfish.class/README.md +++ /dev/null @@ -1,19 +0,0 @@ -This is just enough of the Blowfish algorithm from -http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/crypt/blowfish.c - -to be able to run BCrypt. - - -Instance Variables: - rounds - piArray - s0 - s1 - s2 - s3 - s4 - xl - xr - current - key - data \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/blockSize.st b/source/Blowfish.package/Blowfish.class/class/blockSize.st deleted file mode 100644 index 89a7c89..0000000 --- a/source/Blowfish.package/Blowfish.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -defaults -blockSize - ^8 \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/decrypt.with..st b/source/Blowfish.package/Blowfish.class/class/decrypt.with..st deleted file mode 100644 index bd64dc6..0000000 --- a/source/Blowfish.package/Blowfish.class/class/decrypt.with..st +++ /dev/null @@ -1,4 +0,0 @@ -decrypt -decrypt: someData with: aKeyByteArray -"use this when you have a wordArray" - ^self new decrypt: someData with: aKeyByteArray. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/decryptString.with..st b/source/Blowfish.package/Blowfish.class/class/decryptString.with..st deleted file mode 100644 index 1bc9164..0000000 --- a/source/Blowfish.package/Blowfish.class/class/decryptString.with..st +++ /dev/null @@ -1,5 +0,0 @@ -decrypt -decryptString: aString with: aKey - |decryptedData | - decryptedData := (self new ecbDecrypt: aString asByteArray with: aKey asByteArray ). - ^String fromByteArray: decryptedData asByteArray . \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/decryptToString.with..st b/source/Blowfish.package/Blowfish.class/class/decryptToString.with..st deleted file mode 100644 index 15001bd..0000000 --- a/source/Blowfish.package/Blowfish.class/class/decryptToString.with..st +++ /dev/null @@ -1,5 +0,0 @@ -decrypt -decryptToString: someData with: aKey -|decryptedData | -decryptedData := (self new ecbDecrypt: someData with: aKey asByteArray ). - ^String fromByteArray: decryptedData asByteArray . \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/defaultRounds.st b/source/Blowfish.package/Blowfish.class/class/defaultRounds.st deleted file mode 100644 index a13048b..0000000 --- a/source/Blowfish.package/Blowfish.class/class/defaultRounds.st +++ /dev/null @@ -1,3 +0,0 @@ -defaults -defaultRounds -^self minRounds \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/ecbDecrypt.with..st b/source/Blowfish.package/Blowfish.class/class/ecbDecrypt.with..st deleted file mode 100644 index a03faa0..0000000 --- a/source/Blowfish.package/Blowfish.class/class/ecbDecrypt.with..st +++ /dev/null @@ -1,4 +0,0 @@ -encrypt -ecbDecrypt: someData with: aKey -"use this when you have a byteArray" - ^self new ecbDecrypt: someData with: aKey. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/ecbEncrypt.with..st b/source/Blowfish.package/Blowfish.class/class/ecbEncrypt.with..st deleted file mode 100644 index 184bd59..0000000 --- a/source/Blowfish.package/Blowfish.class/class/ecbEncrypt.with..st +++ /dev/null @@ -1,4 +0,0 @@ -encrypt -ecbEncrypt: someData with: aKey -"use this when you have a byteArray" - ^self new ecbEncrypt: someData with: aKey. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/encrypt.with..st b/source/Blowfish.package/Blowfish.class/class/encrypt.with..st deleted file mode 100644 index 9686ebb..0000000 --- a/source/Blowfish.package/Blowfish.class/class/encrypt.with..st +++ /dev/null @@ -1,4 +0,0 @@ -encrypt -encrypt: someData with: aKey -"use this when you have a wordArray" - ^self new encrypt: someData with: aKey. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/encryptString.with..st b/source/Blowfish.package/Blowfish.class/class/encryptString.with..st deleted file mode 100644 index f13f71d..0000000 --- a/source/Blowfish.package/Blowfish.class/class/encryptString.with..st +++ /dev/null @@ -1,7 +0,0 @@ -encrypt -encryptString: someData with: aKeyString -"use this with a string" -|dataToEncrypt | -dataToEncrypt :=OrderedCollection new. -someData do:[:each | dataToEncrypt add: each asciiValue ]. - ^self new ecbEncrypt: dataToEncrypt asArray with: aKeyString asByteArray . \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/maxRounds.st b/source/Blowfish.package/Blowfish.class/class/maxRounds.st deleted file mode 100644 index e57d6f4..0000000 --- a/source/Blowfish.package/Blowfish.class/class/maxRounds.st +++ /dev/null @@ -1,3 +0,0 @@ -defaults -maxRounds -^20 diff --git a/source/Blowfish.package/Blowfish.class/class/maxUserKeyLength.st b/source/Blowfish.package/Blowfish.class/class/maxUserKeyLength.st deleted file mode 100644 index 1943e2e..0000000 --- a/source/Blowfish.package/Blowfish.class/class/maxUserKeyLength.st +++ /dev/null @@ -1,3 +0,0 @@ -defaults -maxUserKeyLength - ^448/8 \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/minRounds.st b/source/Blowfish.package/Blowfish.class/class/minRounds.st deleted file mode 100644 index 94614a7..0000000 --- a/source/Blowfish.package/Blowfish.class/class/minRounds.st +++ /dev/null @@ -1,3 +0,0 @@ -defaults -minRounds -^16 \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/pBox.st b/source/Blowfish.package/Blowfish.class/class/pBox.st deleted file mode 100644 index 9f29bd7..0000000 --- a/source/Blowfish.package/Blowfish.class/class/pBox.st +++ /dev/null @@ -1,5 +0,0 @@ -defaults -pBox - ^#( 16r243F6A88 16r85A308D3 16r13198A2E 16r03707344 16rA4093822 16r299F31D0 - 16r082EFA98 16rEC4E6C89 16r452821E6 16r38D01377 16rBE5466CF 16r34E90C6C - 16rC0AC29B7 16rC97C50DD 16r3F84D5B5 16rB5470917 16r9216D5D9 16r8979FB1B) \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/s0Box.st b/source/Blowfish.package/Blowfish.class/class/s0Box.st deleted file mode 100644 index 46048b9..0000000 --- a/source/Blowfish.package/Blowfish.class/class/s0Box.st +++ /dev/null @@ -1,66 +0,0 @@ -defaults -s0Box - ^#(16rD1310BA6 16r98DFB5AC 16r2FFD72DB 16rD01ADFB7 - 16rB8E1AFED 16r6A267E96 16rBA7C9045 16rF12C7F99 - 16r24A19947 16rB3916CF7 16r0801F2E2 16r858EFC16 - 16r636920D8 16r71574E69 16rA458FEA3 16rF4933D7E - 16r0D95748F 16r728EB658 16r718BCD58 16r82154AEE - 16r7B54A41D 16rC25A59B5 16r9C30D539 16r2AF26013 - 16rC5D1B023 16r286085F0 16rCA417918 16rB8DB38EF - 16r8E79DCB0 16r603A180E 16r6C9E0E8B 16rB01E8A3E - 16rD71577C1 16rBD314B27 16r78AF2FDA 16r55605C60 - 16rE65525F3 16rAA55AB94 16r57489862 16r63E81440 - 16r55CA396A 16r2AAB10B6 16rB4CC5C34 16r1141E8CE - 16rA15486AF 16r7C72E993 16rB3EE1411 16r636FBC2A - 16r2BA9C55D 16r741831F6 16rCE5C3E16 16r9B87931E - 16rAFD6BA33 16r6C24CF5C 16r7A325381 16r28958677 - 16r3B8F4898 16r6B4BB9AF 16rC4BFE81B 16r66282193 - 16r61D809CC 16rFB21A991 16r487CAC60 16r5DEC8032 - 16rEF845D5D 16rE98575B1 16rDC262302 16rEB651B88 - 16r23893E81 16rD396ACC5 16r0F6D6FF3 16r83F44239 - 16r2E0B4482 16rA4842004 16r69C8F04A 16r9E1F9B5E - 16r21C66842 16rF6E96C9A 16r670C9C61 16rABD388F0 - 16r6A51A0D2 16rD8542F68 16r960FA728 16rAB5133A3 - 16r6EEF0B6C 16r137A3BE4 16rBA3BF050 16r7EFB2A98 - 16rA1F1651D 16r39AF0176 16r66CA593E 16r82430E88 - 16r8CEE8619 16r456F9FB4 16r7D84A5C3 16r3B8B5EBE - 16rE06F75D8 16r85C12073 16r401A449F 16r56C16AA6 - 16r4ED3AA62 16r363F7706 16r1BFEDF72 16r429B023D - 16r37D0D724 16rD00A1248 16rDB0FEAD3 16r49F1C09B - 16r075372C9 16r80991B7B 16r25D479D8 16rF6E8DEF7 - 16rE3FE501A 16rB6794C3B 16r976CE0BD 16r04C006BA - 16rC1A94FB6 16r409F60C4 16r5E5C9EC2 16r196A2463 - 16r68FB6FAF 16r3E6C53B5 16r1339B2EB 16r3B52EC6F - 16r6DFC511F 16r9B30952C 16rCC814544 16rAF5EBD09 - 16rBEE3D004 16rDE334AFD 16r660F2807 16r192E4BB3 - 16rC0CBA857 16r45C8740F 16rD20B5F39 16rB9D3FBDB - 16r5579C0BD 16r1A60320A 16rD6A100C6 16r402C7279 - 16r679F25FE 16rFB1FA3CC 16r8EA5E9F8 16rDB3222F8 - 16r3C7516DF 16rFD616B15 16r2F501EC8 16rAD0552AB - 16r323DB5FA 16rFD238760 16r53317B48 16r3E00DF82 - 16r9E5C57BB 16rCA6F8CA0 16r1A87562E 16rDF1769DB - 16rD542A8F6 16r287EFFC3 16rAC6732C6 16r8C4F5573 - 16r695B27B0 16rBBCA58C8 16rE1FFA35D 16rB8F011A0 - 16r10FA3D98 16rFD2183B8 16r4AFCB56C 16r2DD1D35B - 16r9A53E479 16rB6F84565 16rD28E49BC 16r4BFB9790 - 16rE1DDF2DA 16rA4CB7E33 16r62FB1341 16rCEE4C6E8 - 16rEF20CADA 16r36774C01 16rD07E9EFE 16r2BF11FB4 - 16r95DBDA4D 16rAE909198 16rEAAD8E71 16r6B93D5A0 - 16rD08ED1D0 16rAFC725E0 16r8E3C5B2F 16r8E7594B7 - 16r8FF6E2FB 16rF2122B64 16r8888B812 16r900DF01C - 16r4FAD5EA0 16r688FC31C 16rD1CFF191 16rB3A8C1AD - 16r2F2F2218 16rBE0E1777 16rEA752DFE 16r8B021FA1 - 16rE5A0CC0F 16rB56F74E8 16r18ACF3D6 16rCE89E299 - 16rB4A84FE0 16rFD13E0B7 16r7CC43B81 16rD2ADA8D9 - 16r165FA266 16r80957705 16r93CC7314 16r211A1477 - 16rE6AD2065 16r77B5FA86 16rC75442F5 16rFB9D35CF - 16rEBCDAF0C 16r7B3E89A0 16rD6411BD3 16rAE1E7E49 - 16r00250E2D 16r2071B35E 16r226800BB 16r57B8E0AF - 16r2464369B 16rF009B91E 16r5563911D 16r59DFA6AA - 16r78C14389 16rD95A537F 16r207D5BA2 16r02E5B9C5 - 16r83260376 16r6295CFA9 16r11C81968 16r4E734A41 - 16rB3472DCA 16r7B14A94A 16r1B510052 16r9A532915 - 16rD60F573F 16rBC9BC6E4 16r2B60A476 16r81E67400 - 16r08BA6FB5 16r571BE91F 16rF296EC6B 16r2A0DD915 - 16rB6636521 16rE7B9F9B6 16rFF34052E 16rC5855664 - 16r53B02D5D 16rA99F8FA1 16r08BA4799 16r6E85076A ) \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/s1Box.st b/source/Blowfish.package/Blowfish.class/class/s1Box.st deleted file mode 100644 index b329e91..0000000 --- a/source/Blowfish.package/Blowfish.class/class/s1Box.st +++ /dev/null @@ -1,66 +0,0 @@ -defaults -s1Box - ^#(16r4B7A70E9 16rB5B32944 16rDB75092E 16rC4192623 - 16rAD6EA6B0 16r49A7DF7D 16r9CEE60B8 16r8FEDB266 - 16rECAA8C71 16r699A17FF 16r5664526C 16rC2B19EE1 - 16r193602A5 16r75094C29 16rA0591340 16rE4183A3E - 16r3F54989A 16r5B429D65 16r6B8FE4D6 16r99F73FD6 - 16rA1D29C07 16rEFE830F5 16r4D2D38E6 16rF0255DC1 - 16r4CDD2086 16r8470EB26 16r6382E9C6 16r021ECC5E - 16r09686B3F 16r3EBAEFC9 16r3C971814 16r6B6A70A1 - 16r687F3584 16r52A0E286 16rB79C5305 16rAA500737 - 16r3E07841C 16r7FDEAE5C 16r8E7D44EC 16r5716F2B8 - 16rB03ADA37 16rF0500C0D 16rF01C1F04 16r0200B3FF - 16rAE0CF51A 16r3CB574B2 16r25837A58 16rDC0921BD - 16rD19113F9 16r7CA92FF6 16r94324773 16r22F54701 - 16r3AE5E581 16r37C2DADC 16rC8B57634 16r9AF3DDA7 - 16rA9446146 16r0FD0030E 16rECC8C73E 16rA4751E41 - 16rE238CD99 16r3BEA0E2F 16r3280BBA1 16r183EB331 - 16r4E548B38 16r4F6DB908 16r6F420D03 16rF60A04BF - 16r2CB81290 16r24977C79 16r5679B072 16rBCAF89AF - 16rDE9A771F 16rD9930810 16rB38BAE12 16rDCCF3F2E - 16r5512721F 16r2E6B7124 16r501ADDE6 16r9F84CD87 - 16r7A584718 16r7408DA17 16rBC9F9ABC 16rE94B7D8C - 16rEC7AEC3A 16rDB851DFA 16r63094366 16rC464C3D2 - 16rEF1C1847 16r3215D908 16rDD433B37 16r24C2BA16 - 16r12A14D43 16r2A65C451 16r50940002 16r133AE4DD - 16r71DFF89E 16r10314E55 16r81AC77D6 16r5F11199B - 16r043556F1 16rD7A3C76B 16r3C11183B 16r5924A509 - 16rF28FE6ED 16r97F1FBFA 16r9EBABF2C 16r1E153C6E - 16r86E34570 16rEAE96FB1 16r860E5E0A 16r5A3E2AB3 - 16r771FE71C 16r4E3D06FA 16r2965DCB9 16r99E71D0F - 16r803E89D6 16r5266C825 16r2E4CC978 16r9C10B36A - 16rC6150EBA 16r94E2EA78 16rA5FC3C53 16r1E0A2DF4 - 16rF2F74EA7 16r361D2B3D 16r1939260F 16r19C27960 - 16r5223A708 16rF71312B6 16rEBADFE6E 16rEAC31F66 - 16rE3BC4595 16rA67BC883 16rB17F37D1 16r018CFF28 - 16rC332DDEF 16rBE6C5AA5 16r65582185 16r68AB9802 - 16rEECEA50F 16rDB2F953B 16r2AEF7DAD 16r5B6E2F84 - 16r1521B628 16r29076170 16rECDD4775 16r619F1510 - 16r13CCA830 16rEB61BD96 16r0334FE1E 16rAA0363CF - 16rB5735C90 16r4C70A239 16rD59E9E0B 16rCBAADE14 - 16rEECC86BC 16r60622CA7 16r9CAB5CAB 16rB2F3846E - 16r648B1EAF 16r19BDF0CA 16rA02369B9 16r655ABB50 - 16r40685A32 16r3C2AB4B3 16r319EE9D5 16rC021B8F7 - 16r9B540B19 16r875FA099 16r95F7997E 16r623D7DA8 - 16rF837889A 16r97E32D77 16r11ED935F 16r16681281 - 16r0E358829 16rC7E61FD6 16r96DEDFA1 16r7858BA99 - 16r57F584A5 16r1B227263 16r9B83C3FF 16r1AC24696 - 16rCDB30AEB 16r532E3054 16r8FD948E4 16r6DBC3128 - 16r58EBF2EF 16r34C6FFEA 16rFE28ED61 16rEE7C3C73 - 16r5D4A14D9 16rE864B7E3 16r42105D14 16r203E13E0 - 16r45EEE2B6 16rA3AAABEA 16rDB6C4F15 16rFACB4FD0 - 16rC742F442 16rEF6ABBB5 16r654F3B1D 16r41CD2105 - 16rD81E799E 16r86854DC7 16rE44B476A 16r3D816250 - 16rCF62A1F2 16r5B8D2646 16rFC8883A0 16rC1C7B6A3 - 16r7F1524C3 16r69CB7492 16r47848A0B 16r5692B285 - 16r095BBF00 16rAD19489D 16r1462B174 16r23820E00 - 16r58428D2A 16r0C55F5EA 16r1DADF43E 16r233F7061 - 16r3372F092 16r8D937E41 16rD65FECF1 16r6C223BDB - 16r7CDE3759 16rCBEE7460 16r4085F2A7 16rCE77326E - 16rA6078084 16r19F8509E 16rE8EFD855 16r61D99735 - 16rA969A7AA 16rC50C06C2 16r5A04ABFC 16r800BCADC - 16r9E447A2E 16rC3453484 16rFDD56705 16r0E1E9EC9 - 16rDB73DBD3 16r105588CD 16r675FDA79 16rE3674340 - 16rC5C43465 16r713E38D8 16r3D28F89E 16rF16DFF20 - 16r153E21E7 16r8FB03D4A 16rE6E39F2B 16rDB83ADF7) \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/s2Box.st b/source/Blowfish.package/Blowfish.class/class/s2Box.st deleted file mode 100644 index efa7075..0000000 --- a/source/Blowfish.package/Blowfish.class/class/s2Box.st +++ /dev/null @@ -1,66 +0,0 @@ -defaults -s2Box - ^#(16rE93D5A68 16r948140F7 16rF64C261C 16r94692934 - 16r411520F7 16r7602D4F7 16rBCF46B2E 16rD4A20068 - 16rD4082471 16r3320F46A 16r43B7D4B7 16r500061AF - 16r1E39F62E 16r97244546 16r14214F74 16rBF8B8840 - 16r4D95FC1D 16r96B591AF 16r70F4DDD3 16r66A02F45 - 16rBFBC09EC 16r03BD9785 16r7FAC6DD0 16r31CB8504 - 16r96EB27B3 16r55FD3941 16rDA2547E6 16rABCA0A9A - 16r28507825 16r530429F4 16r0A2C86DA 16rE9B66DFB - 16r68DC1462 16rD7486900 16r680EC0A4 16r27A18DEE - 16r4F3FFEA2 16rE887AD8C 16rB58CE006 16r7AF4D6B6 - 16rAACE1E7C 16rD3375FEC 16rCE78A399 16r406B2A42 - 16r20FE9E35 16rD9F385B9 16rEE39D7AB 16r3B124E8B - 16r1DC9FAF7 16r4B6D1856 16r26A36631 16rEAE397B2 - 16r3A6EFA74 16rDD5B4332 16r6841E7F7 16rCA7820FB - 16rFB0AF54E 16rD8FEB397 16r454056AC 16rBA489527 - 16r55533A3A 16r20838D87 16rFE6BA9B7 16rD096954B - 16r55A867BC 16rA1159A58 16rCCA92963 16r99E1DB33 - 16rA62A4A56 16r3F3125F9 16r5EF47E1C 16r9029317C - 16rFDF8E802 16r04272F70 16r80BB155C 16r05282CE3 - 16r95C11548 16rE4C66D22 16r48C1133F 16rC70F86DC - 16r07F9C9EE 16r41041F0F 16r404779A4 16r5D886E17 - 16r325F51EB 16rD59BC0D1 16rF2BCC18F 16r41113564 - 16r257B7834 16r602A9C60 16rDFF8E8A3 16r1F636C1B - 16r0E12B4C2 16r02E1329E 16rAF664FD1 16rCAD18115 - 16r6B2395E0 16r333E92E1 16r3B240B62 16rEEBEB922 - 16r85B2A20E 16rE6BA0D99 16rDE720C8C 16r2DA2F728 - 16rD0127845 16r95B794FD 16r647D0862 16rE7CCF5F0 - 16r5449A36F 16r877D48FA 16rC39DFD27 16rF33E8D1E - 16r0A476341 16r992EFF74 16r3A6F6EAB 16rF4F8FD37 - 16rA812DC60 16rA1EBDDF8 16r991BE14C 16rDB6E6B0D - 16rC67B5510 16r6D672C37 16r2765D43B 16rDCD0E804 - 16rF1290DC7 16rCC00FFA3 16rB5390F92 16r690FED0B - 16r667B9FFB 16rCEDB7D9C 16rA091CF0B 16rD9155EA3 - 16rBB132F88 16r515BAD24 16r7B9479BF 16r763BD6EB - 16r37392EB3 16rCC115979 16r8026E297 16rF42E312D - 16r6842ADA7 16rC66A2B3B 16r12754CCC 16r782EF11C - 16r6A124237 16rB79251E7 16r06A1BBE6 16r4BFB6350 - 16r1A6B1018 16r11CAEDFA 16r3D25BDD8 16rE2E1C3C9 - 16r44421659 16r0A121386 16rD90CEC6E 16rD5ABEA2A - 16r64AF674E 16rDA86A85F 16rBEBFE988 16r64E4C3FE - 16r9DBC8057 16rF0F7C086 16r60787BF8 16r6003604D - 16rD1FD8346 16rF6381FB0 16r7745AE04 16rD736FCCC - 16r83426B33 16rF01EAB71 16rB0804187 16r3C005E5F - 16r77A057BE 16rBDE8AE24 16r55464299 16rBF582E61 - 16r4E58F48F 16rF2DDFDA2 16rF474EF38 16r8789BDC2 - 16r5366F9C3 16rC8B38E74 16rB475F255 16r46FCD9B9 - 16r7AEB2661 16r8B1DDF84 16r846A0E79 16r915F95E2 - 16r466E598E 16r20B45770 16r8CD55591 16rC902DE4C - 16rB90BACE1 16rBB8205D0 16r11A86248 16r7574A99E - 16rB77F19B6 16rE0A9DC09 16r662D09A1 16rC4324633 - 16rE85A1F02 16r09F0BE8C 16r4A99A025 16r1D6EFE10 - 16r1AB93D1D 16r0BA5A4DF 16rA186F20F 16r2868F169 - 16rDCB7DA83 16r573906FE 16rA1E2CE9B 16r4FCD7F52 - 16r50115E01 16rA70683FA 16rA002B5C4 16r0DE6D027 - 16r9AF88C27 16r773F8641 16rC3604C06 16r61A806B5 - 16rF0177A28 16rC0F586E0 16r006058AA 16r30DC7D62 - 16r11E69ED7 16r2338EA63 16r53C2DD94 16rC2C21634 - 16rBBCBEE56 16r90BCB6DE 16rEBFC7DA1 16rCE591D76 - 16r6F05E409 16r4B7C0188 16r39720A3D 16r7C927C24 - 16r86E3725F 16r724D9DB9 16r1AC15BB4 16rD39EB8FC - 16rED545578 16r08FCA5B5 16rD83D7CD3 16r4DAD0FC4 - 16r1E50EF5E 16rB161E6F8 16rA28514D9 16r6C51133C - 16r6FD5C7E7 16r56E14EC4 16r362ABFCE 16rDDC6C837 - 16rD79A3234 16r92638212 16r670EFA8E 16r406000E0) \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/class/s3Box.st b/source/Blowfish.package/Blowfish.class/class/s3Box.st deleted file mode 100644 index e5a1ccf..0000000 --- a/source/Blowfish.package/Blowfish.class/class/s3Box.st +++ /dev/null @@ -1,66 +0,0 @@ -defaults -s3Box - ^#(16r3A39CE37 16rD3FAF5CF 16rABC27737 16r5AC52D1B - 16r5CB0679E 16r4FA33742 16rD3822740 16r99BC9BBE - 16rD5118E9D 16rBF0F7315 16rD62D1C7E 16rC700C47B - 16rB78C1B6B 16r21A19045 16rB26EB1BE 16r6A366EB4 - 16r5748AB2F 16rBC946E79 16rC6A376D2 16r6549C2C8 - 16r530FF8EE 16r468DDE7D 16rD5730A1D 16r4CD04DC6 - 16r2939BBDB 16rA9BA4650 16rAC9526E8 16rBE5EE304 - 16rA1FAD5F0 16r6A2D519A 16r63EF8CE2 16r9A86EE22 - 16rC089C2B8 16r43242EF6 16rA51E03AA 16r9CF2D0A4 - 16r83C061BA 16r9BE96A4D 16r8FE51550 16rBA645BD6 - 16r2826A2F9 16rA73A3AE1 16r4BA99586 16rEF5562E9 - 16rC72FEFD3 16rF752F7DA 16r3F046F69 16r77FA0A59 - 16r80E4A915 16r87B08601 16r9B09E6AD 16r3B3EE593 - 16rE990FD5A 16r9E34D797 16r2CF0B7D9 16r022B8B51 - 16r96D5AC3A 16r017DA67D 16rD1CF3ED6 16r7C7D2D28 - 16r1F9F25CF 16rADF2B89B 16r5AD6B472 16r5A88F54C - 16rE029AC71 16rE019A5E6 16r47B0ACFD 16rED93FA9B - 16rE8D3C48D 16r283B57CC 16rF8D56629 16r79132E28 - 16r785F0191 16rED756055 16rF7960E44 16rE3D35E8C - 16r15056DD4 16r88F46DBA 16r03A16125 16r0564F0BD - 16rC3EB9E15 16r3C9057A2 16r97271AEC 16rA93A072A - 16r1B3F6D9B 16r1E6321F5 16rF59C66FB 16r26DCF319 - 16r7533D928 16rB155FDF5 16r03563482 16r8ABA3CBB - 16r28517711 16rC20AD9F8 16rABCC5167 16rCCAD925F - 16r4DE81751 16r3830DC8E 16r379D5862 16r9320F991 - 16rEA7A90C2 16rFB3E7BCE 16r5121CE64 16r774FBE32 - 16rA8B6E37E 16rC3293D46 16r48DE5369 16r6413E680 - 16rA2AE0810 16rDD6DB224 16r69852DFD 16r09072166 - 16rB39A460A 16r6445C0DD 16r586CDECF 16r1C20C8AE - 16r5BBEF7DD 16r1B588D40 16rCCD2017F 16r6BB4E3BB - 16rDDA26A7E 16r3A59FF45 16r3E350A44 16rBCB4CDD5 - 16r72EACEA8 16rFA6484BB 16r8D6612AE 16rBF3C6F47 - 16rD29BE463 16r542F5D9E 16rAEC2771B 16rF64E6370 - 16r740E0D8D 16rE75B1357 16rF8721671 16rAF537D5D - 16r4040CB08 16r4EB4E2CC 16r34D2466A 16r0115AF84 - 16rE1B00428 16r95983A1D 16r06B89FB4 16rCE6EA048 - 16r6F3F3B82 16r3520AB82 16r011A1D4B 16r277227F8 - 16r611560B1 16rE7933FDC 16rBB3A792B 16r344525BD - 16rA08839E1 16r51CE794B 16r2F32C9B7 16rA01FBAC9 - 16rE01CC87E 16rBCC7D1F6 16rCF0111C3 16rA1E8AAC7 - 16r1A908749 16rD44FBD9A 16rD0DADECB 16rD50ADA38 - 16r0339C32A 16rC6913667 16r8DF9317C 16rE0B12B4F - 16rF79E59B7 16r43F5BB3A 16rF2D519FF 16r27D9459C - 16rBF97222C 16r15E6FC2A 16r0F91FC71 16r9B941525 - 16rFAE59361 16rCEB69CEB 16rC2A86459 16r12BAA8D1 - 16rB6C1075E 16rE3056A0C 16r10D25065 16rCB03A442 - 16rE0EC6E0E 16r1698DB3B 16r4C98A0BE 16r3278E964 - 16r9F1F9532 16rE0D392DF 16rD3A0342B 16r8971F21E - 16r1B0A7441 16r4BA3348C 16rC5BE7120 16rC37632D8 - 16rDF359F8D 16r9B992F2E 16rE60B6F47 16r0FE3F11D - 16rE54CDA54 16r1EDAD891 16rCE6279CF 16rCD3E7E6F - 16r1618B166 16rFD2C1D05 16r848FD2C5 16rF6FB2299 - 16rF523F357 16rA6327623 16r93A83531 16r56CCCD02 - 16rACF08162 16r5A75EBB5 16r6E163697 16r88D273CC - 16rDE966292 16r81B949D0 16r4C50901B 16r71C65614 - 16rE6C6C7BD 16r327A140A 16r45E1D006 16rC3F27B9A - 16rC9AA53FD 16r62A80F00 16rBB25BFE2 16r35BDD2F6 - 16r71126905 16rB2040222 16rB6CBCF7C 16rCD769C2B - 16r53113EC0 16r1640E3D3 16r38ABBD60 16r2547ADF0 - 16rBA38209C 16rF746CE76 16r77AFA1C5 16r20756060 - 16r85CBFE4E 16r8AE88DD8 16r7AAAF9B0 16r4CF9AA7E - 16r1948C25C 16r02FB8A8C 16r01C36AE4 16rD6EBE1F9 - 16r90D4F869 16rA65CDEA0 16r3F09252D 16rC208E69F - 16rB74E6132 16rCE77E25B 16r578FDFE3 16r3AC372E6) \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/blfDec.for..st b/source/Blowfish.package/Blowfish.class/instance/blfDec.for..st deleted file mode 100644 index de4a395..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/blfDec.for..st +++ /dev/null @@ -1,14 +0,0 @@ -as yet unclassified -blfDec: dataArray for: blocks - | j newDataArray | - newDataArray := Array new: dataArray size. - j := 1. - (1 to: blocks) - do: [ :each | - xl := dataArray at: j. - xr := dataArray at: j + 1. - self decipher. - newDataArray at: j put: xl. - newDataArray at: j + 1 put: xr. - j := j + 2 ]. - ^ newDataArray \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/blfEcbDecrypt.for..st b/source/Blowfish.package/Blowfish.class/instance/blfEcbDecrypt.for..st deleted file mode 100644 index bd936b7..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/blfEcbDecrypt.for..st +++ /dev/null @@ -1,24 +0,0 @@ -as yet unclassified -blfEcbDecrypt: dataArray for: times - - | newDataArray | -newDataArray:=dataArray copy. - - (1 to: times by: 8) do:[ :each | - - xl:=((((newDataArray at: 1) bitShift: 24) bitOr: ((newDataArray at: 2) bitShift: 16) )bitOr: ((newDataArray at: 3) bitShift: 8)) bitOr: (newDataArray at: 4). - xr:=((((newDataArray at: 5) bitShift: 24) bitOr: ((newDataArray at: 6) bitShift: 16) )bitOr: ((newDataArray at: 7) bitShift: 8)) bitOr: (newDataArray at: 8). - - self decipher . - - newDataArray at: 1 put: ((xl bitShift: -24) bitAnd: 16rff). - newDataArray at: 2 put: ((xl bitShift: -16) bitAnd: 16rff). - newDataArray at: 3 put: ((xl bitShift: -8) bitAnd: 16rff). - newDataArray at: 4 put: (xl bitAnd: 16rff). - newDataArray at: 5 put: ((xr bitShift: -24) bitAnd: 16rff). - newDataArray at: 6 put: ((xr bitShift: -16) bitAnd: 16rff). - newDataArray at: 7 put: ((xr bitShift: -8) bitAnd: 16rff). - newDataArray at: 8 put: (xr bitAnd: 16rff). - ] . - - ^newDataArray \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/blfEcbEncrypt.for..st b/source/Blowfish.package/Blowfish.class/instance/blfEcbEncrypt.for..st deleted file mode 100644 index f236f83..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/blfEcbEncrypt.for..st +++ /dev/null @@ -1,24 +0,0 @@ -as yet unclassified -blfEcbEncrypt: dataArray for: times - - | newDataArray | -newDataArray:=dataArray copy. - - (1 to: times by: 8) do:[ :each | - - xl:=((((newDataArray at: 1) bitShift: 24) bitOr: ((newDataArray at: 2) bitShift: 16) )bitOr: ((newDataArray at: 3) bitShift: 8)) bitOr: (newDataArray at: 4). - xr:=((((newDataArray at: 5) bitShift: 24) bitOr: ((newDataArray at: 6) bitShift: 16) )bitOr: ((newDataArray at: 7) bitShift: 8)) bitOr: (newDataArray at: 8). - - self encipher . - - newDataArray at: 1 put: ((xl bitShift: -24) bitAnd: 16rff). - newDataArray at: 2 put: ((xl bitShift: -16) bitAnd: 16rff). - newDataArray at: 3 put: ((xl bitShift: -8) bitAnd: 16rff). - newDataArray at: 4 put: (xl bitAnd: 16rff). - newDataArray at: 5 put: ((xr bitShift: -24) bitAnd: 16rff). - newDataArray at: 6 put: ((xr bitShift: -16) bitAnd: 16rff). - newDataArray at: 7 put: ((xr bitShift: -8) bitAnd: 16rff). - newDataArray at: 8 put: (xr bitAnd: 16rff). - ] . - - ^newDataArray \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/blfEnc.for..st b/source/Blowfish.package/Blowfish.class/instance/blfEnc.for..st deleted file mode 100644 index 24cdbc6..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/blfEnc.for..st +++ /dev/null @@ -1,14 +0,0 @@ -as yet unclassified -blfEnc: dataArray for: blocks - | j newDataArray | - newDataArray := dataArray copy. - j := 1. - (1 to: blocks) - do: [ :each | - xl := newDataArray at: j. - xr := newDataArray at: j + 1. - self encipher. - newDataArray at: j put: xl. - newDataArray at: j + 1 put: xr. - j := j + 2 ]. - ^ newDataArray \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/blfKey..st b/source/Blowfish.package/Blowfish.class/instance/blfKey..st deleted file mode 100644 index 3f9cc9c..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/blfKey..st +++ /dev/null @@ -1,7 +0,0 @@ -as yet unclassified -blfKey: aKey - index:=0. - key:= aKey. - "self initializeLittleEndianBoxes." - self initializeBoxes. - self expandZeroState. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/calculateBlfRndFor.with.andPiAt..st b/source/Blowfish.package/Blowfish.class/instance/calculateBlfRndFor.with.andPiAt..st deleted file mode 100644 index 7bbb590..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/calculateBlfRndFor.with.andPiAt..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -calculateBlfRndFor:oneHalf with: otherHalf andPiAt: n -"#define BLFRND(s,p,i,j,n) (i ^= F(s,j) ^ (p)[n])" - - -^ oneHalf bitXor: ((self feistelWith: otherHalf ) bitXor: (piArray at: n)) . diff --git a/source/Blowfish.package/Blowfish.class/instance/decipher.st b/source/Blowfish.package/Blowfish.class/instance/decipher.st deleted file mode 100644 index 2fdbb2f..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/decipher.st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -decipher - | xL xR temp | - xL := xl copy. - xR := xr copy. - xL := xL bitXor: (piArray at: 18). - (17 to: 2 by: -2) - do: [ :each | - xR := self calculateBlfRndFor: xR with: xL andPiAt: each. - xL := self calculateBlfRndFor: xL with: xR andPiAt: each - 1 ]. - xl := xR bitXor: (piArray at: 1). - xr := xL \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/decrypt.with..st b/source/Blowfish.package/Blowfish.class/instance/decrypt.with..st deleted file mode 100644 index 97dfec9..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/decrypt.with..st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -decrypt: someData with: aKeyString - - - self setRounds: self class defaultRounds . - - self blfKey: aKeyString. - ^self blfDec: someData for: someData size // 2. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/ecbDecrypt.with..st b/source/Blowfish.package/Blowfish.class/instance/ecbDecrypt.with..st deleted file mode 100644 index 540a08a..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/ecbDecrypt.with..st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -ecbDecrypt: someData with: aKeyString - - - self setRounds: self class defaultRounds . - - self blfKey: aKeyString. - ^self blfEcbDecrypt: someData for: someData size // 2. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/ecbEncrypt.with..st b/source/Blowfish.package/Blowfish.class/instance/ecbEncrypt.with..st deleted file mode 100644 index 4593c28..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/ecbEncrypt.with..st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -ecbEncrypt: someData with: aKeyString - - - self setRounds: self class defaultRounds . - - self blfKey: aKeyString. - ^self blfEcbEncrypt: someData for: someData size // 2. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/encipher.st b/source/Blowfish.package/Blowfish.class/instance/encipher.st deleted file mode 100644 index a0deb4f..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/encipher.st +++ /dev/null @@ -1,31 +0,0 @@ -as yet unclassified -encipher - | xL xR temp | - xL := xl copy. - xR := xr copy. - xL := xL bitXor: (piArray at: 1). -" index <= 2 - ifTrue: [ - Transcript - cr; - show: 'New encipher'; - cr; - show: 'Left: '; - show: xL hex greaseString ]." - (2 to: 17 by: 2) - do: [ :each | - xR := self calculateBlfRndFor: xR with: xL andPiAt: each. - xL := self calculateBlfRndFor: xL with: xR andPiAt: each + 1. -" index = 2 - ifTrue: [ - Transcript - cr; - show: 'Right: '; - show: xR hex greaseString; - cr; - show: 'Left: '; - show: xL hex greaseString. - index = 0 ] ]."]. - xR := xR bitXor: (piArray at: 18). - xl := xR. - xr := xL \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/encrypt.with..st b/source/Blowfish.package/Blowfish.class/instance/encrypt.with..st deleted file mode 100644 index 023afb6..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/encrypt.with..st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -encrypt: someData with: aKeyString - - - self setRounds: self class defaultRounds . - - self blfKey: aKeyString. - - ^self blfEnc: someData for: someData size // 2. \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/expandZeroState.st b/source/Blowfish.package/Blowfish.class/instance/expandZeroState.st deleted file mode 100644 index ca23ef6..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/expandZeroState.st +++ /dev/null @@ -1,52 +0,0 @@ -as yet unclassified -expandZeroState - | dataL dataR s0Test s1Test s2Test s3Test pTest| - current := 1. -pTest:=piArray copy. - (1 to: rounds + 2) - do: [ :each | piArray at: each put: ((piArray at: each) bitXor: (self stream2word: key)) ]. - -"xl := 16r0. -xr := 16r0." -xl:=#[0 0 0 0] unsignedLongAt: 1 bigEndian: true. -xr:=#[0 0 0 0] unsignedLongAt: 1 bigEndian: true. -pTest:=piArray copy. - (1 to: rounds + 2 by: 2) - do: [ :each | - self encipher. - piArray at: each put: xl copy. - piArray at: each+1 put: xr copy.]. - -s0Test :=s0 copy. -s1Test :=s1 copy. -s2Test :=s2 copy. -s3Test :=s3 copy. - - - - (1 to:256 by:2) - do: [ :each | self encipher. - s0 at: each put: xl copy. - s0 at: each+1 put: xr copy. - ]. - - (1 to:256 by:2) - do: [ :each | self encipher. - s1 at: each put: xl copy. - s1 at: each+1 put: xr copy.]. - - (1 to:256 by:2) - do: [ :each | self encipher. - s2 at: each put: xl copy. - s2 at: each+1 put: xr copy.]. - - (1 to:256 by:2) - do: [ :each | self encipher. - s3 at: each put: xl copy. - s3 at: each+1 put: xr copy.]. - -" s0Test:= s0 select:[:each | each asByteArray size >4]. - s1Test:= s1 select:[:each | each asByteArray size >4]. - s2Test:= s2 select:[:each | each asByteArray size >4]. - s3Test:= s3 select:[:each | each asByteArray size >4]. - (s0Test size + s1Test size + s2Test size + s3Test size) >0 ifTrue:[self halt]." \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/feistelWith..st b/source/Blowfish.package/Blowfish.class/instance/feistelWith..st deleted file mode 100644 index f8bd371..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/feistelWith..st +++ /dev/null @@ -1,11 +0,0 @@ -as yet unclassified -feistelWith: otherHalf - | a b c d y byteArray | - a := ((otherHalf bitShift: -24) bitAnd: 16rff) + 1. - b := ((otherHalf bitShift: -16) bitAnd: 16rff) + 1. - c := ((otherHalf bitShift: -8) bitAnd: 16rff) + 1. - d := (otherHalf bitAnd: 16rff) + 1. - y := ((s0 at: a) + (s1 at: b)) \\ 4294967296. " (2 raisedTo: 32)" - y := y bitXor: (s2 at: c). - y := (y + (s3 at: d)) \\ 4294967296. "(2 raisedTo: 32)" - ^ y \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/initializeBoxes.st b/source/Blowfish.package/Blowfish.class/instance/initializeBoxes.st deleted file mode 100644 index 6c8b11c..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/initializeBoxes.st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -initializeBoxes - piArray :=self class pBox copy. - s0:=self class s0Box copy. - s1:=self class s1Box copy. - s2:=self class s2Box copy. - s3:=self class s3Box copy. - - - \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/setRounds..st b/source/Blowfish.package/Blowfish.class/instance/setRounds..st deleted file mode 100644 index 4255967..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/setRounds..st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -setRounds: anInteger - - rounds:=(anInteger >= self class minRounds and:[anInteger <= self class maxRounds]) ifTrue: [anInteger] ifFalse:[self class defaultRounds ] \ No newline at end of file diff --git a/source/Blowfish.package/Blowfish.class/instance/stream2word..st b/source/Blowfish.package/Blowfish.class/instance/stream2word..st deleted file mode 100644 index 58d468f..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/stream2word..st +++ /dev/null @@ -1,18 +0,0 @@ -as yet unclassified -stream2word: someData - - -|temp j dataBytes | -temp:=0. - -dataBytes := someData size. - -1 to: 4 do: [ :each | - temp:=(temp bitShift: 8 ) bitOr: ((someData at: current) bitAnd: 16rFF). - - current := (current \\ dataBytes) +1. - - ]. - - -^temp. diff --git a/source/Blowfish.package/Blowfish.class/instance/stream2word.length..st b/source/Blowfish.package/Blowfish.class/instance/stream2word.length..st deleted file mode 100644 index 720829c..0000000 --- a/source/Blowfish.package/Blowfish.class/instance/stream2word.length..st +++ /dev/null @@ -1,18 +0,0 @@ -as yet unclassified -stream2word: someData length: someBytes - - -|temp j | -temp:=0. - - - -1 to: 4 do: [ :each | - temp:=(temp bitShift: 8 ) bitOr: ((someData atWrap: current) bitAnd: 16rFF). - - current := (current \\ someBytes) +1. - - ]. - - -^temp. diff --git a/source/Blowfish.package/Blowfish.class/properties.json b/source/Blowfish.package/Blowfish.class/properties.json deleted file mode 100644 index b86dca8..0000000 --- a/source/Blowfish.package/Blowfish.class/properties.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "commentStamp" : "PaulDeBruicker 4/21/2011 12:00", - "super" : "Object", - "category" : "Blowfish", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "rounds", - "piArray", - "s0", - "s1", - "s2", - "s3", - "xl", - "xr", - "current", - "key", - "data", - "index" - ], - "name" : "Blowfish", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/README.md b/source/Blowfish.package/BlowfishProfiling.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Blowfish.package/BlowfishProfiling.class/class/longTest.st b/source/Blowfish.package/BlowfishProfiling.class/class/longTest.st deleted file mode 100644 index b895e52..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/class/longTest.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -longTest - \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/instance/initialize.st b/source/Blowfish.package/BlowfishProfiling.class/instance/initialize.st deleted file mode 100644 index 9552b41..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/instance/initialize.st +++ /dev/null @@ -1,7 +0,0 @@ -as yet unclassified -initialize - super initialize. - self - initializeClear; - initializeEncrypted; - initializeKeys \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/instance/initializeClear.st b/source/Blowfish.package/BlowfishProfiling.class/instance/initializeClear.st deleted file mode 100644 index 9de8cf9..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/instance/initializeClear.st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -initializeClear - | tmpClear | - clear := OrderedCollection new. - tmpClear := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '1000000000000001' '1111111111111111' '1111111111111111' '0123456789ABCDEF' '0000000000000000' '0123456789ABCDEF' '01A1D6D039776742' '5CD54CA83DEF57DA' '0248D43806F67172' '51454B582DDF440A' '42FD443059577FA2' '059B5E0851CF143A' '0756D8E0774761D2' '762514B829BF486A' '3BDD119049372802' '26955F6835AF609A' '164D5E404F275232' '6B056E18759F5CCA' '004BD6EF09176062' '480D39006EE762F2' '437540C8698F3CFA' '072D43A077075292' '02FE55778117F12A' '1D9D5C5018F728C2' '305532286D6F295A' '0123456789ABCDEF' '0123456789ABCDEF' '0123456789ABCDEF' 'FFFFFFFFFFFFFFFF' '0000000000000000' '0000000000000000' 'FFFFFFFFFFFFFFFF'). - tmpClear - do: [ :each | - | array tmpByteArray | - array := WordArray new: 2. - array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). - array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). - clear add: array ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/instance/initializeEncrypted.st b/source/Blowfish.package/BlowfishProfiling.class/instance/initializeEncrypted.st deleted file mode 100644 index 4002c75..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/instance/initializeEncrypted.st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -initializeEncrypted - | tmpEncrypted | - encrypted := OrderedCollection new. - tmpEncrypted := #('4EF997456198DD78' '51866FD5B85ECB8A' '7D856F9A613063F2' '2466DD878B963C9D' '61F9C3802281B096' '7D0CC630AFDA1EC7' '4EF997456198DD78' '0ACEAB0FC6A0A28D' '59C68245EB05282B' 'B1B8CC0B250F09A0' '1730E5778BEA1DA4' 'A25E7856CF2651EB' '353882B109CE8F1A' '48F4D0884C379918' '432193B78951FC98' '13F04154D69D1AE5' '2EEDDA93FFD39C79' 'D887E0393C2DA6E3' '5F99D04F5B163969' '4A057A3B24D3977B' '452031C1E4FADA8E' '7555AE39F59B87BD' '53C55F9CB49FC019' '7A8E7BFA937E89A3' 'CF9C5D7A4986ADB5' 'D1ABB290658BC778' '55CB3774D13EF201' 'FA34EC4847B268B2' 'A790795108EA3CAE' 'C39E072D9FAC631D' '014933E0CDAFF6E4' 'F21E9A77B71C49BC' '245946885754369A' '6B5C5A9C5D9E0A5A'). - tmpEncrypted - do: [ :each | - | array tmpByteArray | - array := WordArray new: 2. - array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). - array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). - encrypted add: array ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/instance/initializeKeys.st b/source/Blowfish.package/BlowfishProfiling.class/instance/initializeKeys.st deleted file mode 100644 index 5a6af39..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/instance/initializeKeys.st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -initializeKeys - | tempKeys | - keys := OrderedCollection new. - tempKeys := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '3000000000000000' '1111111111111111' '0123456789ABCDEF' '1111111111111111' '0000000000000000' 'FEDCBA9876543210' '7CA110454A1A6E57' '0131D9619DC1376E' '07A1133E4A0B2686' '3849674C2602319E' '04B915BA43FEB5B6' '0113B970FD34F2CE' '0170F175468FB5E6' '43297FAD38E373FE' '07A7137045DA2A16' '04689104C2FD3B2F' '37D06BB516CB7546' '1F08260D1AC2465E' '584023641ABA6176' '025816164629B007' '49793EBC79B3258F' '4FB05E1515AB73A7' '49E95D6D4CA229BF' '018310DC409B26D6' '1C587F1C13924FEF' '0101010101010101' '1F1F1F1F0E0E0E0E' 'E0FEE0FEF1FEF1FE' '0000000000000000' 'FFFFFFFFFFFFFFFF' '0123456789ABCDEF' 'FEDCBA9876543210'). - tempKeys do: [ :each | keys add: (ByteArray fromHexString: each) ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/instance/longDecryptionTest.st b/source/Blowfish.package/BlowfishProfiling.class/instance/longDecryptionTest.st deleted file mode 100644 index 6783129..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/instance/longDecryptionTest.st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -longDecryptionTest - (1 to: keys size) - do: [ :each | - | key clearText cipherText enc | - key := keys at: each. - clearText := clear at: each. - cipherText := encrypted at: each. - enc := Blowfish decrypt: cipherText with: key ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/instance/longEncryptionTest.st b/source/Blowfish.package/BlowfishProfiling.class/instance/longEncryptionTest.st deleted file mode 100644 index 367c739..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/instance/longEncryptionTest.st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -longEncryptionTest - (1 to: keys size) - do: [ :each | - | key clearText cipherText enc | - key := keys at: each. - clearText := clear at: each. - cipherText := encrypted at: each. - enc := Blowfish encrypt: clearText with: key ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishProfiling.class/properties.json b/source/Blowfish.package/BlowfishProfiling.class/properties.json deleted file mode 100644 index 97b5ce3..0000000 --- a/source/Blowfish.package/BlowfishProfiling.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Blowfish", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "keys", - "clear", - "encrypted" - ], - "name" : "BlowfishProfiling", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/README.md b/source/Blowfish.package/BlowfishTests.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Blowfish.package/BlowfishTests.class/instance/setUp.st b/source/Blowfish.package/BlowfishTests.class/instance/setUp.st deleted file mode 100644 index 82acd6e..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/setUp.st +++ /dev/null @@ -1,28 +0,0 @@ -as yet unclassified -setUp - "this data is from here: http://www.schneier.com/code/vectors.txt" - - | tmpKeys tmpClear tmpEncrypted | - keys := OrderedCollection new. - clear := OrderedCollection new. - encrypted := OrderedCollection new. - tmpKeys := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '3000000000000000' '1111111111111111' '0123456789ABCDEF' '1111111111111111' '0000000000000000' 'FEDCBA9876543210' '7CA110454A1A6E57' '0131D9619DC1376E' '07A1133E4A0B2686' '3849674C2602319E' '04B915BA43FEB5B6' '0113B970FD34F2CE' '0170F175468FB5E6' '43297FAD38E373FE' '07A7137045DA2A16' '04689104C2FD3B2F' '37D06BB516CB7546' '1F08260D1AC2465E' '584023641ABA6176' '025816164629B007' '49793EBC79B3258F' '4FB05E1515AB73A7' '49E95D6D4CA229BF' '018310DC409B26D6' '1C587F1C13924FEF' '0101010101010101' '1F1F1F1F0E0E0E0E' 'E0FEE0FEF1FEF1FE' '0000000000000000' 'FFFFFFFFFFFFFFFF' '0123456789ABCDEF' 'FEDCBA9876543210'). - tmpClear := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '1000000000000001' '1111111111111111' '1111111111111111' '0123456789ABCDEF' '0000000000000000' '0123456789ABCDEF' '01A1D6D039776742' '5CD54CA83DEF57DA' '0248D43806F67172' '51454B582DDF440A' '42FD443059577FA2' '059B5E0851CF143A' '0756D8E0774761D2' '762514B829BF486A' '3BDD119049372802' '26955F6835AF609A' '164D5E404F275232' '6B056E18759F5CCA' '004BD6EF09176062' '480D39006EE762F2' '437540C8698F3CFA' '072D43A077075292' '02FE55778117F12A' '1D9D5C5018F728C2' '305532286D6F295A' '0123456789ABCDEF' '0123456789ABCDEF' '0123456789ABCDEF' 'FFFFFFFFFFFFFFFF' '0000000000000000' '0000000000000000' 'FFFFFFFFFFFFFFFF'). - tmpEncrypted := #('4EF997456198DD78' '51866FD5B85ECB8A' '7D856F9A613063F2' '2466DD878B963C9D' '61F9C3802281B096' '7D0CC630AFDA1EC7' '4EF997456198DD78' '0ACEAB0FC6A0A28D' '59C68245EB05282B' 'B1B8CC0B250F09A0' '1730E5778BEA1DA4' 'A25E7856CF2651EB' '353882B109CE8F1A' '48F4D0884C379918' '432193B78951FC98' '13F04154D69D1AE5' '2EEDDA93FFD39C79' 'D887E0393C2DA6E3' '5F99D04F5B163969' '4A057A3B24D3977B' '452031C1E4FADA8E' '7555AE39F59B87BD' '53C55F9CB49FC019' '7A8E7BFA937E89A3' 'CF9C5D7A4986ADB5' 'D1ABB290658BC778' '55CB3774D13EF201' 'FA34EC4847B268B2' 'A790795108EA3CAE' 'C39E072D9FAC631D' '014933E0CDAFF6E4' 'F21E9A77B71C49BC' '245946885754369A' '6B5C5A9C5D9E0A5A'). - - "keys:=tmpKeys. " - tmpKeys do: [ :each | keys add: (ByteArray fromHexString: each) ]. - tmpClear - do: [ :each | - | array tmpByteArray | - array := WordArray new: 2. - array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). - array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). - clear add: array ]. - tmpEncrypted - do: [ :each | - | array tmpByteArray | - array := WordArray new: 2. - array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). - array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). - encrypted add: array ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testDecryption.st b/source/Blowfish.package/BlowfishTests.class/instance/testDecryption.st deleted file mode 100644 index 495f40f..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testDecryption.st +++ /dev/null @@ -1,11 +0,0 @@ -as yet unclassified -testDecryption -|key data res| -key:='abcdefghijklmnopqrstuvwxyz'. -data:=WordArray new: 2. -#(16r324ed0fe 16rf413a203) doWithIndex: [:each :i | data at: i put: ((each asByteArray) unsignedLongAt: 1 bigEndian:true) ]. -res:=(Blowfish decrypt: data with: key asByteArray ). - - -self assert:((res at: 1) = 1112297303). "16r424c4f571" -self assert:((res at: 2) = 1179210568)."16r46495348" \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testEcbDecrypt.st b/source/Blowfish.package/BlowfishTests.class/instance/testEcbDecrypt.st deleted file mode 100644 index f8aa8d5..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testEcbDecrypt.st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -testEcbDecrypt - |key cl enc res | -key:=ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. -cl := ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. -enc :=ByteArray fromHexString: '51866FD5B85ECB8A' . -res:=(Blowfish ecbDecrypt: enc with: key ). -self assert: (res = cl). \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testEcbEncrypt.st b/source/Blowfish.package/BlowfishTests.class/instance/testEcbEncrypt.st deleted file mode 100644 index de88d01..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testEcbEncrypt.st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -testEcbEncrypt - |key cl enc res | -key:=ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. -cl := ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. -enc :=ByteArray fromHexString: '51866FD5B85ECB8A' . -res:=(Blowfish ecbEncrypt: cl with: key ) . - -self assert: (res= enc). \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testEncryptDecrypt.st b/source/Blowfish.package/BlowfishTests.class/instance/testEncryptDecrypt.st deleted file mode 100644 index 80186a0..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testEncryptDecrypt.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -testEncryptDecrypt - -self assert:((Blowfish decryptToString: (Blowfish encryptString: '0123456789' with: 'AAAAA' ) with:'AAAAA' )='0123456789') \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testEncryption.st b/source/Blowfish.package/BlowfishTests.class/instance/testEncryption.st deleted file mode 100644 index 74416c6..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testEncryption.st +++ /dev/null @@ -1,11 +0,0 @@ -as yet unclassified -testEncryption -|key data res| -key:='abcdefghijklmnopqrstuvwxyz'. -data:=WordArray new: 2. -#(16r424c4f57 16r46495348) doWithIndex: [:each :i | data at: i put: ((each asByteArray) unsignedLongAt: 1 bigEndian:true) ]. -res:=(Blowfish encrypt: data with: key asByteArray). - - -self assert:((res at: 1) = 844026110). "16r324ed0fe" -self assert:((res at: 2) = 4094927363)."16rf413a203" \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testLongDecryptionTest.st b/source/Blowfish.package/BlowfishTests.class/instance/testLongDecryptionTest.st deleted file mode 100644 index ccc79b7..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testLongDecryptionTest.st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -testLongDecryptionTest - -(1 to: keys size) do:[:each | |key clearText cipherText enc| - key:= keys at: each. - clearText:=clear at: each. - cipherText:=encrypted at: each. - enc:=Blowfish decrypt: cipherText with: key. - self assert: (enc = clearText asArray ) - ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/instance/testLongEncryptionTest.st b/source/Blowfish.package/BlowfishTests.class/instance/testLongEncryptionTest.st deleted file mode 100644 index 14c5e8c..0000000 --- a/source/Blowfish.package/BlowfishTests.class/instance/testLongEncryptionTest.st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -testLongEncryptionTest - -(1 to: keys size) do:[:each | |key clearText cipherText enc| - key:= keys at: each. - clearText:=clear at: each. - cipherText:=encrypted at: each. - enc:=Blowfish encrypt: clearText with: key. - self assert: (enc = cipherText ) - ] \ No newline at end of file diff --git a/source/Blowfish.package/BlowfishTests.class/properties.json b/source/Blowfish.package/BlowfishTests.class/properties.json deleted file mode 100644 index 162a6b2..0000000 --- a/source/Blowfish.package/BlowfishTests.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Blowfish", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "keys", - "clear", - "encrypted" - ], - "name" : "BlowfishTests", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Blowfish.package/ByteArray.extension/class/fromHexString..st b/source/Blowfish.package/ByteArray.extension/class/fromHexString..st deleted file mode 100644 index a7c8bca..0000000 --- a/source/Blowfish.package/ByteArray.extension/class/fromHexString..st +++ /dev/null @@ -1,3 +0,0 @@ -*blowfish -fromHexString: aString - ^ self readHexFrom: aString \ No newline at end of file diff --git a/source/Blowfish.package/ByteArray.extension/properties.json b/source/Blowfish.package/ByteArray.extension/properties.json deleted file mode 100644 index f81bcb8..0000000 --- a/source/Blowfish.package/ByteArray.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "ByteArray" -} \ No newline at end of file diff --git a/source/Blowfish.package/monticello.meta/categories.st b/source/Blowfish.package/monticello.meta/categories.st deleted file mode 100644 index 863b22c..0000000 --- a/source/Blowfish.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #Blowfish! diff --git a/source/Blowfish.package/monticello.meta/initializers.st b/source/Blowfish.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/Blowfish.package/monticello.meta/package b/source/Blowfish.package/monticello.meta/package deleted file mode 100644 index c0c1adc..0000000 --- a/source/Blowfish.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'Blowfish') \ No newline at end of file diff --git a/source/Blowfish.package/properties.json b/source/Blowfish.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/Blowfish.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/Blowfish/Blowfish.class.st b/source/Blowfish/Blowfish.class.st new file mode 100644 index 0000000..76db629 --- /dev/null +++ b/source/Blowfish/Blowfish.class.st @@ -0,0 +1,709 @@ +" +This is just enough of the Blowfish algorithm from +http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libc/crypt/blowfish.c + +to be able to run BCrypt. + + +Instance Variables: + rounds + piArray + s0 + s1 + s2 + s3 + s4 + xl + xr + current + key + data +" +Class { + #name : #Blowfish, + #superclass : #Object, + #instVars : [ + 'rounds', + 'piArray', + 's0', + 's1', + 's2', + 's3', + 'xl', + 'xr', + 'current', + 'key', + 'data', + 'index' + ], + #category : 'Blowfish' +} + +{ #category : #defaults } +Blowfish class >> blockSize [ + ^8 +] + +{ #category : #decrypt } +Blowfish class >> decrypt: someData with: aKeyByteArray [ +"use this when you have a wordArray" + ^self new decrypt: someData with: aKeyByteArray. +] + +{ #category : #decrypt } +Blowfish class >> decryptString: aString with: aKey [ + |decryptedData | + decryptedData := (self new ecbDecrypt: aString asByteArray with: aKey asByteArray ). + ^String fromByteArray: decryptedData asByteArray . +] + +{ #category : #decrypt } +Blowfish class >> decryptToString: someData with: aKey [ +|decryptedData | +decryptedData := (self new ecbDecrypt: someData with: aKey asByteArray ). + ^String fromByteArray: decryptedData asByteArray . +] + +{ #category : #defaults } +Blowfish class >> defaultRounds [ +^self minRounds +] + +{ #category : #encrypt } +Blowfish class >> ecbDecrypt: someData with: aKey [ +"use this when you have a byteArray" + ^self new ecbDecrypt: someData with: aKey. +] + +{ #category : #encrypt } +Blowfish class >> ecbEncrypt: someData with: aKey [ +"use this when you have a byteArray" + ^self new ecbEncrypt: someData with: aKey. +] + +{ #category : #encrypt } +Blowfish class >> encrypt: someData with: aKey [ +"use this when you have a wordArray" + ^self new encrypt: someData with: aKey. +] + +{ #category : #encrypt } +Blowfish class >> encryptString: someData with: aKeyString [ +"use this with a string" +|dataToEncrypt | +dataToEncrypt :=OrderedCollection new. +someData do:[:each | dataToEncrypt add: each asciiValue ]. + ^self new ecbEncrypt: dataToEncrypt asArray with: aKeyString asByteArray . +] + +{ #category : #defaults } +Blowfish class >> maxRounds [ +^20 + +] + +{ #category : #defaults } +Blowfish class >> maxUserKeyLength [ + ^448/8 +] + +{ #category : #defaults } +Blowfish class >> minRounds [ +^16 +] + +{ #category : #defaults } +Blowfish class >> pBox [ + ^#( 16r243F6A88 16r85A308D3 16r13198A2E 16r03707344 16rA4093822 16r299F31D0 + 16r082EFA98 16rEC4E6C89 16r452821E6 16r38D01377 16rBE5466CF 16r34E90C6C + 16rC0AC29B7 16rC97C50DD 16r3F84D5B5 16rB5470917 16r9216D5D9 16r8979FB1B) +] + +{ #category : #defaults } +Blowfish class >> s0Box [ + ^#(16rD1310BA6 16r98DFB5AC 16r2FFD72DB 16rD01ADFB7 + 16rB8E1AFED 16r6A267E96 16rBA7C9045 16rF12C7F99 + 16r24A19947 16rB3916CF7 16r0801F2E2 16r858EFC16 + 16r636920D8 16r71574E69 16rA458FEA3 16rF4933D7E + 16r0D95748F 16r728EB658 16r718BCD58 16r82154AEE + 16r7B54A41D 16rC25A59B5 16r9C30D539 16r2AF26013 + 16rC5D1B023 16r286085F0 16rCA417918 16rB8DB38EF + 16r8E79DCB0 16r603A180E 16r6C9E0E8B 16rB01E8A3E + 16rD71577C1 16rBD314B27 16r78AF2FDA 16r55605C60 + 16rE65525F3 16rAA55AB94 16r57489862 16r63E81440 + 16r55CA396A 16r2AAB10B6 16rB4CC5C34 16r1141E8CE + 16rA15486AF 16r7C72E993 16rB3EE1411 16r636FBC2A + 16r2BA9C55D 16r741831F6 16rCE5C3E16 16r9B87931E + 16rAFD6BA33 16r6C24CF5C 16r7A325381 16r28958677 + 16r3B8F4898 16r6B4BB9AF 16rC4BFE81B 16r66282193 + 16r61D809CC 16rFB21A991 16r487CAC60 16r5DEC8032 + 16rEF845D5D 16rE98575B1 16rDC262302 16rEB651B88 + 16r23893E81 16rD396ACC5 16r0F6D6FF3 16r83F44239 + 16r2E0B4482 16rA4842004 16r69C8F04A 16r9E1F9B5E + 16r21C66842 16rF6E96C9A 16r670C9C61 16rABD388F0 + 16r6A51A0D2 16rD8542F68 16r960FA728 16rAB5133A3 + 16r6EEF0B6C 16r137A3BE4 16rBA3BF050 16r7EFB2A98 + 16rA1F1651D 16r39AF0176 16r66CA593E 16r82430E88 + 16r8CEE8619 16r456F9FB4 16r7D84A5C3 16r3B8B5EBE + 16rE06F75D8 16r85C12073 16r401A449F 16r56C16AA6 + 16r4ED3AA62 16r363F7706 16r1BFEDF72 16r429B023D + 16r37D0D724 16rD00A1248 16rDB0FEAD3 16r49F1C09B + 16r075372C9 16r80991B7B 16r25D479D8 16rF6E8DEF7 + 16rE3FE501A 16rB6794C3B 16r976CE0BD 16r04C006BA + 16rC1A94FB6 16r409F60C4 16r5E5C9EC2 16r196A2463 + 16r68FB6FAF 16r3E6C53B5 16r1339B2EB 16r3B52EC6F + 16r6DFC511F 16r9B30952C 16rCC814544 16rAF5EBD09 + 16rBEE3D004 16rDE334AFD 16r660F2807 16r192E4BB3 + 16rC0CBA857 16r45C8740F 16rD20B5F39 16rB9D3FBDB + 16r5579C0BD 16r1A60320A 16rD6A100C6 16r402C7279 + 16r679F25FE 16rFB1FA3CC 16r8EA5E9F8 16rDB3222F8 + 16r3C7516DF 16rFD616B15 16r2F501EC8 16rAD0552AB + 16r323DB5FA 16rFD238760 16r53317B48 16r3E00DF82 + 16r9E5C57BB 16rCA6F8CA0 16r1A87562E 16rDF1769DB + 16rD542A8F6 16r287EFFC3 16rAC6732C6 16r8C4F5573 + 16r695B27B0 16rBBCA58C8 16rE1FFA35D 16rB8F011A0 + 16r10FA3D98 16rFD2183B8 16r4AFCB56C 16r2DD1D35B + 16r9A53E479 16rB6F84565 16rD28E49BC 16r4BFB9790 + 16rE1DDF2DA 16rA4CB7E33 16r62FB1341 16rCEE4C6E8 + 16rEF20CADA 16r36774C01 16rD07E9EFE 16r2BF11FB4 + 16r95DBDA4D 16rAE909198 16rEAAD8E71 16r6B93D5A0 + 16rD08ED1D0 16rAFC725E0 16r8E3C5B2F 16r8E7594B7 + 16r8FF6E2FB 16rF2122B64 16r8888B812 16r900DF01C + 16r4FAD5EA0 16r688FC31C 16rD1CFF191 16rB3A8C1AD + 16r2F2F2218 16rBE0E1777 16rEA752DFE 16r8B021FA1 + 16rE5A0CC0F 16rB56F74E8 16r18ACF3D6 16rCE89E299 + 16rB4A84FE0 16rFD13E0B7 16r7CC43B81 16rD2ADA8D9 + 16r165FA266 16r80957705 16r93CC7314 16r211A1477 + 16rE6AD2065 16r77B5FA86 16rC75442F5 16rFB9D35CF + 16rEBCDAF0C 16r7B3E89A0 16rD6411BD3 16rAE1E7E49 + 16r00250E2D 16r2071B35E 16r226800BB 16r57B8E0AF + 16r2464369B 16rF009B91E 16r5563911D 16r59DFA6AA + 16r78C14389 16rD95A537F 16r207D5BA2 16r02E5B9C5 + 16r83260376 16r6295CFA9 16r11C81968 16r4E734A41 + 16rB3472DCA 16r7B14A94A 16r1B510052 16r9A532915 + 16rD60F573F 16rBC9BC6E4 16r2B60A476 16r81E67400 + 16r08BA6FB5 16r571BE91F 16rF296EC6B 16r2A0DD915 + 16rB6636521 16rE7B9F9B6 16rFF34052E 16rC5855664 + 16r53B02D5D 16rA99F8FA1 16r08BA4799 16r6E85076A ) +] + +{ #category : #defaults } +Blowfish class >> s1Box [ + ^#(16r4B7A70E9 16rB5B32944 16rDB75092E 16rC4192623 + 16rAD6EA6B0 16r49A7DF7D 16r9CEE60B8 16r8FEDB266 + 16rECAA8C71 16r699A17FF 16r5664526C 16rC2B19EE1 + 16r193602A5 16r75094C29 16rA0591340 16rE4183A3E + 16r3F54989A 16r5B429D65 16r6B8FE4D6 16r99F73FD6 + 16rA1D29C07 16rEFE830F5 16r4D2D38E6 16rF0255DC1 + 16r4CDD2086 16r8470EB26 16r6382E9C6 16r021ECC5E + 16r09686B3F 16r3EBAEFC9 16r3C971814 16r6B6A70A1 + 16r687F3584 16r52A0E286 16rB79C5305 16rAA500737 + 16r3E07841C 16r7FDEAE5C 16r8E7D44EC 16r5716F2B8 + 16rB03ADA37 16rF0500C0D 16rF01C1F04 16r0200B3FF + 16rAE0CF51A 16r3CB574B2 16r25837A58 16rDC0921BD + 16rD19113F9 16r7CA92FF6 16r94324773 16r22F54701 + 16r3AE5E581 16r37C2DADC 16rC8B57634 16r9AF3DDA7 + 16rA9446146 16r0FD0030E 16rECC8C73E 16rA4751E41 + 16rE238CD99 16r3BEA0E2F 16r3280BBA1 16r183EB331 + 16r4E548B38 16r4F6DB908 16r6F420D03 16rF60A04BF + 16r2CB81290 16r24977C79 16r5679B072 16rBCAF89AF + 16rDE9A771F 16rD9930810 16rB38BAE12 16rDCCF3F2E + 16r5512721F 16r2E6B7124 16r501ADDE6 16r9F84CD87 + 16r7A584718 16r7408DA17 16rBC9F9ABC 16rE94B7D8C + 16rEC7AEC3A 16rDB851DFA 16r63094366 16rC464C3D2 + 16rEF1C1847 16r3215D908 16rDD433B37 16r24C2BA16 + 16r12A14D43 16r2A65C451 16r50940002 16r133AE4DD + 16r71DFF89E 16r10314E55 16r81AC77D6 16r5F11199B + 16r043556F1 16rD7A3C76B 16r3C11183B 16r5924A509 + 16rF28FE6ED 16r97F1FBFA 16r9EBABF2C 16r1E153C6E + 16r86E34570 16rEAE96FB1 16r860E5E0A 16r5A3E2AB3 + 16r771FE71C 16r4E3D06FA 16r2965DCB9 16r99E71D0F + 16r803E89D6 16r5266C825 16r2E4CC978 16r9C10B36A + 16rC6150EBA 16r94E2EA78 16rA5FC3C53 16r1E0A2DF4 + 16rF2F74EA7 16r361D2B3D 16r1939260F 16r19C27960 + 16r5223A708 16rF71312B6 16rEBADFE6E 16rEAC31F66 + 16rE3BC4595 16rA67BC883 16rB17F37D1 16r018CFF28 + 16rC332DDEF 16rBE6C5AA5 16r65582185 16r68AB9802 + 16rEECEA50F 16rDB2F953B 16r2AEF7DAD 16r5B6E2F84 + 16r1521B628 16r29076170 16rECDD4775 16r619F1510 + 16r13CCA830 16rEB61BD96 16r0334FE1E 16rAA0363CF + 16rB5735C90 16r4C70A239 16rD59E9E0B 16rCBAADE14 + 16rEECC86BC 16r60622CA7 16r9CAB5CAB 16rB2F3846E + 16r648B1EAF 16r19BDF0CA 16rA02369B9 16r655ABB50 + 16r40685A32 16r3C2AB4B3 16r319EE9D5 16rC021B8F7 + 16r9B540B19 16r875FA099 16r95F7997E 16r623D7DA8 + 16rF837889A 16r97E32D77 16r11ED935F 16r16681281 + 16r0E358829 16rC7E61FD6 16r96DEDFA1 16r7858BA99 + 16r57F584A5 16r1B227263 16r9B83C3FF 16r1AC24696 + 16rCDB30AEB 16r532E3054 16r8FD948E4 16r6DBC3128 + 16r58EBF2EF 16r34C6FFEA 16rFE28ED61 16rEE7C3C73 + 16r5D4A14D9 16rE864B7E3 16r42105D14 16r203E13E0 + 16r45EEE2B6 16rA3AAABEA 16rDB6C4F15 16rFACB4FD0 + 16rC742F442 16rEF6ABBB5 16r654F3B1D 16r41CD2105 + 16rD81E799E 16r86854DC7 16rE44B476A 16r3D816250 + 16rCF62A1F2 16r5B8D2646 16rFC8883A0 16rC1C7B6A3 + 16r7F1524C3 16r69CB7492 16r47848A0B 16r5692B285 + 16r095BBF00 16rAD19489D 16r1462B174 16r23820E00 + 16r58428D2A 16r0C55F5EA 16r1DADF43E 16r233F7061 + 16r3372F092 16r8D937E41 16rD65FECF1 16r6C223BDB + 16r7CDE3759 16rCBEE7460 16r4085F2A7 16rCE77326E + 16rA6078084 16r19F8509E 16rE8EFD855 16r61D99735 + 16rA969A7AA 16rC50C06C2 16r5A04ABFC 16r800BCADC + 16r9E447A2E 16rC3453484 16rFDD56705 16r0E1E9EC9 + 16rDB73DBD3 16r105588CD 16r675FDA79 16rE3674340 + 16rC5C43465 16r713E38D8 16r3D28F89E 16rF16DFF20 + 16r153E21E7 16r8FB03D4A 16rE6E39F2B 16rDB83ADF7) +] + +{ #category : #defaults } +Blowfish class >> s2Box [ + ^#(16rE93D5A68 16r948140F7 16rF64C261C 16r94692934 + 16r411520F7 16r7602D4F7 16rBCF46B2E 16rD4A20068 + 16rD4082471 16r3320F46A 16r43B7D4B7 16r500061AF + 16r1E39F62E 16r97244546 16r14214F74 16rBF8B8840 + 16r4D95FC1D 16r96B591AF 16r70F4DDD3 16r66A02F45 + 16rBFBC09EC 16r03BD9785 16r7FAC6DD0 16r31CB8504 + 16r96EB27B3 16r55FD3941 16rDA2547E6 16rABCA0A9A + 16r28507825 16r530429F4 16r0A2C86DA 16rE9B66DFB + 16r68DC1462 16rD7486900 16r680EC0A4 16r27A18DEE + 16r4F3FFEA2 16rE887AD8C 16rB58CE006 16r7AF4D6B6 + 16rAACE1E7C 16rD3375FEC 16rCE78A399 16r406B2A42 + 16r20FE9E35 16rD9F385B9 16rEE39D7AB 16r3B124E8B + 16r1DC9FAF7 16r4B6D1856 16r26A36631 16rEAE397B2 + 16r3A6EFA74 16rDD5B4332 16r6841E7F7 16rCA7820FB + 16rFB0AF54E 16rD8FEB397 16r454056AC 16rBA489527 + 16r55533A3A 16r20838D87 16rFE6BA9B7 16rD096954B + 16r55A867BC 16rA1159A58 16rCCA92963 16r99E1DB33 + 16rA62A4A56 16r3F3125F9 16r5EF47E1C 16r9029317C + 16rFDF8E802 16r04272F70 16r80BB155C 16r05282CE3 + 16r95C11548 16rE4C66D22 16r48C1133F 16rC70F86DC + 16r07F9C9EE 16r41041F0F 16r404779A4 16r5D886E17 + 16r325F51EB 16rD59BC0D1 16rF2BCC18F 16r41113564 + 16r257B7834 16r602A9C60 16rDFF8E8A3 16r1F636C1B + 16r0E12B4C2 16r02E1329E 16rAF664FD1 16rCAD18115 + 16r6B2395E0 16r333E92E1 16r3B240B62 16rEEBEB922 + 16r85B2A20E 16rE6BA0D99 16rDE720C8C 16r2DA2F728 + 16rD0127845 16r95B794FD 16r647D0862 16rE7CCF5F0 + 16r5449A36F 16r877D48FA 16rC39DFD27 16rF33E8D1E + 16r0A476341 16r992EFF74 16r3A6F6EAB 16rF4F8FD37 + 16rA812DC60 16rA1EBDDF8 16r991BE14C 16rDB6E6B0D + 16rC67B5510 16r6D672C37 16r2765D43B 16rDCD0E804 + 16rF1290DC7 16rCC00FFA3 16rB5390F92 16r690FED0B + 16r667B9FFB 16rCEDB7D9C 16rA091CF0B 16rD9155EA3 + 16rBB132F88 16r515BAD24 16r7B9479BF 16r763BD6EB + 16r37392EB3 16rCC115979 16r8026E297 16rF42E312D + 16r6842ADA7 16rC66A2B3B 16r12754CCC 16r782EF11C + 16r6A124237 16rB79251E7 16r06A1BBE6 16r4BFB6350 + 16r1A6B1018 16r11CAEDFA 16r3D25BDD8 16rE2E1C3C9 + 16r44421659 16r0A121386 16rD90CEC6E 16rD5ABEA2A + 16r64AF674E 16rDA86A85F 16rBEBFE988 16r64E4C3FE + 16r9DBC8057 16rF0F7C086 16r60787BF8 16r6003604D + 16rD1FD8346 16rF6381FB0 16r7745AE04 16rD736FCCC + 16r83426B33 16rF01EAB71 16rB0804187 16r3C005E5F + 16r77A057BE 16rBDE8AE24 16r55464299 16rBF582E61 + 16r4E58F48F 16rF2DDFDA2 16rF474EF38 16r8789BDC2 + 16r5366F9C3 16rC8B38E74 16rB475F255 16r46FCD9B9 + 16r7AEB2661 16r8B1DDF84 16r846A0E79 16r915F95E2 + 16r466E598E 16r20B45770 16r8CD55591 16rC902DE4C + 16rB90BACE1 16rBB8205D0 16r11A86248 16r7574A99E + 16rB77F19B6 16rE0A9DC09 16r662D09A1 16rC4324633 + 16rE85A1F02 16r09F0BE8C 16r4A99A025 16r1D6EFE10 + 16r1AB93D1D 16r0BA5A4DF 16rA186F20F 16r2868F169 + 16rDCB7DA83 16r573906FE 16rA1E2CE9B 16r4FCD7F52 + 16r50115E01 16rA70683FA 16rA002B5C4 16r0DE6D027 + 16r9AF88C27 16r773F8641 16rC3604C06 16r61A806B5 + 16rF0177A28 16rC0F586E0 16r006058AA 16r30DC7D62 + 16r11E69ED7 16r2338EA63 16r53C2DD94 16rC2C21634 + 16rBBCBEE56 16r90BCB6DE 16rEBFC7DA1 16rCE591D76 + 16r6F05E409 16r4B7C0188 16r39720A3D 16r7C927C24 + 16r86E3725F 16r724D9DB9 16r1AC15BB4 16rD39EB8FC + 16rED545578 16r08FCA5B5 16rD83D7CD3 16r4DAD0FC4 + 16r1E50EF5E 16rB161E6F8 16rA28514D9 16r6C51133C + 16r6FD5C7E7 16r56E14EC4 16r362ABFCE 16rDDC6C837 + 16rD79A3234 16r92638212 16r670EFA8E 16r406000E0) +] + +{ #category : #defaults } +Blowfish class >> s3Box [ + ^#(16r3A39CE37 16rD3FAF5CF 16rABC27737 16r5AC52D1B + 16r5CB0679E 16r4FA33742 16rD3822740 16r99BC9BBE + 16rD5118E9D 16rBF0F7315 16rD62D1C7E 16rC700C47B + 16rB78C1B6B 16r21A19045 16rB26EB1BE 16r6A366EB4 + 16r5748AB2F 16rBC946E79 16rC6A376D2 16r6549C2C8 + 16r530FF8EE 16r468DDE7D 16rD5730A1D 16r4CD04DC6 + 16r2939BBDB 16rA9BA4650 16rAC9526E8 16rBE5EE304 + 16rA1FAD5F0 16r6A2D519A 16r63EF8CE2 16r9A86EE22 + 16rC089C2B8 16r43242EF6 16rA51E03AA 16r9CF2D0A4 + 16r83C061BA 16r9BE96A4D 16r8FE51550 16rBA645BD6 + 16r2826A2F9 16rA73A3AE1 16r4BA99586 16rEF5562E9 + 16rC72FEFD3 16rF752F7DA 16r3F046F69 16r77FA0A59 + 16r80E4A915 16r87B08601 16r9B09E6AD 16r3B3EE593 + 16rE990FD5A 16r9E34D797 16r2CF0B7D9 16r022B8B51 + 16r96D5AC3A 16r017DA67D 16rD1CF3ED6 16r7C7D2D28 + 16r1F9F25CF 16rADF2B89B 16r5AD6B472 16r5A88F54C + 16rE029AC71 16rE019A5E6 16r47B0ACFD 16rED93FA9B + 16rE8D3C48D 16r283B57CC 16rF8D56629 16r79132E28 + 16r785F0191 16rED756055 16rF7960E44 16rE3D35E8C + 16r15056DD4 16r88F46DBA 16r03A16125 16r0564F0BD + 16rC3EB9E15 16r3C9057A2 16r97271AEC 16rA93A072A + 16r1B3F6D9B 16r1E6321F5 16rF59C66FB 16r26DCF319 + 16r7533D928 16rB155FDF5 16r03563482 16r8ABA3CBB + 16r28517711 16rC20AD9F8 16rABCC5167 16rCCAD925F + 16r4DE81751 16r3830DC8E 16r379D5862 16r9320F991 + 16rEA7A90C2 16rFB3E7BCE 16r5121CE64 16r774FBE32 + 16rA8B6E37E 16rC3293D46 16r48DE5369 16r6413E680 + 16rA2AE0810 16rDD6DB224 16r69852DFD 16r09072166 + 16rB39A460A 16r6445C0DD 16r586CDECF 16r1C20C8AE + 16r5BBEF7DD 16r1B588D40 16rCCD2017F 16r6BB4E3BB + 16rDDA26A7E 16r3A59FF45 16r3E350A44 16rBCB4CDD5 + 16r72EACEA8 16rFA6484BB 16r8D6612AE 16rBF3C6F47 + 16rD29BE463 16r542F5D9E 16rAEC2771B 16rF64E6370 + 16r740E0D8D 16rE75B1357 16rF8721671 16rAF537D5D + 16r4040CB08 16r4EB4E2CC 16r34D2466A 16r0115AF84 + 16rE1B00428 16r95983A1D 16r06B89FB4 16rCE6EA048 + 16r6F3F3B82 16r3520AB82 16r011A1D4B 16r277227F8 + 16r611560B1 16rE7933FDC 16rBB3A792B 16r344525BD + 16rA08839E1 16r51CE794B 16r2F32C9B7 16rA01FBAC9 + 16rE01CC87E 16rBCC7D1F6 16rCF0111C3 16rA1E8AAC7 + 16r1A908749 16rD44FBD9A 16rD0DADECB 16rD50ADA38 + 16r0339C32A 16rC6913667 16r8DF9317C 16rE0B12B4F + 16rF79E59B7 16r43F5BB3A 16rF2D519FF 16r27D9459C + 16rBF97222C 16r15E6FC2A 16r0F91FC71 16r9B941525 + 16rFAE59361 16rCEB69CEB 16rC2A86459 16r12BAA8D1 + 16rB6C1075E 16rE3056A0C 16r10D25065 16rCB03A442 + 16rE0EC6E0E 16r1698DB3B 16r4C98A0BE 16r3278E964 + 16r9F1F9532 16rE0D392DF 16rD3A0342B 16r8971F21E + 16r1B0A7441 16r4BA3348C 16rC5BE7120 16rC37632D8 + 16rDF359F8D 16r9B992F2E 16rE60B6F47 16r0FE3F11D + 16rE54CDA54 16r1EDAD891 16rCE6279CF 16rCD3E7E6F + 16r1618B166 16rFD2C1D05 16r848FD2C5 16rF6FB2299 + 16rF523F357 16rA6327623 16r93A83531 16r56CCCD02 + 16rACF08162 16r5A75EBB5 16r6E163697 16r88D273CC + 16rDE966292 16r81B949D0 16r4C50901B 16r71C65614 + 16rE6C6C7BD 16r327A140A 16r45E1D006 16rC3F27B9A + 16rC9AA53FD 16r62A80F00 16rBB25BFE2 16r35BDD2F6 + 16r71126905 16rB2040222 16rB6CBCF7C 16rCD769C2B + 16r53113EC0 16r1640E3D3 16r38ABBD60 16r2547ADF0 + 16rBA38209C 16rF746CE76 16r77AFA1C5 16r20756060 + 16r85CBFE4E 16r8AE88DD8 16r7AAAF9B0 16r4CF9AA7E + 16r1948C25C 16r02FB8A8C 16r01C36AE4 16rD6EBE1F9 + 16r90D4F869 16rA65CDEA0 16r3F09252D 16rC208E69F + 16rB74E6132 16rCE77E25B 16r578FDFE3 16r3AC372E6) +] + +{ #category : #'as yet unclassified' } +Blowfish >> blfDec: dataArray for: blocks [ + | j newDataArray | + newDataArray := Array new: dataArray size. + j := 1. + (1 to: blocks) + do: [ :each | + xl := dataArray at: j. + xr := dataArray at: j + 1. + self decipher. + newDataArray at: j put: xl. + newDataArray at: j + 1 put: xr. + j := j + 2 ]. + ^ newDataArray +] + +{ #category : #'as yet unclassified' } +Blowfish >> blfEcbDecrypt: dataArray for: times [ + + | newDataArray | +newDataArray:=dataArray copy. + + (1 to: times by: 8) do:[ :each | + + xl:=((((newDataArray at: 1) bitShift: 24) bitOr: ((newDataArray at: 2) bitShift: 16) )bitOr: ((newDataArray at: 3) bitShift: 8)) bitOr: (newDataArray at: 4). + xr:=((((newDataArray at: 5) bitShift: 24) bitOr: ((newDataArray at: 6) bitShift: 16) )bitOr: ((newDataArray at: 7) bitShift: 8)) bitOr: (newDataArray at: 8). + + self decipher . + + newDataArray at: 1 put: ((xl bitShift: -24) bitAnd: 16rff). + newDataArray at: 2 put: ((xl bitShift: -16) bitAnd: 16rff). + newDataArray at: 3 put: ((xl bitShift: -8) bitAnd: 16rff). + newDataArray at: 4 put: (xl bitAnd: 16rff). + newDataArray at: 5 put: ((xr bitShift: -24) bitAnd: 16rff). + newDataArray at: 6 put: ((xr bitShift: -16) bitAnd: 16rff). + newDataArray at: 7 put: ((xr bitShift: -8) bitAnd: 16rff). + newDataArray at: 8 put: (xr bitAnd: 16rff). + ] . + + ^newDataArray +] + +{ #category : #'as yet unclassified' } +Blowfish >> blfEcbEncrypt: dataArray for: times [ + + | newDataArray | +newDataArray:=dataArray copy. + + (1 to: times by: 8) do:[ :each | + + xl:=((((newDataArray at: 1) bitShift: 24) bitOr: ((newDataArray at: 2) bitShift: 16) )bitOr: ((newDataArray at: 3) bitShift: 8)) bitOr: (newDataArray at: 4). + xr:=((((newDataArray at: 5) bitShift: 24) bitOr: ((newDataArray at: 6) bitShift: 16) )bitOr: ((newDataArray at: 7) bitShift: 8)) bitOr: (newDataArray at: 8). + + self encipher . + + newDataArray at: 1 put: ((xl bitShift: -24) bitAnd: 16rff). + newDataArray at: 2 put: ((xl bitShift: -16) bitAnd: 16rff). + newDataArray at: 3 put: ((xl bitShift: -8) bitAnd: 16rff). + newDataArray at: 4 put: (xl bitAnd: 16rff). + newDataArray at: 5 put: ((xr bitShift: -24) bitAnd: 16rff). + newDataArray at: 6 put: ((xr bitShift: -16) bitAnd: 16rff). + newDataArray at: 7 put: ((xr bitShift: -8) bitAnd: 16rff). + newDataArray at: 8 put: (xr bitAnd: 16rff). + ] . + + ^newDataArray +] + +{ #category : #'as yet unclassified' } +Blowfish >> blfEnc: dataArray for: blocks [ + | j newDataArray | + newDataArray := dataArray copy. + j := 1. + (1 to: blocks) + do: [ :each | + xl := newDataArray at: j. + xr := newDataArray at: j + 1. + self encipher. + newDataArray at: j put: xl. + newDataArray at: j + 1 put: xr. + j := j + 2 ]. + ^ newDataArray +] + +{ #category : #'as yet unclassified' } +Blowfish >> blfKey: aKey [ + index:=0. + key:= aKey. + "self initializeLittleEndianBoxes." + self initializeBoxes. + self expandZeroState. +] + +{ #category : #'as yet unclassified' } +Blowfish >> calculateBlfRndFor:oneHalf with: otherHalf andPiAt: n [ +"#define BLFRND(s,p,i,j,n) (i ^= F(s,j) ^ (p)[n])" + + +^ oneHalf bitXor: ((self feistelWith: otherHalf ) bitXor: (piArray at: n)) . + +] + +{ #category : #'as yet unclassified' } +Blowfish >> decipher [ + | xL xR temp | + xL := xl copy. + xR := xr copy. + xL := xL bitXor: (piArray at: 18). + (17 to: 2 by: -2) + do: [ :each | + xR := self calculateBlfRndFor: xR with: xL andPiAt: each. + xL := self calculateBlfRndFor: xL with: xR andPiAt: each - 1 ]. + xl := xR bitXor: (piArray at: 1). + xr := xL +] + +{ #category : #'as yet unclassified' } +Blowfish >> decrypt: someData with: aKeyString [ + + + self setRounds: self class defaultRounds . + + self blfKey: aKeyString. + ^self blfDec: someData for: someData size // 2. +] + +{ #category : #'as yet unclassified' } +Blowfish >> ecbDecrypt: someData with: aKeyString [ + + + self setRounds: self class defaultRounds . + + self blfKey: aKeyString. + ^self blfEcbDecrypt: someData for: someData size // 2. +] + +{ #category : #'as yet unclassified' } +Blowfish >> ecbEncrypt: someData with: aKeyString [ + + + self setRounds: self class defaultRounds . + + self blfKey: aKeyString. + ^self blfEcbEncrypt: someData for: someData size // 2. +] + +{ #category : #'as yet unclassified' } +Blowfish >> encipher [ + | xL xR temp | + xL := xl copy. + xR := xr copy. + xL := xL bitXor: (piArray at: 1). +" index <= 2 + ifTrue: [ + Transcript + cr; + show: 'New encipher'; + cr; + show: 'Left: '; + show: xL hex greaseString ]." + (2 to: 17 by: 2) + do: [ :each | + xR := self calculateBlfRndFor: xR with: xL andPiAt: each. + xL := self calculateBlfRndFor: xL with: xR andPiAt: each + 1. +" index = 2 + ifTrue: [ + Transcript + cr; + show: 'Right: '; + show: xR hex greaseString; + cr; + show: 'Left: '; + show: xL hex greaseString. + index = 0 ] ]."]. + xR := xR bitXor: (piArray at: 18). + xl := xR. + xr := xL +] + +{ #category : #'as yet unclassified' } +Blowfish >> encrypt: someData with: aKeyString [ + + + self setRounds: self class defaultRounds . + + self blfKey: aKeyString. + + ^self blfEnc: someData for: someData size // 2. +] + +{ #category : #'as yet unclassified' } +Blowfish >> expandZeroState [ + | dataL dataR s0Test s1Test s2Test s3Test pTest| + current := 1. +pTest:=piArray copy. + (1 to: rounds + 2) + do: [ :each | piArray at: each put: ((piArray at: each) bitXor: (self stream2word: key)) ]. + +"xl := 16r0. +xr := 16r0." +xl:=#[0 0 0 0] unsignedLongAt: 1 bigEndian: true. +xr:=#[0 0 0 0] unsignedLongAt: 1 bigEndian: true. +pTest:=piArray copy. + (1 to: rounds + 2 by: 2) + do: [ :each | + self encipher. + piArray at: each put: xl copy. + piArray at: each+1 put: xr copy.]. + +s0Test :=s0 copy. +s1Test :=s1 copy. +s2Test :=s2 copy. +s3Test :=s3 copy. + + + + (1 to:256 by:2) + do: [ :each | self encipher. + s0 at: each put: xl copy. + s0 at: each+1 put: xr copy. + ]. + + (1 to:256 by:2) + do: [ :each | self encipher. + s1 at: each put: xl copy. + s1 at: each+1 put: xr copy.]. + + (1 to:256 by:2) + do: [ :each | self encipher. + s2 at: each put: xl copy. + s2 at: each+1 put: xr copy.]. + + (1 to:256 by:2) + do: [ :each | self encipher. + s3 at: each put: xl copy. + s3 at: each+1 put: xr copy.]. + +" s0Test:= s0 select:[:each | each asByteArray size >4]. + s1Test:= s1 select:[:each | each asByteArray size >4]. + s2Test:= s2 select:[:each | each asByteArray size >4]. + s3Test:= s3 select:[:each | each asByteArray size >4]. + (s0Test size + s1Test size + s2Test size + s3Test size) >0 ifTrue:[self halt]." +] + +{ #category : #'as yet unclassified' } +Blowfish >> feistelWith: otherHalf [ + | a b c d y byteArray | + a := ((otherHalf bitShift: -24) bitAnd: 16rff) + 1. + b := ((otherHalf bitShift: -16) bitAnd: 16rff) + 1. + c := ((otherHalf bitShift: -8) bitAnd: 16rff) + 1. + d := (otherHalf bitAnd: 16rff) + 1. + y := ((s0 at: a) + (s1 at: b)) \\ 4294967296. " (2 raisedTo: 32)" + y := y bitXor: (s2 at: c). + y := (y + (s3 at: d)) \\ 4294967296. "(2 raisedTo: 32)" + ^ y +] + +{ #category : #'as yet unclassified' } +Blowfish >> initializeBoxes [ + piArray :=self class pBox copy. + s0:=self class s0Box copy. + s1:=self class s1Box copy. + s2:=self class s2Box copy. + s3:=self class s3Box copy. + + + +] + +{ #category : #'as yet unclassified' } +Blowfish >> setRounds: anInteger [ + + rounds:=(anInteger >= self class minRounds and:[anInteger <= self class maxRounds]) ifTrue: [anInteger] ifFalse:[self class defaultRounds ] +] + +{ #category : #'as yet unclassified' } +Blowfish >> stream2word: someData [ + + +|temp j dataBytes | +temp:=0. + +dataBytes := someData size. + +1 to: 4 do: [ :each | + temp:=(temp bitShift: 8 ) bitOr: ((someData at: current) bitAnd: 16rFF). + + current := (current \\ dataBytes) +1. + + ]. + + +^temp. + +] + +{ #category : #'as yet unclassified' } +Blowfish >> stream2word: someData length: someBytes [ + + +|temp j | +temp:=0. + + + +1 to: 4 do: [ :each | + temp:=(temp bitShift: 8 ) bitOr: ((someData atWrap: current) bitAnd: 16rFF). + + current := (current \\ someBytes) +1. + + ]. + + +^temp. + +] diff --git a/source/Blowfish/BlowfishProfiling.class.st b/source/Blowfish/BlowfishProfiling.class.st new file mode 100644 index 0000000..84dfd8d --- /dev/null +++ b/source/Blowfish/BlowfishProfiling.class.st @@ -0,0 +1,82 @@ +Class { + #name : #BlowfishProfiling, + #superclass : #Object, + #instVars : [ + 'keys', + 'clear', + 'encrypted' + ], + #category : 'Blowfish' +} + +{ #category : #'as yet unclassified' } +BlowfishProfiling class >> longTest [ + +] + +{ #category : #'as yet unclassified' } +BlowfishProfiling >> initialize [ + super initialize. + self + initializeClear; + initializeEncrypted; + initializeKeys +] + +{ #category : #'as yet unclassified' } +BlowfishProfiling >> initializeClear [ + | tmpClear | + clear := OrderedCollection new. + tmpClear := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '1000000000000001' '1111111111111111' '1111111111111111' '0123456789ABCDEF' '0000000000000000' '0123456789ABCDEF' '01A1D6D039776742' '5CD54CA83DEF57DA' '0248D43806F67172' '51454B582DDF440A' '42FD443059577FA2' '059B5E0851CF143A' '0756D8E0774761D2' '762514B829BF486A' '3BDD119049372802' '26955F6835AF609A' '164D5E404F275232' '6B056E18759F5CCA' '004BD6EF09176062' '480D39006EE762F2' '437540C8698F3CFA' '072D43A077075292' '02FE55778117F12A' '1D9D5C5018F728C2' '305532286D6F295A' '0123456789ABCDEF' '0123456789ABCDEF' '0123456789ABCDEF' 'FFFFFFFFFFFFFFFF' '0000000000000000' '0000000000000000' 'FFFFFFFFFFFFFFFF'). + tmpClear + do: [ :each | + | array tmpByteArray | + array := WordArray new: 2. + array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). + array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). + clear add: array ] +] + +{ #category : #'as yet unclassified' } +BlowfishProfiling >> initializeEncrypted [ + | tmpEncrypted | + encrypted := OrderedCollection new. + tmpEncrypted := #('4EF997456198DD78' '51866FD5B85ECB8A' '7D856F9A613063F2' '2466DD878B963C9D' '61F9C3802281B096' '7D0CC630AFDA1EC7' '4EF997456198DD78' '0ACEAB0FC6A0A28D' '59C68245EB05282B' 'B1B8CC0B250F09A0' '1730E5778BEA1DA4' 'A25E7856CF2651EB' '353882B109CE8F1A' '48F4D0884C379918' '432193B78951FC98' '13F04154D69D1AE5' '2EEDDA93FFD39C79' 'D887E0393C2DA6E3' '5F99D04F5B163969' '4A057A3B24D3977B' '452031C1E4FADA8E' '7555AE39F59B87BD' '53C55F9CB49FC019' '7A8E7BFA937E89A3' 'CF9C5D7A4986ADB5' 'D1ABB290658BC778' '55CB3774D13EF201' 'FA34EC4847B268B2' 'A790795108EA3CAE' 'C39E072D9FAC631D' '014933E0CDAFF6E4' 'F21E9A77B71C49BC' '245946885754369A' '6B5C5A9C5D9E0A5A'). + tmpEncrypted + do: [ :each | + | array tmpByteArray | + array := WordArray new: 2. + array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). + array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). + encrypted add: array ] +] + +{ #category : #'as yet unclassified' } +BlowfishProfiling >> initializeKeys [ + | tempKeys | + keys := OrderedCollection new. + tempKeys := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '3000000000000000' '1111111111111111' '0123456789ABCDEF' '1111111111111111' '0000000000000000' 'FEDCBA9876543210' '7CA110454A1A6E57' '0131D9619DC1376E' '07A1133E4A0B2686' '3849674C2602319E' '04B915BA43FEB5B6' '0113B970FD34F2CE' '0170F175468FB5E6' '43297FAD38E373FE' '07A7137045DA2A16' '04689104C2FD3B2F' '37D06BB516CB7546' '1F08260D1AC2465E' '584023641ABA6176' '025816164629B007' '49793EBC79B3258F' '4FB05E1515AB73A7' '49E95D6D4CA229BF' '018310DC409B26D6' '1C587F1C13924FEF' '0101010101010101' '1F1F1F1F0E0E0E0E' 'E0FEE0FEF1FEF1FE' '0000000000000000' 'FFFFFFFFFFFFFFFF' '0123456789ABCDEF' 'FEDCBA9876543210'). + tempKeys do: [ :each | keys add: (ByteArray fromHexString: each) ] +] + +{ #category : #'as yet unclassified' } +BlowfishProfiling >> longDecryptionTest [ + (1 to: keys size) + do: [ :each | + | key clearText cipherText enc | + key := keys at: each. + clearText := clear at: each. + cipherText := encrypted at: each. + enc := Blowfish decrypt: cipherText with: key ] +] + +{ #category : #'as yet unclassified' } +BlowfishProfiling >> longEncryptionTest [ + (1 to: keys size) + do: [ :each | + | key clearText cipherText enc | + key := keys at: each. + clearText := clear at: each. + cipherText := encrypted at: each. + enc := Blowfish encrypt: clearText with: key ] +] diff --git a/source/Blowfish/BlowfishTests.class.st b/source/Blowfish/BlowfishTests.class.st new file mode 100644 index 0000000..85747b4 --- /dev/null +++ b/source/Blowfish/BlowfishTests.class.st @@ -0,0 +1,117 @@ +Class { + #name : #BlowfishTests, + #superclass : #TestCase, + #instVars : [ + 'keys', + 'clear', + 'encrypted' + ], + #category : 'Blowfish' +} + +{ #category : #'as yet unclassified' } +BlowfishTests >> setUp [ + "this data is from here: http://www.schneier.com/code/vectors.txt" + + | tmpKeys tmpClear tmpEncrypted | + keys := OrderedCollection new. + clear := OrderedCollection new. + encrypted := OrderedCollection new. + tmpKeys := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '3000000000000000' '1111111111111111' '0123456789ABCDEF' '1111111111111111' '0000000000000000' 'FEDCBA9876543210' '7CA110454A1A6E57' '0131D9619DC1376E' '07A1133E4A0B2686' '3849674C2602319E' '04B915BA43FEB5B6' '0113B970FD34F2CE' '0170F175468FB5E6' '43297FAD38E373FE' '07A7137045DA2A16' '04689104C2FD3B2F' '37D06BB516CB7546' '1F08260D1AC2465E' '584023641ABA6176' '025816164629B007' '49793EBC79B3258F' '4FB05E1515AB73A7' '49E95D6D4CA229BF' '018310DC409B26D6' '1C587F1C13924FEF' '0101010101010101' '1F1F1F1F0E0E0E0E' 'E0FEE0FEF1FEF1FE' '0000000000000000' 'FFFFFFFFFFFFFFFF' '0123456789ABCDEF' 'FEDCBA9876543210'). + tmpClear := #('0000000000000000' 'FFFFFFFFFFFFFFFF' '1000000000000001' '1111111111111111' '1111111111111111' '0123456789ABCDEF' '0000000000000000' '0123456789ABCDEF' '01A1D6D039776742' '5CD54CA83DEF57DA' '0248D43806F67172' '51454B582DDF440A' '42FD443059577FA2' '059B5E0851CF143A' '0756D8E0774761D2' '762514B829BF486A' '3BDD119049372802' '26955F6835AF609A' '164D5E404F275232' '6B056E18759F5CCA' '004BD6EF09176062' '480D39006EE762F2' '437540C8698F3CFA' '072D43A077075292' '02FE55778117F12A' '1D9D5C5018F728C2' '305532286D6F295A' '0123456789ABCDEF' '0123456789ABCDEF' '0123456789ABCDEF' 'FFFFFFFFFFFFFFFF' '0000000000000000' '0000000000000000' 'FFFFFFFFFFFFFFFF'). + tmpEncrypted := #('4EF997456198DD78' '51866FD5B85ECB8A' '7D856F9A613063F2' '2466DD878B963C9D' '61F9C3802281B096' '7D0CC630AFDA1EC7' '4EF997456198DD78' '0ACEAB0FC6A0A28D' '59C68245EB05282B' 'B1B8CC0B250F09A0' '1730E5778BEA1DA4' 'A25E7856CF2651EB' '353882B109CE8F1A' '48F4D0884C379918' '432193B78951FC98' '13F04154D69D1AE5' '2EEDDA93FFD39C79' 'D887E0393C2DA6E3' '5F99D04F5B163969' '4A057A3B24D3977B' '452031C1E4FADA8E' '7555AE39F59B87BD' '53C55F9CB49FC019' '7A8E7BFA937E89A3' 'CF9C5D7A4986ADB5' 'D1ABB290658BC778' '55CB3774D13EF201' 'FA34EC4847B268B2' 'A790795108EA3CAE' 'C39E072D9FAC631D' '014933E0CDAFF6E4' 'F21E9A77B71C49BC' '245946885754369A' '6B5C5A9C5D9E0A5A'). + + "keys:=tmpKeys. " + tmpKeys do: [ :each | keys add: (ByteArray fromHexString: each) ]. + tmpClear + do: [ :each | + | array tmpByteArray | + array := WordArray new: 2. + array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). + array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). + clear add: array ]. + tmpEncrypted + do: [ :each | + | array tmpByteArray | + array := WordArray new: 2. + array at: 1 put: ((ByteArray fromHexString: (each copyFrom: 1 to: 8)) unsignedLongAt: 1 bigEndian: true). + array at: 2 put: ((ByteArray fromHexString: (each copyFrom: 9 to: 16)) unsignedLongAt: 1 bigEndian: true). + encrypted add: array ] +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testDecryption [ +|key data res| +key:='abcdefghijklmnopqrstuvwxyz'. +data:=WordArray new: 2. +#(16r324ed0fe 16rf413a203) doWithIndex: [:each :i | data at: i put: ((each asByteArray) unsignedLongAt: 1 bigEndian:true) ]. +res:=(Blowfish decrypt: data with: key asByteArray ). + + +self assert:((res at: 1) = 1112297303). "16r424c4f571" +self assert:((res at: 2) = 1179210568)."16r46495348" +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testEcbDecrypt [ + |key cl enc res | +key:=ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. +cl := ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. +enc :=ByteArray fromHexString: '51866FD5B85ECB8A' . +res:=(Blowfish ecbDecrypt: enc with: key ). +self assert: (res = cl). +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testEcbEncrypt [ + |key cl enc res | +key:=ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. +cl := ByteArray fromHexString: 'FFFFFFFFFFFFFFFF'. +enc :=ByteArray fromHexString: '51866FD5B85ECB8A' . +res:=(Blowfish ecbEncrypt: cl with: key ) . + +self assert: (res= enc). +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testEncryptDecrypt [ + +self assert:((Blowfish decryptToString: (Blowfish encryptString: '0123456789' with: 'AAAAA' ) with:'AAAAA' )='0123456789') +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testEncryption [ +|key data res| +key:='abcdefghijklmnopqrstuvwxyz'. +data:=WordArray new: 2. +#(16r424c4f57 16r46495348) doWithIndex: [:each :i | data at: i put: ((each asByteArray) unsignedLongAt: 1 bigEndian:true) ]. +res:=(Blowfish encrypt: data with: key asByteArray). + + +self assert:((res at: 1) = 844026110). "16r324ed0fe" +self assert:((res at: 2) = 4094927363)."16rf413a203" +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testLongDecryptionTest [ + +(1 to: keys size) do:[:each | |key clearText cipherText enc| + key:= keys at: each. + clearText:=clear at: each. + cipherText:=encrypted at: each. + enc:=Blowfish decrypt: cipherText with: key. + self assert: (enc = clearText asArray ) + ] +] + +{ #category : #'as yet unclassified' } +BlowfishTests >> testLongEncryptionTest [ + +(1 to: keys size) do:[:each | |key clearText cipherText enc| + key:= keys at: each. + clearText:=clear at: each. + cipherText:=encrypted at: each. + enc:=Blowfish encrypt: clearText with: key. + self assert: (enc = cipherText ) + ] +] diff --git a/source/Blowfish/ByteArray.extension.st b/source/Blowfish/ByteArray.extension.st new file mode 100644 index 0000000..ac1f2de --- /dev/null +++ b/source/Blowfish/ByteArray.extension.st @@ -0,0 +1,6 @@ +Extension { #name : #ByteArray } + +{ #category : #'*blowfish' } +ByteArray class >> fromHexString: aString [ + ^ self readHexFrom: aString +] diff --git a/source/Blowfish/package.st b/source/Blowfish/package.st new file mode 100644 index 0000000..27175a6 --- /dev/null +++ b/source/Blowfish/package.st @@ -0,0 +1 @@ +Package { #name : #Blowfish } diff --git a/source/Cryptography.package/.filetree b/source/Cryptography.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/Cryptography.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/README.md b/source/Cryptography.package/ARC2.class/README.md deleted file mode 100644 index ae124f0..0000000 --- a/source/Cryptography.package/ARC2.class/README.md +++ /dev/null @@ -1,631 +0,0 @@ -Network Working Group R. Rivest -Request for Comments: 2268 MIT Laboratory for Computer Science -Category: Informational and RSA Data Security, Inc. - March 1998 - - - -A Description of the RC2(r) Encryption Algorithm - - -Status of this Memo - - This memo provides information for the Internet community. It does - not specify an Internet standard of any kind. Distribution of this - memo is unlimited. - -Copyright Notice - - Copyright (C) The Internet Society (1998). All Rights Reserved. - -1. Introduction - - - This memo is an RSA Laboratories Technical Note. It is meant for - informational use by the Internet community. - - This memo describes a conventional (secret-key) block encryption - algorithm, called RC2, which may be considered as a proposal for a - DES replacement. The input and output block sizes are 64 bits each. - The key size is variable, from one byte up to 128 bytes, although the - current implementation uses eight bytes. - - The algorithm is designed to be easy to implement on 16-bit - microprocessors. On an IBM AT, the encryption runs about twice as - fast as DES (assuming that key expansion has been done). - -1.1 Algorithm description - - - We use the term "word" to denote a 16-bit quantity. The symbol + will - denote twos-complement addition. The symbol & will denote the bitwise - "and" operation. The term XOR will denote the bitwise "exclusive-or" - operation. The symbol ~ will denote bitwise complement. The symbol ^ - will denote the exponentiation operation. The term MOD will denote - the modulo operation. - - There are three separate algorithms involved: - - Key expansion. This takes a (variable-length) input key and - produces an expanded key consisting of 64 words K[0],...,K[63]. - - - - - -Rivest Informational [Page 1] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - Encryption. This takes a 64-bit input quantity stored in words - R[0], ..., R[3] and encrypts it "in place" (the result is left in - R[0], ..., R[3]). - - Decryption. The inverse operation to encryption. - -2. Key expansion - - - Since we will be dealing with eight-bit byte operations as well as - 16-bit word operations, we will use two alternative notations - - for referring to the key buffer: - - For word operations, we will refer to the positions of the - buffer as K[0], ..., K[63]; each K[i] is a 16-bit word. - - For byte operations, we will refer to the key buffer as - L[0], ..., L[127]; each L[i] is an eight-bit byte. - - These are alternative views of the same data buffer. At all times it - will be true that - - K[i] = L[2*i] + 256*L[2*i+1]. - - (Note that the low-order byte of each K word is given before the - high-order byte.) - - We will assume that exactly T bytes of key are supplied, for some T - in the range 1 <= T <= 128. (Our current implementation uses T = 8.) - However, regardless of T, the algorithm has a maximum effective key - length in bits, denoted T1. That is, the search space is 2^(8*T), or - 2^T1, whichever is smaller. - - The purpose of the key-expansion algorithm is to modify the key - buffer so that each bit of the expanded key depends in a complicated - way on every bit of the supplied input key. - - The key expansion algorithm begins by placing the supplied T-byte key - into bytes L[0], ..., L[T-1] of the key buffer. - - The key expansion algorithm then computes the effective key length in - bytes T8 and a mask TM based on the effective key length in bits T1. - It uses the following operations: - - T8 = (T1+7)/8; - TM = 255 MOD 2^(8 + T1 - 8*T8); - - Thus TM has its 8 - (8*T8 - T1) least significant bits set. - - - -Rivest Informational [Page 2] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - For example, with an effective key length of 64 bits, T1 = 64, T8 = 8 - and TM = 0xff. With an effective key length of 63 bits, T1 = 63, T8 - = 8 and TM = 0x7f. - - Here PITABLE[0], ..., PITABLE[255] is an array of "random" bytes - based on the digits of PI = 3.14159... . More precisely, the array - PITABLE is a random permutation of the values 0, ..., 255. Here is - the PITABLE in hexadecimal notation: - - 0 1 2 3 4 5 6 7 8 9 a b c d e f - 00: d9 78 f9 c4 19 dd b5 ed 28 e9 fd 79 4a a0 d8 9d - 10: c6 7e 37 83 2b 76 53 8e 62 4c 64 88 44 8b fb a2 - 20: 17 9a 59 f5 87 b3 4f 13 61 45 6d 8d 09 81 7d 32 - 30: bd 8f 40 eb 86 b7 7b 0b f0 95 21 22 5c 6b 4e 82 - 40: 54 d6 65 93 ce 60 b2 1c 73 56 c0 14 a7 8c f1 dc - 50: 12 75 ca 1f 3b be e4 d1 42 3d d4 30 a3 3c b6 26 - 60: 6f bf 0e da 46 69 07 57 27 f2 1d 9b bc 94 43 03 - 70: f8 11 c7 f6 90 ef 3e e7 06 c3 d5 2f c8 66 1e d7 - 80: 08 e8 ea de 80 52 ee f7 84 aa 72 ac 35 4d 6a 2a - 90: 96 1a d2 71 5a 15 49 74 4b 9f d0 5e 04 18 a4 ec - a0: c2 e0 41 6e 0f 51 cb cc 24 91 af 50 a1 f4 70 39 - b0: 99 7c 3a 85 23 b8 b4 7a fc 02 36 5b 25 55 97 31 - c0: 2d 5d fa 98 e3 8a 92 ae 05 df 29 10 67 6c ba c9 - d0: d3 00 e6 cf e1 9e a8 2c 63 16 01 3f 58 e2 89 a9 - e0: 0d 38 34 1b ab 33 ff b0 bb 48 0c 5f b9 b1 cd 2e - f0: c5 f3 db 47 e5 a5 9c 77 0a a6 20 68 fe 7f c1 ad - - The key expansion operation consists of the following two loops and - intermediate step: - - for i = T, T+1, ..., 127 do - L[i] = PITABLE[L[i-1] + L[i-T]]; - - L[128-T8] = PITABLE[L[128-T8] & TM]; - - for i = 127-T8, ..., 0 do - L[i] = PITABLE[L[i+1] XOR L[i+T8]]; - - (In the first loop, the addition of L[i-1] and L[i-T] is performed - modulo 256.) - - The "effective key" consists of the values L[128-T8],..., L[127]. - The intermediate step's bitwise "and" operation reduces the search - space for L[128-T8] so that the effective number of key bits is T1. - The expanded key depends only on the effective key bits, regardless - - - - - - -Rivest Informational [Page 3] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - of the supplied key K. Since the expanded key is not itself modified - during encryption or decryption, as a pragmatic matter one can expand - the key just once when encrypting or decrypting a large block of - data. - -3. Encryption algorithm - - - The encryption operation is defined in terms of primitive "mix" and - "mash" operations. - - Here the expression "x rol k" denotes the 16-bit word x rotated left - by k bits, with the bits shifted out the top end entering the bottom - end. - -3.1 Mix up R[i] - - - The primitive "Mix up R[i]" operation is defined as follows, where - s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices - of the array R are always to be considered "modulo 4," so that R[i-1] - refers to R[3] if i is 0 (these values are - - "wrapped around" so that R always has a subscript in the range 0 to 3 - inclusive): - - R[i] = R[i] + K[j] + (R[i-1] & R[i-2]) + ((~R[i-1]) & R[i-3]); - j = j + 1; - R[i] = R[i] rol s[i]; - - In words: The next key word K[j] is added to R[i], and j is advanced. - Then R[i-1] is used to create a "composite" word which is added to - R[i]. The composite word is identical with R[i-2] in those positions - where R[i-1] is one, and identical to R[i-3] in those positions where - R[i-1] is zero. Then R[i] is rotated left by s[i] bits (bits rotated - out the left end of R[i] are brought back in at the right). Here j is - a "global" variable so that K[j] is always the first key word in the - expanded key which has not yet been used in a "mix" operation. - -3.2 Mixing round - - - A "mixing round" consists of the following operations: - - Mix up R[0] - Mix up R[1] - Mix up R[2] - Mix up R[3] - - - - - - -Rivest Informational [Page 4] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - -3.3 Mash R[i] - - - The primitive "Mash R[i]" operation is defined as follows (using the - previous conventions regarding subscripts for R): - - R[i] = R[i] + K[R[i-1] & 63]; - - In words: R[i] is "mashed" by adding to it one of the words of the - expanded key. The key word to be used is determined by looking at the - low-order six bits of R[i-1], and using that as an index into the key - array K. - -3.4 Mashing round - - - A "mashing round" consists of: - - Mash R[0] - Mash R[1] - Mash R[2] - Mash R[3] - -3.5 Encryption operation - - - The entire encryption operation can now be described as follows. Here - j is a global integer variable which is affected by the mixing - operations. - - 1. Initialize words R[0], ..., R[3] to contain the - 64-bit input value. - - 2. Expand the key, so that words K[0], ..., K[63] become - defined. - - 3. Initialize j to zero. - - 4. Perform five mixing rounds. - - 5. Perform one mashing round. - - 6. Perform six mixing rounds. - - 7. Perform one mashing round. - - 8. Perform five mixing rounds. - - Note that each mixing round uses four key words, and that there are - 16 mixing rounds altogether, so that each key word is used exactly - - - - -Rivest Informational [Page 5] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - once in a mixing round. The mashing rounds will refer to up to eight - of the key words in a data-dependent manner. (There may be - repetitions, and the actual set of words referred to will vary from - encryption to encryption.) - -4. Decryption algorithm - - - The decryption operation is defined in terms of primitive operations - that undo the "mix" and "mash" operations of the encryption - algorithm. They are named "r-mix" and "r-mash" (r- denotes the - reverse operation). - - Here the expression "x ror k" denotes the 16-bit word x rotated right - by k bits, with the bits shifted out the bottom end entering the top - end. - -4.1 R-Mix up R[i] - - - The primitive "R-Mix up R[i]" operation is defined as follows, where - s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices - of the array R are always to be considered "modulo 4," so that R[i-1] - refers to R[3] if i is 0 (these values are "wrapped around" so that R - always has a subscript in the range 0 to 3 inclusive): - - R[i] = R[i] ror s[i]; - R[i] = R[i] - K[j] - (R[i-1] & R[i-2]) - ((~R[i-1]) & R[i-3]); - j = j - 1; - - In words: R[i] is rotated right by s[i] bits (bits rotated out the - right end of R[i] are brought back in at the left). Here j is a - "global" variable so that K[j] is always the key word with greatest - index in the expanded key which has not yet been used in a "r-mix" - operation. The key word K[j] is subtracted from R[i], and j is - decremented. R[i-1] is used to create a "composite" word which is - subtracted from R[i]. The composite word is identical with R[i-2] in - those positions where R[i-1] is one, and identical to R[i-3] in those - positions where R[i-1] is zero. - -4.2 R-Mixing round - - - An "r-mixing round" consists of the following operations: - - R-Mix up R[3] - R-Mix up R[2] - R-Mix up R[1] - R-Mix up R[0] - - - - - -Rivest Informational [Page 6] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - -4.3 R-Mash R[i] - - - The primitive "R-Mash R[i]" operation is defined as follows (using - the previous conventions regarding subscripts for R): - - R[i] = R[i] - K[R[i-1] & 63]; - - In words: R[i] is "r-mashed" by subtracting from it one of the words - of the expanded key. The key word to be used is determined by looking - at the low-order six bits of R[i-1], and using that as an index into - the key array K. - -4.4 R-Mashing round - - - An "r-mashing round" consists of: - - R-Mash R[3] - R-Mash R[2] - R-Mash R[1] - R-Mash R[0] - -4.5 Decryption operation - - - The entire decryption operation can now be described as follows. - Here j is a global integer variable which is affected by the mixing - operations. - - 1. Initialize words R[0], ..., R[3] to contain the 64-bit - ciphertext value. - - 2. Expand the key, so that words K[0], ..., K[63] become - defined. - - 3. Initialize j to 63. - - 4. Perform five r-mixing rounds. - - 5. Perform one r-mashing round. - - 6. Perform six r-mixing rounds. - - 7. Perform one r-mashing round. - - 8. Perform five r-mixing rounds. - -5. Test vectors - - - Test vectors for encryption with RC2 are provided below. - - - -Rivest Informational [Page 7] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - All quantities are given in hexadecimal notation. - - Key length (bytes) = 8 - Effective key length (bits) = 63 - Key = 00000000 00000000 - Plaintext = 00000000 00000000 - Ciphertext = ebb773f9 93278eff - - Key length (bytes) = 8 - Effective key length (bits) = 64 - Key = ffffffff ffffffff - Plaintext = ffffffff ffffffff - Ciphertext = 278b27e4 2e2f0d49 - - Key length (bytes) = 8 - Effective key length (bits) = 64 - Key = 30000000 00000000 - Plaintext = 10000000 00000001 - Ciphertext = 30649edf 9be7d2c2 - - Key length (bytes) = 1 - Effective key length (bits) = 64 - Key = 88 - Plaintext = 00000000 00000000 - Ciphertext = 61a8a244 adacccf0 - - Key length (bytes) = 7 - Effective key length (bits) = 64 - Key = 88bca90e 90875a - Plaintext = 00000000 00000000 - Ciphertext = 6ccf4308 974c267f - - Key length (bytes) = 16 - Effective key length (bits) = 64 - Key = 88bca90e 90875a7f 0f79c384 627bafb2 - Plaintext = 00000000 00000000 - Ciphertext = 1a807d27 2bbe5db1 - - Key length (bytes) = 16 - Effective key length (bits) = 128 - Key = 88bca90e 90875a7f 0f79c384 627bafb2 - Plaintext = 00000000 00000000 - Ciphertext = 2269552a b0f85ca6 - - Key length (bytes) = 33 - Effective key length (bits) = 129 - Key = 88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 - c42fceb0 be255daf 1e - - - -Rivest Informational [Page 8] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - Plaintext = 00000000 00000000 - Ciphertext = 5b78d3a4 3dfff1f1 - -6. RC2 Algorithm Object Identifier - - - The Object Identifier for RC2 in cipher block chaining mode is - - rc2CBC OBJECT IDENTIFIER - ::= {iso(1) member-body(2) US(840) rsadsi(113549) - encryptionAlgorithm(3) 2} - - RC2-CBC takes parameters - - RC2-CBCParameter ::= CHOICE { - iv IV, - params SEQUENCE { - version RC2Version, - iv IV - } - } - - where - - IV ::= OCTET STRING -- 8 octets - RC2Version ::= INTEGER -- 1-1024 - - RC2 in CBC mode has two parameters: an 8-byte initialization vector - (IV) and a version number in the range 1-1024 which specifies in a - roundabout manner the number of effective key bits to be used for the - RC2 encryption/decryption. - - The correspondence between effective key bits and version number is - as follows: - - 1. If the number EKB of effective key bits is in the range 1-255, - then the version number is given by Table[EKB], where the 256-byte - translation table Table[] is specified below. Table[] specifies a - permutation on the numbers 0-255; note that it is not the same - table that appears in the key expansion phase of RC2. - - 2. If the number EKB of effective key bits is in the range - 256-1024, then the version number is simply EKB. - - The default number of effective key bits for RC2 is 32. If RC2-CBC - is being performed with 32 effective key bits, the parameters - should be supplied as a simple IV, rather than as a SEQUENCE - containing a version and an IV. - - - - -Rivest Informational [Page 9] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - - 0 1 2 3 4 5 6 7 8 9 a b c d e f - - 00: bd 56 ea f2 a2 f1 ac 2a b0 93 d1 9c 1b 33 fd d0 - 10: 30 04 b6 dc 7d df 32 4b f7 cb 45 9b 31 bb 21 5a - 20: 41 9f e1 d9 4a 4d 9e da a0 68 2c c3 27 5f 80 36 - 30: 3e ee fb 95 1a fe ce a8 34 a9 13 f0 a6 3f d8 0c - 40: 78 24 af 23 52 c1 67 17 f5 66 90 e7 e8 07 b8 60 - 50: 48 e6 1e 53 f3 92 a4 72 8c 08 15 6e 86 00 84 fa - 60: f4 7f 8a 42 19 f6 db cd 14 8d 50 12 ba 3c 06 4e - 70: ec b3 35 11 a1 88 8e 2b 94 99 b7 71 74 d3 e4 bf - 80: 3a de 96 0e bc 0a ed 77 fc 37 6b 03 79 89 62 c6 - 90: d7 c0 d2 7c 6a 8b 22 a3 5b 05 5d 02 75 d5 61 e3 - a0: 18 8f 55 51 ad 1f 0b 5e 85 e5 c2 57 63 ca 3d 6c - b0: b4 c5 cc 70 b2 91 59 0d 47 20 c8 4f 58 e0 01 e2 - c0: 16 38 c4 6f 3b 0f 65 46 be 7e 2d 7b 82 f9 40 b5 - d0: 1d 73 f8 eb 26 c7 87 97 25 54 b1 28 aa 98 9d a5 - e0: 64 6d 7a d4 10 81 44 ef 49 d6 ae 2e dd 76 5c 2f - f0: a7 1c c9 09 69 9a 83 cf 29 39 b9 e9 4c ff 43 ab - -A. Intellectual Property Notice - - RC2 is a registered trademark of RSA Data Security, Inc. RSA's - copyrighted RC2 software is available under license from RSA Data - Security, Inc. - -B. Author's Address - - Ron Rivest - RSA Laboratories - 100 Marine Parkway, #500 - Redwood City, CA 94065 USA - - Phone: (650) 595-7703 - EMail: rsa-labs@rsa.com - - - - - - - - - - - - - - - - - -Rivest Informational [Page 10] - -RFC 2268 RC2(r) Encryption Algorithm March 1998 - - -C. Full Copyright Statement - - Copyright (C) The Internet Society (1998). All Rights Reserved. - - This document and translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it - or assist in its implementation may be prepared, copied, published - and distributed, in whole or in part, without restriction of any - kind, provided that the above copyright notice and this paragraph are - included on all such copies and derivative works. However, this - document itself may not be modified in any way, such as by removing - the copyright notice or references to the Internet Society or other - Internet organizations, except as needed for the purpose of - developing Internet standards in which case the procedures for - copyrights defined in the Internet Standards process must be - followed, or as required to translate it into languages other than - English. - - The limited permissions granted above are perpetual and will not be - revoked by the Internet Society or its successors or assigns. - - This document and the information contained herein is provided on an - "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING - TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION - HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF - MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - - - - - - - - - - - - - - - - - - - - - - - - -Rivest Informational [Page 11] \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/class/LICENSE.st b/source/Cryptography.package/ARC2.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/Cryptography.package/ARC2.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/Cryptography.package/ARC2.class/class/PITABLE.st b/source/Cryptography.package/ARC2.class/class/PITABLE.st deleted file mode 100644 index d620f95..0000000 --- a/source/Cryptography.package/ARC2.class/class/PITABLE.st +++ /dev/null @@ -1,6 +0,0 @@ -constants -PITABLE - - PITABLE isNil ifTrue: [ - PITABLE := #(217 120 249 196 25 221 181 237 40 233 253 121 74 160 216 157 198 126 55 131 43 118 83 142 98 76 100 136 68 139 251 162 23 154 89 245 135 179 79 19 97 69 109 141 9 129 125 50 189 143 64 235 134 183 123 11 240 149 33 34 92 107 78 130 84 214 101 147 206 96 178 28 115 86 192 20 167 140 241 220 18 117 202 31 59 190 228 209 66 61 212 48 163 60 182 38 111 191 14 218 70 105 7 87 39 242 29 155 188 148 67 3 248 17 199 246 144 239 62 231 6 195 213 47 200 102 30 215 8 232 234 222 128 82 238 247 132 170 114 172 53 77 106 42 150 26 210 113 90 21 73 116 75 159 208 94 4 24 164 236 194 224 65 110 15 81 203 204 36 145 175 80 161 244 112 57 153 124 58 133 35 184 180 122 252 2 54 91 37 85 151 49 45 93 250 152 227 138 146 174 5 223 41 16 103 108 186 201 211 0 230 207 225 158 168 44 99 22 1 63 88 226 137 169 13 56 52 27 171 51 255 176 187 72 12 95 185 177 205 46 197 243 219 71 229 165 156 119 10 166 32 104 254 127 193 173) asByteArray]. - ^ PITABLE \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/class/key..st b/source/Cryptography.package/ARC2.class/class/key..st deleted file mode 100644 index 89a10d5..0000000 --- a/source/Cryptography.package/ARC2.class/class/key..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -key: aByteArray - ^ self new key: aByteArray; - T1: 128; - setKeySize; - yourself \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/class/key.effectiveKeyLength..st b/source/Cryptography.package/ARC2.class/class/key.effectiveKeyLength..st deleted file mode 100644 index c22dece..0000000 --- a/source/Cryptography.package/ARC2.class/class/key.effectiveKeyLength..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -key: aByteArray effectiveKeyLength: aKeyStrength - ^ self new key: aByteArray; - T1: aKeyStrength; - setKeySize; - yourself \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/class/rotate16BitWord.leftBy..st b/source/Cryptography.package/ARC2.class/class/rotate16BitWord.leftBy..st deleted file mode 100644 index 5108de7..0000000 --- a/source/Cryptography.package/ARC2.class/class/rotate16BitWord.leftBy..st +++ /dev/null @@ -1,8 +0,0 @@ -support -rotate16BitWord: a16BitWord leftBy: bitCount - | s1 s2 aBitCount | - aBitCount := bitCount \\ 16. - aBitCount < 0 ifTrue: [aBitCount := aBitCount + 16]. - s1 := aBitCount. - s2 := s1 - 16. - ^((a16BitWord bitShift: s1) bitAnd: 16rFFFF) bitOr: (a16BitWord bitShift: s2). \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/T1..st b/source/Cryptography.package/ARC2.class/instance/T1..st deleted file mode 100644 index 8888017..0000000 --- a/source/Cryptography.package/ARC2.class/instance/T1..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -T1: anObject - "Set the value of T1" - - T1 := anObject \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/T1.st b/source/Cryptography.package/ARC2.class/instance/T1.st deleted file mode 100644 index 0ef2d2a..0000000 --- a/source/Cryptography.package/ARC2.class/instance/T1.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -T1 - "Answer the value of T1" - - ^ T1 \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/T8..st b/source/Cryptography.package/ARC2.class/instance/T8..st deleted file mode 100644 index 01b30ec..0000000 --- a/source/Cryptography.package/ARC2.class/instance/T8..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -T8: anObject - "Set the value of T8" - - T8 := anObject \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/T8.st b/source/Cryptography.package/ARC2.class/instance/T8.st deleted file mode 100644 index 36d9393..0000000 --- a/source/Cryptography.package/ARC2.class/instance/T8.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -T8 - "Answer the value of T8" - - ^ T8 \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/TM..st b/source/Cryptography.package/ARC2.class/instance/TM..st deleted file mode 100644 index 148ec0f..0000000 --- a/source/Cryptography.package/ARC2.class/instance/TM..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -TM: anObject - "Set the value of TM" - - TM := anObject \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/TM.st b/source/Cryptography.package/ARC2.class/instance/TM.st deleted file mode 100644 index 43d4a7e..0000000 --- a/source/Cryptography.package/ARC2.class/instance/TM.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -TM - "Answer the value of TM" - - ^ TM \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/blockSize.st b/source/Cryptography.package/ARC2.class/instance/blockSize.st deleted file mode 100644 index 73a1579..0000000 --- a/source/Cryptography.package/ARC2.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -blockSize - ^8 \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/decryptBlock..st b/source/Cryptography.package/ARC2.class/instance/decryptBlock..st deleted file mode 100644 index 0d9463c..0000000 --- a/source/Cryptography.package/ARC2.class/instance/decryptBlock..st +++ /dev/null @@ -1,8 +0,0 @@ -encryption/decryption -decryptBlock: cipherText - | result | - result := self decryptBlock: cipherText key: self expandedKey. - result withIndexDo: [:a :i | - cipherText at: i put: a - ]. - ^cipherText \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/decryptBlock.key..st b/source/Cryptography.package/ARC2.class/instance/decryptBlock.key..st deleted file mode 100644 index 23562eb..0000000 --- a/source/Cryptography.package/ARC2.class/instance/decryptBlock.key..st +++ /dev/null @@ -1,44 +0,0 @@ -encryption/decryption -decryptBlock: plainText key: expandedKeys - "The entire decryption operation can now be described as follows. - Here j is a global integer variable which is affected by the mixing - operations. - - 1. Initialize words R[0], ..., R[3] to contain the 64-bit - ciphertext value. - 2. Expand the key, so that words K[0], ..., K[63] become - defined. - 3. Initialize j to 63. - 4. Perform five r-mixing rounds. - 5. Perform one r-mashing round. - 6. Perform six r-mixing rounds. - 7. Perform one r-mashing round. - 8. Perform five r-mixing rounds." - - | cText rStream result | - self j: 63. - cText := plainText. - rStream := cText readStream. - result := ByteArray new. - [rStream atEnd] whileFalse: [ - result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize: 2) - ]. - cText := result. - 1 to: 5 do: [:i | - cText := self rMixUp: cText withKeys: expandedKeys - ]. - cText := self rMash: cText withKeys: expandedKeys. - 1 to: 6 do: [:i | - cText := self rMixUp: cText withKeys: expandedKeys - ]. - cText := self rMash: cText withKeys: expandedKeys. - 1 to: 5 do: [:i | - cText := self rMixUp: cText withKeys: expandedKeys - ]. - rStream := cText readStream. - result := ByteArray new. - [rStream atEnd] whileFalse: [ - result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize: 2) - ]. - ^result - \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/destroy.st b/source/Cryptography.package/ARC2.class/instance/destroy.st deleted file mode 100644 index 92765b1..0000000 --- a/source/Cryptography.package/ARC2.class/instance/destroy.st +++ /dev/null @@ -1,3 +0,0 @@ -services -destroy - self keyHolder destroy. \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/encryptBlock..st b/source/Cryptography.package/ARC2.class/instance/encryptBlock..st deleted file mode 100644 index bc7e784..0000000 --- a/source/Cryptography.package/ARC2.class/instance/encryptBlock..st +++ /dev/null @@ -1,8 +0,0 @@ -encryption/decryption -encryptBlock: plainText - | result | - result := self encryptBlock: plainText key: self expandedKey. - result withIndexDo: [:a :i | - plainText at: i put: a - ]. - ^plainText \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/encryptBlock.key..st b/source/Cryptography.package/ARC2.class/instance/encryptBlock.key..st deleted file mode 100644 index f443275..0000000 --- a/source/Cryptography.package/ARC2.class/instance/encryptBlock.key..st +++ /dev/null @@ -1,43 +0,0 @@ -encryption/decryption -encryptBlock: plainText key: expandedKeys - "The entire encryption operation can now be described as follows. Here - j is a global integer variable which is affected by the mixing - operations. - 1. Initialize words R[0], ..., R[3] to contain the - 64-bit input value. - 2. Expand the key, so that words K[0], ..., K[63] become - defined. - 3. Initialize j to zero. - 4. Perform five mixing rounds. - 5. Perform one mashing round. - 6. Perform six mixing rounds. - 7. Perform one mashing round. - 8. Perform five mixing rounds." - - | cText rStream result | - self j: 0. - cText := plainText. - rStream := cText readStream. - result := ByteArray new. - [rStream atEnd] whileFalse: [ - result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize:2) - ]. - cText := result. - 1 to: 5 do: [:i | - cText := self mixUp: cText withKeys: expandedKeys - ]. - cText := self mash: cText withKeys: expandedKeys. - 1 to: 6 do: [:i | - cText := self mixUp: cText withKeys: expandedKeys - ]. - cText := self mash: cText withKeys: expandedKeys. - 1 to: 5 do: [:i | - cText := self mixUp: cText withKeys: expandedKeys - ]. - rStream := cText readStream. - result := ByteArray new. - [rStream atEnd] whileFalse: [ - result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize: 2) - ]. - ^result - \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/expandedKey.st b/source/Cryptography.package/ARC2.class/instance/expandedKey.st deleted file mode 100644 index a7068ea..0000000 --- a/source/Cryptography.package/ARC2.class/instance/expandedKey.st +++ /dev/null @@ -1,32 +0,0 @@ -services -expandedKey - - "for i = T, T+1, ..., 127 do - L[i] = PITABLE[L[i-1] + L[i-T]];" - - | keyBuffer aT v1 v2 pos byteStream result | - keyBuffer := (self key reverse asByteArrayOfSize: 128) reverse. - aT := self key size. - aT to: 127 do: [:i | - v1 := keyBuffer at: (i -1) + 1. - v2 := keyBuffer at: (i - aT) + 1. - keyBuffer at: (i+1) put: (self class PITABLE at: (((v1 + v2) \\ 256) + 1)). - ]. - - "L[128-T8] = PITABLE[L[128-T8] & TM];" - pos := (128 - self T8) + 1. - keyBuffer at: pos put: (self class PITABLE at: (((keyBuffer at: pos) bitAnd: self TM) + 1)). - - "for i = 127-T8, ..., 0 do - L[i] = PITABLE[L[i+1] XOR L[i+T8]]; - " - (127 - self T8) to: 0 by: -1 do: [:i | - keyBuffer at: (i+1) put: (self class PITABLE at: (((keyBuffer at: ((i + 1) +1)) bitXor: (keyBuffer at: ((i + self T8)+1))) +1)) - ]. - byteStream := keyBuffer readStream. - result := OrderedCollection new: byteStream size. - [byteStream atEnd] whileFalse: [ - result add: (byteStream next + (byteStream next bitShift: 8)) "Little Endian" - ]. - ^result - \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/initialize.st b/source/Cryptography.package/ARC2.class/instance/initialize.st deleted file mode 100644 index aba612b..0000000 --- a/source/Cryptography.package/ARC2.class/instance/initialize.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -initialize - self j: 0. \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/j..st b/source/Cryptography.package/ARC2.class/instance/j..st deleted file mode 100644 index 11e1411..0000000 --- a/source/Cryptography.package/ARC2.class/instance/j..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -j: anInteger - "Set the value of j" - - j := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/j.st b/source/Cryptography.package/ARC2.class/instance/j.st deleted file mode 100644 index 929206f..0000000 --- a/source/Cryptography.package/ARC2.class/instance/j.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -j - "Answer the value of j" - - ^ j \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/key..st b/source/Cryptography.package/ARC2.class/instance/key..st deleted file mode 100644 index a6f0fca..0000000 --- a/source/Cryptography.package/ARC2.class/instance/key..st +++ /dev/null @@ -1,3 +0,0 @@ -key -key: aByteArray - self keyHolder: (KeyHolder holdKey: aByteArray) \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/key.st b/source/Cryptography.package/ARC2.class/instance/key.st deleted file mode 100644 index 44b84ec..0000000 --- a/source/Cryptography.package/ARC2.class/instance/key.st +++ /dev/null @@ -1,3 +0,0 @@ -key -key - ^self keyHolder key \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/keyHolder..st b/source/Cryptography.package/ARC2.class/instance/keyHolder..st deleted file mode 100644 index b2a4b99..0000000 --- a/source/Cryptography.package/ARC2.class/instance/keyHolder..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keyHolder: anObject - "Set the value of keyHolder" - - keyHolder := anObject \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/keyHolder.st b/source/Cryptography.package/ARC2.class/instance/keyHolder.st deleted file mode 100644 index 810b63e..0000000 --- a/source/Cryptography.package/ARC2.class/instance/keyHolder.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keyHolder - "Answer the value of keyHolder" - - ^ keyHolder \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/mash.withKeys..st b/source/Cryptography.package/ARC2.class/instance/mash.withKeys..st deleted file mode 100644 index 1def4b6..0000000 --- a/source/Cryptography.package/ARC2.class/instance/mash.withKeys..st +++ /dev/null @@ -1,30 +0,0 @@ -services -mash: a64BitWord withKeys: expandedKeys - "The primitive 'Mash R[i]' operation is defined as follows (using the - previous conventions regarding subscripts for R): - - R[i] = R[i] + K[R[i-1] & 63]; - - In words: R[i] is 'mashed; by adding to it one of the words of the - expanded key. The key word to be used is determined by looking at the - low-order six bits of R[i-1], and using that as an index into the key - array K. -" - | aR aByteStream aRi aK result | - aR := Array new: 4. - aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. - 1 to: 4 do: [:i | - aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). - ]. - 0 to: 3 do: [:i | - aRi := aR at: i + 1. - aK := expandedKeys at: (((aR at: ((i - 1) \\ 4)+1) bitAnd: 63) + 1). - aR at: i + 1 put: ((aRi + aK) bitAnd: 16rFFFF). - ]. - result := ByteArray new. - aR do: [:a16BitWord | - result := result, (a16BitWord asByteArrayOfSize: 2) - ]. - ^result. - - diff --git a/source/Cryptography.package/ARC2.class/instance/mixUp.withKeys..st b/source/Cryptography.package/ARC2.class/instance/mixUp.withKeys..st deleted file mode 100644 index e272967..0000000 --- a/source/Cryptography.package/ARC2.class/instance/mixUp.withKeys..st +++ /dev/null @@ -1,38 +0,0 @@ -services -mixUp: a64BitWord withKeys: expandedKeys - "The primitive 'Mix up R[i]' operation is defined as follows, where - s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices - of the array R are always to be considered 'modulo 4,' so that R[i-1] - refers to R[3] if i is 0 (these values are - - 'wrapped around' so that R always has a subscript in the range 0 to 3 - inclusive): - - R[i] = R[i] + K[j] + (R[i-1] & R[i-2]) + ((~R[i-1]) & R[i-3]); - j = j + 1; - R[i] = R[i] rol s[i]; - " - | aS aR aByteStream aRi aKj aRa aRb aRc aRd si result | - aS := Array with: 1 with: 2 with: 3 with: 5. - aR := Array new: 4. - aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. - 1 to: 4 do: [:i | - aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). - ]. - 0 to: 3 do: [:i | - aRi := aR at: i +1. - aKj := expandedKeys at: self j + 1. "j+1 changes offset from 0 - 3 to 1 to 4" - aRa := aR at: ((i - 1 \\ 4) + 1). - aRb := aR at: ((i - 2 \\ 4) + 1). - aRc := aRa bitXor: 16rFFFF. - aRd := aR at: ((i - 3 \\ 4) + 1). - si := aS at: i +1. - aR at: i+1 put: (self class rotate16BitWord: ((aRi + aKj + (aRa bitAnd: aRb) + (aRc bitAnd: aRd)) bitAnd: 16rFFFF) leftBy: si). - self j: self j + 1. - ]. - result := ByteArray new. - aR do: [:a16BitWord | - result := result, (a16BitWord asByteArrayOfSize: 2) - ]. - ^result. - \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/rMash.withKeys..st b/source/Cryptography.package/ARC2.class/instance/rMash.withKeys..st deleted file mode 100644 index aee8bff..0000000 --- a/source/Cryptography.package/ARC2.class/instance/rMash.withKeys..st +++ /dev/null @@ -1,30 +0,0 @@ -services -rMash: a64BitWord withKeys: expandedKeys - "The primitive 'Mash R[i]' operation is defined as follows (using the - previous conventions regarding subscripts for R): - - R[i] = R[i] - K[R[i-1] & 63]; - - In words: R[i] is 'mashed; by adding to it one of the words of the - expanded key. The key word to be used is determined by looking at the - low-order six bits of R[i-1], and using that as an index into the key - array K. -" - | aR aByteStream aRi aK result | - aR := Array new: 4. - aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. - 1 to: 4 do: [:i | - aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). - ]. - 3 to: 0 by: -1 do: [:i | - aRi := aR at: i + 1. - aK := expandedKeys at: (((aR at: ((i - 1) \\ 4)+1) bitAnd: 63) + 1). - aR at: i + 1 put: ((aRi - aK) bitAnd: 16rFFFF). - ]. - result := ByteArray new. - aR do: [:a16BitWord | - result := result, (a16BitWord asByteArrayOfSize: 2) - ]. - ^result. - - diff --git a/source/Cryptography.package/ARC2.class/instance/rMixUp.withKeys..st b/source/Cryptography.package/ARC2.class/instance/rMixUp.withKeys..st deleted file mode 100644 index 3beb410..0000000 --- a/source/Cryptography.package/ARC2.class/instance/rMixUp.withKeys..st +++ /dev/null @@ -1,38 +0,0 @@ -services -rMixUp: a64BitWord withKeys: expandedKeys - "The primitive 'R-Mix up R[i]' operation is defined as follows, where - s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices - of the array R are always to be considered 'modulo 4,' so that R[i-1] - refers to R[3] if i is 0 (these values are 'wrapped around' so that R - always has a subscript in the range 0 to 3 inclusive): - - R[i] = R[i] roR s[i]; - R[i] = R[i] - K[j] - (R[i-1] & R[i-2]) - ((~R[i-1]) & R[i-3]); - j = j - 1; - - " - | aS aR aByteStream aRi aKj aRa aRb aRc aRd si result | - aS := Array with: 1 with: 2 with: 3 with: 5. - aR := Array new: 4. - aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. - 1 to: 4 do: [:i | - aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). - ]. - 3 to: 0 by: -1 do: [:i | - si := aS at: i +1. - aR at: i + 1 put: (self class rotate16BitWord: (aR at: i +1) leftBy: si negated). - aRi := aR at: i + 1. - aKj := expandedKeys at: self j + 1. "j+1 changes offset from 0 - 3 to 1 to 4" - aRa := aR at: ((i - 1 \\ 4) + 1). - aRb := aR at: ((i - 2 \\ 4) + 1). - aRc := aRa bitXor: 16rFFFF. - aRd := aR at: ((i - 3 \\ 4) + 1). - aR at: i+1 put: ((aRi - aKj - (aRa bitAnd: aRb) - (aRc bitAnd: aRd)) bitAnd: 16rFFFF). - self j: self j - 1. - ]. - result := ByteArray new. - aR do: [:a16BitWord | - result := result, (a16BitWord asByteArrayOfSize: 2) - ]. - ^result. - \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/instance/setKeySize.st b/source/Cryptography.package/ARC2.class/instance/setKeySize.st deleted file mode 100644 index 008a919..0000000 --- a/source/Cryptography.package/ARC2.class/instance/setKeySize.st +++ /dev/null @@ -1,4 +0,0 @@ -key -setKeySize - self T8: (self T1+7) // 8. - self TM: (255 \\ (2 raisedTo: (8 + self T1 - (8 * self T8)))). \ No newline at end of file diff --git a/source/Cryptography.package/ARC2.class/properties.json b/source/Cryptography.package/ARC2.class/properties.json deleted file mode 100644 index 5299811..0000000 --- a/source/Cryptography.package/ARC2.class/properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commentStamp" : "RJT 3/30/2007 09:48", - "super" : "BlockCipher", - "category" : "Cryptography-ARC2", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "PITABLE" - ], - "instvars" : [ - "T1", - "T8", - "TM", - "keyHolder", - "j" - ], - "name" : "ARC2", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/ARC4.class/README.md b/source/Cryptography.package/ARC4.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/ARC4.class/instance/decrypt..st b/source/Cryptography.package/ARC4.class/instance/decrypt..st deleted file mode 100644 index c8841c3..0000000 --- a/source/Cryptography.package/ARC4.class/instance/decrypt..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -decrypt: aByteArray - ^ self encrypt: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/ARC4.class/instance/encrypt..st b/source/Cryptography.package/ARC4.class/instance/encrypt..st deleted file mode 100644 index ecff6c4..0000000 --- a/source/Cryptography.package/ARC4.class/instance/encrypt..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -encrypt: aByteArray - | newBytes | - newBytes := aByteArray copy. - 1 to: aByteArray size do: [ :each | newBytes at: each put: ((aByteArray at: each) bitXor: self next)]. - ^ newBytes \ No newline at end of file diff --git a/source/Cryptography.package/ARC4.class/instance/key..st b/source/Cryptography.package/ARC4.class/instance/key..st deleted file mode 100644 index 1e3c52e..0000000 --- a/source/Cryptography.package/ARC4.class/instance/key..st +++ /dev/null @@ -1,10 +0,0 @@ -accessing -key: aByteArray - | k other | - sbox := (0 to: 255) asByteArray. - k := (0 to: 255) collect: [ :each | aByteArray at: each \\ aByteArray size + 1]. - other := 0. - 1 to: 256 do: [ :each | - other := other + (sbox at: each) + (k at: each) \\ 256. - sbox swap: each with: other+1]. - i := j := 0 \ No newline at end of file diff --git a/source/Cryptography.package/ARC4.class/instance/next.st b/source/Cryptography.package/ARC4.class/instance/next.st deleted file mode 100644 index 51b32ad..0000000 --- a/source/Cryptography.package/ARC4.class/instance/next.st +++ /dev/null @@ -1,8 +0,0 @@ -accessing -next - | t | - i := i + 1 \\ 256. - j := j + (sbox at: i+1) \\ 256. - sbox swap: i+1 with: j+1. - t := (sbox at: i+1) + (sbox at: j+1) \\ 256. - ^ sbox at: t+1 \ No newline at end of file diff --git a/source/Cryptography.package/ARC4.class/properties.json b/source/Cryptography.package/ARC4.class/properties.json deleted file mode 100644 index c45018f..0000000 --- a/source/Cryptography.package/ARC4.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RC4", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "sbox", - "i", - "j" - ], - "name" : "ARC4", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/README.md b/source/Cryptography.package/BlockCipher.class/README.md deleted file mode 100644 index bf8f474..0000000 --- a/source/Cryptography.package/BlockCipher.class/README.md +++ /dev/null @@ -1 +0,0 @@ -Abstract class for blockmode ciphers (those which encrypt/decrypt more than 1 byte at a time, typically 64 bits) \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/class/blockSize.st b/source/Cryptography.package/BlockCipher.class/class/blockSize.st deleted file mode 100644 index 726c639..0000000 --- a/source/Cryptography.package/BlockCipher.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/class/key..st b/source/Cryptography.package/BlockCipher.class/class/key..st deleted file mode 100644 index e00c2a2..0000000 --- a/source/Cryptography.package/BlockCipher.class/class/key..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -key: aByteArray - ^ self new key: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/class/keySize.st b/source/Cryptography.package/BlockCipher.class/class/keySize.st deleted file mode 100644 index b26eb46..0000000 --- a/source/Cryptography.package/BlockCipher.class/class/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/blockSize.st b/source/Cryptography.package/BlockCipher.class/instance/blockSize.st deleted file mode 100644 index ea3115a..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ self class blockSize \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/blocksIn.from.to.do..st b/source/Cryptography.package/BlockCipher.class/instance/blocksIn.from.to.do..st deleted file mode 100644 index e8c12ba..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/blocksIn.from.to.do..st +++ /dev/null @@ -1,21 +0,0 @@ -private -blocksIn: aByteArray from: startIndex to: endIndex do: oneArgBlock - | tempBlock | - self isStreamCipher - ifFalse: [ self validateEndpointsFrom: startIndex to: endIndex ]. - tempBlock := ByteArray new: self blockSize. - startIndex to: endIndex - by: self blockSize - do: - [ : startPos | - tempBlock - replaceFrom: 1 - to: (self blockSize min: aByteArray size - startPos + 1) - with: aByteArray - startingAt: startPos. - oneArgBlock value: tempBlock. - aByteArray - replaceFrom: startPos - to: (startPos + self blockSize - 1 min: aByteArray size) - with: tempBlock - startingAt: 1] \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/cbc.st b/source/Cryptography.package/BlockCipher.class/instance/cbc.st deleted file mode 100644 index ec20856..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/cbc.st +++ /dev/null @@ -1,3 +0,0 @@ -modes -cbc - ^ CBC on: self \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/cfb.st b/source/Cryptography.package/BlockCipher.class/instance/cfb.st deleted file mode 100644 index b6038ad..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/cfb.st +++ /dev/null @@ -1,3 +0,0 @@ -modes -cfb - ^ CFB on: self \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/ctr.st b/source/Cryptography.package/BlockCipher.class/instance/ctr.st deleted file mode 100644 index 4683bc7..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/ctr.st +++ /dev/null @@ -1,3 +0,0 @@ -modes -ctr - ^ CTR on: self \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/decrypt..st b/source/Cryptography.package/BlockCipher.class/instance/decrypt..st deleted file mode 100644 index 9d492d5..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/decrypt..st +++ /dev/null @@ -1,15 +0,0 @@ -accessing -decrypt: aByteArray - "Answer a copy of aByteArray which is decrypted with my key." - | decryptedBlock | - decryptedBlock := - self - decrypt: aByteArray copy - from: 1 - to: aByteArray size. - ^ self isStreamCipher - ifTrue: [ decryptedBlock ] - ifFalse: - [ decryptedBlock - copyFrom: 1 - to: decryptedBlock unpaddedSize ] \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/decrypt.from.to..st b/source/Cryptography.package/BlockCipher.class/instance/decrypt.from.to..st deleted file mode 100644 index 1ee48ec..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/decrypt.from.to..st +++ /dev/null @@ -1,9 +0,0 @@ -accessing -decrypt: aByteArray from: startPos to: endPos - "Decrypt aByteArray in-place." - self - blocksIn: aByteArray - from: startPos - to: endPos - do: [:each | self decryptBlock: each]. - ^ aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/decryptBlock..st b/source/Cryptography.package/BlockCipher.class/instance/decryptBlock..st deleted file mode 100644 index b414b63..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/decryptBlock..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -decryptBlock: cipherText - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/ecb.st b/source/Cryptography.package/BlockCipher.class/instance/ecb.st deleted file mode 100644 index 6e86313..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/ecb.st +++ /dev/null @@ -1,3 +0,0 @@ -modes -ecb - ^ self \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/encrypt..st b/source/Cryptography.package/BlockCipher.class/instance/encrypt..st deleted file mode 100644 index 822a517..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/encrypt..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -encrypt: aByteArray - "Answer a copy of aByteArray which is encrypted with my key." - | encryptable | - encryptable := self isStreamCipher - ifTrue: [ aByteArray copy ] - ifFalse: [ aByteArray padToMultipleOf: self blockSize ]. - ^ self - encrypt: encryptable - from: 1 - to: encryptable size \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/encrypt.from.to..st b/source/Cryptography.package/BlockCipher.class/instance/encrypt.from.to..st deleted file mode 100644 index 69e0090..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/encrypt.from.to..st +++ /dev/null @@ -1,9 +0,0 @@ -accessing -encrypt: aByteArray from: startPos to: endPos - "Encrypt aByteArray in place." - self - blocksIn: aByteArray - from: startPos - to: endPos - do: [:each | self encryptBlock: each]. - ^aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/encryptBlock..st b/source/Cryptography.package/BlockCipher.class/instance/encryptBlock..st deleted file mode 100644 index a603582..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/encryptBlock..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -encryptBlock: plainText - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/isStreamCipher.st b/source/Cryptography.package/BlockCipher.class/instance/isStreamCipher.st deleted file mode 100644 index 383fa2f..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/isStreamCipher.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isStreamCipher - "Answer whether I have stream characteristics; a Stream cipher typically generates its own stream of pseudo-random bytes which is then XOR'd with plaintext. Another characteristic is no padding is required because the last (odd-sized) block can simply XOR to whatever length needed." - ^ false \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/key..st b/source/Cryptography.package/BlockCipher.class/instance/key..st deleted file mode 100644 index 32317d1..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/key..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -key: aKey - ^ self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/keySize.st b/source/Cryptography.package/BlockCipher.class/instance/keySize.st deleted file mode 100644 index 3a86e15..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ self class keySize \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/ofb.st b/source/Cryptography.package/BlockCipher.class/instance/ofb.st deleted file mode 100644 index 0fa0cef..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/ofb.st +++ /dev/null @@ -1,3 +0,0 @@ -modes -ofb - ^ OFB on: self \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/instance/validateEndpointsFrom.to..st b/source/Cryptography.package/BlockCipher.class/instance/validateEndpointsFrom.to..st deleted file mode 100644 index dddcbc0..0000000 --- a/source/Cryptography.package/BlockCipher.class/instance/validateEndpointsFrom.to..st +++ /dev/null @@ -1,3 +0,0 @@ -private -validateEndpointsFrom: startIndex to: endIndex - endIndex-startIndex+1 \\ self blockSize = 0 ifFalse: [ CryptographyError signal: 'message size must be a multiple of my blockSize.' ] \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipher.class/properties.json b/source/Cryptography.package/BlockCipher.class/properties.json deleted file mode 100644 index fb52752..0000000 --- a/source/Cryptography.package/BlockCipher.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "hmm 3/26/2002 18:17", - "super" : "Object", - "category" : "Cryptography-Core", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "BlockCipher", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/README.md b/source/Cryptography.package/BlockCipherMode.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/BlockCipherMode.class/class/blockSize.st b/source/Cryptography.package/BlockCipherMode.class/class/blockSize.st deleted file mode 100644 index 7e35299..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ self shouldNotImplement \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/class/key..st b/source/Cryptography.package/BlockCipherMode.class/class/key..st deleted file mode 100644 index c0e773c..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/class/key..st +++ /dev/null @@ -1,5 +0,0 @@ -*cryptography-tests -key: aByteArray - Warning signal: 'you do NOT want to use this method in a real program because we use a hard-coded nonce. You should take care of your own nonce.'. - ^ (self on: (Rijndael new keySize: aByteArray size; key: aByteArray)) - initialVector: #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/class/keySize.st b/source/Cryptography.package/BlockCipherMode.class/class/keySize.st deleted file mode 100644 index 4e1d20e..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/class/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ self shouldNotImplement \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/class/on..st b/source/Cryptography.package/BlockCipherMode.class/class/on..st deleted file mode 100644 index 32c29a0..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/class/on..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -on: aCipher - ^ self new setCipher: aCipher \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/blockSize.st b/source/Cryptography.package/BlockCipherMode.class/instance/blockSize.st deleted file mode 100644 index 8b77491..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ cipher blockSize \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/destroy.st b/source/Cryptography.package/BlockCipherMode.class/instance/destroy.st deleted file mode 100644 index 209fd14..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/destroy.st +++ /dev/null @@ -1,3 +0,0 @@ -initialization-release -destroy - vector destroy \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/initialVector..st b/source/Cryptography.package/BlockCipherMode.class/instance/initialVector..st deleted file mode 100644 index a112bad..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/initialVector..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -initialVector: aByteArray - "avoid leakage, shred prior vectors before disconnecting them." - self vector: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/key..st b/source/Cryptography.package/BlockCipherMode.class/instance/key..st deleted file mode 100644 index 0bf1113..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/key..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -key: aByteArray - cipher key: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/keySize.st b/source/Cryptography.package/BlockCipherMode.class/instance/keySize.st deleted file mode 100644 index af6ddfb..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ cipher keySize \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/printOn..st b/source/Cryptography.package/BlockCipherMode.class/instance/printOn..st deleted file mode 100644 index 7a5fbea..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/printOn..st +++ /dev/null @@ -1,3 +0,0 @@ -printing -printOn: aStream - aStream print: cipher; nextPut: $-; nextPutAll: self class name \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/setCipher..st b/source/Cryptography.package/BlockCipherMode.class/instance/setCipher..st deleted file mode 100644 index cea58f8..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/setCipher..st +++ /dev/null @@ -1,4 +0,0 @@ -initialization-release -setCipher: aCipher - cipher := aCipher. - self initialVector: (ByteArray new: self blockSize) \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/instance/vector..st b/source/Cryptography.package/BlockCipherMode.class/instance/vector..st deleted file mode 100644 index 8afc2a2..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/instance/vector..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -vector: aByteArray - vector == aByteArray ifFalse: - [ "avoid leakage, shred prior vectors before disconnecting them." - vector ifNotNil: [ vector destroy ]. - vector := aByteArray ] \ No newline at end of file diff --git a/source/Cryptography.package/BlockCipherMode.class/properties.json b/source/Cryptography.package/BlockCipherMode.class/properties.json deleted file mode 100644 index 9210642..0000000 --- a/source/Cryptography.package/BlockCipherMode.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipher", - "category" : "Cryptography-Core", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "cipher", - "vector" - ], - "name" : "BlockCipherMode", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/class/fromHexString..st b/source/Cryptography.package/ByteArray.extension/class/fromHexString..st deleted file mode 100644 index a332f80..0000000 --- a/source/Cryptography.package/ByteArray.extension/class/fromHexString..st +++ /dev/null @@ -1,16 +0,0 @@ -*cryptography-core -fromHexString: hexString - "Returns a byteArray from a hex string. The hex string can have - leading zeros that will not be truncated, preserving the size of the - byteArray for things like cyrptograpy" - | anInteger hexSize stringSize aStringOfHex | - aStringOfHex := (hexString copyWithoutAll: (Array with: $ with: Character cr with: Character tab)). - stringSize := aStringOfHex size. - (stringSize > 3 - and: [(aStringOfHex copyFrom: 1 to: 3) = '16r']) - ifTrue: [anInteger := Number readFrom: (aStringOfHex asUppercase at: 3 put: $r; - yourself). - hexSize := aStringOfHex size - 3 / 2] - ifFalse: [anInteger := Number readFrom: aStringOfHex asUppercase base: 16. - hexSize := aStringOfHex size / 2]. - ^ anInteger asByteArrayOfSize: hexSize asInteger \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/hexStringInNibbles.st b/source/Cryptography.package/ByteArray.extension/instance/hexStringInNibbles.st deleted file mode 100644 index e8abec3..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/hexStringInNibbles.st +++ /dev/null @@ -1,12 +0,0 @@ -*cryptography-core -hexStringInNibbles - - - ^ (self - inject: String new writeStream - into: [:stream :byte | - stream - nextPut: ('0123456789ABCDEF' at: byte // 16 + 1); - nextPut: ('0123456789ABCDEF' at: byte \\ 16 + 1); - nextPut: Character space. - stream]) contents. diff --git a/source/Cryptography.package/ByteArray.extension/instance/isProperlyPadded.st b/source/Cryptography.package/ByteArray.extension/instance/isProperlyPadded.st deleted file mode 100644 index f7b7a1a..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/isProperlyPadded.st +++ /dev/null @@ -1,9 +0,0 @@ -*cryptography-core -isProperlyPadded - "Verify my bytes have padding applied by #padToMultipleOf:. The padding scheme used here is option #2 as specified by Ferguson and Schneier in 'Practical Cryptography', p. 68-69." - | pad end start | - pad := self last. - end := self size. - start := end - pad + 1. - ^ start > 0 - and: [ (start to: end) allSatisfy: [ : each | (self at: each) = pad ] ] \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/padToMultipleOf..st b/source/Cryptography.package/ByteArray.extension/instance/padToMultipleOf..st deleted file mode 100644 index cac7491..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/padToMultipleOf..st +++ /dev/null @@ -1,15 +0,0 @@ -*cryptography-core -padToMultipleOf: blockSize - "Answer a new ByteArray that is padded to anInteger bytes. This is used by block-based ciphers where the length of the ByteArray to be encrypted must be a multiple of that ciphers #blockSize. The padding scheme used here is option #2 as specified by Ferguson and Schneier in 'Practical Cryptography', p. 68-69." - | answer pad | - answer := ByteArray new: (self paddedSize: blockSize). - answer - replaceFrom: 1 - to: self size - with: self - startingAt: 1. - pad := answer size - self size. - self size+1 - to: answer size - do: [ : x | answer at: x put: pad ]. - ^ answer \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/paddedSize..st b/source/Cryptography.package/ByteArray.extension/instance/paddedSize..st deleted file mode 100644 index 7734fb3..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/paddedSize..st +++ /dev/null @@ -1,4 +0,0 @@ -*cryptography-core -paddedSize: blockSize - "If my size is an exact multiple of blockSize, an entire pad-block is required. That's why we have the +1." - ^ (self size+1) roundUpTo: blockSize \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/toEBase64String.st b/source/Cryptography.package/ByteArray.extension/instance/toEBase64String.st deleted file mode 100644 index ea31640..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/toEBase64String.st +++ /dev/null @@ -1,33 +0,0 @@ -*cryptography-core -toEBase64String - - | base64Table stream firstIndex secondIndex thirdIndex fourthIndex extra | - base64Table := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=_'. - - stream := String new writeStream. - 1 to: self size - 2 by: 3 do: [:i | - firstIndex := ((self at: i) bitAnd: 16rFC) >> 2. - secondIndex := ((((self at: i) bitAnd: 16r03) << 4) bitOr: (((self at: i+1) bitAnd: 16rF0) >> 4)). - thirdIndex := ((((self at: i+1) bitAnd: 16r0F) << 2) bitOr: (((self at: i+2) bitAnd: 16rC0) >> 6)). - fourthIndex := ((self at: i+2) bitAnd: 16r3F). - stream nextPut: (base64Table at: firstIndex + 1). - stream nextPut: (base64Table at: secondIndex + 1). - stream nextPut: (base64Table at: thirdIndex + 1). - stream nextPut: (base64Table at: fourthIndex + 1)]. - - extra := self size - (self size // 3 * 3). - extra = 0 ifTrue: [^ stream contents]. - extra = 1 ifTrue: [ - firstIndex := ((self at: self size) bitAnd: 16rFC) >> 2. - secondIndex := ((self at: self size) bitAnd: 16r03) << 4. - stream nextPut: (base64Table at: firstIndex + 1). - stream nextPut: (base64Table at: secondIndex + 1). - ^ stream contents]. - extra = 2 ifTrue: [ - firstIndex := ((self at: self size - 1) bitAnd: 16rFC) >> 2. - secondIndex := ((((self at: self size - 1) bitAnd: 16r03) << 4) bitOr: (((self at: self size) bitAnd: 16rF0) >> 4)). - thirdIndex := ((self at: self size) bitAnd: 16r0F) << 2. - stream nextPut: (base64Table at: firstIndex + 1). - stream nextPut: (base64Table at: secondIndex + 1). - stream nextPut: (base64Table at: thirdIndex + 1). - ^ stream contents]. diff --git a/source/Cryptography.package/ByteArray.extension/instance/uint.at..st b/source/Cryptography.package/ByteArray.extension/instance/uint.at..st deleted file mode 100644 index bb40a75..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/uint.at..st +++ /dev/null @@ -1,29 +0,0 @@ -*cryptography-core -uint: bits at: anInteger - - | answer bytes | - bits == 64 ifTrue: [ ^ self unsigned64At: anInteger ]. - bits == 56 ifTrue: [ ^ self unsigned56At: anInteger ]. - bits == 48 ifTrue: [ ^ self unsigned48At: anInteger ]. - bits == 40 ifTrue: [ ^ self unsigned40At: anInteger ]. - bits == 32 - ifTrue: - [ ^ self - unsignedLongAt: anInteger - bigEndian: false ]. - bits == 16 - ifTrue: - [ ^ self - unsignedShortAt: anInteger - bigEndian: false ]. - bits == 8 - ifTrue: - [ ^ self byteAt: anInteger ]. - bytes := bits // 8. - answer := LargePositiveInteger new: bytes. - 1 to: bytes do: - [ :digitPosition | - answer - digitAt: digitPosition - put: (self at: digitPosition + anInteger - 1) ]. - ^answer normalize \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/uint.at.put..st b/source/Cryptography.package/ByteArray.extension/instance/uint.at.put..st deleted file mode 100644 index 9d8f0de..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/uint.at.put..st +++ /dev/null @@ -1,11 +0,0 @@ -*cryptography-core -uint: bits at: position put: anInteger - - position - to: position + (bits // 8) - 1 - do: - [ :pos | - self - at: pos - put: (anInteger digitAt: pos-position+1) ]. - ^ anInteger \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/unpad.st b/source/Cryptography.package/ByteArray.extension/instance/unpad.st deleted file mode 100644 index 528dc61..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/unpad.st +++ /dev/null @@ -1,7 +0,0 @@ -*cryptography-core -unpad - | pad end | - self isProperlyPadded ifFalse: [ CryptographyError signal: 'Authentication failure (improperly padded!)' ]. - pad := self last. - end := self size - pad. - ^ self copyFrom: 1 to: end \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/unpaddedSize.st b/source/Cryptography.package/ByteArray.extension/instance/unpaddedSize.st deleted file mode 100644 index f5cab39..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/unpaddedSize.st +++ /dev/null @@ -1,5 +0,0 @@ -*cryptography-core -unpaddedSize - "If I was padded by a BlockCipher, answer the size of the original plaintext." - self isProperlyPadded ifFalse: [ CryptographyError signal: 'Authentication failure (improperly padded!)' ]. - ^ self size - self last \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/unsigned40At..st b/source/Cryptography.package/ByteArray.extension/instance/unsigned40At..st deleted file mode 100644 index 9890c28..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/unsigned40At..st +++ /dev/null @@ -1,19 +0,0 @@ -*cryptography-core -unsigned40At: index - "Return a unsigned integer quantity starting from the given byte index" - - | b0 b1 b2 b3 w | - - w := self at: index. - b3 := self at: index+1. - b2 := self at: index+2. - b1 := self at: index+3. - b0 := self at: index+4. - - "Minimize LargeInteger arithmetic" - b3 = 0 ifFalse:[w := (b3 bitShift: 8) + w]. - b2 = 0 ifFalse:[w := (b2 bitShift: 16) + w]. - b1 = 0 ifFalse:[w := (b1 bitShift: 24) + w]. - b0 = 0 ifFalse:[w := (b0 bitShift: 32) + w]. - - ^w \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/unsigned48At..st b/source/Cryptography.package/ByteArray.extension/instance/unsigned48At..st deleted file mode 100644 index 3218022..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/unsigned48At..st +++ /dev/null @@ -1,21 +0,0 @@ -*cryptography-core -unsigned48At: index - "Return a unsigned integer quantity starting from the given byte index" - - | b0 b1 b2 b3 b4 w | - - w := self at: index. - b4 := self at: index+1. - b3 := self at: index+2. - b2 := self at: index+3. - b1 := self at: index+4. - b0 := self at: index+5. - - "Minimize LargeInteger arithmetic" - b4 = 0 ifFalse:[w := (b4 bitShift: 8) + w]. - b3 = 0 ifFalse:[w := (b3 bitShift: 16) + w]. - b2 = 0 ifFalse:[w := (b2 bitShift: 24) + w]. - b1 = 0 ifFalse:[w := (b1 bitShift: 32) + w]. - b0 = 0 ifFalse:[w := (b0 bitShift: 40) + w]. - - ^w \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/unsigned56At..st b/source/Cryptography.package/ByteArray.extension/instance/unsigned56At..st deleted file mode 100644 index 058f520..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/unsigned56At..st +++ /dev/null @@ -1,23 +0,0 @@ -*cryptography-core -unsigned56At: index - "Return a unsigned integer quantity starting from the given byte index" - - | b0 b1 b2 b3 b4 b5 w | - - w := self at: index. - b5 := self at: index+1. - b4 := self at: index+2. - b3 := self at: index+3. - b2 := self at: index+4. - b1 := self at: index+5. - b0 := self at: index+6. - - "Minimize LargeInteger arithmetic" - b5 = 0 ifFalse:[w := (b5 bitShift: 8) + w]. - b4 = 0 ifFalse:[w := (b4 bitShift: 16) + w]. - b3 = 0 ifFalse:[w := (b3 bitShift: 24) + w]. - b2 = 0 ifFalse:[w := (b2 bitShift: 32) + w]. - b1 = 0 ifFalse:[w := (b1 bitShift: 40) + w]. - b0 = 0 ifFalse:[w := (b0 bitShift: 48) + w]. - - ^w \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/instance/unsigned64At..st b/source/Cryptography.package/ByteArray.extension/instance/unsigned64At..st deleted file mode 100644 index 4888910..0000000 --- a/source/Cryptography.package/ByteArray.extension/instance/unsigned64At..st +++ /dev/null @@ -1,25 +0,0 @@ -*cryptography-core -unsigned64At: index - "Return a unsigned integer quantity starting from the given byte index" - - | b0 b1 b2 b3 b4 b5 b6 w | - - w := self at: index. - b6 := self at: index+1. - b5 := self at: index+2. - b4 := self at: index+3. - b3 := self at: index+4. - b2 := self at: index+5. - b1 := self at: index+6. - b0 := self at: index+7. - - "Minimize LargeInteger arithmetic" - b6 = 0 ifFalse:[w := (b6 bitShift: 8) + w]. - b5 = 0 ifFalse:[w := (b5 bitShift: 16) + w]. - b4 = 0 ifFalse:[w := (b4 bitShift: 24) + w]. - b3 = 0 ifFalse:[w := (b3 bitShift: 32) + w]. - b2 = 0 ifFalse:[w := (b2 bitShift: 40) + w]. - b1 = 0 ifFalse:[w := (b1 bitShift: 48) + w]. - b0 = 0 ifFalse:[w := (b0 bitShift: 56) + w]. - - ^w \ No newline at end of file diff --git a/source/Cryptography.package/ByteArray.extension/properties.json b/source/Cryptography.package/ByteArray.extension/properties.json deleted file mode 100644 index f81bcb8..0000000 --- a/source/Cryptography.package/ByteArray.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "ByteArray" -} \ No newline at end of file diff --git a/source/Cryptography.package/ByteString.extension/instance/destroy.st b/source/Cryptography.package/ByteString.extension/instance/destroy.st deleted file mode 100644 index ff64459..0000000 --- a/source/Cryptography.package/ByteString.extension/instance/destroy.st +++ /dev/null @@ -1,6 +0,0 @@ -*Cryptography-RandomAndPrime -destroy - "destroy this string by replacing every character with a space" - 1 to: self size do: [:i | - self at: i put: Character space - ] \ No newline at end of file diff --git a/source/Cryptography.package/ByteString.extension/instance/unsignedLongAt.bigEndian..st b/source/Cryptography.package/ByteString.extension/instance/unsignedLongAt.bigEndian..st deleted file mode 100644 index 18b4ec6..0000000 --- a/source/Cryptography.package/ByteString.extension/instance/unsignedLongAt.bigEndian..st +++ /dev/null @@ -1,20 +0,0 @@ -*Cryptography-RandomAndPrime -unsignedLongAt: index bigEndian: aBool - "Return a 32bit unsigned integer quantity starting from the given byte index" - | b0 b1 b2 w | - aBool ifTrue:[ - b0 := self byteAt: index. - b1 := self byteAt: index+1. - b2 := self byteAt: index+2. - w := self byteAt: index+3. - ] ifFalse:[ - w := self byteAt: index. - b2 := self byteAt: index+1. - b1 := self byteAt: index+2. - b0 := self byteAt: index+3. - ]. - "Minimize LargeInteger arithmetic" - b2 = 0 ifFalse:[w := (b2 bitShift: 8) + w]. - b1 = 0 ifFalse:[w := (b1 bitShift: 16) + w]. - b0 = 0 ifFalse:[w := (b0 bitShift: 24) + w]. - ^w \ No newline at end of file diff --git a/source/Cryptography.package/ByteString.extension/instance/unsignedLongAt.put.bigEndian..st b/source/Cryptography.package/ByteString.extension/instance/unsignedLongAt.put.bigEndian..st deleted file mode 100644 index c0aaae1..0000000 --- a/source/Cryptography.package/ByteString.extension/instance/unsignedLongAt.put.bigEndian..st +++ /dev/null @@ -1,20 +0,0 @@ -*Cryptography-RandomAndPrime -unsignedLongAt: index put: value bigEndian: aBool - "Store a 32bit unsigned integer quantity starting from the given byte index" - | b0 b1 b2 b3 | - b0 := value bitShift: -24. - b1 := (value bitShift: -16) bitAnd: 255. - b2 := (value bitShift: -8) bitAnd: 255. - b3 := value bitAnd: 255. - aBool ifTrue:[ - self byteAt: index put: b0. - self byteAt: index+1 put: b1. - self byteAt: index+2 put: b2. - self byteAt: index+3 put: b3. - ] ifFalse:[ - self byteAt: index put: b3. - self byteAt: index+1 put: b2. - self byteAt: index+2 put: b1. - self byteAt: index+3 put: b0. - ]. - ^value \ No newline at end of file diff --git a/source/Cryptography.package/ByteString.extension/properties.json b/source/Cryptography.package/ByteString.extension/properties.json deleted file mode 100644 index 8ff1001..0000000 --- a/source/Cryptography.package/ByteString.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "ByteString" -} \ No newline at end of file diff --git a/source/Cryptography.package/CBC.class/README.md b/source/Cryptography.package/CBC.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CBC.class/instance/decryptBlock..st b/source/Cryptography.package/CBC.class/instance/decryptBlock..st deleted file mode 100644 index dc8b90f..0000000 --- a/source/Cryptography.package/CBC.class/instance/decryptBlock..st +++ /dev/null @@ -1,13 +0,0 @@ -accessing -decryptBlock: aByteArray - | nextVector | - nextVector := aByteArray copy. - cipher decryptBlock: aByteArray. - 1 - to: aByteArray size - do: - [ : i | - aByteArray - at: i - put: ((vector at: i) bitXor: (aByteArray at: i)) ]. - self vector: nextVector \ No newline at end of file diff --git a/source/Cryptography.package/CBC.class/instance/encryptBlock..st b/source/Cryptography.package/CBC.class/instance/encryptBlock..st deleted file mode 100644 index 11a026b..0000000 --- a/source/Cryptography.package/CBC.class/instance/encryptBlock..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -encryptBlock: aByteArray - 1 - to: aByteArray size - do: - [ : i | - aByteArray - at: i - put: ((vector at: i) bitXor: (aByteArray at: i)) ]. - cipher encryptBlock: aByteArray. - self vector: aByteArray copy \ No newline at end of file diff --git a/source/Cryptography.package/CBC.class/properties.json b/source/Cryptography.package/CBC.class/properties.json deleted file mode 100644 index f380703..0000000 --- a/source/Cryptography.package/CBC.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipherMode", - "category" : "Cryptography-Core", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CBC", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CFB.class/README.md b/source/Cryptography.package/CFB.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CFB.class/instance/decryptBlock..st b/source/Cryptography.package/CFB.class/instance/decryptBlock..st deleted file mode 100644 index b1b9c34..0000000 --- a/source/Cryptography.package/CFB.class/instance/decryptBlock..st +++ /dev/null @@ -1,13 +0,0 @@ -accessing -decryptBlock: aByteArray - | nextVector | - nextVector := aByteArray copy. - cipher encryptBlock: vector. - 1 - to: aByteArray size - do: - [ : i | - aByteArray - at: i - put: ((vector at: i) bitXor: (aByteArray at: i)) ]. - self vector: nextVector \ No newline at end of file diff --git a/source/Cryptography.package/CFB.class/instance/encryptBlock..st b/source/Cryptography.package/CFB.class/instance/encryptBlock..st deleted file mode 100644 index 3f17b48..0000000 --- a/source/Cryptography.package/CFB.class/instance/encryptBlock..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -encryptBlock: aByteArray - cipher encryptBlock: vector. - 1 - to: aByteArray size - do: - [ : i | - aByteArray - at: i - put: ((vector at: i) bitXor: (aByteArray at: i)) ]. - self vector: aByteArray copy \ No newline at end of file diff --git a/source/Cryptography.package/CFB.class/instance/isStreamCipher.st b/source/Cryptography.package/CFB.class/instance/isStreamCipher.st deleted file mode 100644 index 02499d5..0000000 --- a/source/Cryptography.package/CFB.class/instance/isStreamCipher.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isStreamCipher - "Because the actual ciphertext plays a role in computing the next vector, streaming mode seems inappropriate for CFB. There's also an implementation issue; the vector is shortened after the last (irregularly sized) block, rendering that BlockCipher instance unusable.." - ^ false \ No newline at end of file diff --git a/source/Cryptography.package/CFB.class/properties.json b/source/Cryptography.package/CFB.class/properties.json deleted file mode 100644 index 6f1fb60..0000000 --- a/source/Cryptography.package/CFB.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipherMode", - "category" : "Cryptography-Core", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CFB", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/README.md b/source/Cryptography.package/CTR.class/README.md deleted file mode 100644 index ea74e9f..0000000 --- a/source/Cryptography.package/CTR.class/README.md +++ /dev/null @@ -1,9 +0,0 @@ -This CTR mode implementation was guided by - - Nils Ferguson, Bruce Schneier. Pratical Cryptography. - Wiley, 2003. - pp. 75-82, 111-127. - -With CTR, my initialVector is partitioned into a nonce and a counter ("i" in the book). My blockSize, 128-bits, are available to accommodate both of these "fields". The two of them combined together form my #initialVector (IV). The book suggests the nonce portion used as a message-number used also in sequencing messages of a secure-channel (chapter 8). The overall requirement is that the same initialVector (i.e., counter+nonce combination) never be used twice for this key (instance). The counter is re-set to 1 each time the nonce is set. - -If you run out of counter, I signal a CryptographyError. \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/counter..st b/source/Cryptography.package/CTR.class/instance/counter..st deleted file mode 100644 index e1d546b..0000000 --- a/source/Cryptography.package/CTR.class/instance/counter..st +++ /dev/null @@ -1,7 +0,0 @@ -private -counter: anInteger - vector - uint: counterBits - at: self positionOfCounter - put: anInteger. - counter := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/counter.st b/source/Cryptography.package/CTR.class/instance/counter.st deleted file mode 100644 index c4d98ab..0000000 --- a/source/Cryptography.package/CTR.class/instance/counter.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -counter - ^ counter \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/counterBits..st b/source/Cryptography.package/CTR.class/instance/counterBits..st deleted file mode 100644 index 8621068..0000000 --- a/source/Cryptography.package/CTR.class/instance/counterBits..st +++ /dev/null @@ -1,6 +0,0 @@ -initialization-release -counterBits: anInteger - ((16 to: 128 by: 16) includes: anInteger) ifFalse: - [ CryptographyError signal: 'invalid counter size' ]. - counterBits := anInteger. - maximumCounterValue := (1 bitShift: counterBits) - 1 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/counterBytes.st b/source/Cryptography.package/CTR.class/instance/counterBytes.st deleted file mode 100644 index 5dca52e..0000000 --- a/source/Cryptography.package/CTR.class/instance/counterBytes.st +++ /dev/null @@ -1,3 +0,0 @@ -private -counterBytes - ^ counterBits/8 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/decryptBlock..st b/source/Cryptography.package/CTR.class/instance/decryptBlock..st deleted file mode 100644 index 88bd581..0000000 --- a/source/Cryptography.package/CTR.class/instance/decryptBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -decryptBlock: aByteArray - "One of the advantages of CTR mode is that the decrypt implementation is exactly like the encrypt." - self encryptBlock: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/destroy.st b/source/Cryptography.package/CTR.class/instance/destroy.st deleted file mode 100644 index 48b4c58..0000000 --- a/source/Cryptography.package/CTR.class/instance/destroy.st +++ /dev/null @@ -1,4 +0,0 @@ -initialization-release -destroy - super destroy. - counter := 0 "avoid potential leakage" \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/encryptBlock..st b/source/Cryptography.package/CTR.class/instance/encryptBlock..st deleted file mode 100644 index abb4f71..0000000 --- a/source/Cryptography.package/CTR.class/instance/encryptBlock..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -encryptBlock: aByteArray - | kSubI | - kSubI := self nextBlock. - aByteArray withIndexDo: - [ : eachByte : x | - aByteArray - at: x - put: (eachByte bitXor: (kSubI at: x)). - "reduce leakage" - kSubI at: x put: 0 ] \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/highestNonce.st b/source/Cryptography.package/CTR.class/instance/highestNonce.st deleted file mode 100644 index 2dec61b..0000000 --- a/source/Cryptography.package/CTR.class/instance/highestNonce.st +++ /dev/null @@ -1,3 +0,0 @@ -private -highestNonce - ^ (1 bitShift: self nonceBits) - 1 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/incrementCounter.st b/source/Cryptography.package/CTR.class/instance/incrementCounter.st deleted file mode 100644 index fa6dbc9..0000000 --- a/source/Cryptography.package/CTR.class/instance/incrementCounter.st +++ /dev/null @@ -1,6 +0,0 @@ -private -incrementCounter - counter >= maximumCounterValue - ifTrue: - [ CryptographyError signal: 'cannot operate on more than ', maximumCounterValue printString, ' blocks at a time.' ]. - self counter: counter + 1 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/incrementNonce.st b/source/Cryptography.package/CTR.class/instance/incrementNonce.st deleted file mode 100644 index 92b03da..0000000 --- a/source/Cryptography.package/CTR.class/instance/incrementNonce.st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -incrementNonce - "increment my nonce" - | answer | - answer := self nonce + 1. - self nonce: answer. - ^ answer \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/initialize.st b/source/Cryptography.package/CTR.class/instance/initialize.st deleted file mode 100644 index cc0c4f8..0000000 --- a/source/Cryptography.package/CTR.class/instance/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -initialization-release -initialize - super initialize. - self counterBits: 32 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/isExpired.st b/source/Cryptography.package/CTR.class/instance/isExpired.st deleted file mode 100644 index 5f97f01..0000000 --- a/source/Cryptography.package/CTR.class/instance/isExpired.st +++ /dev/null @@ -1,3 +0,0 @@ -private -isExpired - ^ self nonce = self highestNonce \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/isStreamCipher.st b/source/Cryptography.package/CTR.class/instance/isStreamCipher.st deleted file mode 100644 index 4111f99..0000000 --- a/source/Cryptography.package/CTR.class/instance/isStreamCipher.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isStreamCipher - ^ true \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/nextBlock.st b/source/Cryptography.package/CTR.class/instance/nextBlock.st deleted file mode 100644 index 0e1e2c3..0000000 --- a/source/Cryptography.package/CTR.class/instance/nextBlock.st +++ /dev/null @@ -1,7 +0,0 @@ -private -nextBlock - | kSubI | - self incrementCounter. - kSubI := vector copy. "as named in the book" - cipher encryptBlock: kSubI. - ^ kSubI \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/nonce..st b/source/Cryptography.package/CTR.class/instance/nonce..st deleted file mode 100644 index a81fc77..0000000 --- a/source/Cryptography.package/CTR.class/instance/nonce..st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -nonce: anInteger - vector - uint: self nonceBits - at: self positionOfNonce - put: anInteger. - self counter: 0 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/nonce.st b/source/Cryptography.package/CTR.class/instance/nonce.st deleted file mode 100644 index abd5fe7..0000000 --- a/source/Cryptography.package/CTR.class/instance/nonce.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -nonce - ^ vector - uint: self nonceBits - at: self positionOfNonce \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/nonceBits.st b/source/Cryptography.package/CTR.class/instance/nonceBits.st deleted file mode 100644 index d202da7..0000000 --- a/source/Cryptography.package/CTR.class/instance/nonceBits.st +++ /dev/null @@ -1,4 +0,0 @@ -private -nonceBits - "The number of bits left over for the nonce." - ^ (self blockSize*8) - counterBits \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/positionOfCounter.st b/source/Cryptography.package/CTR.class/instance/positionOfCounter.st deleted file mode 100644 index 106fa28..0000000 --- a/source/Cryptography.package/CTR.class/instance/positionOfCounter.st +++ /dev/null @@ -1,3 +0,0 @@ -private -positionOfCounter - ^ 1 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/positionOfNonce.st b/source/Cryptography.package/CTR.class/instance/positionOfNonce.st deleted file mode 100644 index f75e446..0000000 --- a/source/Cryptography.package/CTR.class/instance/positionOfNonce.st +++ /dev/null @@ -1,3 +0,0 @@ -private -positionOfNonce - ^ self counterBytes + 1 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/instance/setCipher..st b/source/Cryptography.package/CTR.class/instance/setCipher..st deleted file mode 100644 index 3c575b6..0000000 --- a/source/Cryptography.package/CTR.class/instance/setCipher..st +++ /dev/null @@ -1,4 +0,0 @@ -initialization-release -setCipher: aCipher - super setCipher: aCipher. - self counter: 0 \ No newline at end of file diff --git a/source/Cryptography.package/CTR.class/properties.json b/source/Cryptography.package/CTR.class/properties.json deleted file mode 100644 index ab491aa..0000000 --- a/source/Cryptography.package/CTR.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "cmm 5/11/2006 22:33", - "super" : "BlockCipherMode", - "category" : "Cryptography-Core", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "counter", - "counterBits", - "maximumCounterValue" - ], - "name" : "CTR", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDESTest.class/README.md b/source/Cryptography.package/CryptoDESTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testDES.st b/source/Cryptography.package/CryptoDESTest.class/instance/testDES.st deleted file mode 100644 index 38cf2d2..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testDES.st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -testDES - | plain key d | - plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. - key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. - d := DES key: key. - d encryptBlock: plain. - self assert: plain = #(16rC9 16r57 16r44 16r25 16r6A 16r5E 16rD3 16r1D) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testDES2.st b/source/Cryptography.package/CryptoDESTest.class/instance/testDES2.st deleted file mode 100644 index 5c35f3e..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testDES2.st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -testDES2 - | plain key d | - plain := 'squeaker' asByteArray. - key := 'hacking!' asByteArray. - d := DES key: key. - d encryptBlock: plain. - self assert: plain = #[64 222 70 13 59 145 76 186] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testDES3.st b/source/Cryptography.package/CryptoDESTest.class/instance/testDES3.st deleted file mode 100644 index 4da27e2..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testDES3.st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -testDES3 - | plain plainCopy key d | - plain := 'squeaker'. - key := 'hacking!'. - plainCopy := plain copy. - d := DES key: key. - d encryptBlock: plainCopy. - self assert: plainCopy asByteArray = #[64 222 70 13 59 145 76 186]. diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testDESCBC.st b/source/Cryptography.package/CryptoDESTest.class/instance/testDESCBC.st deleted file mode 100644 index ecef21b..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testDESCBC.st +++ /dev/null @@ -1,15 +0,0 @@ -as yet unclassified -testDESCBC - | plain key encryptor decryptor vector | - plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. - key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. - vector := #(16r00 16r11 16r22 16r33 16r44 16r55 16r66 16r77) asByteArray. - encryptor := (DES key: key) cbc. - encryptor initialVector: vector copy. - decryptor := (DES key: key) cbc. - decryptor initialVector: vector copy. - encryptor encryptBlock: plain. - decryptor decryptBlock: plain. - encryptor encryptBlock: plain. - decryptor decryptBlock: plain. - self assert: plain = #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testDESFormal.st b/source/Cryptography.package/CryptoDESTest.class/instance/testDESFormal.st deleted file mode 100644 index 39615c4..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testDESFormal.st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -testDESFormal - | x d | - x := #(16r94 16r74 16rB8 16rE8 16rC7 16r3B 16rCA 16r7D) asByteArray. - 1 to: 16 do: [:i | - d := DES key: x. - (i - 1) even - ifTrue: [d encryptBlock: x] - ifFalse: [d decryptBlock: x] ]. - self assert: x = #(16r1B 16r1A 16r2D 16rDB 16r4C 16r64 16r24 16r38) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testTripleDES.st b/source/Cryptography.package/CryptoDESTest.class/instance/testTripleDES.st deleted file mode 100644 index 4e88a1a..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testTripleDES.st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -testTripleDES - | plain key d | - plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. - key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. - d := TripleDES key: key. - d encryptBlock: plain. - self assert: plain = #(16rC9 16r57 16r44 16r25 16r6A 16r5E 16rD3 16r1D) asByteArray. - d decryptBlock: plain. - self assert: plain = #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. diff --git a/source/Cryptography.package/CryptoDESTest.class/instance/testTripleDESCBC.st b/source/Cryptography.package/CryptoDESTest.class/instance/testTripleDESCBC.st deleted file mode 100644 index faafe34..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/instance/testTripleDESCBC.st +++ /dev/null @@ -1,15 +0,0 @@ -as yet unclassified -testTripleDESCBC - | plain key encryptor decryptor vector | - plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. - key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. - vector := #(16r00 16r11 16r22 16r33 16r44 16r55 16r66 16r77) asByteArray. - encryptor := (TripleDES key: key) cbc. - encryptor initialVector: vector copy. - decryptor := (TripleDES key: key) cbc. - decryptor initialVector: vector copy. - encryptor encryptBlock: plain. - decryptor decryptBlock: plain. - encryptor encryptBlock: plain. - decryptor decryptBlock: plain. - self assert: plain = #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDESTest.class/properties.json b/source/Cryptography.package/CryptoDESTest.class/properties.json deleted file mode 100644 index b6be971..0000000 --- a/source/Cryptography.package/CryptoDESTest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoDESTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDSATest.class/README.md b/source/Cryptography.package/CryptoDSATest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoDSATest.class/instance/dsaPrivateKey.st b/source/Cryptography.package/CryptoDSATest.class/instance/dsaPrivateKey.st deleted file mode 100644 index 42d6970..0000000 --- a/source/Cryptography.package/CryptoDSATest.class/instance/dsaPrivateKey.st +++ /dev/null @@ -1,7 +0,0 @@ -DSA -dsaPrivateKey - ^ DSAPrivateKey - p: 8343811888543852523216773185009428259187948644369498021763210776677854991854533186365944349987509452133156416880596803846631577352387751880552969116768071 - q: 1197175832754339660404549606408619548226315875117 - g: 1433467472198821951822151391684734233265646022897503720591270330985699984763922266163182803556189497900262038518780931942996381297743579119123094520048965 - x: 957348690772296812 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDSATest.class/instance/dsaPublicKey.st b/source/Cryptography.package/CryptoDSATest.class/instance/dsaPublicKey.st deleted file mode 100644 index aace87f..0000000 --- a/source/Cryptography.package/CryptoDSATest.class/instance/dsaPublicKey.st +++ /dev/null @@ -1,7 +0,0 @@ -as yet unclassified -dsaPublicKey - ^ DSAPublicKey - p: 8343811888543852523216773185009428259187948644369498021763210776677854991854533186365944349987509452133156416880596803846631577352387751880552969116768071 - q: 1197175832754339660404549606408619548226315875117 - g: 1433467472198821951822151391684734233265646022897503720591270330985699984763922266163182803556189497900262038518780931942996381297743579119123094520048965 - y: 4645213122572190617807944614677917601101008235397095646475699959851618402406173485853587185431290863173614335452934961425661774118334228449202337038283799 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDSATest.class/instance/testDSASigningAndVerifying.st b/source/Cryptography.package/CryptoDSATest.class/instance/testDSASigningAndVerifying.st deleted file mode 100644 index 4beac94..0000000 --- a/source/Cryptography.package/CryptoDSATest.class/instance/testDSASigningAndVerifying.st +++ /dev/null @@ -1,6 +0,0 @@ -DSA -testDSASigningAndVerifying - | msg sig | - msg := 'This is a test...'. - sig := self dsaPrivateKey signMessage: msg. - self assert: (self dsaPublicKey verify: sig isSignatureOf: msg) \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDSATest.class/properties.json b/source/Cryptography.package/CryptoDSATest.class/properties.json deleted file mode 100644 index 45c0881..0000000 --- a/source/Cryptography.package/CryptoDSATest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoDSATest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDiffieHellmanTest.class/README.md b/source/Cryptography.package/CryptoDiffieHellmanTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/generator.st b/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/generator.st deleted file mode 100644 index 01dee14..0000000 --- a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/generator.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -generator - - ^ 19717436579274206947345122013064021491006648667525860934655329476450089156965164852462918009904002231332897658527803 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/prime.st b/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/prime.st deleted file mode 100644 index dc2b19a..0000000 --- a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/prime.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -prime - - ^ 75736283208334870880874184828066736731062763491072315486250947429607562308928878772529680132938244784039544211105987 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/testDiffieHellman.st b/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/testDiffieHellman.st deleted file mode 100644 index 3a12c6c..0000000 --- a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/testDiffieHellman.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -testDiffieHellman - - | alice bob fromAlice fromBob k1 k2 | - alice := DiffieHellman prime: self prime generator: self generator. - bob := DiffieHellman prime: self prime generator: self generator. - fromAlice := alice sendMessage. - fromBob := bob sendMessage. - k1 := alice receiveMessage: fromBob. - k2 := bob receiveMessage: fromAlice. - self assert: k1 = k2 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/testDiffieHellmanWithGeneration.st b/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/testDiffieHellmanWithGeneration.st deleted file mode 100644 index 7346c4a..0000000 --- a/source/Cryptography.package/CryptoDiffieHellmanTest.class/instance/testDiffieHellmanWithGeneration.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -testDiffieHellmanWithGeneration - - | alice bob fromAlice fromBob k1 k2 | - alice := DiffieHellman bits: 64. "very low for speed" - bob := DiffieHellman prime: alice prime generator: alice generator. - fromAlice := alice sendMessage. - fromBob := bob sendMessage. - k1 := alice receiveMessage: fromBob. - k2 := bob receiveMessage: fromAlice. - self assert: k1 = k2 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoDiffieHellmanTest.class/properties.json b/source/Cryptography.package/CryptoDiffieHellmanTest.class/properties.json deleted file mode 100644 index 2f38b23..0000000 --- a/source/Cryptography.package/CryptoDiffieHellmanTest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoDiffieHellmanTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/README.md b/source/Cryptography.package/CryptoElGamalTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/elGamalGeneratorOfSize..st b/source/Cryptography.package/CryptoElGamalTest.class/instance/elGamalGeneratorOfSize..st deleted file mode 100644 index 9050371..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/elGamalGeneratorOfSize..st +++ /dev/null @@ -1,7 +0,0 @@ -ElGamal -elGamalGeneratorOfSize: bits - ^ elGamalGenerators - at: bits - ifAbsent: - [ "We should at least run the generator code to be sure it gets tested." - ElGamalKeyGenerator new generateKeysOfSize: bits ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/elGamalSizes.st b/source/Cryptography.package/CryptoElGamalTest.class/instance/elGamalSizes.st deleted file mode 100644 index c0f55ee..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/elGamalSizes.st +++ /dev/null @@ -1,5 +0,0 @@ -ElGamal -elGamalSizes -" ^#(384 512 768 1024 2048 )" - - ^#(64 512 ) \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/initialize.st b/source/Cryptography.package/CryptoElGamalTest.class/instance/initialize.st deleted file mode 100644 index 05dec91..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -initialize -initialize - super initialize. - self - initializeElGamalGenerators \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/initializeElGamalGenerators.st b/source/Cryptography.package/CryptoElGamalTest.class/instance/initializeElGamalGenerators.st deleted file mode 100644 index 7f4d1a9..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/initializeElGamalGenerators.st +++ /dev/null @@ -1,20 +0,0 @@ -ElGamal -initializeElGamalGenerators - elGamalGenerators := Dictionary new - - at: 512 - put: - (ElGamalKeyGenerator basicNew instVarAt: 1 put: 14997038101000471656908825146898513563002169840799091820711874590927961409550512572428509314042888054869079913003134043613271458211821248434060678863943999; instVarAt: 2 put: 5361564564837954391893723942228287597694468337177799740324910691768071826418893848377283607598491893249419038971685698869752393654611799189607985606751717; instVarAt: 3 put: 14403853607602337679914835868070068312873008366859520925460200717630345023960768832597791608212285651911616689566045479334218776261375380546818169284633222; yourself) ; - at: 768 - put: "time to generate (1.3GHz laptop): 0:00:15:35.71" - (ElGamalKeyGenerator basicNew instVarAt: 1 put: 1627332758910669005349673899493430221060426291376421198672767104943990188121953540024154874632086014644358143872462042844845205724969954316173299451580831206047385225398963232807212824639418997262644394808208010952184597290928279083; instVarAt: 2 put: 637353925196181662716534281309417485695156757195851477182610451877569627941960958993724216664932866527382869766700707821847752783200389297904293272300703210689296849853090260886879923123065483201535107015232963789463552975559327338; instVarAt: 3 put: 1382119909913548250681949383374805537713040446907845318586396338232006123603639447180435936299472529495807027144078416474159199852128556879205262745414383327498575491661863562367989514634268303068691788866483656964224388150042511145; yourself) ; - - at: 1024 - put: "time to generate (1.3GHz laptop): 0:00:47:36.288" - (ElGamalKeyGenerator basicNew instVarAt: 1 put: 187962930112203130099304875066550992472989894755401650849423145019107775415120153753379890896898159468888909642301301426861539004261391697652587719733773666895578476166092219394431668865654035130702071975227577489091637769871178365952593486414574736105032572563196302943313478263258078003344616094907879494183; instVarAt: 2 put: 101379856798288932395208478694565744867478878485170411883016695448216014229040233878325777809530026322981840402000631493588538174303052403820192798556612765069387657111145929959798776355339656977979943366339321986473695320247202765836954753923663960196445984306386126700715069527679925061366367143594939752311; instVarAt: 3 put: 166515262641331249052409678632107998360295620903954709872386461965666190307310785117636796778342643935688990419372071274434257100649608137040102448736492114478048476296404763678373473030171410691968491068014395855534564710476510365843729427792397083999439079005119559363379365315966400331819925035641027782262; yourself) ; - - at: 2048 - put: "time to generate (1.3GHz laptop): 0:10:12:51.318" - (ElGamalKeyGenerator basicNew instVarAt: 1 put: 43744550524640778592149701468321500307659483711161614933780759317538835660018499584863359875319736195497834842011206606111677937058576081833326123611960958651716618573704725631301784031019401088209827585193009767033768284401492225440611202384860046570022594166194086374043414523106999827113761864480276549701342546190042502746170762523030838415181639559467384246646980630730354186842888000169398408845020528778902676590121957276525059882643422002341827009727652951788957728483337275699584610825200769579177116050586037396083453876647282696542617919089209621847548931160771918736412809101535195712578982414848324842023; instVarAt: 2 put: 10712249143584610517062034706393748750841448112842264168635103160726320592857516094777199394038060786699730059487045452474549294208077531478734497996197653738535125856484035290422114479816131356589211862230201414545738081276869984650096988089393906878268413233796553170847827164856623679160971724585707100834284358979484189497136931922824212488771387863590257584963981297527371077585758027526026146064280994391353033474013279212299950762699784082492767463217396754190025401868735342133341990021934718202416382949744384380039458404029702056002896172354530543264720995892165487343788849479311283598302664326567957332056; instVarAt: 3 put: 34071313526526550964319859214388665314022163381999037971182526093331137188777643466498971633059086483606132787656147890791281175830824595869636722657222797206435777085613341792023090529456287226683946127489180430863850983140873843765939491483118681168525418491145087283699270267894578719923555878333437301788432335456184779553157758814789690967079053314015566185742547007752259485986859847843898791493225888341829225652240920951193796829090836607954659113174671564171844005862397483897607655449822950579836313328217159525558966188520476621728360816330014688201932196096220643747293750747578885327851920080280020579421; yourself) ; - - yourself \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/performElGamalEncryption..st b/source/Cryptography.package/CryptoElGamalTest.class/instance/performElGamalEncryption..st deleted file mode 100644 index 03230cc..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/performElGamalEncryption..st +++ /dev/null @@ -1,9 +0,0 @@ -ElGamal -performElGamalEncryption: bits - | elgamal pub priv c element | - elgamal := self elGamalGeneratorOfSize: bits. - pub := elgamal publicKey. - priv := elgamal privateKey. - element := (SecureRandom picker nextBits: bits). - c := pub encryptElement: element. - self assert: (priv decryptElement: c) = element \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/performElGamalSignature..st b/source/Cryptography.package/CryptoElGamalTest.class/instance/performElGamalSignature..st deleted file mode 100644 index 1e34e52..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/performElGamalSignature..st +++ /dev/null @@ -1,9 +0,0 @@ -ElGamal -performElGamalSignature: bits - | elgamal pub priv signature message | - elgamal := self elGamalGeneratorOfSize: bits. - pub := elgamal publicKey. - priv := elgamal privateKey. - message := SecureRandom picker nextBits: bits. - signature := priv signMessage: message. - self assert: (pub verifySignature: signature onMessage: message) \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/testElGamalEncryption.st b/source/Cryptography.package/CryptoElGamalTest.class/instance/testElGamalEncryption.st deleted file mode 100644 index 87b2ed0..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/testElGamalEncryption.st +++ /dev/null @@ -1,3 +0,0 @@ -ElGamal -testElGamalEncryption - self elGamalSizes do: [:eachBits | self performElGamalEncryption: eachBits] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/instance/testElGamalSignature.st b/source/Cryptography.package/CryptoElGamalTest.class/instance/testElGamalSignature.st deleted file mode 100644 index 3900a5f..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/instance/testElGamalSignature.st +++ /dev/null @@ -1,3 +0,0 @@ -ElGamal -testElGamalSignature - self elGamalSizes do: [:eachBits | self performElGamalSignature: eachBits] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoElGamalTest.class/properties.json b/source/Cryptography.package/CryptoElGamalTest.class/properties.json deleted file mode 100644 index a106d9b..0000000 --- a/source/Cryptography.package/CryptoElGamalTest.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "elGamalGenerators" - ], - "name" : "CryptoElGamalTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/README.md b/source/Cryptography.package/CryptoHashFunctionTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testHMAC.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testHMAC.st deleted file mode 100644 index 5c54d54..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testHMAC.st +++ /dev/null @@ -1,5 +0,0 @@ -hash algorithms -testHMAC - self assert: (MD5 new hmac key: (ByteArray new: 16 withAll: 16r0B); digestMessage: 'Hi There' asByteArray) asInteger = 16r9294727A3638BB1C13F48EF8158BFC9D. - self assert: (MD5 new hmac key: 'Jefe' asByteArray; digestMessage: 'what do ya want for nothing?' asByteArray) asInteger = 16r750C783E6AB0B503EAA86E310A5DB738. - self assert: (MD5 new hmac key: (ByteArray new: 16 withAll: 16rAA); digestMessage: (ByteArray new: 50 withAll: 16rDD)) asInteger = 16r56BE34521D144C88DBB8C733F0E8B3F6 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testHMACSHA1.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testHMACSHA1.st deleted file mode 100644 index 7791217..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testHMACSHA1.st +++ /dev/null @@ -1,3 +0,0 @@ -hash algorithms -testHMACSHA1 - self assert: ((SHA1 new hmac key: (ByteArray new: 16 withAll: 16r0B); digestMessage: 'Hi There' asByteArray) asByteArray) = #(16r67 16r5B 16rB 16r3A 16r1B 16r4D 16rDF 16r4E 16r12 16r48 16r72 16rDA 16r6C 16r2F 16r63 16r2B 16rFE 16rD9 16r57 16rE9) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testLargeSHA1.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testLargeSHA1.st deleted file mode 100644 index 3e58e06..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testLargeSHA1.st +++ /dev/null @@ -1,4 +0,0 @@ -hash algorithms -testLargeSHA1 - "Here is the third example from the specification document (FIPS PUB 180-1). This example may take several minutes." - self assert: (SHA1 hashMessage: (String new: 1000000 withAll: $a)) asInteger = 16r34AA973CD4C4DAA4F61EEB2BDBAD27316534016F \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD2.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD2.st deleted file mode 100644 index 4f13495..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD2.st +++ /dev/null @@ -1,9 +0,0 @@ -hash algorithms -testMD2 - self assert: (MD2 hashMessage: '') asInteger = 16r8350E5A3E24C153DF2275C9F80692773. - self assert: (MD2 hashMessage: 'a') asInteger = 16r32EC01EC4A6DAC72C0AB96FB34C0B5D1. - self assert: (MD2 hashMessage: 'abc') asInteger = 16rDA853B0D3F88D99B30283A69E6DED6BB. - self assert: (MD2 hashMessage: 'message digest') asInteger = 16rAB4F496BFB2A530B219FF33031FE06B0. - self assert: (MD2 hashMessage: 'abcdefghijklmnopqrstuvwxyz') asInteger = 16r4E8DDFF3650292AB5A4108C3AA47940B. - self assert: (MD2 hashMessage: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') asInteger = 16rDA33DEF2A42DF13975352846C30338CD. - self assert: (MD2 hashMessage: '12345678901234567890123456789012345678901234567890123456789012345678901234567890') asInteger = 16rD5976F79D83D3A0DC9806C3C66F3EFD8. \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD4.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD4.st deleted file mode 100644 index 02d5fd8..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD4.st +++ /dev/null @@ -1,3 +0,0 @@ -hash algorithms -testMD4 - self assert: (MD4 hashMessage: #(115 0 115 0 110 0) asByteArray) = #(252 63 129 51 180 217 221 240 64 37 167 140 183 214 26 126) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD5.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD5.st deleted file mode 100644 index 94a9b18..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD5.st +++ /dev/null @@ -1,10 +0,0 @@ -hash algorithms -testMD5 - - self assert: (MD5 hashMessage: '') asInteger = 16rD41D8CD98F00B204E9800998ECF8427E. - self assert: (MD5 hashMessage: 'a') asInteger = 16r0CC175B9C0F1B6A831C399E269772661. - self assert: (MD5 hashMessage: 'abc') asInteger = 16r900150983CD24FB0D6963F7D28E17F72. - self assert: (MD5 hashMessage: 'message digest') asInteger = 16rF96B697D7CB7938D525A2F31AAF161D0. - self assert: (MD5 hashMessage: 'abcdefghijklmnopqrstuvwxyz') asInteger = 16rC3FCD3D76192E4007DFB496CCA67E13B. - self assert: (MD5 hashMessage: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') asInteger = 16rD174AB98D277D9F5A5611C2C9F419D9F. - self assert: (MD5 hashMessage: '12345678901234567890123456789012345678901234567890123456789012345678901234567890') asInteger = 16r57EDF4A22BE3C955AC49DA2E2107B67A \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD5Implementations.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD5Implementations.st deleted file mode 100644 index 7be9c46..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testMD5Implementations.st +++ /dev/null @@ -1,13 +0,0 @@ -hash algorithms -testMD5Implementations - "Check if the two implementations give the same results. Do nothing if the plugin is not available" - - | data | - MD5 isPluginAvailable ifFalse: [ ^self ]. - data := ''. - 100 timesRepeat: [ - | primitive nonPrimitive | - primitive := MD5NonPrimitive basicNew hashMessage: data. - nonPrimitive := MD5WithPrimitive basicNew hashMessage: data. - self assert: primitive = nonPrimitive. - data := data, 'Squeak' ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA1.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA1.st deleted file mode 100644 index d78f1a1..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA1.st +++ /dev/null @@ -1,4 +0,0 @@ -hash algorithms -testSHA1 - self assert: (SHA1 hashMessage: 'abc') asInteger = 16rA9993E364706816ABA3E25717850C26C9CD0D89D. - self assert: (SHA1 hashMessage: 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') asInteger = 16r84983E441C3BD26EBAAE4AA1F95129E5E54670F1 diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA256.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA256.st deleted file mode 100644 index 131c234..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA256.st +++ /dev/null @@ -1,8 +0,0 @@ -hash algorithms -testSHA256 - "these tests come from http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf" - - self assert: (SHA256 hashMessage: 'abc') asInteger = 16rBA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD. - self assert: (SHA256 hashMessage: 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') asInteger = 16r248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1. - SHA256 isPluginAvailable ifTrue: [ "takes a while to run without the plugin" - self assert: (SHA256 hashMessage: (String new: 1000000 withAll: $a)) asInteger = 16rCDC76E5C9914FB9281A1C7E284D73E67F1809A48A497200E046D39CCC7112CD0 ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA256Implementations.st b/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA256Implementations.st deleted file mode 100644 index 329b4e6..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/instance/testSHA256Implementations.st +++ /dev/null @@ -1,13 +0,0 @@ -hash algorithms -testSHA256Implementations - "Check if the two implementations give the same results. Do nothing if the plugin is not available" - - | data | - SHA256 isPluginAvailable ifFalse: [ ^self ]. - data := ''. - 100 timesRepeat: [ - | primitive nonPrimitive | - primitive := SHA256NonPrimitive basicNew hashMessage: data. - nonPrimitive := SHA256WithPrimitive basicNew hashMessage: data. - self assert: primitive = nonPrimitive. - data := data, 'Squeak' ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoHashFunctionTest.class/properties.json b/source/Cryptography.package/CryptoHashFunctionTest.class/properties.json deleted file mode 100644 index 71d47d2..0000000 --- a/source/Cryptography.package/CryptoHashFunctionTest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoHashFunctionTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRC2Test.class/README.md b/source/Cryptography.package/CryptoRC2Test.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoRC2Test.class/instance/genericARC2TestKey.effectiveKeyLength.plaintext.ciphertext..st b/source/Cryptography.package/CryptoRC2Test.class/instance/genericARC2TestKey.effectiveKeyLength.plaintext.ciphertext..st deleted file mode 100644 index 291b90f..0000000 --- a/source/Cryptography.package/CryptoRC2Test.class/instance/genericARC2TestKey.effectiveKeyLength.plaintext.ciphertext..st +++ /dev/null @@ -1,11 +0,0 @@ -testing -genericARC2TestKey: key effectiveKeyLength: aLength plaintext: plainText ciphertext: ciphertext - | vector rc2 | - vector := plainText copy. - rc2 := ARC2 key: key effectiveKeyLength: aLength. - rc2 encryptBlock: vector. - self assert: vector = ciphertext. - - rc2 decryptBlock: vector. - self assert: vector = plainText. - rc2 destroy. \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRC2Test.class/instance/testARC2.st b/source/Cryptography.package/CryptoRC2Test.class/instance/testARC2.st deleted file mode 100644 index c90c60b..0000000 --- a/source/Cryptography.package/CryptoRC2Test.class/instance/testARC2.st +++ /dev/null @@ -1,68 +0,0 @@ -testing -testARC2 - " All quantities are given in hexadecimal notation. - - Key length (bytes) = 8 - Effective key length (bits) = 63 - Key = 00000000 00000000 - Plaintext = 00000000 00000000 - Ciphertext = ebb773f9 93278eff " - - self genericARC2TestKey: (ByteArray fromHexString: '00000000 00000000') effectiveKeyLength: 63 plaintext: (ByteArray fromHexString: '00000000 00000000') ciphertext: (ByteArray fromHexString: 'ebb773f9 93278eff'). - - "Key length (bytes) = 8 - Effective key length (bits) = 64 - Key = ffffffff ffffffff - Plaintext = ffffffff ffffffff - Ciphertext = 278b27e4 2e2f0d49" - - self genericARC2TestKey: (ByteArray fromHexString: 'ffffffff ffffffff') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: 'ffffffff ffffffff') ciphertext: (ByteArray fromHexString: '278b27e4 2e2f0d49'). - - "Key length (bytes) = 8 - Effective key length (bits) = 64 - Key = 30000000 00000000 - Plaintext = 10000000 00000001 - Ciphertext = 30649edf 9be7d2c2" - - self genericARC2TestKey: (ByteArray fromHexString: '30000000 00000000') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '10000000 00000001') ciphertext: (ByteArray fromHexString: '30649edf 9be7d2c2'). - - "Key length (bytes) = 1 - Effective key length (bits) = 64 - Key = 88 - Plaintext = 00000000 00000000 - Ciphertext = 61a8a244 adacccf0" - - self genericARC2TestKey: (ByteArray fromHexString: '88') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '00000000 00000000') ciphertext: (ByteArray fromHexString: '61a8a244 adacccf0'). - - "Key length (bytes) = 7 - Effective key length (bits) = 64 - Key = 88bca90e 90875a - Plaintext = 00000000 00000000 - Ciphertext = 6ccf4308 974c267f" - - self genericARC2TestKey: (ByteArray fromHexString: '88bca90e 90875a') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '00000000 00000000') ciphertext: (ByteArray fromHexString: '6ccf4308 974c267f'). - - "Key length (bytes) = 16 - Effective key length (bits) = 64 - Key = 88bca90e 90875a7f 0f79c384 627bafb2 - Plaintext = 00000000 00000000 - Ciphertext = 1a807d27 2bbe5db1" - - self genericARC2TestKey: (ByteArray fromHexString: '88bca90e 90875a7f 0f79c384 627bafb2') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '00000000 00000000') ciphertext: (ByteArray fromHexString: '1a807d27 2bbe5db1'). - - "Key length (bytes) = 16 - Effective key length (bits) = 128 - Key = 88bca90e 90875a7f 0f79c384 627bafb2 - Plaintext = 00000000 00000000 - Ciphertext = 2269552a b0f85ca6" - - self genericARC2TestKey: (ByteArray fromHexString: '88bca90e 90875a7f 0f79c384 627bafb2') effectiveKeyLength: 128 plaintext: (ByteArray fromHexString: '00000000 00000000') ciphertext: (ByteArray fromHexString: '2269552a b0f85ca6'). - - "Key length (bytes) = 33 - Effective key length (bits) = 129 - Key = 88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 - c42fceb0 be255daf 1e - Plaintext = 00000000 00000000 - Ciphertext = 5b78d3a4 3dfff1f1" - - self genericARC2TestKey: (ByteArray fromHexString: '88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 c42fceb0 be255daf 1e') effectiveKeyLength: 129 plaintext: (ByteArray fromHexString: '00000000 00000000') ciphertext: (ByteArray fromHexString: '5b78d3a4 3dfff1f1'). \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRC2Test.class/properties.json b/source/Cryptography.package/CryptoRC2Test.class/properties.json deleted file mode 100644 index 3afb5c7..0000000 --- a/source/Cryptography.package/CryptoRC2Test.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoRC2Test", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRC4Test.class/README.md b/source/Cryptography.package/CryptoRC4Test.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoRC4Test.class/instance/genericARC4TestKey.plaintext.ciphertext..st b/source/Cryptography.package/CryptoRC4Test.class/instance/genericARC4TestKey.plaintext.ciphertext..st deleted file mode 100644 index 497dea8..0000000 --- a/source/Cryptography.package/CryptoRC4Test.class/instance/genericARC4TestKey.plaintext.ciphertext..st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -genericARC4TestKey: key plaintext: plaintext ciphertext: ciphertext - | vector rc4 | - vector := plaintext copy. - rc4 := ARC4 new. - rc4 key: key. - vector := rc4 encrypt: vector. - self assert: vector = ciphertext \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRC4Test.class/instance/testARC4.st b/source/Cryptography.package/CryptoRC4Test.class/instance/testARC4.st deleted file mode 100644 index 5e52fb7..0000000 --- a/source/Cryptography.package/CryptoRC4Test.class/instance/testARC4.st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -testARC4 - self genericARC4TestKey: #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) plaintext: #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) ciphertext: #(16r75 16rB7 16r87 16r80 16r99 16rE0 16rC5 16r96). - self genericARC4TestKey: #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) plaintext: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) ciphertext: #(16r74 16r94 16rC2 16rE7 16r10 16r4B 16r08 16r79). - self genericARC4TestKey: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) plaintext: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) ciphertext: #(16rDE 16r18 16r89 16r41 16rA3 16r37 16r5D 16r3A). - self genericARC4TestKey: #(16rEF 16r01 16r23 16r45) plaintext: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) ciphertext: #(16rD6 16rA1 16r41 16rA7 16rEC 16r3C 16r38 16rDF 16rBD 16r61) \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRC4Test.class/properties.json b/source/Cryptography.package/CryptoRC4Test.class/properties.json deleted file mode 100644 index 2fef25b..0000000 --- a/source/Cryptography.package/CryptoRC4Test.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoRC4Test", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRandomTest.class/README.md b/source/Cryptography.package/CryptoRandomTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoRandomTest.class/instance/testRandomGenerators.st b/source/Cryptography.package/CryptoRandomTest.class/instance/testRandomGenerators.st deleted file mode 100644 index 2694f9f..0000000 --- a/source/Cryptography.package/CryptoRandomTest.class/instance/testRandomGenerators.st +++ /dev/null @@ -1,15 +0,0 @@ -others -testRandomGenerators - | random randomBytes | - RandomGenerator allSubclassesDo: - [ : each | - random := each withGeneratedKey. - 100 timesRepeat: - [ self assert: ((random nextBits: 1) between: 0 and: 1) ]. - 100 timesRepeat: [ self assert: (random nextBits: 1024) highBit <= 1024 ]. - "Random enough to span all 10 within 100-elements?" - self assert: ((1 to: 100) collect: [ : n | random nextInt: 10 ]) asSet asSortedCollection = (1 to: 10) asSortedCollection. - randomBytes := random nextBytes: 100. - self - assert: randomBytes size = 100 ; - assert: randomBytes asSet size > 1 "if this fails, I wanna see it!" ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRandomTest.class/properties.json b/source/Cryptography.package/CryptoRandomTest.class/properties.json deleted file mode 100644 index f2c71f5..0000000 --- a/source/Cryptography.package/CryptoRandomTest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoRandomTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/README.md b/source/Cryptography.package/CryptoRigndaelCBCTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testByteArrayFromHexString.st b/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testByteArrayFromHexString.st deleted file mode 100644 index 55d4bd0..0000000 --- a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testByteArrayFromHexString.st +++ /dev/null @@ -1,8 +0,0 @@ -tests -testByteArrayFromHexString - "this test requres that the cryptography core method fromHexString be loaded the main purpose of the method fromHexString is to - ensure leading zeros are not chopped off and that small case letters in hex strings are allowed" - self assert: (ByteArray fromHexString: '16r000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f') storeString = - '#[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31]'. - self assert: (ByteArray fromHexString: '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f') storeString = - '#[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31]'. \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case1.st b/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case1.st deleted file mode 100644 index 5501785..0000000 --- a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case1.st +++ /dev/null @@ -1,14 +0,0 @@ -tests -testRFC3602Case1 - "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html - Case #1: Encrypting 16 bytes (1 block) using AES-CBC with 128-bit key - Key : 0x06a9214036b8a15b512e03d534120006 - IV : 0x3dafba429d9eb430b422da802c9fac41 - Plaintext : 'Single block msg' - Ciphertext: 0xe353779c1079aeb82708942dbe77181a" - | result | - ((CBC on: (Rijndael new keySize: 16; - key: (ByteArray fromHexString: '06a9214036b8a15b512e03d534120006'))) - initialVector: (ByteArray fromHexString: '3dafba429d9eb430b422da802c9fac41')) - encryptBlock: (result := 'Single block msg' asByteArray). - self assert: result hex = 'e353779c1079aeb82708942dbe77181a' \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case2.st b/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case2.st deleted file mode 100644 index d1a1ade..0000000 --- a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case2.st +++ /dev/null @@ -1,17 +0,0 @@ -tests -testRFC3602Case2 - "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html - Case #2: Encrypting 32 bytes (2 blocks) using AES-CBC with 128-bit key - Key : 0xc286696d887c9aa0611bbb3e2025a45a - IV : 0x562e17996d093d28ddb3ba695a2e6f58 - Plaintext : 0x000102030405060708090a0b0c0d0e0f - 101112131415161718191a1b1c1d1e1f - Ciphertext: 0xd296cd94c2cccf8a3a863028b5e1dc0a - 7586602d253cfff91b8266bea6d61ab1" - - | result | - result := ((CBC on: (Rijndael new keySize: 16; - key: (ByteArray fromHexString: '16rc286696d887c9aa0611bbb3e2025a45a'))) - initialVector: (ByteArray fromHexString: '16r562e17996d093d28ddb3ba695a2e6f58')) - encrypt: (result := ByteArray fromHexString: '16r000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f'). - self assert: result hex = 'd296cd94c2cccf8a3a863028b5e1dc0a7586602d253cfff91b8266bea6d61ab1bcfd81022202366bde6dd260a15841a1' \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case3.st b/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case3.st deleted file mode 100644 index df16d3a..0000000 --- a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case3.st +++ /dev/null @@ -1,17 +0,0 @@ -tests -testRFC3602Case3 - "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html - Case #3: Encrypting 48 bytes (3 blocks) using AES-CBC with 128-bit key - Key : 0x6c3ea0477630ce21a2ce334aa746c2cd - IV : 0xc782dc4c098c66cbd9cd27d825682c81 - Plaintext : This is a 48-byte message (exactly 3 AES blocks) - Ciphertext: 0xd0a02b3836451753d493665d33f0e886 - 2dea54cdb293abc7506939276772f8d5 - 021c19216bad525c8579695d83ba2684" - | result | - result := ((CBC on: (Rijndael new keySize: 16; - - key: (ByteArray fromHexString: '16r6c3ea0477630ce21a2ce334aa746c2cd'))) - initialVector: (ByteArray fromHexString: '16rc782dc4c098c66cbd9cd27d825682c81')) - encrypt: 'This is a 48-byte message (exactly 3 AES blocks)' asByteArray. - self assert: result hex = 'd0a02b3836451753d493665d33f0e8862dea54cdb293abc7506939276772f8d5021c19216bad525c8579695d83ba2684d248b3e0f2388c137102846eb06272ff' \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case4.st b/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case4.st deleted file mode 100644 index 51f6bf0..0000000 --- a/source/Cryptography.package/CryptoRigndaelCBCTest.class/instance/testRFC3602Case4.st +++ /dev/null @@ -1,22 +0,0 @@ -tests -testRFC3602Case4 - "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html - Case #4: Encrypting 64 bytes (4 blocks) using AES-CBC with 128-bit key - Key : 0x56e47a38c5598974bc46903dba290349 - IV : 0x8ce82eefbea0da3c44699ed7db51b7d9 - Plaintext : 0xa0a1a2a3a4a5a6a7a8a9aaabacadaeaf - b0b1b2b3b4b5b6b7b8b9babbbcbdbebf - c0c1c2c3c4c5c6c7c8c9cacbcccdcecf - d0d1d2d3d4d5d6d7d8d9dadbdcdddedf - Ciphertext: 0xc30e32ffedc0774e6aff6af0869f71aa - 0f3af07a9a31a9c684db207eb0ef8e4e - 35907aa632c3ffdf868bb7b29d3d46ad - 83ce9f9a102ee99d49a53e87f4c3da55 -" - | result | - result := ((CBC on: (Rijndael new keySize: 16; - - key: (ByteArray fromHexString: '16r56e47a38c5598974bc46903dba290349'))) - initialVector: (ByteArray fromHexString: '16r8ce82eefbea0da3c44699ed7db51b7d9')) - encrypt: (ByteArray fromHexString: '16ra0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf'). - self assert: result hex = 'c30e32ffedc0774e6aff6af0869f71aa0f3af07a9a31a9c684db207eb0ef8e4e35907aa632c3ffdf868bb7b29d3d46ad83ce9f9a102ee99d49a53e87f4c3da5578b8d04731041aa2d9787ca4a4fa3eef' \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRigndaelCBCTest.class/properties.json b/source/Cryptography.package/CryptoRigndaelCBCTest.class/properties.json deleted file mode 100644 index 330ef96..0000000 --- a/source/Cryptography.package/CryptoRigndaelCBCTest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoRigndaelCBCTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/README.md b/source/Cryptography.package/CryptoRijndaelTest.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/runBlockCipherModeTest..st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/runBlockCipherModeTest..st deleted file mode 100644 index a6bf14a..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/runBlockCipherModeTest..st +++ /dev/null @@ -1,21 +0,0 @@ -block ciphers -runBlockCipherModeTest: cipherModeSelector - | key encipherer decipherer startMsg | - key := #(190 219 189 251 27 38 8 9 135 25 167 8 238 107 29 251 136 65 107 0 37 215 45 130 84 87 13 206 8 55 74 82) asByteArray. - encipherer := (Rijndael key: key) perform: cipherModeSelector. - decipherer := (Rijndael key: key) perform: cipherModeSelector. - "Stream ciphers do not require padding, therefore blocks can be less than the encipherer's blockSize." - startMsg := encipherer isStreamCipher ifTrue: [ 900 ] ifFalse: [ 1000 ]. - startMsg to: 1200 do: - [ : n | | block originalBlock iv | - block := ('some message', n printString) asByteArray. - iv := ByteArray new: Rijndael blockSize. - iv uint: Rijndael blockSize*8 at: 1 put: n. - encipherer initialVector: iv copy. - decipherer initialVector: iv copy. - originalBlock := block copy. - encipherer encryptBlock: block. - self deny: block = originalBlock. - self assert: block size = originalBlock size. - decipherer decryptBlock: block. - self assert: block = originalBlock ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/runEncryptDecrypt..st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/runEncryptDecrypt..st deleted file mode 100644 index c9a4c9a..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/runEncryptDecrypt..st +++ /dev/null @@ -1,15 +0,0 @@ -as yet unclassified -runEncryptDecrypt: blockCipherClass - | msg key1 key2 enc1 enc2 dec1 dec2 ct2 ct1 | - enc1 := blockCipherClass key: (key1 := SecureRandom picker nextBytes: 16). - dec1 := blockCipherClass key: key1. - enc2 := blockCipherClass key: (key2 := SecureRandom picker nextBytes: 16). - dec2 := blockCipherClass key: key2. - msg := 'hello how are you?' asByteArray. - ct2 := enc2 encrypt: msg. - self deny: msg = ct2. - self assert: (dec2 decrypt: ct2) = msg. - "ensure the cipher still works if its key is changed after creation, both for the encryptor instance and decryptor instance." - enc1 key: key2. dec1 key: key2. - ct1 := enc1 encrypt: msg. - self assert: (dec1 decrypt: ct1) = msg \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testByteArrayPadding.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testByteArrayPadding.st deleted file mode 100644 index b1e6eb0..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testByteArrayPadding.st +++ /dev/null @@ -1,16 +0,0 @@ -as yet unclassified -testByteArrayPadding - | paddedHello fullBlockPad needsFullPad | - paddedHello := #(104 101 108 108 111 11 11 11 11 11 11 11 11 11 11 11 ) asByteArray. - self assert: paddedHello isProperlyPadded. - self assert: ('hello' asByteArray padToMultipleOf: 16) = paddedHello. - self assert: paddedHello unpaddedSize = 'hello' size. - - fullBlockPad := #(16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16) asByteArray. - self assert: fullBlockPad asByteArray isProperlyPadded. - - needsFullPad := '1234567890123456' asByteArray padToMultipleOf: 16. - self assert: needsFullPad size = 32. - self assert: (needsFullPad copyFrom: 17 to: 32) = fullBlockPad. - self assert: needsFullPad isProperlyPadded. - self assert: needsFullPad unpaddedSize = 16 \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCBC.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCBC.st deleted file mode 100644 index 91463ba..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCBC.st +++ /dev/null @@ -1,3 +0,0 @@ -block ciphers -testCBC - self runBlockCipherModeTest: #cbc \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCFB.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCFB.st deleted file mode 100644 index 84202fb..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCFB.st +++ /dev/null @@ -1,3 +0,0 @@ -block ciphers -testCFB - self runBlockCipherModeTest: #cfb \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCTR.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCTR.st deleted file mode 100644 index 9dd50ca..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testCTR.st +++ /dev/null @@ -1,3 +0,0 @@ -block ciphers -testCTR - self runBlockCipherModeTest: #ctr \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testEncryptDecrypt.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testEncryptDecrypt.st deleted file mode 100644 index 3f95a1f..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testEncryptDecrypt.st +++ /dev/null @@ -1,7 +0,0 @@ -others -testEncryptDecrypt - BlockCipherMode allSubclasses asArray do: - [ : each | - [ self runEncryptDecrypt: each ] - on: Warning - do: [ : warn | warn resume ] ] \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testOFB.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testOFB.st deleted file mode 100644 index a78d257..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testOFB.st +++ /dev/null @@ -1,3 +0,0 @@ -block ciphers -testOFB - self runBlockCipherModeTest: #ofb \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testRijndael.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testRijndael.st deleted file mode 100644 index 1eb379b..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testRijndael.st +++ /dev/null @@ -1,25 +0,0 @@ -block ciphers -testRijndael - | rijndael vector | - rijndael := Rijndael new keySize: 16; key: (0 to: 15) asByteArray. - vector := (0 to: 15) asByteArray. - rijndael encryptBlock: vector. - self assert: vector hex = '0a940bb5416ef045f1c39458c653ea5a'. - rijndael decryptBlock: vector. - self assert: vector hex = '000102030405060708090a0b0c0d0e0f'. - - rijndael := Rijndael new blockSize: 16; keySize: 24. - rijndael key: (0 to: 16r17) asByteArray. - vector := (0 to: 15) asByteArray. - rijndael encryptBlock: vector. - self assert: vector hex = '0060bffe46834bb8da5cf9a61ff220ae'. - rijndael decryptBlock: vector. - self assert: vector hex = '000102030405060708090a0b0c0d0e0f'. - - rijndael := Rijndael new blockSize: 16; keySize: 32. - rijndael key: (0 to: 16r1F) asByteArray. - vector := (0 to: 15) asByteArray. - rijndael encryptBlock: vector. - self assert: vector hex = '5a6e045708fb7196f02e553d02c3a692'. - rijndael decryptBlock: vector. - self assert: vector hex = '000102030405060708090a0b0c0d0e0f' \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testRijndael128128.st b/source/Cryptography.package/CryptoRijndaelTest.class/instance/testRijndael128128.st deleted file mode 100644 index b28b2f0..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/instance/testRijndael128128.st +++ /dev/null @@ -1,11 +0,0 @@ -block ciphers -testRijndael128128 - | key vector cipher | - key := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C) asByteArray. - vector := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34) asByteArray. - - cipher := Rijndael new keySize: 16; key: key. - cipher encryptBlock: vector. - self assert: vector hex = '3925841d02dc09fbdc118597196a0b32'. - cipher decryptBlock: vector. - self assert: vector hex = '3243f6a8885a308d313198a2e0370734' \ No newline at end of file diff --git a/source/Cryptography.package/CryptoRijndaelTest.class/properties.json b/source/Cryptography.package/CryptoRijndaelTest.class/properties.json deleted file mode 100644 index 20ed867..0000000 --- a/source/Cryptography.package/CryptoRijndaelTest.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "Cryptography-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoRijndaelTest", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/CryptographyError.class/README.md b/source/Cryptography.package/CryptographyError.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/CryptographyError.class/properties.json b/source/Cryptography.package/CryptographyError.class/properties.json deleted file mode 100644 index c3da93a..0000000 --- a/source/Cryptography.package/CryptographyError.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Error", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptographyError", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/README.md b/source/Cryptography.package/DES.class/README.md deleted file mode 100644 index 5930525..0000000 --- a/source/Cryptography.package/DES.class/README.md +++ /dev/null @@ -1,19 +0,0 @@ -This class implements the Data Encryption Standard (DES) block cipher per -ANSI X3.92. It requires the presence of the 'DESPlugin'. At some future -date the functionality of the plugin may be provided in pure Smalltalk, but -the slowness would be prohibitive for anything other than trivial usage. -The main barrier to translation is the heavy use of zero-based indexing of -arrays. - -How to use: you first provide an 8-byte key which will be used to encode -and decode the data. Internally, this is 'cooked' into a 32-word format to -speed up the encryption process. The data is then sent in 8-byte packets -to be encoded or decoded. You must externally account for padding. See -the 'testing' category on the class side for examples. - -As of this date (1/26/2000), the U.S. Government has lifted many of the -previous restrictions on the export of encryption software, but you should -check before exporting anything including this code. - -Submitted by Duane Maxwell. - diff --git a/source/Cryptography.package/DES.class/class/blockSize.st b/source/Cryptography.package/DES.class/class/blockSize.st deleted file mode 100644 index 1d23ac1..0000000 --- a/source/Cryptography.package/DES.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ 8 \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/class/keySize.st b/source/Cryptography.package/DES.class/class/keySize.st deleted file mode 100644 index f907f39..0000000 --- a/source/Cryptography.package/DES.class/class/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ 8 \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/decryptBlock..st b/source/Cryptography.package/DES.class/instance/decryptBlock..st deleted file mode 100644 index 7f3f36f..0000000 --- a/source/Cryptography.package/DES.class/instance/decryptBlock..st +++ /dev/null @@ -1,14 +0,0 @@ -accessing -decryptBlock: aByteArray - | int | - self primPluginAvailable - ifTrue: [ - encrypting = false ifFalse: [self key: key encrypt: false]. - ^self transform: aByteArray]. - nonPrimitive isNil ifTrue: [ - nonPrimitive := DESNonPrimitive new setKeyFromByteArray: key]. - int := ((aByteArray unsignedLongAt: 1 bigEndian: true) bitShift: 32) - + (aByteArray unsignedLongAt: 5 bigEndian: true). - int := nonPrimitive decryptBlock: int. - aByteArray unsignedLongAt: 1 put: (int bitShift: -32) bigEndian: true. - aByteArray unsignedLongAt: 5 put: (int bitAnd: 16rFFFFFFFF) bigEndian: true \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/encryptBlock..st b/source/Cryptography.package/DES.class/instance/encryptBlock..st deleted file mode 100644 index 7657157..0000000 --- a/source/Cryptography.package/DES.class/instance/encryptBlock..st +++ /dev/null @@ -1,14 +0,0 @@ -accessing -encryptBlock: aByteArray - | int | - self primPluginAvailable - ifTrue: [ - encrypting = true ifFalse: [self key: key encrypt: true]. - ^self transform: aByteArray]. - nonPrimitive isNil ifTrue: [ - nonPrimitive := DESNonPrimitive new setKeyFromByteArray: key]. - int := ((aByteArray unsignedLongAt: 1 bigEndian: true) bitShift: 32) - + (aByteArray unsignedLongAt: 5 bigEndian: true). - int := nonPrimitive encryptBlock: int. - aByteArray unsignedLongAt: 1 put: (int bitShift: -32) bigEndian: true. - aByteArray unsignedLongAt: 5 put: (int bitAnd: 16rFFFFFFFF) bigEndian: true \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/key..st b/source/Cryptography.package/DES.class/instance/key..st deleted file mode 100644 index 0c3546f..0000000 --- a/source/Cryptography.package/DES.class/instance/key..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -key: aByteArray - key := aByteArray. - encrypting := nil. - nonPrimitive := nil \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/key.encrypt..st b/source/Cryptography.package/DES.class/instance/key.encrypt..st deleted file mode 100644 index 3e7cdc9..0000000 --- a/source/Cryptography.package/DES.class/instance/key.encrypt..st +++ /dev/null @@ -1,9 +0,0 @@ -private -key: aByteArray encrypt: aBoolean - encrypting := aBoolean. - self primPluginAvailable ifFalse: [^self]. - aByteArray size = 8 ifFalse: [self error: 'DES key must be 8 bytes']. - cookedKey := WordArray new: 32. - cookedKey atAllPut: 0. - self primCookKey: aByteArray mode: (aBoolean ifTrue: [1] ifFalse: -[0]) to: cookedKey \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/primCookKey.mode.to..st b/source/Cryptography.package/DES.class/instance/primCookKey.mode.to..st deleted file mode 100644 index cea8188..0000000 --- a/source/Cryptography.package/DES.class/instance/primCookKey.mode.to..st +++ /dev/null @@ -1,6 +0,0 @@ -primitives -primCookKey: aByteArray mode: flag to: cooked - - ^ self primitiveFailed - - \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/primPluginAvailable.st b/source/Cryptography.package/DES.class/instance/primPluginAvailable.st deleted file mode 100644 index bc5cd1c..0000000 --- a/source/Cryptography.package/DES.class/instance/primPluginAvailable.st +++ /dev/null @@ -1,4 +0,0 @@ -primitives -primPluginAvailable - - ^ false \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/primTransform.using..st b/source/Cryptography.package/DES.class/instance/primTransform.using..st deleted file mode 100644 index b3a2724..0000000 --- a/source/Cryptography.package/DES.class/instance/primTransform.using..st +++ /dev/null @@ -1,4 +0,0 @@ -primitives -primTransform: aByteArray using: cooked - - ^ self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/instance/transform..st b/source/Cryptography.package/DES.class/instance/transform..st deleted file mode 100644 index 47e3aea..0000000 --- a/source/Cryptography.package/DES.class/instance/transform..st +++ /dev/null @@ -1,11 +0,0 @@ -private -transform: block - - self primPluginAvailable ifFalse: [self error: 'DES plugin missing']. - cookedKey ifNil: [ self error: 'DES key not provided']. - cookedKey size = 32 ifFalse: [ self error: 'DES cooked key damaged']. - block size = 8 ifFalse: [ self error: 'DES block must be 8 -bytes']. - self primTransform: block using: cookedKey. - - \ No newline at end of file diff --git a/source/Cryptography.package/DES.class/properties.json b/source/Cryptography.package/DES.class/properties.json deleted file mode 100644 index 1ebb9d7..0000000 --- a/source/Cryptography.package/DES.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipher", - "category" : "Cryptography-DES", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "cookedKey", - "key", - "encrypting", - "nonPrimitive" - ], - "name" : "DES", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/README.md b/source/Cryptography.package/DESBitPermutation.class/README.md deleted file mode 100644 index bb2af1d..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/README.md +++ /dev/null @@ -1 +0,0 @@ -Instances of this class can be used to permute bits in an integer according to a predefined mapping. It's used for DES encryption in several places. \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/class/fromBitIndexes..st b/source/Cryptography.package/DESBitPermutation.class/class/fromBitIndexes..st deleted file mode 100644 index c8727e1..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/class/fromBitIndexes..st +++ /dev/null @@ -1,17 +0,0 @@ -instance creation -fromBitIndexes: aCollection - "aCollection are bit indexes counting from the right, unlike the DES spec which counts from the left" - "Example: the key permutation table for DES - self fromBitIndexes: (#( - 57 49 41 33 25 17 9 - 1 58 50 42 34 26 18 - 10 2 59 51 43 35 27 - 19 11 3 60 52 44 36 - 63 55 47 39 31 23 15 - 7 62 54 46 38 30 22 - 14 6 61 53 45 37 29 - 21 13 5 28 20 12 4) reverse collect: [:i | 64-i])" - | permutation | - permutation := self new initialize. - aCollection doWithIndex: [:srcBit :dstBit | permutation map: srcBit to: dstBit-1]. - ^permutation \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/class/fromDESBitIndexes.sourceWidth..st b/source/Cryptography.package/DESBitPermutation.class/class/fromDESBitIndexes.sourceWidth..st deleted file mode 100644 index 0630175..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/class/fromDESBitIndexes.sourceWidth..st +++ /dev/null @@ -1,14 +0,0 @@ -instance creation -fromDESBitIndexes: aCollection sourceWidth: sourceWidth - "aCollection are bit indexes counting from the right, unlike the DES spec which counts from the left" - "Example: the key permutation table for DES - self fromDESBitIndexes: #( - 57 49 41 33 25 17 9 - 1 58 50 42 34 26 18 - 10 2 59 51 43 35 27 - 19 11 3 60 52 44 36 - 63 55 47 39 31 23 15 - 7 62 54 46 38 30 22 - 14 6 61 53 45 37 29 - 21 13 5 28 20 12 4) sourceWidth: 64" - ^self fromBitIndexes: (aCollection reverse collect: [:i | sourceWidth-i]) \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/class/initialize.st b/source/Cryptography.package/DESBitPermutation.class/class/initialize.st deleted file mode 100644 index b8b65d0..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/class/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -class initialization -initialize - "DESBitPermutation initialize" - ChunkBits := 6. - ChunkMask := (1 bitShift: ChunkBits) - 1 \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/instance/initialize.st b/source/Cryptography.package/DESBitPermutation.class/instance/initialize.st deleted file mode 100644 index 4b6ede5..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/instance/initialize.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -initialize - tables := #() \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/instance/map.to..st b/source/Cryptography.package/DESBitPermutation.class/instance/map.to..st deleted file mode 100644 index 4bc83a2..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/instance/map.to..st +++ /dev/null @@ -1,11 +0,0 @@ -initialize-release -map: srcBit to: dstBit - | i mask array bit | - i := srcBit // ChunkBits + 1. - [tables size < i] whileTrue: [tables := tables copyWith: (Array new: ChunkMask+1 withAll: 0)]. - mask := 1 bitShift: (srcBit \\ ChunkBits). - array := tables at: i. - bit := 1 bitShift: dstBit. - 0 to: ChunkMask do: [:index | - (index bitAnd: mask) = mask ifTrue: [ - array at: index+1 put: ((array at: index+1) bitOr: bit)]] \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/instance/permute..st b/source/Cryptography.package/DESBitPermutation.class/instance/permute..st deleted file mode 100644 index f20cfef..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/instance/permute..st +++ /dev/null @@ -1,10 +0,0 @@ -permuting -permute: input - | output shift bits | - output := 0. - shift := 0. - tables do: [:array | - bits := (input bitShift: shift) bitAnd: ChunkMask. - output := output + (array at: bits+1). - shift := shift - ChunkBits]. - ^output \ No newline at end of file diff --git a/source/Cryptography.package/DESBitPermutation.class/properties.json b/source/Cryptography.package/DESBitPermutation.class/properties.json deleted file mode 100644 index 1e49a7e..0000000 --- a/source/Cryptography.package/DESBitPermutation.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "hmm 3/26/2002 18:15", - "super" : "Object", - "category" : "Cryptography-DES", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "ChunkBits", - "ChunkMask" - ], - "instvars" : [ - "tables" - ], - "name" : "DESBitPermutation", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/README.md b/source/Cryptography.package/DESNonPrimitive.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/DESNonPrimitive.class/class/initSBox.from..st b/source/Cryptography.package/DESNonPrimitive.class/class/initSBox.from..st deleted file mode 100644 index 0506a42..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/class/initSBox.from..st +++ /dev/null @@ -1,12 +0,0 @@ -class initialization -initSBox: index from: anArray - "Initialization data is given in the same order order as in the spec, which is nonsense. - This method reorders it to avoid reordering in the encryption/decryption process." - "Validity test: - (DESNonPrimitive new applyToSBoxes: 2r011101000101110101000111101000011100101101011101) - = 2r00110100111001011010010110101001" - | row col | - SBoxes at: index put: ((0 to: 63) collect: [:i | - row := i // 32 * 2 + (i \\ 2). - col := i // 2 \\ 16. - anArray at: row * 16 + col + 1]) \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/class/initialize.st b/source/Cryptography.package/DESNonPrimitive.class/class/initialize.st deleted file mode 100644 index 08166ae..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/class/initialize.st +++ /dev/null @@ -1,99 +0,0 @@ -class initialization -initialize - "DESNonPrimitive initialize" - DESBitPermutation initialize. - PC1 := DESBitPermutation fromDESBitIndexes: #( - 57 49 41 33 25 17 9 - 1 58 50 42 34 26 18 - 10 2 59 51 43 35 27 - 19 11 3 60 52 44 36 - 63 55 47 39 31 23 15 - 7 62 54 46 38 30 22 - 14 6 61 53 45 37 29 - 21 13 5 28 20 12 4) sourceWidth: 64. - PC2 := DESBitPermutation fromDESBitIndexes: #( - 14 17 11 24 1 5 - 3 28 15 6 21 10 - 23 19 12 4 26 8 - 16 7 27 20 13 2 - 41 52 31 37 47 55 - 30 40 51 45 33 48 - 44 49 39 56 34 53 - 46 42 50 36 29 32) sourceWidth: 56. - IP := DESBitPermutation fromDESBitIndexes: #( - 58 50 42 34 26 18 10 2 - 60 52 44 36 28 20 12 4 - 62 54 46 38 30 22 14 6 - 64 56 48 40 32 24 16 8 - 57 49 41 33 25 17 9 1 - 59 51 43 35 27 19 11 3 - 61 53 45 37 29 21 13 5 - 63 55 47 39 31 23 15 7) sourceWidth: 64. - IIP := DESBitPermutation fromDESBitIndexes: #( - 40 8 48 16 56 24 64 32 - 39 7 47 15 55 23 63 31 - 38 6 46 14 54 22 62 30 - 37 5 45 13 53 21 61 29 - 36 4 44 12 52 20 60 28 - 35 3 43 11 51 19 59 27 - 34 2 42 10 50 18 58 26 - 33 1 41 9 49 17 57 25) sourceWidth: 64. - EBitSelectionTable := DESBitPermutation fromDESBitIndexes: #( - 32 1 2 3 4 5 - 4 5 6 7 8 9 - 8 9 10 11 12 13 - 12 13 14 15 16 17 - 16 17 18 19 20 21 - 20 21 22 23 24 25 - 24 25 26 27 28 29 - 28 29 30 31 32 1) sourceWidth: 32. - P := DESBitPermutation fromDESBitIndexes: #( - 16 7 20 21 - 29 12 28 17 - 1 15 23 26 - 5 18 31 10 - 2 8 24 14 - 32 27 3 9 - 19 13 30 6 - 22 11 4 25) sourceWidth: 32. - SBoxes := Array new: 8. - self initSBox: 1 from: #( - 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7 - 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8 - 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0 - 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13). - self initSBox: 2 from: #( - 15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10 - 3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5 - 0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15 - 13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9). - self initSBox: 3 from: #( - 10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8 - 13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1 - 13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7 - 1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12). - self initSBox: 4 from: #( - 7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15 - 13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9 - 10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4 - 3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14). - self initSBox: 5 from: #( - 2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9 - 14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6 - 4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14 - 11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3). - self initSBox: 6 from: #( - 12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11 - 10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8 - 9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6 - 4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13). - self initSBox: 7 from: #( - 4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1 - 13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6 - 1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2 - 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12). - self initSBox: 8 from: #( - 13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7 - 1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2 - 7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8 - 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11) \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/applyToSBoxes..st b/source/Cryptography.package/DESNonPrimitive.class/instance/applyToSBoxes..st deleted file mode 100644 index 1cbb882..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/applyToSBoxes..st +++ /dev/null @@ -1,8 +0,0 @@ -encryption/decryption -applyToSBoxes: anInteger - | result bits | - result := 0. - 1 to: 8 do: [:i | - bits := (anInteger bitShift: i*6-48) bitAnd: 63. - result := (result bitShift: 4) + ((SBoxes at: i) at: bits+1)]. - ^result \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/blockSize.st b/source/Cryptography.package/DESNonPrimitive.class/instance/blockSize.st deleted file mode 100644 index aec60aa..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -blockSize - ^8 \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/coreProcess.forward..st b/source/Cryptography.package/DESNonPrimitive.class/instance/coreProcess.forward..st deleted file mode 100644 index 0f14065..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/coreProcess.forward..st +++ /dev/null @@ -1,14 +0,0 @@ -encryption/decryption -coreProcess: anInteger forward: aBoolean - | rLast lLast rCurrent rXored rSBoxed rPermuted | - lLast := anInteger bitShift: -32. - rLast := anInteger bitAnd: 16rFFFFFFFF. - 1 to: 16 do: [:i | - rCurrent := EBitSelectionTable permute: rLast. - rXored := rCurrent bitXor: (k at: (aBoolean ifTrue: [i] ifFalse: [17-i])). - rSBoxed := self applyToSBoxes: rXored. - rPermuted := P permute: rSBoxed. - rCurrent := rPermuted bitXor: lLast. - lLast := rLast. - rLast := rCurrent]. - ^lLast + (rLast bitShift: 32) \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/decryptBlock..st b/source/Cryptography.package/DESNonPrimitive.class/instance/decryptBlock..st deleted file mode 100644 index 7eb952d..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/decryptBlock..st +++ /dev/null @@ -1,6 +0,0 @@ -encryption/decryption -decryptBlock: anInteger - | permuted encoded | - permuted := IP permute: anInteger. - encoded := self coreProcess: permuted forward: false. - ^IIP permute: encoded \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/encryptBlock..st b/source/Cryptography.package/DESNonPrimitive.class/instance/encryptBlock..st deleted file mode 100644 index 0884a35..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/encryptBlock..st +++ /dev/null @@ -1,6 +0,0 @@ -encryption/decryption -encryptBlock: anInteger - | permuted encoded | - permuted := IP permute: anInteger. - encoded := self coreProcess: permuted forward: true. - ^IIP permute: encoded \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/keySize.st b/source/Cryptography.package/DESNonPrimitive.class/instance/keySize.st deleted file mode 100644 index 0715b6e..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -keySize - ^8 \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/setKey..st b/source/Cryptography.package/DESNonPrimitive.class/instance/setKey..st deleted file mode 100644 index a970799..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/setKey..st +++ /dev/null @@ -1,21 +0,0 @@ -initialize-release -setKey: anInteger - "anInteger is a 64-bit DES key" - "DES new setKey: 2" - | kCurrent mask28 rot l r | - mask28 := 16rFFFFFFF. - kCurrent := PC1 permute: anInteger. - l := kCurrent bitShift: -28. - r := kCurrent bitAnd: mask28. - k := Array new: 16. - 1 to: 16 do: [:i | - rot := #(1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1) at: i. - false - ifTrue: [ - l := (l bitShift: 0-rot) + (l bitShift: 28-rot) bitAnd: mask28. - r := (r bitShift: 0-rot) + (r bitShift: 28-rot) bitAnd: mask28] - ifFalse: [ - l := (l bitShift: rot) + (l bitShift: rot - 28) bitAnd: mask28. - r := (r bitShift: rot) + (r bitShift: rot - 28) bitAnd: mask28]. - kCurrent := (l bitShift: 28) + r. - k at: i put: (PC2 permute: kCurrent)] \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/instance/setKeyFromByteArray..st b/source/Cryptography.package/DESNonPrimitive.class/instance/setKeyFromByteArray..st deleted file mode 100644 index 4c55f2b..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/instance/setKeyFromByteArray..st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -setKeyFromByteArray: aByteArray - self setKey: ((aByteArray unsignedLongAt: 1 bigEndian: true) bitShift: 32) + (aByteArray unsignedLongAt: 5 bigEndian: true) \ No newline at end of file diff --git a/source/Cryptography.package/DESNonPrimitive.class/properties.json b/source/Cryptography.package/DESNonPrimitive.class/properties.json deleted file mode 100644 index e51af3f..0000000 --- a/source/Cryptography.package/DESNonPrimitive.class/properties.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipher", - "category" : "Cryptography-DES", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "EBitSelectionTable", - "IIP", - "IP", - "P", - "PC1", - "PC2", - "SBoxes" - ], - "instvars" : [ - "k" - ], - "name" : "DESNonPrimitive", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DSAKeyPairGenerator.class/README.md b/source/Cryptography.package/DSAKeyPairGenerator.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/generateKeySet.st b/source/Cryptography.package/DSAKeyPairGenerator.class/instance/generateKeySet.st deleted file mode 100644 index 3b57745..0000000 --- a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/generateKeySet.st +++ /dev/null @@ -1,13 +0,0 @@ -as yet unclassified -generateKeySet - "Generate and answer a key set for DSA. The result is a pair (). Each key is an array of four large integers. The private key is (p, q, g, x); the public one is (p, q, g, y). The signer must be sure to record (p, q, g, x), and must keep x secret to prevent someone from forging their signature." - "Note: Key generation can take some time. Open a transcript so you can see what's happening and take a coffee break!" - - | exp h | - random := SecureRandom new. - self generateQandP. - exp := (p - 1) / q. - h := 2. - [g := h raisedTo: exp modulo: p. g = 1] whileTrue: [h := h + 1]. - x := self nextRandom160. - y := g raisedTo: x modulo: p. diff --git a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/generateQandP.st b/source/Cryptography.package/DSAKeyPairGenerator.class/instance/generateQandP.st deleted file mode 100644 index 0e1e233..0000000 --- a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/generateQandP.st +++ /dev/null @@ -1,30 +0,0 @@ -as yet unclassified -generateQandP - "Generate the two industrial-grade primes, q (160-bits) and p (512-bit) needed to build a key set. Answer the array (q, p, s), where s is the seed that from which q and p were created. This seed is normally discarded, but can be used to verify the key generation process if desired." - - | pBits halfTwoToTheP chunkCount twoQ n c w | - pBits := 512. "desired size of p in bits" - halfTwoToTheP := 2 raisedTo: (pBits - 1). - chunkCount := pBits // 160. - - Transcript show: 'Searching for primes q and p...'; cr. - [true] whileTrue: [ - Transcript show: ' Found a candidate q.'; cr. - q := random nextBits: 160. - q := q bitOr: 1. "ensure it is odd" - q := q bitOr: 1 << 160. "ensure it is of the requiered length" - q := (PrimesFinder candidate: q) nextPrime. - twoQ := q bitShift: 1. - n := 2. - c := 0. - [c < 4096] whileTrue: [ - w := random nextBits: pBits. - x := w + halfTwoToTheP. - p := (x - ( x \\ twoQ)) + 1. - p highBit = pBits ifTrue: [ - Transcript show: ' Testing potential p ', (c + 1) printString, '...'; cr. - (self isProbablyPrime: p) ifTrue: [ - Transcript show: ' Found p!'; cr. - ^ self]]. - n := n + chunkCount + 1. - c := c + 1]] \ No newline at end of file diff --git a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/privateKey.st b/source/Cryptography.package/DSAKeyPairGenerator.class/instance/privateKey.st deleted file mode 100644 index d0d6dde..0000000 --- a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/privateKey.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -privateKey - ^ DSAPrivateKey p: p q: q g: g x: x \ No newline at end of file diff --git a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/publicKey.st b/source/Cryptography.package/DSAKeyPairGenerator.class/instance/publicKey.st deleted file mode 100644 index 42ee228..0000000 --- a/source/Cryptography.package/DSAKeyPairGenerator.class/instance/publicKey.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -publicKey - ^ DSAPublicKey p: p q: q g: g y: y \ No newline at end of file diff --git a/source/Cryptography.package/DSAKeyPairGenerator.class/properties.json b/source/Cryptography.package/DSAKeyPairGenerator.class/properties.json deleted file mode 100644 index 1142852..0000000 --- a/source/Cryptography.package/DSAKeyPairGenerator.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-DSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "p", - "q", - "g", - "x", - "y", - "random" - ], - "name" : "DSAKeyPairGenerator", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/README.md b/source/Cryptography.package/DSAPrivateKey.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/DSAPrivateKey.class/class/p.q.g.x..st b/source/Cryptography.package/DSAPrivateKey.class/class/p.q.g.x..st deleted file mode 100644 index 956b68c..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/class/p.q.g.x..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -p: p q: q g: g x: x - ^ self new p: p q: q g: g x: x \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/instance/computeSignatureForMessageHash..st b/source/Cryptography.package/DSAPrivateKey.class/instance/computeSignatureForMessageHash..st deleted file mode 100644 index 89d2bd6..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/instance/computeSignatureForMessageHash..st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -computeSignatureForMessageHash: hash - "Answer the digital signature of the given message hash using the given private key. A signature is a pair of large integers." - - | r s k tmp | - r := s := 0. - [r = 0 or: [s = 0]] whileTrue: [ - k := self nextRandom160 \\ q. - r := (g raisedTo: k modulo: p) \\ q. - tmp := (hash asInteger + (x * r)) \\ q. - s := (k inverseModulo: q) * tmp \\ q]. - ^ Array with: r with: s \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/instance/nextRandom160.st b/source/Cryptography.package/DSAPrivateKey.class/instance/nextRandom160.st deleted file mode 100644 index 72f02fa..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/instance/nextRandom160.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -nextRandom160 - ^ (RandomPool default next: 20) asInteger \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/instance/p.q.g.x..st b/source/Cryptography.package/DSAPrivateKey.class/instance/p.q.g.x..st deleted file mode 100644 index 74ca267..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/instance/p.q.g.x..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -p: p0 q: q0 g: g0 x: x0 - p := p0. - q := q0. - g := g0. - x := x0 \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/instance/signMessage..st b/source/Cryptography.package/DSAPrivateKey.class/instance/signMessage..st deleted file mode 100644 index 7961775..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/instance/signMessage..st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -signMessage: aStringOrStream - | hasher h sig | - - hasher := SHA1 new. - (aStringOrStream class isBytes) - ifTrue: [h := hasher hashMessage: aStringOrStream] - ifFalse: [h := hasher hashStream: aStringOrStream]. - sig := self computeSignatureForMessageHash: h. - ^ self signatureToString: sig \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/instance/signatureToString..st b/source/Cryptography.package/DSAPrivateKey.class/instance/signatureToString..st deleted file mode 100644 index 6f677ac..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/instance/signatureToString..st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -signatureToString: aSignature - "Answer a string representation of the given signature. This string can be parsed using the stringToSignature: method." - - | s | - s := WriteStream on: (String new: 2000). - s nextPutAll: '[DSA digital signature '. - s nextPutAll: (aSignature first printStringBase: 16). - s space. - s nextPutAll: (aSignature second printStringBase: 16). - s nextPutAll: ']'. - ^ s contents \ No newline at end of file diff --git a/source/Cryptography.package/DSAPrivateKey.class/properties.json b/source/Cryptography.package/DSAPrivateKey.class/properties.json deleted file mode 100644 index fbb63cb..0000000 --- a/source/Cryptography.package/DSAPrivateKey.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-DSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "p", - "q", - "g", - "x" - ], - "name" : "DSAPrivateKey", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/README.md b/source/Cryptography.package/DSAPublicKey.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/DSAPublicKey.class/class/notesOnAsnEncoding.st b/source/Cryptography.package/DSAPublicKey.class/class/notesOnAsnEncoding.st deleted file mode 100644 index d552c84..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/class/notesOnAsnEncoding.st +++ /dev/null @@ -1,73 +0,0 @@ -examples -notesOnAsnEncoding - -"Smalltalk at: #ASN1Constants put: Dictionary new! -ASN1Constants at: #classApplication put: 64! -ASN1Constants at: #classContextSpecific put: 128! -ASN1Constants at: #classPrivate put: 192! -ASN1Constants at: #classUniversal put: 0! -ASN1Constants at: #idBitString put: 3! -ASN1Constants at: #idBoolean put: 1! -ASN1Constants at: #idIA5String put: 22! -ASN1Constants at: #idInteger put: 2! -ASN1Constants at: #idNull put: 5! -ASN1Constants at: #idObjectIdentifier put: 6! -ASN1Constants at: #idOctetString put: 4! -ASN1Constants at: #idPrintableString put: 19! -ASN1Constants at: #idSequence put: 16! -ASN1Constants at: #idSet put: 17! -ASN1Constants at: #idUTCTime put: 23! -ASN1Constants at: #maskClass put: 192! -ASN1Constants at: #maskConstructed put: 32! -ASN1Constants at: #maskTag put: 31! -ASN1Constants at: #tagHigh put: 31! - -Transcript show: 'ASN1ObjectIdentifiers'; cr! -Smalltalk at: #ASN1ObjectIdentifiers put: Dictionary new! -ASN1ObjectIdentifiers at: #x1x2x840x10040x4x1 put: ('id-dsa')! -ASN1ObjectIdentifiers at: #x1x2x840x10040x4x3 put: ('id-dsa-with-sha1')! -ASN1ObjectIdentifiers at: #x1x2x840x113533x7x65x0 put: ('entrustVersion')! -ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x1 put: ('rsaEncryption')! -ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x2 put: ('md2WithRSAEncryption')! -ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x4 put: ('md5WithRSAEncryption')! -ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x5 put: ('sha-1WithRSAEncryption')! -ASN1ObjectIdentifiers at: #x1x2x840x113549x1x9x1 put: ('e-mailAddress')! -ASN1ObjectIdentifiers at: #x1x3x14x3x2x12 put: ('dsa')! -ASN1ObjectIdentifiers at: #x1x3x14x3x2x27 put: ('dsa With SHA1')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x1 put: ('netscapeCertificateType')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x12 put: ('SslServerName')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x13 put: ('netscapeCertificateComment')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x2 put: ('BaseURL')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x3 put: ('RevocationURL')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x4 put: ('CARevocationURL')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x7 put: ('renewalURL')! -ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x8 put: ('netscapeCaPolicyURL')! -ASN1ObjectIdentifiers at: #x2x5x29x14 put: ('subjectKeyIdentifier')! -ASN1ObjectIdentifiers at: #x2x5x29x15 put: ('keyUsage')! -ASN1ObjectIdentifiers at: #x2x5x29x16 put: ('privateKeyUsagePeriod')! -ASN1ObjectIdentifiers at: #x2x5x29x17 put: ('subjectAlternativeName')! -ASN1ObjectIdentifiers at: #x2x5x29x18 put: ('issuerAlternativeName')! -ASN1ObjectIdentifiers at: #x2x5x29x19 put: ('basicConstraints')! -ASN1ObjectIdentifiers at: #x2x5x29x20 put: ('cRLNumber')! -ASN1ObjectIdentifiers at: #x2x5x29x21 put: ('reasonCode')! -ASN1ObjectIdentifiers at: #x2x5x29x23 put: ('holdInstructionCode')! -ASN1ObjectIdentifiers at: #x2x5x29x24 put: ('invalidityDate')! -ASN1ObjectIdentifiers at: #x2x5x29x27 put: ('deltaCRLIndicator')! -ASN1ObjectIdentifiers at: #x2x5x29x28 put: ('issuingDistributionPoint')! -ASN1ObjectIdentifiers at: #x2x5x29x29 put: ('certificateIssuer')! -ASN1ObjectIdentifiers at: #x2x5x29x3 put: ('certificate policies - old')! -ASN1ObjectIdentifiers at: #x2x5x29x30 put: ('nameConstraints')! -ASN1ObjectIdentifiers at: #x2x5x29x31 put: ('cRLDistributionPoints')! -ASN1ObjectIdentifiers at: #x2x5x29x32 put: ('certificatePolicies')! -ASN1ObjectIdentifiers at: #x2x5x29x33 put: ('policyMappings')! -ASN1ObjectIdentifiers at: #x2x5x29x35 put: ('authorityKeyIdentifier')! -ASN1ObjectIdentifiers at: #x2x5x29x36 put: ('policyConstraints')! -ASN1ObjectIdentifiers at: #x2x5x4x10 put: ('O')! -ASN1ObjectIdentifiers at: #x2x5x4x11 put: ('OU')! -ASN1ObjectIdentifiers at: #x2x5x4x13 put: ('??')! -ASN1ObjectIdentifiers at: #x2x5x4x3 put: ('CN')! -ASN1ObjectIdentifiers at: #x2x5x4x6 put: ('C')! -ASN1ObjectIdentifiers at: #x2x5x4x7 put: ('L')! -ASN1ObjectIdentifiers at: #x2x5x4x8 put: ('S')! -ASN1ObjectIdentifiers at: #x2x5x8x1x1 put: ('rsa')! -" \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/class/p.q.g.y..st b/source/Cryptography.package/DSAPublicKey.class/class/p.q.g.y..st deleted file mode 100644 index a62551c..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/class/p.q.g.y..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -p: p0 q: q0 g: g0 y: y0 - ^ self new p: p0 q: q0 g: g0 y: y0 \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/class/test1.st b/source/Cryptography.package/DSAPublicKey.class/class/test1.st deleted file mode 100644 index 05a4e9f..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/class/test1.st +++ /dev/null @@ -1,10 +0,0 @@ -examples -test1 - - | x509 key hash | - x509 := #(48 130 1 184 48 130 1 44 6 7 42 134 72 206 56 4 1 48 130 1 31 2 129 129 0 253 127 83 129 29 117 18 41 82 223 74 156 46 236 228 231 246 17 183 82 60 239 68 0 195 30 63 128 182 81 38 105 69 93 64 34 81 251 89 61 141 88 250 191 197 245 186 48 246 203 155 85 108 215 129 59 128 29 52 111 242 102 96 183 107 153 80 165 164 159 159 232 4 123 16 34 194 79 187 169 215 254 183 198 27 248 59 87 231 198 168 166 21 15 4 251 131 246 211 197 30 195 2 53 84 19 90 22 145 50 246 117 243 174 43 97 215 42 239 242 34 3 25 157 209 72 1 199 2 21 0 151 96 80 143 21 35 11 204 178 146 185 130 162 235 132 11 240 88 28 245 2 129 129 0 247 225 160 133 214 155 61 222 203 188 171 92 54 184 87 185 121 148 175 187 250 58 234 130 249 87 76 11 61 7 130 103 81 89 87 142 186 212 89 79 230 113 7 16 129 128 180 73 22 113 35 232 76 40 22 19 183 207 9 50 140 200 166 225 60 22 122 139 84 124 141 40 224 163 174 30 43 179 166 117 145 110 163 127 11 250 33 53 98 241 251 98 122 1 36 59 204 164 241 190 168 81 144 137 168 131 223 225 90 229 159 6 146 139 102 94 128 123 85 37 100 1 76 59 254 207 73 42 3 129 133 0 2 129 129 0 209 171 224 141 87 74 186 36 200 200 42 40 228 114 112 206 104 250 213 194 178 215 57 23 135 248 223 239 188 97 167 102 105 90 234 151 109 222 24 29 72 142 144 0 11 95 96 125 132 94 155 201 238 92 229 249 108 218 81 237 57 70 21 226 217 118 235 29 215 214 73 236 204 148 72 7 26 167 85 90 96 4 15 232 157 127 208 172 107 241 4 180 137 245 183 54 97 233 185 114 47 14 37 221 10 6 183 240 46 247 196 150 223 119 107 80 145 214 222 138 248 230 247 102 1 229 209 193) asByteArray. - key := DSAPublicKey fromAsnDerBytes: x509. - (key asAsn1Bytes = x509) - ifFalse: [self error: 'encodings different']. - hash := SHA1 hashMessage: key asAsn1Bytes. - ^ (Base64MimeConverter mimeEncode: hash readStream) contents diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/^equals.st b/source/Cryptography.package/DSAPublicKey.class/instance/^equals.st deleted file mode 100644 index ac1de39..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/^equals.st +++ /dev/null @@ -1,5 +0,0 @@ -as yet unclassified -= anObject - - (anObject isKindOf: self class) ifFalse: [^false]. - ^ self asAsn1Bytes = anObject asAsn1Bytes \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/base64CryptoHash.st b/source/Cryptography.package/DSAPublicKey.class/instance/base64CryptoHash.st deleted file mode 100644 index e06130b..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/base64CryptoHash.st +++ /dev/null @@ -1,11 +0,0 @@ -as yet unclassified -base64CryptoHash - - | encoded hash | - encoded := self asAsn1Bytes. - ((encoded first bitAnd: 16r80) > 0) - ifTrue: [encoded := #(0) asByteArray, encoded]. - hash := (SHA1 hashMessage: encoded) asByteArray reversed. - ((hash first bitAnd: 16r80) > 0) - ifTrue: [hash := #(0) asByteArray, hash]. - ^ hash toEBase64String diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/dssSig.st b/source/Cryptography.package/DSAPublicKey.class/instance/dssSig.st deleted file mode 100644 index adfaacb..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/dssSig.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -dssSig - - ^ OrderedCollection with: p with: q with: g \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/p.q.g.y..st b/source/Cryptography.package/DSAPublicKey.class/instance/p.q.g.y..st deleted file mode 100644 index 5111d72..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/p.q.g.y..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -p: p0 q: q0 g: g0 y: y0 - p := p0. - q := q0. - g := g0. - y := y0 \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/stringToSignature..st b/source/Cryptography.package/DSAPublicKey.class/instance/stringToSignature..st deleted file mode 100644 index fef08ab..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/stringToSignature..st +++ /dev/null @@ -1,17 +0,0 @@ -as yet unclassified -stringToSignature: aString - "Answer the signature stored in the given string. A signature string has the format: - - '[DSA digital signature ]' - - where and are large positive integers represented by strings of hexidecimal digits." - - | prefix stream r s | - prefix := '[DSA digital signature '. - (aString beginsWith: prefix) ifFalse: [self error: 'bad signature prefix']. - stream := ReadStream on: aString. - stream position: prefix size. - r := Integer readFrom: stream base: 16. - stream next. - s := Integer readFrom: stream base: 16. - ^ Array with: r with: s diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/verify.isSignatureOf..st b/source/Cryptography.package/DSAPublicKey.class/instance/verify.isSignatureOf..st deleted file mode 100644 index 79b84d4..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/verify.isSignatureOf..st +++ /dev/null @@ -1,12 +0,0 @@ -as yet unclassified -verify: signatureString isSignatureOf: aStringOrStream - "Answer true if the given signature string signs the given message (a stream or string)." - "Note: Random numbers are not needed for signature verification; thus, there is no need to call initRandomFromUser before verifying a signature." - - | hasher h sig | - hasher := SHA1 new. - (aStringOrStream class isBytes) - ifTrue: [h := hasher hashMessage: aStringOrStream] - ifFalse: [h := hasher hashStream: aStringOrStream]. - sig := self stringToSignature: signatureString. - ^ self verifySignature: sig ofMessageHash: h \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/instance/verifySignature.ofMessageHash..st b/source/Cryptography.package/DSAPublicKey.class/instance/verifySignature.ofMessageHash..st deleted file mode 100644 index 6477ff8..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/instance/verifySignature.ofMessageHash..st +++ /dev/null @@ -1,16 +0,0 @@ -as yet unclassified -verifySignature: aSignature ofMessageHash: hash - "Answer true if the given signature is the authentic signature of the given message hash. That is, if the signature must have been computed using the private key set corresponding to the given public key." - - | r s w u1 u2 v0 v | - r := aSignature first. - s := aSignature last. - ((r > 0) and: [r < q]) ifFalse: [^ false]. "reject" - ((s > 0) and: [s < q]) ifFalse: [^ false]. "reject" - - w := s inverseModulo: q. - u1 := (hash asInteger * w) \\ q. - u2 := (r * w) \\ q. - v0 := (g raisedTo: u1 modulo: p) * (y raisedTo: u2 modulo: p). - v := ( v0 \\ p) \\ q. - ^ v = r \ No newline at end of file diff --git a/source/Cryptography.package/DSAPublicKey.class/properties.json b/source/Cryptography.package/DSAPublicKey.class/properties.json deleted file mode 100644 index d5b11b0..0000000 --- a/source/Cryptography.package/DSAPublicKey.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-DSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "p", - "q", - "g", - "y" - ], - "name" : "DSAPublicKey", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/README.md b/source/Cryptography.package/DiffieHellman.class/README.md deleted file mode 100644 index 6794b95..0000000 --- a/source/Cryptography.package/DiffieHellman.class/README.md +++ /dev/null @@ -1,25 +0,0 @@ -I represent the basic version of the Diffie-Hellman key agreement. -See Handbook of Applied Cryptography, Ch. 12, p. 516 - -One time setup: -* a safe prime p and a generator alpha of Zp* are published. - -Protocol actions: -* Alice chooses a random secret x between 1 and p-2. -* Alice sends Bob message alpha^x mod p. -* Bob chooses a random secret y between 1 and p-2. -* Bob sends Alice message alpha^y mod p. -* Alice receives alpha^y and computes the shared key: - K = (alpha^y)^x mod p. -* Bob receives alpha^x and computes the shared key: - K = (alpha^x)^y mod p. - -Example from testCase: -| alice bob fromAlice fromBob k1 k2 | -alice := DiffieHellman bits: 15. -bob := DiffieHellman prime: alice prime generator: alice generator. -fromAlice := alice sendMessage. -fromBob := bob sendMessage. -k1 := alice receiveMessage: fromBob. -k2 := bob receiveMessage: fromAlice. -self assert: k1 = k2 diff --git a/source/Cryptography.package/DiffieHellman.class/class/bits..st b/source/Cryptography.package/DiffieHellman.class/class/bits..st deleted file mode 100644 index 38d12e1..0000000 --- a/source/Cryptography.package/DiffieHellman.class/class/bits..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -bits: anInteger - | prime generator | - prime := PrimesFinder safePrimeOfSize: anInteger. - generator := ElGamalKeyGenerator generatorOfZp: prime. - ^ self prime: prime generator: generator \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/class/prime.generator..st b/source/Cryptography.package/DiffieHellman.class/class/prime.generator..st deleted file mode 100644 index dba2698..0000000 --- a/source/Cryptography.package/DiffieHellman.class/class/prime.generator..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -prime: prime generator: generator - ^ self new prime: prime; generator: generator \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/generator..st b/source/Cryptography.package/DiffieHellman.class/instance/generator..st deleted file mode 100644 index 00f37b5..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/generator..st +++ /dev/null @@ -1,3 +0,0 @@ -initialization -generator: anInteger - generator := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/generator.st b/source/Cryptography.package/DiffieHellman.class/instance/generator.st deleted file mode 100644 index 7a97aa9..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/generator.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -generator - ^ generator \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/prime..st b/source/Cryptography.package/DiffieHellman.class/instance/prime..st deleted file mode 100644 index 3bb368b..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/prime..st +++ /dev/null @@ -1,3 +0,0 @@ -initialization -prime: anInteger - prime := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/prime.st b/source/Cryptography.package/DiffieHellman.class/instance/prime.st deleted file mode 100644 index b816a1a..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/prime.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -prime - ^ prime \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/receiveMessage..st b/source/Cryptography.package/DiffieHellman.class/instance/receiveMessage..st deleted file mode 100644 index 1ca78bd..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/receiveMessage..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -receiveMessage: anInteger - sharedKey := anInteger raisedTo: secret modulo: prime. - ^ sharedKey \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/sendMessage.st b/source/Cryptography.package/DiffieHellman.class/instance/sendMessage.st deleted file mode 100644 index 03d61ab..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/sendMessage.st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -sendMessage - secret := SecureRandom picker nextInt: prime-2. - ^ generator raisedTo: secret modulo: prime \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/setupPrimeOfSize..st b/source/Cryptography.package/DiffieHellman.class/instance/setupPrimeOfSize..st deleted file mode 100644 index aef67d3..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/setupPrimeOfSize..st +++ /dev/null @@ -1,4 +0,0 @@ -initialization -setupPrimeOfSize: bits - prime := PrimesFinder safePrimeOfSize: bits. - generator := ElGamalKeyGenerator generatorOfZp: prime \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/instance/sharedKey.st b/source/Cryptography.package/DiffieHellman.class/instance/sharedKey.st deleted file mode 100644 index b31af52..0000000 --- a/source/Cryptography.package/DiffieHellman.class/instance/sharedKey.st +++ /dev/null @@ -1,3 +0,0 @@ -protocol -sharedKey - ^ sharedKey \ No newline at end of file diff --git a/source/Cryptography.package/DiffieHellman.class/properties.json b/source/Cryptography.package/DiffieHellman.class/properties.json deleted file mode 100644 index f39c33b..0000000 --- a/source/Cryptography.package/DiffieHellman.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "cs 12/5/2002 18:50", - "super" : "Object", - "category" : "Cryptography-ElGamal", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "prime", - "generator", - "secret", - "sharedKey" - ], - "name" : "DiffieHellman", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/README.md b/source/Cryptography.package/ElGamalKeyGenerator.class/README.md deleted file mode 100644 index 8e2d88b..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/README.md +++ /dev/null @@ -1,29 +0,0 @@ -The ElGamal public-key encryption scheme is related to the Diffie-Hellman key agreement. Their security is based on the intractability of the same number theoretic problems (the discrete logarithm problem and the Diffie-Hellman problem). - -See Handbook of Applied Cryptography, Ch. 8, p. 294. - -Key generation: -* Generate a large random prime p and a generator alpha of the multiplicative group Zp* of the integers modulo p -* Select a random integer a between 1 and p-2, and compute alpha^a mod p -* The public key is (p, alpha, alpha^a) - The private key is a - -Example of encryption: -| elgamal pub priv c | -elgamal := ElGamalKeyGenerator new. -elgamal generateKeysOfSize: 15. -pub := elgamal publicKey. -priv := elgamal privateKey. -c := pub encryptElement: 31. -priv decryptElement: c. - - -Example of signature: -| elgamal pub priv signature | -elgamal := ElGamalKeyGenerator new. -elgamal generateKeysOfSize: 15. -pub := elgamal publicKey. -priv := elgamal privateKey. -signature := priv signMessage: 'hello'. -pub verifySignature: signature onMessage: 'hello'. - diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/class/bits..st b/source/Cryptography.package/ElGamalKeyGenerator.class/class/bits..st deleted file mode 100644 index 8a21bef..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/class/bits..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -bits: anInteger - ^ self new generateKeysOfSize: anInteger \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/class/generatorOfZp..st b/source/Cryptography.package/ElGamalKeyGenerator.class/class/generatorOfZp..st deleted file mode 100644 index b83ba91..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/class/generatorOfZp..st +++ /dev/null @@ -1,12 +0,0 @@ -utils -generatorOfZp: safePrimeP - "Finds a generator of Zp* where p is a safe prime: p = 2q+1 with q prime. - The order of Zp* is n = p-1 = 2q, so we know the factorization of n. - See Handbook of Applied Cryptography, Ch.4, p.163 " - - | alpha p n | - p := safePrimeP. - n := p - 1. - [alpha := SecureRandom picker nextInt: n. - ((alpha raisedTo: n/2 modulo: p) = 1 or: [(alpha raisedTo: 2 modulo: p) = 1])] whileFalse. - ^ alpha \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/destroy.st b/source/Cryptography.package/ElGamalKeyGenerator.class/instance/destroy.st deleted file mode 100644 index 92b8fb2..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/destroy.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -destroy - p destroy. - alpha destroy. - a destroy \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/generateKeysOfSize..st b/source/Cryptography.package/ElGamalKeyGenerator.class/instance/generateKeysOfSize..st deleted file mode 100644 index ebbf530..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/generateKeysOfSize..st +++ /dev/null @@ -1,5 +0,0 @@ -private -generateKeysOfSize: numberOfBits - p := PrimesFinder safePrimeOfSize: numberOfBits. - alpha := self class generatorOfZp: p. - a := SecureRandom picker nextInt: p-2 \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/privateKey.st b/source/Cryptography.package/ElGamalKeyGenerator.class/instance/privateKey.st deleted file mode 100644 index 9e9ca83..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/privateKey.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -privateKey - ^ ElGamalPrivateKey - setModulo: p - generator: alpha - secretExponent: a diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/publicKey.st b/source/Cryptography.package/ElGamalKeyGenerator.class/instance/publicKey.st deleted file mode 100644 index 82071a9..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/instance/publicKey.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -publicKey - ^ ElGamalPublicKey - setModulo: p - generator: alpha - generatorRaisedToA: (alpha raisedTo: a modulo: p) diff --git a/source/Cryptography.package/ElGamalKeyGenerator.class/properties.json b/source/Cryptography.package/ElGamalKeyGenerator.class/properties.json deleted file mode 100644 index 1ab7e26..0000000 --- a/source/Cryptography.package/ElGamalKeyGenerator.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-ElGamal", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "p", - "alpha", - "a" - ], - "name" : "ElGamalKeyGenerator", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/README.md b/source/Cryptography.package/ElGamalPrivateKey.class/README.md deleted file mode 100644 index dbbd277..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/README.md +++ /dev/null @@ -1,21 +0,0 @@ -See Handbook of Applied Cryptography, Ch. 8, p. 295. - -Here we use the notation: - p = modulo - alpha = generator - a = secretExponent - -Decryption: -* Receive the ciphertext c = (gamma, delta). -* Use the private key to compute: - gamma^(p-1-a) = gamma^(-a) = alpha^(-a*k) mod p -* Recover m = (gamma^(p-1-a)) * delta mod p - -Signature generation: -* Select a random secret integer k between 1 and p-2, with gcd(k, p-1) = 1. -* Compute r = alpha^k mod p. -* Compute k^(-1) mod (p-1). -* Compute s = k^(-1) * ( h(m) - a*r ) mod (p-1), where h is a hash function. -* The signature for m is the pair (r,s). - - diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/class/setModulo.generator.secretExponent..st b/source/Cryptography.package/ElGamalPrivateKey.class/class/setModulo.generator.secretExponent..st deleted file mode 100644 index 16b6f2c..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/class/setModulo.generator.secretExponent..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -setModulo: p generator: alpha secretExponent: a - ^ self new setModulo: p generator: alpha secretExponent: a - diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/instance/decryptElement..st b/source/Cryptography.package/ElGamalPrivateKey.class/instance/decryptElement..st deleted file mode 100644 index dfc9845..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/instance/decryptElement..st +++ /dev/null @@ -1,7 +0,0 @@ -actions -decryptElement: anArray - | gamma delta aux | - gamma := anArray at: 1. - delta := anArray at: 2. - aux := gamma raisedTo: (modulo - 1 - secretExponent) modulo: modulo. - ^ aux * delta \\ modulo \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/instance/hashFunction.st b/source/Cryptography.package/ElGamalPrivateKey.class/instance/hashFunction.st deleted file mode 100644 index dc33299..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/instance/hashFunction.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashFunction - ^ SHA1 new \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/instance/setModulo.generator.secretExponent..st b/source/Cryptography.package/ElGamalPrivateKey.class/instance/setModulo.generator.secretExponent..st deleted file mode 100644 index 0b3117e..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/instance/setModulo.generator.secretExponent..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -setModulo: p generator: alpha secretExponent: a - modulo := p. - generator := alpha. - secretExponent := a. \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/instance/signMessage..st b/source/Cryptography.package/ElGamalPrivateKey.class/instance/signMessage..st deleted file mode 100644 index 3769e2a..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/instance/signMessage..st +++ /dev/null @@ -1,12 +0,0 @@ -actions -signMessage: aByteArray - | hm k kinv r s | - hm := (self hashFunction hashMessage: aByteArray) asInteger. - - [k := SecureRandom picker nextInt: modulo - 2. - (k gcd: modulo-1) = 1] whileFalse. - - r := generator raisedTo: k modulo: modulo. - kinv := k inverseModulo: (modulo-1). - s := kinv * (hm - (secretExponent*r)) \\ (modulo-1). - ^ Array with: r with: s \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPrivateKey.class/properties.json b/source/Cryptography.package/ElGamalPrivateKey.class/properties.json deleted file mode 100644 index ea89ab2..0000000 --- a/source/Cryptography.package/ElGamalPrivateKey.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-ElGamal", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "modulo", - "generator", - "secretExponent" - ], - "name" : "ElGamalPrivateKey", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPublicKey.class/README.md b/source/Cryptography.package/ElGamalPublicKey.class/README.md deleted file mode 100644 index 9ca7861..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/README.md +++ /dev/null @@ -1,24 +0,0 @@ -See Handbook of Applied Cryptography, Ch. 8, p. 295. - -Here we use the notation: - p = modulo - alpha = generator - alpha^a = generatorRaisedToA - -Encryption: -* Obtain A's public key (p, alpha, alpha^a). -* Represent the message as an integer m between 0 and p-1. -* Select a random integer k between 1 and p-2. -* Compute: - gamma = alpha^k mod p - delta = m * (alpha^a)^k mod p. -* Send the ciphertext c = (gamma, delta). - -Signature verification: -* Obtain A's public key (p, alpha, alpha^a). -* Verify that r is between 1 and p-1, if not then reject the signature. -* Compute v1 = (alpha^a)^r * r^s mod p. -* Compute h(m) where h is a hash function -* Compute v2 = alpha^h(m) mod p. -* Accept the signature if and only if v1=v2. - diff --git a/source/Cryptography.package/ElGamalPublicKey.class/class/setModulo.generator.generatorRaisedToA..st b/source/Cryptography.package/ElGamalPublicKey.class/class/setModulo.generator.generatorRaisedToA..st deleted file mode 100644 index 369beae..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/class/setModulo.generator.generatorRaisedToA..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -setModulo: p generator: alpha generatorRaisedToA: y - ^ self new setModulo: p generator: alpha generatorRaisedToA: y \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPublicKey.class/instance/encryptElement..st b/source/Cryptography.package/ElGamalPublicKey.class/instance/encryptElement..st deleted file mode 100644 index 7bd6ebd..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/instance/encryptElement..st +++ /dev/null @@ -1,7 +0,0 @@ -actions -encryptElement: anInteger - | k gamma delta | - k := SecureRandom picker nextInt: modulo-2. - gamma := generator raisedTo: k modulo: modulo. - delta := anInteger * (generatorRaisedToA raisedTo: k modulo: modulo) \\ modulo. - ^ Array with: gamma with: delta \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPublicKey.class/instance/hashFunction.st b/source/Cryptography.package/ElGamalPublicKey.class/instance/hashFunction.st deleted file mode 100644 index dc33299..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/instance/hashFunction.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashFunction - ^ SHA1 new \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPublicKey.class/instance/setModulo.generator.generatorRaisedToA..st b/source/Cryptography.package/ElGamalPublicKey.class/instance/setModulo.generator.generatorRaisedToA..st deleted file mode 100644 index b68cdee..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/instance/setModulo.generator.generatorRaisedToA..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -setModulo: p generator: alpha generatorRaisedToA: y - modulo := p. - generator := alpha. - generatorRaisedToA := y. \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPublicKey.class/instance/verifySignature.onMessage..st b/source/Cryptography.package/ElGamalPublicKey.class/instance/verifySignature.onMessage..st deleted file mode 100644 index 2ec615c..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/instance/verifySignature.onMessage..st +++ /dev/null @@ -1,12 +0,0 @@ -actions -verifySignature: anArray onMessage: aByteArray - | hm r s v1 v2 | - hm := (self hashFunction hashMessage: aByteArray) asInteger. - r := anArray at: 1. - s := anArray at: 2. - (r between: 1 and: modulo-1) ifFalse: [^ false]. "signature rejected" - - v1 := generatorRaisedToA raisedTo: r modulo: modulo. - v1 := v1 * (r raisedTo: s modulo: modulo) \\ modulo. - v2 := generator raisedTo: hm modulo: modulo. - ^ v1 = v2 "signature accepted if v1=v2" \ No newline at end of file diff --git a/source/Cryptography.package/ElGamalPublicKey.class/properties.json b/source/Cryptography.package/ElGamalPublicKey.class/properties.json deleted file mode 100644 index 16d07dd..0000000 --- a/source/Cryptography.package/ElGamalPublicKey.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-ElGamal", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "modulo", - "generator", - "generatorRaisedToA" - ], - "name" : "ElGamalPublicKey", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/README.md b/source/Cryptography.package/EuclidAlgorithm.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/EuclidAlgorithm.class/class/with.with..st b/source/Cryptography.package/EuclidAlgorithm.class/class/with.with..st deleted file mode 100644 index 928473c..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/class/with.with..st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -with: a with: b - ^ self new with: a with: b \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/doBasicAlgorithm.st b/source/Cryptography.package/EuclidAlgorithm.class/instance/doBasicAlgorithm.st deleted file mode 100644 index 2334fdb..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/doBasicAlgorithm.st +++ /dev/null @@ -1,15 +0,0 @@ -as yet unclassified -doBasicAlgorithm - | u1 a1 b1 q r | - u := 1. u1 := 0. a1 := a. b1 := b. - [b1 = 0] - whileFalse: - [q := a1 // b1. - r := a1 - (b1 * q). - u1 := u - (q * (u := u1)). - a1 := b1. - b1 := r]. - gcd := a1. - v := b = 0 - ifTrue: [b] - ifFalse: [gcd - (u * a) // b] \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/firstCoefficient.st b/source/Cryptography.package/EuclidAlgorithm.class/instance/firstCoefficient.st deleted file mode 100644 index 1c30c5b..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/firstCoefficient.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -firstCoefficient - ^u \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/gcd.st b/source/Cryptography.package/EuclidAlgorithm.class/instance/gcd.st deleted file mode 100644 index 73e65a4..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/gcd.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -gcd - ^gcd \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/lehmer.st b/source/Cryptography.package/EuclidAlgorithm.class/instance/lehmer.st deleted file mode 100644 index 2210689..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/lehmer.st +++ /dev/null @@ -1,80 +0,0 @@ -as yet unclassified -lehmer - "For a desciption of the algorithm below for large integers See 'A Course in Computational Algebraic - Number Theory' by Henri Cohen" - - "do Preprocessing" - | a0 b0 a1 b1 aHat bHat higher aa bb cc dd q t r v1 bcc bdd quoRem e k | - b1 := b abs. - a1 := a abs max: b1. - b1 := a abs min: b1. - a0 := a1. - b0 := b1. "Initialize elements" - u := 1. - v1 := 0. - aa := 1. - bb := 0. - cc := 0. - dd := 1. - higher := 30. "Core.SmallInteger maxVal highBit." - ["Are we done yet" - b1 class == SmallInteger] - whileFalse: - [aHat := a1. - k := higher - a1 highBit. - (aHat bitShift: k) class == SmallInteger - ifFalse: - [k := k - 1. - aHat := aHat bitShift: -1]. - bHat := b1 bitShift: k. - - ["Test the quotient" - bcc := bHat + cc. - bcc ~= 0 - and: - [bdd := bHat + dd. - bdd ~= 0 - and: - [q := aHat + a1 // bcc. - q = (aHat + bb // bdd)]]] - whileTrue: - ["Euclidean step" - aa := cc. - cc := aa - (q * aa). - bb := dd. - dd := bb - (q * bb). - aHat := bHat. - bHat := aHat - (q * aHat)]. - bb = 0 - ifTrue: - ["Multi-precision step" - quoRem := a1 digitDiv: b1 neg: false. - a1 := b1. - b1 := quoRem at: 2. - u := v1. - v1 := u - ((quoRem at: 1) - * u)] - ifFalse: - [t := aa * a1 + (bb * b1). - r := cc * a1 + (dd * b1). - a1 := t. - b1 := r. - t := aa * u + (bb * v1). - r := cc * u + (dd * v1). - u := t. - v1 := r]]. - e := self class with: a1 with: b1. - e doBasicAlgorithm. - gcd := e gcd. - u := u * e firstCoefficient + (v1 * e secondCoefficient). - v := b0 = 0 - ifTrue: [b0] - ifFalse: [gcd - (u * a0) // b0]. - a abs >= b abs - ifFalse: - ["Postprocess" - t := u. - u := v. - v := t]. - a < 0 ifTrue: [u := u negated]. - b < 0 ifTrue: [v := v negated] \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/run.st b/source/Cryptography.package/EuclidAlgorithm.class/instance/run.st deleted file mode 100644 index 84cb353..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/run.st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -run - ((a isKindOf: LargePositiveInteger) - and: [b isKindOf: LargePositiveInteger]) - ifTrue: [self lehmer] - ifFalse: [self doBasicAlgorithm] \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/secondCoefficient.st b/source/Cryptography.package/EuclidAlgorithm.class/instance/secondCoefficient.st deleted file mode 100644 index de5b03c..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/secondCoefficient.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -secondCoefficient - ^ v \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/instance/with.with..st b/source/Cryptography.package/EuclidAlgorithm.class/instance/with.with..st deleted file mode 100644 index 10cb873..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/instance/with.with..st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -with: numberA with: numberB - a := numberA. - b := numberB \ No newline at end of file diff --git a/source/Cryptography.package/EuclidAlgorithm.class/properties.json b/source/Cryptography.package/EuclidAlgorithm.class/properties.json deleted file mode 100644 index 61b63ef..0000000 --- a/source/Cryptography.package/EuclidAlgorithm.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "a", - "b", - "u", - "v", - "gcd" - ], - "name" : "EuclidAlgorithm", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/README.md b/source/Cryptography.package/Fortuna.class/README.md deleted file mode 100644 index 569f18e..0000000 --- a/source/Cryptography.package/Fortuna.class/README.md +++ /dev/null @@ -1 +0,0 @@ -Fortuna is a cryptographically secure pseudorandom number generator specified by Niels Ferguson and Bruce Schneier in chapter 10 of "Practical Cryptography." This generator utilizes a Rijndael (AES) cipher in CTR mode and is patent-free. \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/class/key..st b/source/Cryptography.package/Fortuna.class/class/key..st deleted file mode 100644 index 9edf5f5..0000000 --- a/source/Cryptography.package/Fortuna.class/class/key..st +++ /dev/null @@ -1,5 +0,0 @@ -instance creation -key: aByteArray - ^ self new - setKey: aByteArray ; - yourself \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/instance/destroy.st b/source/Cryptography.package/Fortuna.class/instance/destroy.st deleted file mode 100644 index 912e972..0000000 --- a/source/Cryptography.package/Fortuna.class/instance/destroy.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize -destroy - key destroy. - ctr destroy \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/instance/generateBlocks..st b/source/Cryptography.package/Fortuna.class/instance/generateBlocks..st deleted file mode 100644 index 22a5e54..0000000 --- a/source/Cryptography.package/Fortuna.class/instance/generateBlocks..st +++ /dev/null @@ -1,6 +0,0 @@ -private -generateBlocks: anInteger - ^ ByteArray streamContents: - [ : stream | - anInteger timesRepeat: - [ stream nextPutAll: ctr nextBlock ] ] \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/instance/initializeCtr.st b/source/Cryptography.package/Fortuna.class/instance/initializeCtr.st deleted file mode 100644 index 9d120cd..0000000 --- a/source/Cryptography.package/Fortuna.class/instance/initializeCtr.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize -initializeCtr - ctr := (Rijndael key: key) ctr \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/instance/nextBits..st b/source/Cryptography.package/Fortuna.class/instance/nextBits..st deleted file mode 100644 index 7c99d88..0000000 --- a/source/Cryptography.package/Fortuna.class/instance/nextBits..st +++ /dev/null @@ -1,16 +0,0 @@ -accessing -nextBits: anInteger - | firstBits bits8 | - firstBits := (self nextBytes: anInteger // 8) - uint: (bits8 := anInteger truncateTo: 8) - at: 1. - ^ bits8 = anInteger - ifTrue: [ firstBits ] - ifFalse: - [ | last8 mask bitsNeeded | - last8 := self nextBytes: 1. - bitsNeeded := anInteger - bits8. - mask := ((1 to: bitsNeeded) - inject: 0 - into: [ : total : n | 1 bitShift: n ]) - 1. - (firstBits bitShift: bitsNeeded) + (last8 first bitAnd: mask) ] \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/instance/nextBytes..st b/source/Cryptography.package/Fortuna.class/instance/nextBytes..st deleted file mode 100644 index bc117c1..0000000 --- a/source/Cryptography.package/Fortuna.class/instance/nextBytes..st +++ /dev/null @@ -1,13 +0,0 @@ -accessing -nextBytes: anInteger - "Generates and answers a ByteArray of size anInteger filled with random data. This is the #pseudoRandomData: function from p. 166 of Practical Cryptography. I have renamed it to nextBytes: to be more consistent with Squeaks #nextBits: nomenclature." - | data | - (anInteger between: 0 and: 1048576 "2 raisedTo: 20") - ifFalse: - [ CryptographyError signal: 'program error, should not generate this much data with the same key.' ]. - data := self generateBlocks: ((anInteger / 16) roundUpTo: 1). - "Switch to a new key to avoid later compromises of this output." - self setKey: (self generateBlocks: 2). - ^ data size = anInteger - ifTrue: [ data ] - ifFalse: [ data copyFrom: 1 to: anInteger ] \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/instance/setKey..st b/source/Cryptography.package/Fortuna.class/instance/setKey..st deleted file mode 100644 index 73221b9..0000000 --- a/source/Cryptography.package/Fortuna.class/instance/setKey..st +++ /dev/null @@ -1,7 +0,0 @@ -initialize -setKey: aByteArray - aByteArray size < Rijndael keySize - ifTrue: - [ CryptographyError signal: 'Fortuna requires a ', Rijndael keySize printString, '-byte key' ]. - key := aByteArray copyFrom: 1 to: Rijndael keySize. - self initializeCtr \ No newline at end of file diff --git a/source/Cryptography.package/Fortuna.class/properties.json b/source/Cryptography.package/Fortuna.class/properties.json deleted file mode 100644 index d150119..0000000 --- a/source/Cryptography.package/Fortuna.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "cmm 5/4/2006 15:28", - "super" : "RandomGenerator", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "key", - "ctr" - ], - "name" : "Fortuna", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/InputEventSensor.extension/instance/mousePoint.st b/source/Cryptography.package/InputEventSensor.extension/instance/mousePoint.st deleted file mode 100644 index eb42969..0000000 --- a/source/Cryptography.package/InputEventSensor.extension/instance/mousePoint.st +++ /dev/null @@ -1,4 +0,0 @@ -*Cryptography -mousePoint - - ^mousePosition \ No newline at end of file diff --git a/source/Cryptography.package/InputEventSensor.extension/properties.json b/source/Cryptography.package/InputEventSensor.extension/properties.json deleted file mode 100644 index 4655a0e..0000000 --- a/source/Cryptography.package/InputEventSensor.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "InputEventSensor" -} \ No newline at end of file diff --git a/source/Cryptography.package/Integer.extension/instance/areAllBitsSet.st b/source/Cryptography.package/Integer.extension/instance/areAllBitsSet.st deleted file mode 100644 index 18735ae..0000000 --- a/source/Cryptography.package/Integer.extension/instance/areAllBitsSet.st +++ /dev/null @@ -1,4 +0,0 @@ -*cryptography-core -areAllBitsSet - - ^self digitLength ~= (self + 1) digitLength \ No newline at end of file diff --git a/source/Cryptography.package/Integer.extension/instance/inverseModulo..st b/source/Cryptography.package/Integer.extension/instance/inverseModulo..st deleted file mode 100644 index c5ce0c9..0000000 --- a/source/Cryptography.package/Integer.extension/instance/inverseModulo..st +++ /dev/null @@ -1,51 +0,0 @@ -*cryptography-core -inverseModulo: n - "Answer the inverse of the receiver modulus n. That is, the integer y such that (self * y) \\ n is 1. Both self and n must be positive, and it is assumed that self < n and that n is integer." - "Details: Use the extended Euclidean algorithm, Schneier, p. 247." - - | v u k u1 u2 u3 t1 t2 t3 tmp | - ((self <= 0) or: [n <= 0]) ifTrue: [self error: 'number and modulo must be greater than zero']. - self >= n ifTrue: [self error: 'number must be < modulo']. - - v := self. - u := n. - k := 0. - [self even and: [n even and: [u > 0]]] whileTrue: [ "eliminate common factors of two" - k := k + 1. - u := u bitShift: -1. - v := v bitShift: -1]. - - u1 := 1. u2 := 0. u3 := u. - t1 := v. t2 := u - 1. t3 := v. - [ [u3 even ifTrue: [ - ((u1 odd) or: [u2 odd]) ifTrue: [ - u1 := u1 + v. - u2 := u2 + u]. - u1 := u1 bitShift: -1. - u2 := u2 bitShift: -1. - u3 := u3 bitShift: -1]. - ((t3 even) or: [u3 < t3]) ifTrue: [ - tmp := u1. u1 := t1. t1 := tmp. - tmp := u2. u2 := t2. t2 := tmp. - tmp := u3. u3 := t3. t3 := tmp]. - u3 even and: [u3 > 0]] whileTrue: ["loop while u3 is even"]. - - [((u1 < t1) or: [u2 < t2]) and: [u1 > 0]] whileTrue: [ - u1 := u1 + v. - u2 := u2 + u]. - - u1 := u1 - t1. - u2 := u2 - t2. - u3 := u3 - t3. - t3 > 0] whileTrue: ["loop while t3 > 0"]. - - [u1 >= v and: [u2 >= u]] whileTrue: [ - u1 := u1 - v. - u2 := u2 - u]. - - u1 := u1 bitShift: k. - u2 := u2 bitShift: k. - u3 := u3 bitShift: k. - - u3 = 1 ifFalse: [self error: 'no inverse']. - ^ u - u2 \ No newline at end of file diff --git a/source/Cryptography.package/Integer.extension/instance/toEBase64String.st b/source/Cryptography.package/Integer.extension/instance/toEBase64String.st deleted file mode 100644 index 4e846e2..0000000 --- a/source/Cryptography.package/Integer.extension/instance/toEBase64String.st +++ /dev/null @@ -1,5 +0,0 @@ -*cryptography-core -toEBase64String - - self < 0 ifTrue: [^ '-', self negated toEBase64String]. - ^ self asByteArray toEBase64String. diff --git a/source/Cryptography.package/Integer.extension/instance/twosComplement.st b/source/Cryptography.package/Integer.extension/instance/twosComplement.st deleted file mode 100644 index 443ee54..0000000 --- a/source/Cryptography.package/Integer.extension/instance/twosComplement.st +++ /dev/null @@ -1,11 +0,0 @@ -*cryptography-core -twosComplement - | complement digit length | - length := self digitLength + 1. - complement := Integer new: length neg: false. - 1 to: length-1 do: [:index | - digit := self digitAt: index. - digit := digit bitXor: 16rFF. "flip bits without 2's complement logic in bitInvert" - complement digitAt: index put: digit]. - self areAllBitsSet ifTrue: [complement digitAt: length put: 16rFF]. - ^complement + 1 \ No newline at end of file diff --git a/source/Cryptography.package/Integer.extension/properties.json b/source/Cryptography.package/Integer.extension/properties.json deleted file mode 100644 index a8c2b93..0000000 --- a/source/Cryptography.package/Integer.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "Integer" -} \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/README.md b/source/Cryptography.package/KeyHolder.class/README.md deleted file mode 100644 index c521bca..0000000 --- a/source/Cryptography.package/KeyHolder.class/README.md +++ /dev/null @@ -1,27 +0,0 @@ -A KeyHolder is a construct that holds key information safely in memory. The key is never stored in plain text in memory. The system encrypts the key using two different objects and therefore two different memory locations. A random key is generated and used to encrypt the key. That random key is changed every 100ms. To retrieve the key send the message #key. You must send in a byteArray. If you are storing a key that is a string then do: - -KeyHolder holdKey: 'aPassword' asByteArray. - -when asking for key you will get back aByteArray so if you are looking for a string use - -aByteArray := aKeyHolder key. -pKey := aByteArray asString. -aByteArray destroy. - -When you are done with the byteArray send the message destroy to it, to keep your secret key from being written to disk. Never leave your key in memory for very log. Get it, use it and destroy it as quickly as possible in the same message chain. - -If you no longer need this keyHolder you must send the message destroy to it to stop the process and wipe the memory clean. - -Instance Variables - data: KeyHolderData - random: aByteArray - randomChangeProcess: aProcess - -data - - holds onto an instance of KeyHolderData which holds your encrypted key. - -random - - the key used to encrypt your key - -randomChangeProcess - - the process that changes random diff --git a/source/Cryptography.package/KeyHolder.class/class/LICENSE.st b/source/Cryptography.package/KeyHolder.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/Cryptography.package/KeyHolder.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/Cryptography.package/KeyHolder.class/class/holdKey..st b/source/Cryptography.package/KeyHolder.class/class/holdKey..st deleted file mode 100644 index a147b15..0000000 --- a/source/Cryptography.package/KeyHolder.class/class/holdKey..st +++ /dev/null @@ -1,8 +0,0 @@ -instance creation -holdKey: aKey - "store a key scrambled in memory" - ^self new - data: (KeyHolderData new); - encryptKey: aKey; - randomChangeLoop; - yourself \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/class/readFromFile.password..st b/source/Cryptography.package/KeyHolder.class/class/readFromFile.password..st deleted file mode 100644 index f716acc..0000000 --- a/source/Cryptography.package/KeyHolder.class/class/readFromFile.password..st +++ /dev/null @@ -1,16 +0,0 @@ -instance creation -readFromFile: aFileName password: aPassword - "this method takes a long time on purpose, the idea is to increase the amount of time and resources needed to crack password" - | pwHash cipher cData pwHashAndSalt pwSalt eData aStream aKeyHolder | - [eData := ((aStream := FileStream fileNamed: aFileName) ifNil: [^nil]) binary contents asByteArray] ensure: [aStream close]. - pwSalt := eData copyFrom: eData size - 31 to: eData size. - eData := eData copyFrom: 1 to: eData size - 32. - pwHashAndSalt := PasswordSaltAndStretch hashForPassword: aPassword s: pwSalt. - pwHash := pwHashAndSalt key. - pwSalt := pwHashAndSalt value. - cipher := (TripleDES key: pwHash) cbc. - cData := cipher decrypt: eData. - aKeyHolder := self holdKey: cData. - cData destroy. - ^aKeyHolder - \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/data..st b/source/Cryptography.package/KeyHolder.class/instance/data..st deleted file mode 100644 index 7137742..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/data..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -data: anObject - "Set the value of data" - - data := anObject \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/data.st b/source/Cryptography.package/KeyHolder.class/instance/data.st deleted file mode 100644 index a1bd141..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/data.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -data - "Answer the value of data" - - ^ data \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/destroy.st b/source/Cryptography.package/KeyHolder.class/instance/destroy.st deleted file mode 100644 index 4f38c03..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/destroy.st +++ /dev/null @@ -1,7 +0,0 @@ -initialize-release -destroy - self randomChangeProcess terminate. - self randomChangeProcess: nil. - self random destroy. - self data key destroy. - self data: nil. \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/encryptKey..st b/source/Cryptography.package/KeyHolder.class/instance/encryptKey..st deleted file mode 100644 index 18b45f5..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/encryptKey..st +++ /dev/null @@ -1,5 +0,0 @@ -services -encryptKey: pKey - | eKey | - eKey := (TripleDES key: self random) cbc encrypt: pKey. - self data key: eKey \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/initialize.st b/source/Cryptography.package/KeyHolder.class/instance/initialize.st deleted file mode 100644 index f876cca..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/initialize.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -initialize - self random: (SecureRandom picker nextBytesNonZero: 32) \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/key.st b/source/Cryptography.package/KeyHolder.class/instance/key.st deleted file mode 100644 index be2b232..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/key.st +++ /dev/null @@ -1,3 +0,0 @@ -services -key - ^[(TripleDES key: self random) cbc decrypt: self data key] on: CryptographyError do: [:ex | ex retry] \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/random..st b/source/Cryptography.package/KeyHolder.class/instance/random..st deleted file mode 100644 index 1a90995..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/random..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -random: anObject - "Set the value of random" - - random := anObject \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/random.st b/source/Cryptography.package/KeyHolder.class/instance/random.st deleted file mode 100644 index fefde69..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/random.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -random - "Answer the value of random" - - ^ random \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/randomChangeLoop.st b/source/Cryptography.package/KeyHolder.class/instance/randomChangeLoop.st deleted file mode 100644 index 09f60b4..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/randomChangeLoop.st +++ /dev/null @@ -1,15 +0,0 @@ -processes -randomChangeLoop - "This loop changes the random and reencrypts the data every 100ms" - | pKey randomGenerator | - self randomChangeProcess: ([ - randomGenerator := SecureRandom picker. - [ - pKey := self key. - self random: (randomGenerator nextBytesNonZero: 32). - self encryptKey: pKey. - pKey destroy. - (Delay forMilliseconds: 100) wait. - true. - ] whileTrue. - ] forkAt: Processor highIOPriority) \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/randomChangeProcess..st b/source/Cryptography.package/KeyHolder.class/instance/randomChangeProcess..st deleted file mode 100644 index 47b58fa..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/randomChangeProcess..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -randomChangeProcess: anObject - "Set the value of randomChangeProcess" - - randomChangeProcess := anObject \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/randomChangeProcess.st b/source/Cryptography.package/KeyHolder.class/instance/randomChangeProcess.st deleted file mode 100644 index 5bff3a3..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/randomChangeProcess.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -randomChangeProcess - "Answer the value of randomChangeProcess" - - ^ randomChangeProcess \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/instance/writeToFile.password..st b/source/Cryptography.package/KeyHolder.class/instance/writeToFile.password..st deleted file mode 100644 index 4b493e5..0000000 --- a/source/Cryptography.package/KeyHolder.class/instance/writeToFile.password..st +++ /dev/null @@ -1,14 +0,0 @@ -services -writeToFile: aFileName password: aPassword - "this method takes a long time on purpose, the idea is to increase the amount of time and resources needed to crack password" - | pwHash cipher cData pwHashAndSalt pwSalt | - pwHashAndSalt := PasswordSaltAndStretch hashForPassword: aPassword. - pwHash := pwHashAndSalt key. - pwSalt := pwHashAndSalt value. - cipher := (TripleDES key: pwHash) cbc. - cData := cipher encrypt: self key. - (FileStream forceNewFileNamed: aFileName) - nextPutAll: cData; - nextPutAll: pwSalt; - close. - \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolder.class/properties.json b/source/Cryptography.package/KeyHolder.class/properties.json deleted file mode 100644 index d605a43..0000000 --- a/source/Cryptography.package/KeyHolder.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "RJT 2/9/2007 11:10", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "data", - "random", - "randomChangeProcess" - ], - "name" : "KeyHolder", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolderData.class/README.md b/source/Cryptography.package/KeyHolderData.class/README.md deleted file mode 100644 index 80452ff..0000000 --- a/source/Cryptography.package/KeyHolderData.class/README.md +++ /dev/null @@ -1,7 +0,0 @@ -A KeyHolderData is used by KeyHolder see comments there. - -Instance Variables - key: - -key - - key that was encrypted by KeyHolder. This value is changed frequently by KeyHolder. diff --git a/source/Cryptography.package/KeyHolderData.class/class/LICENSE.st b/source/Cryptography.package/KeyHolderData.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/Cryptography.package/KeyHolderData.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/Cryptography.package/KeyHolderData.class/instance/key..st b/source/Cryptography.package/KeyHolderData.class/instance/key..st deleted file mode 100644 index b7eec7a..0000000 --- a/source/Cryptography.package/KeyHolderData.class/instance/key..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -key: anObject - "Set the value of key" - - key := anObject \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolderData.class/instance/key.st b/source/Cryptography.package/KeyHolderData.class/instance/key.st deleted file mode 100644 index 7619dae..0000000 --- a/source/Cryptography.package/KeyHolderData.class/instance/key.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -key - "Answer the value of key" - - ^ key \ No newline at end of file diff --git a/source/Cryptography.package/KeyHolderData.class/properties.json b/source/Cryptography.package/KeyHolderData.class/properties.json deleted file mode 100644 index 181459f..0000000 --- a/source/Cryptography.package/KeyHolderData.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "RJT 2/9/2007 11:17", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "key" - ], - "name" : "KeyHolderData", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/LargePositiveInteger.extension/instance/destroy.st b/source/Cryptography.package/LargePositiveInteger.extension/instance/destroy.st deleted file mode 100644 index 71a6a02..0000000 --- a/source/Cryptography.package/LargePositiveInteger.extension/instance/destroy.st +++ /dev/null @@ -1,8 +0,0 @@ -*cryptography-core -destroy - "Wipe my bytes so that they cannot possibly be discovered." - 1 to: self size do: - [ : x | - self - digitAt: x - put: 0 ] \ No newline at end of file diff --git a/source/Cryptography.package/LargePositiveInteger.extension/properties.json b/source/Cryptography.package/LargePositiveInteger.extension/properties.json deleted file mode 100644 index 4fea44e..0000000 --- a/source/Cryptography.package/LargePositiveInteger.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "LargePositiveInteger" -} \ No newline at end of file diff --git a/source/Cryptography.package/MD2.class/README.md b/source/Cryptography.package/MD2.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/MD2.class/class/initialize.st b/source/Cryptography.package/MD2.class/class/initialize.st deleted file mode 100644 index 49156d6..0000000 --- a/source/Cryptography.package/MD2.class/class/initialize.st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -initialize - - PITable := OrderedCollection new. - self initializeFirstHalfPITable. - self initializeSecondHalfPITable. diff --git a/source/Cryptography.package/MD2.class/class/initializeFirstHalfPITable.st b/source/Cryptography.package/MD2.class/class/initializeFirstHalfPITable.st deleted file mode 100644 index 44621ff..0000000 --- a/source/Cryptography.package/MD2.class/class/initializeFirstHalfPITable.st +++ /dev/null @@ -1,14 +0,0 @@ -as yet unclassified -initializeFirstHalfPITable - - PITable addAll: { - 41. 46. 67. 201. 162. 216. 124. 1. 61. 54. 84. 161. 236. 240. 6. - 19. 98. 167. 5. 243. 192. 199. 115. 140. 152. 147. 43. 217. 188. - 76. 130. 202. 30. 155. 87. 60. 253. 212. 224. 22. 103. 66. 111. 24. - 138. 23. 229. 18. 190. 78. 196. 214. 218. 158. 222. 73. 160. 251. - 245. 142. 187. 47. 238. 122. 169. 104. 121. 145. 21. 178. 7. 63. - 148. 194. 16. 137. 11. 34. 95. 33. 128. 127. 93. 154. 90. 144. 50. - 39. 53. 62. 204. 231. 191. 247. 151. 3. 255. 25. 48. 179. 72. 165. - 181. 209. 215. 94. 146. 42. 172. 86. 170. 198. 79. 184. 56. 210. - 150. 164. 125. 182. 118. 252. 107. 226. 156. 116. 4. 241. 69. 157. - }. diff --git a/source/Cryptography.package/MD2.class/class/initializeSecondHalfPITable.st b/source/Cryptography.package/MD2.class/class/initializeSecondHalfPITable.st deleted file mode 100644 index d0f6b1b..0000000 --- a/source/Cryptography.package/MD2.class/class/initializeSecondHalfPITable.st +++ /dev/null @@ -1,14 +0,0 @@ -as yet unclassified -initializeSecondHalfPITable - - PITable addAll: { - 112. 89. 100. 113. 135. 32. 134. 91. 207. 101. 230. 45. 168. 2. 27. - 96. 37. 173. 174. 176. 185. 246. 28. 70. 97. 105. 52. 64. 126. 15. - 85. 71. 163. 35. 221. 81. 175. 58. 195. 92. 249. 206. 186. 197. - 234. 38. 44. 83. 13. 110. 133. 40. 132. 9. 211. 223. 205. 244. 65. - 129. 77. 82. 106. 220. 55. 200. 108. 193. 171. 250. 36. 225. 123. - 8. 12. 189. 177. 74. 120. 136. 149. 139. 227. 99. 232. 109. 233. - 203. 213. 254. 59. 0. 29. 57. 242. 239. 183. 14. 102. 88. 208. 228. - 166. 119. 114. 248. 235. 117. 75. 10. 49. 68. 80. 180. 143. 237. - 31. 26. 219. 153. 141. 51. 159. 17. 131. 20 - }. diff --git a/source/Cryptography.package/MD2.class/class/oidString.st b/source/Cryptography.package/MD2.class/class/oidString.st deleted file mode 100644 index cd8042f..0000000 --- a/source/Cryptography.package/MD2.class/class/oidString.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -oidString - - ^ '1.2.840.113549.2.2'. diff --git a/source/Cryptography.package/MD2.class/class/piTable.st b/source/Cryptography.package/MD2.class/class/piTable.st deleted file mode 100644 index b37d213..0000000 --- a/source/Cryptography.package/MD2.class/class/piTable.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -piTable - - ^ PITable \ No newline at end of file diff --git a/source/Cryptography.package/MD2.class/instance/appendChecksumToInput..st b/source/Cryptography.package/MD2.class/instance/appendChecksumToInput..st deleted file mode 100644 index 0723fab..0000000 --- a/source/Cryptography.package/MD2.class/instance/appendChecksumToInput..st +++ /dev/null @@ -1,14 +0,0 @@ -accessing -appendChecksumToInput: input - - | checksum l c | - checksum := ByteArray new: 16 withAll: 0. - l := 0. - - 0 to: (input size // 16) - 1 do: [:i | - 1 to: 16 do: [:j | - c := input at: (i * 16 + j). - checksum at: j put: ((checksum at: j) bitXor: (self piTable at: (c bitXor: l) + 1)). - l := checksum at: j]]. - - ^ input, checksum diff --git a/source/Cryptography.package/MD2.class/instance/appendPaddingToInput..st b/source/Cryptography.package/MD2.class/instance/appendPaddingToInput..st deleted file mode 100644 index 3c39b4e..0000000 --- a/source/Cryptography.package/MD2.class/instance/appendPaddingToInput..st +++ /dev/null @@ -1,9 +0,0 @@ -accessing -appendPaddingToInput: input - - | paddingLength newInput | - paddingLength := 16 - (input size \\ 16). - newInput := input asByteArray, (ByteArray new: paddingLength withAll: paddingLength). - newInput size \\ 16 = 0 - ifFalse: [self error: 'bad padding']. - ^ newInput diff --git a/source/Cryptography.package/MD2.class/instance/hashMessage..st b/source/Cryptography.package/MD2.class/instance/hashMessage..st deleted file mode 100644 index 9349af6..0000000 --- a/source/Cryptography.package/MD2.class/instance/hashMessage..st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -hashMessage: aStringOrByteArray - - | input | - input := self appendPaddingToInput: aStringOrByteArray asByteArray. - input := self appendChecksumToInput: input. - ^ self processBlocks: input. diff --git a/source/Cryptography.package/MD2.class/instance/piTable.st b/source/Cryptography.package/MD2.class/instance/piTable.st deleted file mode 100644 index 9e5fbd6..0000000 --- a/source/Cryptography.package/MD2.class/instance/piTable.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -piTable - - ^ self class piTable. diff --git a/source/Cryptography.package/MD2.class/instance/processBlocks..st b/source/Cryptography.package/MD2.class/instance/processBlocks..st deleted file mode 100644 index 7fcd3a3..0000000 --- a/source/Cryptography.package/MD2.class/instance/processBlocks..st +++ /dev/null @@ -1,16 +0,0 @@ -accessing -processBlocks: data - - | buffer t | - buffer := ByteArray new: 48 withAll: 0. - 0 to: (data size // 16) - 1 do: [:i | - 1 to: 16 do: [:j | - buffer at: (16 + j) put: (data at: (i * 16 + j)). - buffer at: (32 + j) put: ((buffer at: (16 + j)) bitXor: (buffer at: j))]. - t := 0. - 1 to: 18 do: [:j | - 1 to: 48 do: [:k | - t := (buffer at: k) bitXor: (self piTable at: t + 1). - buffer at: k put: t]. - t := (t+j-1) \\ 256]]. - ^ buffer copyFrom: 1 to: 16. diff --git a/source/Cryptography.package/MD2.class/properties.json b/source/Cryptography.package/MD2.class/properties.json deleted file mode 100644 index 79b201b..0000000 --- a/source/Cryptography.package/MD2.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "HashFunction", - "category" : "Cryptography-MD4", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "PITable" - ], - "instvars" : [ ], - "name" : "MD2", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/README.md b/source/Cryptography.package/MD4.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/MD4.class/class/encode..st b/source/Cryptography.package/MD4.class/class/encode..st deleted file mode 100644 index e26ac8d..0000000 --- a/source/Cryptography.package/MD4.class/class/encode..st +++ /dev/null @@ -1,5 +0,0 @@ -instance creation -encode: aString - ^ (self input: aString) - run; - output \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/class/input..st b/source/Cryptography.package/MD4.class/class/input..st deleted file mode 100644 index 9f5d9ab..0000000 --- a/source/Cryptography.package/MD4.class/class/input..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -input: anArray - ^ self new input: anArray \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/class/new.st b/source/Cryptography.package/MD4.class/class/new.st deleted file mode 100644 index 777662d..0000000 --- a/source/Cryptography.package/MD4.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^ super new initialize \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/class/oidString.st b/source/Cryptography.package/MD4.class/class/oidString.st deleted file mode 100644 index 8104890..0000000 --- a/source/Cryptography.package/MD4.class/class/oidString.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -oidString - - ^ '1.2.840.113549.2.5'. diff --git a/source/Cryptography.package/MD4.class/instance/copy4.to.startingAt..st b/source/Cryptography.package/MD4.class/instance/copy4.to.startingAt..st deleted file mode 100644 index 5b6fe11..0000000 --- a/source/Cryptography.package/MD4.class/instance/copy4.to.startingAt..st +++ /dev/null @@ -1,7 +0,0 @@ -copying -copy4: u to: anArray startingAt: n - anArray - at: n put: (u bitAnd: 16rFF); - at: n + 1 put: (u >> 8 bitAnd: 16rFF); - at: n + 2 put: (u >> 16 bitAnd: 16rFF); - at: n + 3 put: (u >> 24 bitAnd: 16rFF) \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/copy4ToOutput.st b/source/Cryptography.package/MD4.class/instance/copy4ToOutput.st deleted file mode 100644 index 703d6aa..0000000 --- a/source/Cryptography.package/MD4.class/instance/copy4ToOutput.st +++ /dev/null @@ -1,7 +0,0 @@ -copying -copy4ToOutput - self - copy4: a to: output startingAt: 1; - copy4: b to: output startingAt: 5; - copy4: c to: output startingAt: 9; - copy4: d to: output startingAt: 13 \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/copy64..st b/source/Cryptography.package/MD4.class/instance/copy64..st deleted file mode 100644 index 69c5729..0000000 --- a/source/Cryptography.package/MD4.class/instance/copy64..st +++ /dev/null @@ -1,3 +0,0 @@ -copying -copy64: anArray - ^ self copy64: anArray startingAt: 1 \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/copy64.startingAt..st b/source/Cryptography.package/MD4.class/instance/copy64.startingAt..st deleted file mode 100644 index 57e2482..0000000 --- a/source/Cryptography.package/MD4.class/instance/copy64.startingAt..st +++ /dev/null @@ -1,14 +0,0 @@ -copying -copy64: anArray startingAt: n - | array u answer | - array := anArray collect: [:char | char asInteger]. - answer := Array new: 16. - 1 to: answer size - do: - [:i | - u := (array at: i - 1 * 4 + 3 + n) << 24. - u := u bitOr: (array at: i - 1 * 4 + 2 + n) << 16. - u := u bitOr: (array at: i - 1 * 4 + 1 + n) << 8. - u := u bitOr: (array at: i - 1 * 4 + 0 + n) << 0. - answer at: i put: u]. - ^ answer \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/fFunction..st b/source/Cryptography.package/MD4.class/instance/fFunction..st deleted file mode 100644 index 92b6ffe..0000000 --- a/source/Cryptography.package/MD4.class/instance/fFunction..st +++ /dev/null @@ -1,5 +0,0 @@ -functions -fFunction: x - ^ ((b bitAnd: c) - bitOr: (b bitInvert bitAnd: d)) - + x \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/fRound.shift..st b/source/Cryptography.package/MD4.class/instance/fRound.shift..st deleted file mode 100644 index 03c0292..0000000 --- a/source/Cryptography.package/MD4.class/instance/fRound.shift..st +++ /dev/null @@ -1,3 +0,0 @@ -functions -fRound: x shift: s - a := self lshift: a + (self fFunction: x) bits: s \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/gFunction..st b/source/Cryptography.package/MD4.class/instance/gFunction..st deleted file mode 100644 index 4eba990..0000000 --- a/source/Cryptography.package/MD4.class/instance/gFunction..st +++ /dev/null @@ -1,6 +0,0 @@ -functions -gFunction: x - ^ ((b bitAnd: c) - bitOr: ((b bitAnd: d) - bitOr: (c bitAnd: d))) - + x + 16r5A827999 \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/gRound.shift..st b/source/Cryptography.package/MD4.class/instance/gRound.shift..st deleted file mode 100644 index 70f5b94..0000000 --- a/source/Cryptography.package/MD4.class/instance/gRound.shift..st +++ /dev/null @@ -1,3 +0,0 @@ -functions -gRound: x shift: s - a := self lshift: a + (self gFunction: x) bits: s \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/hFunction..st b/source/Cryptography.package/MD4.class/instance/hFunction..st deleted file mode 100644 index 5f15585..0000000 --- a/source/Cryptography.package/MD4.class/instance/hFunction..st +++ /dev/null @@ -1,5 +0,0 @@ -functions -hFunction: x - ^ ((b bitXor: c) - bitXor: d) - + x + 16r6ED9EBA1 \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/hRound.shift..st b/source/Cryptography.package/MD4.class/instance/hRound.shift..st deleted file mode 100644 index 09a6dd6..0000000 --- a/source/Cryptography.package/MD4.class/instance/hRound.shift..st +++ /dev/null @@ -1,3 +0,0 @@ -functions -hRound: x shift: s - a := self lshift: a + (self hFunction: x) bits: s \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/hashMessage..st b/source/Cryptography.package/MD4.class/instance/hashMessage..st deleted file mode 100644 index 9bd9a4d..0000000 --- a/source/Cryptography.package/MD4.class/instance/hashMessage..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -hashMessage: aStringOrByteArray - self input: aStringOrByteArray asByteArray. - self run. - ^ self output \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/hashStream..st b/source/Cryptography.package/MD4.class/instance/hashStream..st deleted file mode 100644 index 87608e4..0000000 --- a/source/Cryptography.package/MD4.class/instance/hashStream..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashStream: aStream - ^ self hashMessage: aStream upToEnd \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/initialize.st b/source/Cryptography.package/MD4.class/instance/initialize.st deleted file mode 100644 index 712ddec..0000000 --- a/source/Cryptography.package/MD4.class/instance/initialize.st +++ /dev/null @@ -1,7 +0,0 @@ -initialization -initialize - a := 16r67452301. - b := 16rEFCDAB89. - c := 16r98BADCFE. - d := 16r10325476. - output := ByteArray new: 16 \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/input..st b/source/Cryptography.package/MD4.class/instance/input..st deleted file mode 100644 index a666a02..0000000 --- a/source/Cryptography.package/MD4.class/instance/input..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -input: anArray - input := anArray \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/lshift.bits..st b/source/Cryptography.package/MD4.class/instance/lshift.bits..st deleted file mode 100644 index 3620cef..0000000 --- a/source/Cryptography.package/MD4.class/instance/lshift.bits..st +++ /dev/null @@ -1,10 +0,0 @@ -functions -lshift: u bits: s - " - (Md4 new lshift: 1 s: 33) printStringRadix: 2 - " - - | lo | - lo := u bitAnd: 16rFFFFFFFF. - ^ (lo << s bitAnd: 16rFFFFFFFF) - bitOr: lo >> (32 - s) \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/mdFour64..st b/source/Cryptography.package/MD4.class/instance/mdFour64..st deleted file mode 100644 index f1c0f44..0000000 --- a/source/Cryptography.package/MD4.class/instance/mdFour64..st +++ /dev/null @@ -1,26 +0,0 @@ -computing -mdFour64: array - | aa bb cc dd indexes s | - aa := a. - bb := b. - cc := c. - dd := d. - indexes := #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) readStream. - s := #(3 7 11 19 3 7 11 19 3 7 11 19 3 7 11 19) readStream. - [indexes atEnd] - whileFalse: [self fRound: (array at: indexes next) - shift: s next; turn]. - indexes := #(1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16) readStream. - s := #(3 5 9 13 3 5 9 13 3 5 9 13 3 5 9 13) readStream. - [indexes atEnd] - whileFalse: [self gRound: (array at: indexes next) - shift: s next; turn]. - indexes := #(1 9 5 13 3 11 7 15 2 10 6 14 4 12 8 16) readStream. - s := #(3 9 11 15 3 9 11 15 3 9 11 15 3 9 11 15) readStream. - [indexes atEnd] - whileFalse: [self hRound: (array at: indexes next) - shift: s next; turn]. - a := a + aa bitAnd: 16rFFFFFFFF. - b := b + bb bitAnd: 16rFFFFFFFF. - c := c + cc bitAnd: 16rFFFFFFFF. - d := d + dd bitAnd: 16rFFFFFFFF \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/output.st b/source/Cryptography.package/MD4.class/instance/output.st deleted file mode 100644 index 90f43f7..0000000 --- a/source/Cryptography.package/MD4.class/instance/output.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -output - ^ output \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/run.st b/source/Cryptography.package/MD4.class/instance/run.st deleted file mode 100644 index d03a887..0000000 --- a/source/Cryptography.package/MD4.class/instance/run.st +++ /dev/null @@ -1,22 +0,0 @@ -computing -run - | n buffer bb j offset | - buffer := ByteArray new: 128. - n := input size. - bb := n * 8. - j := 0. - [n > 64] - whileTrue: - [self mdFour64: (self copy64: input startingAt: j + 1). - j := j + 64. - n := n - 64]. - buffer atAllPut: 0. - 1 to: n do: [:i | buffer at: i put: (input at: j + i)]. - buffer at: n + 1 put: 16r80. - offset := n <= 55 ifTrue: [56] ifFalse: [120]. - self copy4: bb to: buffer startingAt: offset + 1. - self mdFour64: (self copy64: buffer). - n > 55 ifTrue: [self mdFour64: (self copy64: buffer startingAt: 64)]. - buffer atAllPut: 0. - self copy4ToOutput. - a := b := c := d := 0 \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/instance/turn.st b/source/Cryptography.package/MD4.class/instance/turn.st deleted file mode 100644 index eb38746..0000000 --- a/source/Cryptography.package/MD4.class/instance/turn.st +++ /dev/null @@ -1,8 +0,0 @@ -functions -turn - | temp | - temp := d. - d := c. - c := b. - b := a. - a := temp \ No newline at end of file diff --git a/source/Cryptography.package/MD4.class/properties.json b/source/Cryptography.package/MD4.class/properties.json deleted file mode 100644 index 1f1818e..0000000 --- a/source/Cryptography.package/MD4.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "commentStamp" : "", - "super" : "HashFunction", - "category" : "Cryptography-MD4", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "a", - "b", - "c", - "d", - "input", - "output" - ], - "name" : "MD4", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/MD5.extension/instance/finalHash.st b/source/Cryptography.package/MD5.extension/instance/finalHash.st deleted file mode 100644 index 446cbac..0000000 --- a/source/Cryptography.package/MD5.extension/instance/finalHash.st +++ /dev/null @@ -1,4 +0,0 @@ -*Cryptography -finalHash - - self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/MD5.extension/instance/initializeState.st b/source/Cryptography.package/MD5.extension/instance/initializeState.st deleted file mode 100644 index 838af05..0000000 --- a/source/Cryptography.package/MD5.extension/instance/initializeState.st +++ /dev/null @@ -1,4 +0,0 @@ -*Cryptography -initializeState - - self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/MD5.extension/properties.json b/source/Cryptography.package/MD5.extension/properties.json deleted file mode 100644 index 1c71740..0000000 --- a/source/Cryptography.package/MD5.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "MD5" -} \ No newline at end of file diff --git a/source/Cryptography.package/MD5NonPrimitive.extension/instance/finalHash.st b/source/Cryptography.package/MD5NonPrimitive.extension/instance/finalHash.st deleted file mode 100644 index 709f1bf..0000000 --- a/source/Cryptography.package/MD5NonPrimitive.extension/instance/finalHash.st +++ /dev/null @@ -1,5 +0,0 @@ -*Cryptography -finalHash - "Concatenate the state values to produce the 128-bite result" - - ^ (state at: 1) asByteArray, (state at: 2) asByteArray, (state at: 3) asByteArray, (state at: 4) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/MD5NonPrimitive.extension/instance/initializeState.st b/source/Cryptography.package/MD5NonPrimitive.extension/instance/initializeState.st deleted file mode 100644 index 132a11b..0000000 --- a/source/Cryptography.package/MD5NonPrimitive.extension/instance/initializeState.st +++ /dev/null @@ -1,10 +0,0 @@ -*Cryptography -initializeState - "Some magic numbers to get the process started" - - state := OrderedCollection newFrom: { - (ThirtyTwoBitRegister new load: 16r67452301). - (ThirtyTwoBitRegister new load: 16rEFCDAB89). - (ThirtyTwoBitRegister new load: 16r98BADCFE). - (ThirtyTwoBitRegister new load: 16r10325476)}. - diff --git a/source/Cryptography.package/MD5NonPrimitive.extension/properties.json b/source/Cryptography.package/MD5NonPrimitive.extension/properties.json deleted file mode 100644 index 69e8073..0000000 --- a/source/Cryptography.package/MD5NonPrimitive.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "MD5NonPrimitive" -} \ No newline at end of file diff --git a/source/Cryptography.package/MD5WithPrimitive.class/README.md b/source/Cryptography.package/MD5WithPrimitive.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/MD5WithPrimitive.class/instance/finalHash.st b/source/Cryptography.package/MD5WithPrimitive.class/instance/finalHash.st deleted file mode 100644 index 2b60903..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/instance/finalHash.st +++ /dev/null @@ -1,5 +0,0 @@ -private-buffers -finalHash - - self primDecodeState: state. - ^state \ No newline at end of file diff --git a/source/Cryptography.package/MD5WithPrimitive.class/instance/initializeState.st b/source/Cryptography.package/MD5WithPrimitive.class/instance/initializeState.st deleted file mode 100644 index 71c1d0d..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/instance/initializeState.st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -initializeState - - state := ByteArray new: 16. - self primInitializeState: state diff --git a/source/Cryptography.package/MD5WithPrimitive.class/instance/primDecodeState..st b/source/Cryptography.package/MD5WithPrimitive.class/instance/primDecodeState..st deleted file mode 100644 index 6099369..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/instance/primDecodeState..st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -primDecodeState: s - - - self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/MD5WithPrimitive.class/instance/primInitializeState..st b/source/Cryptography.package/MD5WithPrimitive.class/instance/primInitializeState..st deleted file mode 100644 index 690f261..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/instance/primInitializeState..st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -primInitializeState: s - - - self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/MD5WithPrimitive.class/instance/primProcessBuffer.withState..st b/source/Cryptography.package/MD5WithPrimitive.class/instance/primProcessBuffer.withState..st deleted file mode 100644 index 772300d..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/instance/primProcessBuffer.withState..st +++ /dev/null @@ -1,5 +0,0 @@ -private-buffers -primProcessBuffer: aByteArray withState: s - - - self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/MD5WithPrimitive.class/instance/processBuffer..st b/source/Cryptography.package/MD5WithPrimitive.class/instance/processBuffer..st deleted file mode 100644 index 0381a4e..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/instance/processBuffer..st +++ /dev/null @@ -1,5 +0,0 @@ -private-buffers -processBuffer: aByteArray - - self primProcessBuffer: aByteArray withState: state. - \ No newline at end of file diff --git a/source/Cryptography.package/MD5WithPrimitive.class/properties.json b/source/Cryptography.package/MD5WithPrimitive.class/properties.json deleted file mode 100644 index c848984..0000000 --- a/source/Cryptography.package/MD5WithPrimitive.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "MD5", - "category" : "Cryptography-MD5", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "MD5WithPrimitive", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/README.md b/source/Cryptography.package/MillerRabin.class/README.md deleted file mode 100644 index 5330c7d..0000000 --- a/source/Cryptography.package/MillerRabin.class/README.md +++ /dev/null @@ -1 +0,0 @@ -My instances are Miller-Rabin algorithms. Miller-Rabin is a probabilistic algorithm for primality testing. \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/class/isProbablyPrime..st b/source/Cryptography.package/MillerRabin.class/class/isProbablyPrime..st deleted file mode 100644 index f9115f4..0000000 --- a/source/Cryptography.package/MillerRabin.class/class/isProbablyPrime..st +++ /dev/null @@ -1,11 +0,0 @@ -primality testing -isProbablyPrime: p - | probabilistic | - probabilistic := self new. - probabilistic target: p. - [probabilistic satisfied - and: - ["error > (1 / 1024)" - probabilistic iterations < 5]] - whileTrue: [probabilistic iterate]. - ^ probabilistic satisfied \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/instance/error.st b/source/Cryptography.package/MillerRabin.class/instance/error.st deleted file mode 100644 index 4e3b051..0000000 --- a/source/Cryptography.package/MillerRabin.class/instance/error.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -error - ^ 1 / (4 raisedTo: iterations) \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/instance/iterate.st b/source/Cryptography.package/MillerRabin.class/instance/iterate.st deleted file mode 100644 index fbc3a75..0000000 --- a/source/Cryptography.package/MillerRabin.class/instance/iterate.st +++ /dev/null @@ -1,14 +0,0 @@ -computing -iterate - | b t x | - iterations := iterations + 1. - b := SecureRandom picker nextInt: samples. - (target gcd: b) = 1 ifFalse: [^ satisfied := false]. - t := 0. - x := b raisedTo: n0 modulo: target. - (x = 1 or: [x = minusOne]) ifFalse: [ - [x := x squared \\ target. - t := t + 1. - satisfied := x = minusOne. - satisfied not and: [t < k]] whileTrue. - satisfied ifFalse: [^ satisfied]] diff --git a/source/Cryptography.package/MillerRabin.class/instance/iterations.st b/source/Cryptography.package/MillerRabin.class/instance/iterations.st deleted file mode 100644 index 72a01d3..0000000 --- a/source/Cryptography.package/MillerRabin.class/instance/iterations.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -iterations - ^ iterations \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/instance/reset.st b/source/Cryptography.package/MillerRabin.class/instance/reset.st deleted file mode 100644 index 133fbe9..0000000 --- a/source/Cryptography.package/MillerRabin.class/instance/reset.st +++ /dev/null @@ -1,8 +0,0 @@ -computing -reset - iterations := 0. - satisfied := true. - minusOne := target - 1. - samples := minusOne. - k := minusOne lowBit - 1. - n0 := minusOne bitShift: k negated \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/instance/satisfied.st b/source/Cryptography.package/MillerRabin.class/instance/satisfied.st deleted file mode 100644 index fbe3548..0000000 --- a/source/Cryptography.package/MillerRabin.class/instance/satisfied.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -satisfied - ^ satisfied \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/instance/target..st b/source/Cryptography.package/MillerRabin.class/instance/target..st deleted file mode 100644 index f9aacf8..0000000 --- a/source/Cryptography.package/MillerRabin.class/instance/target..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -target: anInteger - target := anInteger. - self reset \ No newline at end of file diff --git a/source/Cryptography.package/MillerRabin.class/properties.json b/source/Cryptography.package/MillerRabin.class/properties.json deleted file mode 100644 index da66813..0000000 --- a/source/Cryptography.package/MillerRabin.class/properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "target", - "iterations", - "satisfied", - "samples", - "minusOne", - "k", - "n0" - ], - "name" : "MillerRabin", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/OFB.class/README.md b/source/Cryptography.package/OFB.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/OFB.class/instance/advanceVector.st b/source/Cryptography.package/OFB.class/instance/advanceVector.st deleted file mode 100644 index 96fa1fa..0000000 --- a/source/Cryptography.package/OFB.class/instance/advanceVector.st +++ /dev/null @@ -1,3 +0,0 @@ -private -advanceVector - cipher encryptBlock: vector \ No newline at end of file diff --git a/source/Cryptography.package/OFB.class/instance/decryptBlock..st b/source/Cryptography.package/OFB.class/instance/decryptBlock..st deleted file mode 100644 index c4e63fc..0000000 --- a/source/Cryptography.package/OFB.class/instance/decryptBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -decryptBlock: aByteArray - "One of the nice attributes of OFB is there is no difference between the encrypt and decrypt implementations." - ^ self encryptBlock: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/OFB.class/instance/encryptBlock..st b/source/Cryptography.package/OFB.class/instance/encryptBlock..st deleted file mode 100644 index f89ac5f..0000000 --- a/source/Cryptography.package/OFB.class/instance/encryptBlock..st +++ /dev/null @@ -1,8 +0,0 @@ -accessing -encryptBlock: aByteArray - self advanceVector. - aByteArray withIndexDo: - [ : eachByte : x | - aByteArray - at: x - put: ((aByteArray at: x) bitXor: (vector at: x)) ] \ No newline at end of file diff --git a/source/Cryptography.package/OFB.class/instance/isStreamCipher.st b/source/Cryptography.package/OFB.class/instance/isStreamCipher.st deleted file mode 100644 index 4111f99..0000000 --- a/source/Cryptography.package/OFB.class/instance/isStreamCipher.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isStreamCipher - ^ true \ No newline at end of file diff --git a/source/Cryptography.package/OFB.class/properties.json b/source/Cryptography.package/OFB.class/properties.json deleted file mode 100644 index d20e711..0000000 --- a/source/Cryptography.package/OFB.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipherMode", - "category" : "Cryptography-Core", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "OFB", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/README.md b/source/Cryptography.package/PasswordSaltAndStretch.class/README.md deleted file mode 100644 index 3515c67..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/README.md +++ /dev/null @@ -1,18 +0,0 @@ -A PasswordSaltAndStretch is way to increase the entropy of bad passwords. The idea is to increase the amount of work needed for an attacker to try random passwords. The class returns two values a hash and a salt value. The salt value is random data used to calculate the hash. If the hash is used as a key then store the salt value along with the encrypted data. Then to calculate the key or verify a password use hashForPassword: aPassword s: theSalt. - -So - -| result | -(result := PasswordSaltAndStretch hashForPassword: 'password') = (PasswordSaltAndStretch hashForPassword: 'password' s: result value) - -should be true. - -Instance Variables - r: - s: - -r - - the number of rounds used to stretch the password - -s - - salt which is random data used to make the hash unique. The salt should be stored with encrypted data, or with the hash because it is needed to verify the hash later. diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/class/LICENSE.st b/source/Cryptography.package/PasswordSaltAndStretch.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/class/defaultR.st b/source/Cryptography.package/PasswordSaltAndStretch.class/class/defaultR.st deleted file mode 100644 index 1d7b204..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/class/defaultR.st +++ /dev/null @@ -1,4 +0,0 @@ -constants -defaultR - "this value is way too low when there is a primitive SHA256 this should be increased" - ^250 \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword..st b/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword..st deleted file mode 100644 index 2030eba..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword..st +++ /dev/null @@ -1,5 +0,0 @@ -instance creation -hashForPassword: aPassword - "the default for r is way to small. Once we have a primitive SHA256 this should be increased so that this method takes at least 1 second" - ^self hashForPassword: aPassword r: self defaultR - \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.r..st b/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.r..st deleted file mode 100644 index 341f94a..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.r..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -hashForPassword: aPassword r: aStretchInteger - ^self hashForPassword: aPassword r: aStretchInteger s: (SecureRandom picker nextBytesNonZero: 32) \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.r.s..st b/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.r.s..st deleted file mode 100644 index bb4124a..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.r.s..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -hashForPassword: aPassword r: aStretchInteger s: salt - ^self new - r: aStretchInteger; - s: salt; - saltAndStretch: aPassword \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.s..st b/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.s..st deleted file mode 100644 index 5644041..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/class/hashForPassword.s..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -hashForPassword: aPassword s: salt - ^self new - r: self defaultR; - s: salt; - saltAndStretch: aPassword \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/r..st b/source/Cryptography.package/PasswordSaltAndStretch.class/instance/r..st deleted file mode 100644 index 5c5b846..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/r..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -r: anObject - "Set the value of r" - - r := anObject \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/r.st b/source/Cryptography.package/PasswordSaltAndStretch.class/instance/r.st deleted file mode 100644 index 2b4d75e..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/r.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -r - "Answer the value of r" - - ^ r \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/s..st b/source/Cryptography.package/PasswordSaltAndStretch.class/instance/s..st deleted file mode 100644 index c0e8ee2..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/s..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -s: anObject - "Set the value of s" - - s := anObject \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/s.st b/source/Cryptography.package/PasswordSaltAndStretch.class/instance/s.st deleted file mode 100644 index 457d50f..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/s.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -s - "Answer the value of s" - - ^ s \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/saltAndStretch..st b/source/Cryptography.package/PasswordSaltAndStretch.class/instance/saltAndStretch..st deleted file mode 100644 index 667b59c..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/instance/saltAndStretch..st +++ /dev/null @@ -1,8 +0,0 @@ -services -saltAndStretch: aPassword - | result | - result := ByteArray new. - 1 to: r do: [:i | - result := SHA256 new hashMessage: (result, aPassword asByteArray, self s) - ]. - ^result -> self s \ No newline at end of file diff --git a/source/Cryptography.package/PasswordSaltAndStretch.class/properties.json b/source/Cryptography.package/PasswordSaltAndStretch.class/properties.json deleted file mode 100644 index 56e962d..0000000 --- a/source/Cryptography.package/PasswordSaltAndStretch.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "RJT 2/9/2007 16:00", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "r", - "s" - ], - "name" : "PasswordSaltAndStretch", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/PositionableStream.extension/instance/nextUtfString.st b/source/Cryptography.package/PositionableStream.extension/instance/nextUtfString.st deleted file mode 100644 index f11b1fa..0000000 --- a/source/Cryptography.package/PositionableStream.extension/instance/nextUtfString.st +++ /dev/null @@ -1,4 +0,0 @@ -*cryptography-core -nextUtfString - - ^ (self next: self uint16) asString. diff --git a/source/Cryptography.package/PositionableStream.extension/instance/nextUtfStringPut..st b/source/Cryptography.package/PositionableStream.extension/instance/nextUtfStringPut..st deleted file mode 100644 index 15a356d..0000000 --- a/source/Cryptography.package/PositionableStream.extension/instance/nextUtfStringPut..st +++ /dev/null @@ -1,5 +0,0 @@ -*cryptography-core -nextUtfStringPut: s - - self uint16: s size. - self nextPutAll: s asByteArray. diff --git a/source/Cryptography.package/PositionableStream.extension/properties.json b/source/Cryptography.package/PositionableStream.extension/properties.json deleted file mode 100644 index 8e090ee..0000000 --- a/source/Cryptography.package/PositionableStream.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "PositionableStream" -} \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/README.md b/source/Cryptography.package/PrimesFinder.class/README.md deleted file mode 100644 index 4a3f01f..0000000 --- a/source/Cryptography.package/PrimesFinder.class/README.md +++ /dev/null @@ -1 +0,0 @@ -My instances search for primes of a given size. They implement a probabilistic method. For speed, they first test for divisibility by the primest up to 2000 (in a deterministic way). Next, they employ a probabilistic test (such as MillerRabin). \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/class/bits..st b/source/Cryptography.package/PrimesFinder.class/class/bits..st deleted file mode 100644 index 4dc5ae1..0000000 --- a/source/Cryptography.package/PrimesFinder.class/class/bits..st +++ /dev/null @@ -1,8 +0,0 @@ -instance creation -bits: numberOfBits - | shift b | - shift := numberOfBits - 1. - b := (SecureRandom picker nextBits: shift)+1. - b := b bitOr: 1. "ensure it is odd" - b := b bitOr: (1 << shift). "ensure it is of the requiered length" - ^ self candidate: b \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/class/candidate..st b/source/Cryptography.package/PrimesFinder.class/class/candidate..st deleted file mode 100644 index 0c48313..0000000 --- a/source/Cryptography.package/PrimesFinder.class/class/candidate..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -candidate: n - ^ self new setCandidate: n \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/class/primeOfSize..st b/source/Cryptography.package/PrimesFinder.class/class/primeOfSize..st deleted file mode 100644 index f6769a7..0000000 --- a/source/Cryptography.package/PrimesFinder.class/class/primeOfSize..st +++ /dev/null @@ -1,3 +0,0 @@ -primes generation -primeOfSize: numberOfBits - ^ (self bits: numberOfBits) nextPrime \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/class/safePrimeOfSize..st b/source/Cryptography.package/PrimesFinder.class/class/safePrimeOfSize..st deleted file mode 100644 index b7ab17d..0000000 --- a/source/Cryptography.package/PrimesFinder.class/class/safePrimeOfSize..st +++ /dev/null @@ -1,3 +0,0 @@ -primes generation -safePrimeOfSize: numberOfBits - ^ (self bits: numberOfBits) nextSafePrime \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/instance/^plus.equals.st b/source/Cryptography.package/PrimesFinder.class/instance/^plus.equals.st deleted file mode 100644 index f614bb3..0000000 --- a/source/Cryptography.package/PrimesFinder.class/instance/^plus.equals.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -+= anInteger - candidate := candidate + anInteger. - wheel += anInteger \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/instance/nextPrime.st b/source/Cryptography.package/PrimesFinder.class/instance/nextPrime.st deleted file mode 100644 index 04d835b..0000000 --- a/source/Cryptography.package/PrimesFinder.class/instance/nextPrime.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -nextPrime - [self += 2. self satisfied] whileFalse. - ^ candidate \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/instance/nextSafePrime.st b/source/Cryptography.package/PrimesFinder.class/instance/nextSafePrime.st deleted file mode 100644 index 9df0f07..0000000 --- a/source/Cryptography.package/PrimesFinder.class/instance/nextSafePrime.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -nextSafePrime - [self += 2. self satisfiedSafe] whileFalse. - ^ 2*candidate + 1 \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/instance/satisfied.st b/source/Cryptography.package/PrimesFinder.class/instance/satisfied.st deleted file mode 100644 index b4bbafe..0000000 --- a/source/Cryptography.package/PrimesFinder.class/instance/satisfied.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -satisfied - wheel satisfied ifFalse: [^ false]. - ^ MillerRabin isProbablyPrime: candidate \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/instance/satisfiedSafe.st b/source/Cryptography.package/PrimesFinder.class/instance/satisfiedSafe.st deleted file mode 100644 index 99eecf8..0000000 --- a/source/Cryptography.package/PrimesFinder.class/instance/satisfiedSafe.st +++ /dev/null @@ -1,5 +0,0 @@ -testing -satisfiedSafe - wheel satisfiedSafe ifFalse: [^ false]. - ^ (MillerRabin isProbablyPrime: candidate) - and: [MillerRabin isProbablyPrime: 2*candidate+1] \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/instance/setCandidate..st b/source/Cryptography.package/PrimesFinder.class/instance/setCandidate..st deleted file mode 100644 index 610098e..0000000 --- a/source/Cryptography.package/PrimesFinder.class/instance/setCandidate..st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -setCandidate: n - n < 4 ifTrue: [self error: 'the candidate is too small']. - candidate := n even ifTrue: [n + 1] ifFalse: [n]. - wheel := (PrimesWheel upTo: 2000) += candidate \ No newline at end of file diff --git a/source/Cryptography.package/PrimesFinder.class/properties.json b/source/Cryptography.package/PrimesFinder.class/properties.json deleted file mode 100644 index 474b134..0000000 --- a/source/Cryptography.package/PrimesFinder.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "wheel", - "candidate" - ], - "name" : "PrimesFinder", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/README.md b/source/Cryptography.package/PrimesWheel.class/README.md deleted file mode 100644 index f575b6b..0000000 --- a/source/Cryptography.package/PrimesWheel.class/README.md +++ /dev/null @@ -1 +0,0 @@ -My instances are wheels of primes. See the class comment in PrimesFinder. \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/class/primes2000.st b/source/Cryptography.package/PrimesWheel.class/class/primes2000.st deleted file mode 100644 index f304b29..0000000 --- a/source/Cryptography.package/PrimesWheel.class/class/primes2000.st +++ /dev/null @@ -1,3 +0,0 @@ -precomputed -primes2000 - ^ #(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999) \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/class/upTo..st b/source/Cryptography.package/PrimesWheel.class/class/upTo..st deleted file mode 100644 index 0c8b20c..0000000 --- a/source/Cryptography.package/PrimesWheel.class/class/upTo..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -upTo: n - ^ self new initialize: n diff --git a/source/Cryptography.package/PrimesWheel.class/instance/^minus.equals.st b/source/Cryptography.package/PrimesWheel.class/instance/^minus.equals.st deleted file mode 100644 index db53bda..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/^minus.equals.st +++ /dev/null @@ -1,3 +0,0 @@ -arithmetic --= anInteger - self += anInteger negated \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/instance/^plus.equals.st b/source/Cryptography.package/PrimesWheel.class/instance/^plus.equals.st deleted file mode 100644 index 5ae5bc3..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/^plus.equals.st +++ /dev/null @@ -1,9 +0,0 @@ -arithmetic -+= anInteger - | s r | - s := true. - 1 to: primes size do: [:i | - r := (residues at: i) + anInteger \\ (primes at: i). - residues at: i put: r. - r isZero ifTrue: [s := false]]. - satisfied := s \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/instance/^star.equals.st b/source/Cryptography.package/PrimesWheel.class/instance/^star.equals.st deleted file mode 100644 index 12b1f2f..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/^star.equals.st +++ /dev/null @@ -1,9 +0,0 @@ -arithmetic -*= anInteger - | s r | - s := true. - 1 to: primes size do: [:i | - r := (residues at: i) * anInteger \\ (primes at: i). - residues at: i put: r. - r isZero ifTrue: [s := false]]. - satisfied := s \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/instance/initialize..st b/source/Cryptography.package/PrimesWheel.class/instance/initialize..st deleted file mode 100644 index 0cc3ca8..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/initialize..st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -initialize: n - self initializePrimes: n. - residues := (Array new: primes size) atAllPut: 0. - satisfied := false \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/instance/initializePrimes..st b/source/Cryptography.package/PrimesWheel.class/instance/initializePrimes..st deleted file mode 100644 index 3a5d154..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/initializePrimes..st +++ /dev/null @@ -1,20 +0,0 @@ -initialization -initializePrimes: n - | primes2000 last p | - primes2000 := self class primes2000. - n = 2000 - ifTrue: - [primes := primes2000. - ^ self]. - n < 2000 - ifTrue: - [last := primes2000 findLast: [:prime | prime <= n]. - primes := primes2000 copyFrom: 1 to: last. - ^ self]. - primes := (OrderedCollection new: n // 2) addAll: primes2000; yourself. - p := primes2000 last + 2. - [p <= n] - whileTrue: - [primes detect: [:one | p \\ one = 0] ifNone: [primes add: p]. - p := p + 2]. - primes := primes asArray diff --git a/source/Cryptography.package/PrimesWheel.class/instance/satisfied.st b/source/Cryptography.package/PrimesWheel.class/instance/satisfied.st deleted file mode 100644 index 413ca30..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/satisfied.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -satisfied - "residues noneSatisfy: [:r | r isZero]" - ^ satisfied diff --git a/source/Cryptography.package/PrimesWheel.class/instance/satisfiedSafe.st b/source/Cryptography.package/PrimesWheel.class/instance/satisfiedSafe.st deleted file mode 100644 index ed8be6d..0000000 --- a/source/Cryptography.package/PrimesWheel.class/instance/satisfiedSafe.st +++ /dev/null @@ -1,7 +0,0 @@ -testing -satisfiedSafe - "Answer true if the condition for a safe prime is satisfied." - satisfied ifFalse: [^ false]. - 1 to: primes size do: [:i | - ((residues at: i) * 2 + 1 \\ (primes at: i)) isZero ifTrue: [^ false]]. - ^ true \ No newline at end of file diff --git a/source/Cryptography.package/PrimesWheel.class/properties.json b/source/Cryptography.package/PrimesWheel.class/properties.json deleted file mode 100644 index 05712f2..0000000 --- a/source/Cryptography.package/PrimesWheel.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "primes", - "residues", - "satisfied" - ], - "name" : "PrimesWheel", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/README.md b/source/Cryptography.package/RSAEncryptionScheme.class/README.md deleted file mode 100644 index 64ca1b5..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Example: - -| rsa pub priv rsaes c | -rsa := RSAKeyPairGenerator new. -rsa bits: 1024. -pub := rsa publicKey. -priv := rsa privateKey. - -rsaes := RSAEncryptionScheme new. -rsaes setPublicKey: pub privateKey: priv parameter: 'p'. - -c := rsaes encrypt: 'hola'. -(rsaes decrypt: c) asString. - diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/class/new.st b/source/Cryptography.package/RSAEncryptionScheme.class/class/new.st deleted file mode 100644 index 777662d..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^ super new initialize \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/class/publicKey.privateKey.parameter..st b/source/Cryptography.package/RSAEncryptionScheme.class/class/publicKey.privateKey.parameter..st deleted file mode 100644 index 8161c59..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/class/publicKey.privateKey.parameter..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -publicKey: aRSAPublicKey privateKey: aRSAPrivateKey parameter: aString - ^ self new setPublicKey: aRSAPublicKey privateKey: aRSAPrivateKey parameter: aString \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/decode.parameter..st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/decode.parameter..st deleted file mode 100644 index b07645a..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/decode.parameter..st +++ /dev/null @@ -1,32 +0,0 @@ -OAEP encoder -decode: em parameter: parameter - | emLen maskedSeed maskedDB seedMask seed dbMask dataBlock dbLen pHash pHashPrima i terminado b | - parameter size > (2 raisedTo: 60) ifTrue: [self error: 'decoding error']. - emLen := em size. - emLen < (2 * hashLen + 1) ifTrue: [self error: 'decoding error']. - - maskedSeed := em copyFrom: 1 to: hashLen. - maskedDB := em copyFrom: (hashLen + 1) to: emLen. - seedMask := self maskOfLength: hashLen fromString: maskedDB. - seed := maskedSeed bitXor: seedMask. - dbMask := self maskOfLength: (emLen - hashLen) fromString: seed. - dataBlock := maskedDB bitXor: dbMask. - dbLen := dataBlock size. - - pHash := (hash hashMessage: parameter) asByteArrayOfSize: hashLen. - pHashPrima := dataBlock copyFrom: 1 to: hashLen. - i := hashLen + 1. - terminado := false. - [terminado] whileFalse: - [b := dataBlock at: i. - b=0 ifTrue: - [i := i+1. - i > dbLen ifTrue: [self error: 'decoding error']] - ifFalse: - [b=1 - ifTrue: [terminado := true] - ifFalse: [self error: 'decoding error'] - ] - ]. - pHash = pHashPrima ifFalse: [self error: 'decoding error']. - ^ dataBlock copyFrom: i+1 to: dbLen \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/decrypt..st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/decrypt..st deleted file mode 100644 index 3959ceb..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/decrypt..st +++ /dev/null @@ -1,8 +0,0 @@ -encryption scheme -decrypt: aByteArray - | m | - m := privateKey crypt: aByteArray asInteger. - ^ self decode: m asByteArray parameter: encodingParameter. - - - \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/encode.parameter.length..st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/encode.parameter.length..st deleted file mode 100644 index 801e23a..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/encode.parameter.length..st +++ /dev/null @@ -1,23 +0,0 @@ -OAEP encoder -encode: message parameter: parameter length: emLen - | messageLen paddingString pHash dataBlock seed dbMask maskedDB seedMask maskedSeed em | - - parameter size > (2 raisedTo: 60) ifTrue: - [self error: 'parameter string too long']. - messageLen := message size. - messageLen > (emLen - (2 * hashLen) - 1) ifTrue: - [self error: 'message too long']. - - paddingString := 0 asByteArrayOfSize: (emLen - messageLen - (2*hashLen) - 1). - pHash := (hash hashMessage: parameter) asByteArrayOfSize: hashLen. - dataBlock := pHash, paddingString, (ByteArray with: 1), message. - - seed := ByteArray new: hashLen. - 1 to: hashLen do: - [:i | seed at: i put: (rand next * 256) floor]. - dbMask := self maskOfLength: (emLen - hashLen) fromString: seed. - maskedDB := dataBlock bitXor: dbMask. - seedMask := self maskOfLength: hashLen fromString: maskedDB. - maskedSeed := seed bitXor: seedMask. - em := maskedSeed, maskedDB. - ^ em \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/encrypt..st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/encrypt..st deleted file mode 100644 index 257f118..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/encrypt..st +++ /dev/null @@ -1,7 +0,0 @@ -encryption scheme -encrypt: aByteArray - | k em c | - k := publicKey bits // 8. - em := self encode: aByteArray parameter: encodingParameter length: k-1. - c := publicKey crypt: em asInteger. - ^ c asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/initialize.st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/initialize.st deleted file mode 100644 index ba6cd20..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -initialize - rand := Random new. - hash := SHA1 new. - hashLen := 20 \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/maskOfLength.fromString..st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/maskOfLength.fromString..st deleted file mode 100644 index 35a72be..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/maskOfLength.fromString..st +++ /dev/null @@ -1,10 +0,0 @@ -mask generator -maskOfLength: numberOfBytes fromString: seedString - | t c | - numberOfBytes > ((2 raisedTo: 32) * hashLen) ifTrue: - [self error: 'mask too long']. - t := ByteArray new. - 0 to: (numberOfBytes / hashLen) floor do: [:counter | - c := counter asByteArrayOfSize: 4. - t := t, ((hash hashMessage: seedString, c) asByteArrayOfSize: hashLen)]. - ^ t copyFrom: 1 to: numberOfBytes diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/instance/setPublicKey.privateKey.parameter..st b/source/Cryptography.package/RSAEncryptionScheme.class/instance/setPublicKey.privateKey.parameter..st deleted file mode 100644 index 61485a6..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/instance/setPublicKey.privateKey.parameter..st +++ /dev/null @@ -1,5 +0,0 @@ -initialization -setPublicKey: aRSAPublicKey privateKey: aRSAPrivateKey parameter: aString - publicKey := aRSAPublicKey. - privateKey := aRSAPrivateKey. - encodingParameter := aString \ No newline at end of file diff --git a/source/Cryptography.package/RSAEncryptionScheme.class/properties.json b/source/Cryptography.package/RSAEncryptionScheme.class/properties.json deleted file mode 100644 index 94a228d..0000000 --- a/source/Cryptography.package/RSAEncryptionScheme.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "commentStamp" : "rww 4/11/2004 14:55", - "super" : "Object", - "category" : "Cryptography-RSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "hash", - "hashLen", - "rand", - "publicKey", - "privateKey", - "encodingParameter" - ], - "name" : "RSAEncryptionScheme", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/README.md b/source/Cryptography.package/RSAKeyPairGenerator.class/README.md deleted file mode 100644 index 1c23cfb..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/README.md +++ /dev/null @@ -1 +0,0 @@ -My instances generate public/private RSA pairs. \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/class/bits..st b/source/Cryptography.package/RSAKeyPairGenerator.class/class/bits..st deleted file mode 100644 index a17b3e8..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/class/bits..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -bits: anInteger - ^ self new bits: anInteger \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/bits..st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/bits..st deleted file mode 100644 index 3b12297..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/bits..st +++ /dev/null @@ -1,3 +0,0 @@ -initialization -bits: anInteger - bits := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/computePrimes.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/computePrimes.st deleted file mode 100644 index 9459620..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/computePrimes.st +++ /dev/null @@ -1,4 +0,0 @@ -private -computePrimes - [p := self findPrime. p - 1 \\ self e = 0] whileTrue. - [q := self findPrime. p - 1 * (q - 1) \\ self e = 0] whileTrue \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/d.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/d.st deleted file mode 100644 index c80930f..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/d.st +++ /dev/null @@ -1,4 +0,0 @@ -private -d - d isNil ifFalse: [^ d]. - ^ d := self e inverseModulo: self p - 1 * (self q - 1) \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/dp.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/dp.st deleted file mode 100644 index eea8f8f..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/dp.st +++ /dev/null @@ -1,4 +0,0 @@ -private -dp - - ^dP ifNil: [ dP := self d \\ ( self p - 1 ) ] \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/dq.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/dq.st deleted file mode 100644 index 07d2084..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/dq.st +++ /dev/null @@ -1,4 +0,0 @@ -private -dq - - ^dQ ifNil: [ dQ := self d \\ (self q - 1) ] \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/e.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/e.st deleted file mode 100644 index 4e029a5..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/e.st +++ /dev/null @@ -1,3 +0,0 @@ -private -e - ^ 65537 \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/findPrime.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/findPrime.st deleted file mode 100644 index 6b73bdf..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/findPrime.st +++ /dev/null @@ -1,3 +0,0 @@ -private -findPrime - ^ PrimesFinder primeOfSize: bits // 2 \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/p..st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/p..st deleted file mode 100644 index e7b6370..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/p..st +++ /dev/null @@ -1,3 +0,0 @@ -private -p: anInteger - p := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/p.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/p.st deleted file mode 100644 index 9207fe2..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/p.st +++ /dev/null @@ -1,4 +0,0 @@ -private -p - p isNil ifTrue: [self computePrimes]. - ^ p \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/privateKey.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/privateKey.st deleted file mode 100644 index c22eba2..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/privateKey.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -privateKey - ^ RSAPrivateKey p: self p q: self q dP: self dp dQ: self dq qInv: self qInv \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/publicKey.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/publicKey.st deleted file mode 100644 index 9c96e7e..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/publicKey.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -publicKey - ^ RSAPublicKey exponent: self e modulo: self p * self q \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/q..st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/q..st deleted file mode 100644 index f073084..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/q..st +++ /dev/null @@ -1,3 +0,0 @@ -private -q: anInteger - q := anInteger \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/q.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/q.st deleted file mode 100644 index b8b0107..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/q.st +++ /dev/null @@ -1,4 +0,0 @@ -private -q - q isNil ifTrue: [self computePrimes]. - ^ q \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/qInv.st b/source/Cryptography.package/RSAKeyPairGenerator.class/instance/qInv.st deleted file mode 100644 index 2c6dfba..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/instance/qInv.st +++ /dev/null @@ -1,7 +0,0 @@ -private -qInv - - ^qInv ifNil: [ "qInv = 1 / q mod p" - qInv := (EuclidAlgorithm with: q with: p) doBasicAlgorithm; firstCoefficient. - qInv < 0 ifTrue: [ qInv := qInv \\ p ]. - qInv ] \ No newline at end of file diff --git a/source/Cryptography.package/RSAKeyPairGenerator.class/properties.json b/source/Cryptography.package/RSAKeyPairGenerator.class/properties.json deleted file mode 100644 index 657ca4c..0000000 --- a/source/Cryptography.package/RSAKeyPairGenerator.class/properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "bits", - "p", - "q", - "d", - "dP", - "dQ", - "qInv" - ], - "name" : "RSAKeyPairGenerator", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/README.md b/source/Cryptography.package/RSAPrivateKey.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/RSAPrivateKey.class/class/p.q.dP.dQ.qInv..st b/source/Cryptography.package/RSAPrivateKey.class/class/p.q.dP.dQ.qInv..st deleted file mode 100644 index 9566096..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/class/p.q.dP.dQ.qInv..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -p: int1 q: int2 dP: int3 dQ: int4 qInv: int5 - - ^ self new - p: int1 q: int2 dP: int3 dQ: int4 qInv: int5; - yourself \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/crypt..st b/source/Cryptography.package/RSAPrivateKey.class/instance/crypt..st deleted file mode 100644 index baff178..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/crypt..st +++ /dev/null @@ -1,9 +0,0 @@ -process -crypt: anInteger - - | m1 m2 h | - m1 := anInteger raisedTo: self dP modulo: self p. - m2 := anInteger raisedTo: self dQ modulo: self q. - h := (m1 - m2) * self qInv \\ self p. - ^ m2 + (self q * h). - \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/dP.st b/source/Cryptography.package/RSAPrivateKey.class/instance/dP.st deleted file mode 100644 index 13d9f08..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/dP.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -dP - "Answer the value of dP" - - ^ dP \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/dQ.st b/source/Cryptography.package/RSAPrivateKey.class/instance/dQ.st deleted file mode 100644 index f06f6fd..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/dQ.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -dQ - "Answer the value of dQ" - - ^ dQ \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/p.q.dP.dQ.qInv..st b/source/Cryptography.package/RSAPrivateKey.class/instance/p.q.dP.dQ.qInv..st deleted file mode 100644 index 07ef2ba..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/p.q.dP.dQ.qInv..st +++ /dev/null @@ -1,8 +0,0 @@ -accessing -p: int1 q: int2 dP: int3 dQ: int4 qInv: int5 - - p := int1. - q := int2. - dP := int3. - dQ := int4. - qInv := int5. diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/p.st b/source/Cryptography.package/RSAPrivateKey.class/instance/p.st deleted file mode 100644 index 76b7541..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/p.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -p - "Answer the value of p" - - ^ p \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/q.st b/source/Cryptography.package/RSAPrivateKey.class/instance/q.st deleted file mode 100644 index f8c81c7..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/q.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -q - "Answer the value of q" - - ^ q \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/qInv.st b/source/Cryptography.package/RSAPrivateKey.class/instance/qInv.st deleted file mode 100644 index 3f64756..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/qInv.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -qInv - "Answer the value of qInv" - - ^ qInv \ No newline at end of file diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/v15Decrypt..st b/source/Cryptography.package/RSAPrivateKey.class/instance/v15Decrypt..st deleted file mode 100644 index 1a4f80b..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/v15Decrypt..st +++ /dev/null @@ -1,9 +0,0 @@ -process -v15Decrypt: aByteArray - - | em stream | - em := self crypt: aByteArray asInteger. - stream := em asByteArray readStream. - stream upTo: 16r02. - stream upTo: 16r00. - ^ stream upToEnd. diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/v15SignMessage..st b/source/Cryptography.package/RSAPrivateKey.class/instance/v15SignMessage..st deleted file mode 100644 index e7e1769..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/v15SignMessage..st +++ /dev/null @@ -1,5 +0,0 @@ -process -v15SignMessage: aMessage - - ^ self v15SignMessageHash: ( - SHA1 digestInfoAsn1DerEncodingFromMessage: aMessage). diff --git a/source/Cryptography.package/RSAPrivateKey.class/instance/v15SignMessageHash..st b/source/Cryptography.package/RSAPrivateKey.class/instance/v15SignMessageHash..st deleted file mode 100644 index 9511a51..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/instance/v15SignMessageHash..st +++ /dev/null @@ -1,17 +0,0 @@ -process -v15SignMessageHash: encodedMsg - - | int emLen | - - emLen := (p * q) digitLength -1. - - int := LargePositiveInteger basicNew: emLen. - " Our LargeIntegers are little endian, so we have to reverse the bytes" - encodedMsg with: (encodedMsg size to: 1 by: -1) do: [:each :index | - int basicAt: index put: each]. - int basicAt: encodedMsg size + 1 put: 0. - - encodedMsg size + 2 to: emLen - 1 do: [ :ind | int basicAt: ind put: 255]. - int basicAt: emLen put: 1. - - ^ (self crypt: int) asByteArray. diff --git a/source/Cryptography.package/RSAPrivateKey.class/properties.json b/source/Cryptography.package/RSAPrivateKey.class/properties.json deleted file mode 100644 index 80bb52f..0000000 --- a/source/Cryptography.package/RSAPrivateKey.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "p", - "q", - "dP", - "dQ", - "qInv" - ], - "name" : "RSAPrivateKey", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/README.md b/source/Cryptography.package/RSAPublicKey.class/README.md deleted file mode 100644 index 6ddc24a..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/README.md +++ /dev/null @@ -1 +0,0 @@ -My instances are RSA algorithms. \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/class/exponent.modulo..st b/source/Cryptography.package/RSAPublicKey.class/class/exponent.modulo..st deleted file mode 100644 index 27264a0..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/class/exponent.modulo..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -exponent: anInteger modulo: anotherInteger - ^ self new setExponent: anInteger modulo: anotherInteger \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/bits.st b/source/Cryptography.package/RSAPublicKey.class/instance/bits.st deleted file mode 100644 index f7eea25..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/bits.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -bits - ^ modulo highBit \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/crypt..st b/source/Cryptography.package/RSAPublicKey.class/instance/crypt..st deleted file mode 100644 index 834f0d7..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/crypt..st +++ /dev/null @@ -1,3 +0,0 @@ -process -crypt: anInteger - ^ anInteger raisedTo: exponent modulo: modulo \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/exponent.st b/source/Cryptography.package/RSAPublicKey.class/instance/exponent.st deleted file mode 100644 index e6728d7..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/exponent.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -exponent - ^ exponent \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/modulo.st b/source/Cryptography.package/RSAPublicKey.class/instance/modulo.st deleted file mode 100644 index 38bd183..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/modulo.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -modulo - ^ modulo \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/setExponent.modulo..st b/source/Cryptography.package/RSAPublicKey.class/instance/setExponent.modulo..st deleted file mode 100644 index 53ada4a..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/setExponent.modulo..st +++ /dev/null @@ -1,4 +0,0 @@ -initialization -setExponent: anInteger modulo: anotherInteger - exponent := anInteger. - modulo := anotherInteger \ No newline at end of file diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/v15Decrypt..st b/source/Cryptography.package/RSAPublicKey.class/instance/v15Decrypt..st deleted file mode 100644 index 1a4f80b..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/v15Decrypt..st +++ /dev/null @@ -1,9 +0,0 @@ -process -v15Decrypt: aByteArray - - | em stream | - em := self crypt: aByteArray asInteger. - stream := em asByteArray readStream. - stream upTo: 16r02. - stream upTo: 16r00. - ^ stream upToEnd. diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/v15Encrypt..st b/source/Cryptography.package/RSAPublicKey.class/instance/v15Encrypt..st deleted file mode 100644 index a57ad76..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/v15Encrypt..st +++ /dev/null @@ -1,8 +0,0 @@ -process -v15Encrypt: aByteArray - - | em k ps | - k := self modulo asByteArray size. - ps := SecureRandom new nextBytesNonZero: (k - aByteArray size - 3). - em := 16r00 asByteArray, 16r02 asByteArray, ps, 16r00 asByteArray, aByteArray. - ^ (self crypt: em asInteger) asByteArray. diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/v15SignMessage..st b/source/Cryptography.package/RSAPublicKey.class/instance/v15SignMessage..st deleted file mode 100644 index e7e1769..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/v15SignMessage..st +++ /dev/null @@ -1,5 +0,0 @@ -process -v15SignMessage: aMessage - - ^ self v15SignMessageHash: ( - SHA1 digestInfoAsn1DerEncodingFromMessage: aMessage). diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/v15SignMessageHash..st b/source/Cryptography.package/RSAPublicKey.class/instance/v15SignMessageHash..st deleted file mode 100644 index f22abb0..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/v15SignMessageHash..st +++ /dev/null @@ -1,7 +0,0 @@ -process -v15SignMessageHash: encodedMsg - - | padded toBeSigned | - padded := ByteArray new: (256 - encodedMsg size - 3) withAll: 255. - toBeSigned := #(0) asByteArray, #(1) asByteArray, padded, #(0) asByteArray, encodedMsg. - ^ (self crypt: toBeSigned asInteger) asByteArray. diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/v15Verify.isSignatureOf..st b/source/Cryptography.package/RSAPublicKey.class/instance/v15Verify.isSignatureOf..st deleted file mode 100644 index fef7a40..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/v15Verify.isSignatureOf..st +++ /dev/null @@ -1,8 +0,0 @@ -process -v15Verify: aSignature isSignatureOf: aMessage - "Answer true if the given signature string signs the given message." - - ^ self - v15VerifySignature: aSignature - ofMessageHash: ( - SHA1 digestInfoAsn1DerEncodingFromMessage: aMessage). diff --git a/source/Cryptography.package/RSAPublicKey.class/instance/v15VerifySignature.ofMessageHash..st b/source/Cryptography.package/RSAPublicKey.class/instance/v15VerifySignature.ofMessageHash..st deleted file mode 100644 index 8c2a40b..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/instance/v15VerifySignature.ofMessageHash..st +++ /dev/null @@ -1,9 +0,0 @@ -process -v15VerifySignature: aSignature ofMessageHash: encodedMsg - "Answer true if the given signature string signs the given message (a stream or string)." - "Note: Random numbers are not needed for signature verification; thus, there is no need to call initRandomFromUser before verifying a signature." - - | bytes signedMsg | - bytes := (self crypt: aSignature asInteger) asByteArray. - signedMsg := bytes readStream upTo: 1; upTo: 0; upToEnd. - ^ encodedMsg = signedMsg diff --git a/source/Cryptography.package/RSAPublicKey.class/properties.json b/source/Cryptography.package/RSAPublicKey.class/properties.json deleted file mode 100644 index a4e8685..0000000 --- a/source/Cryptography.package/RSAPublicKey.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RSA", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "exponent", - "modulo" - ], - "name" : "RSAPublicKey", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/README.md b/source/Cryptography.package/RandomGenerator.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/RandomGenerator.class/class/destroyPickers.st b/source/Cryptography.package/RandomGenerator.class/class/destroyPickers.st deleted file mode 100644 index 6b22f1e..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/destroyPickers.st +++ /dev/null @@ -1,8 +0,0 @@ -initialize-release -destroyPickers - self withAllSubclassesDo: - [ : each | - (each instVarNamed: 'picker') ifNotNil: [ : thePicker | thePicker destroy ]. - each - instVarNamed: 'picker' - put: nil ] \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/fromUser.st b/source/Cryptography.package/RandomGenerator.class/class/fromUser.st deleted file mode 100644 index 45541f4..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/fromUser.st +++ /dev/null @@ -1,7 +0,0 @@ -create -fromUser - "Ask the user to type a long random string and use the result to seed the secure random number generator." - - | string | - string := FillInTheBlank request: 'Enter a long random string to seed the random generator.'. - ^ self key: string \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/generateKey.st b/source/Cryptography.package/RandomGenerator.class/class/generateKey.st deleted file mode 100644 index 80cfd07..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/generateKey.st +++ /dev/null @@ -1,21 +0,0 @@ -initialize-release -generateKey - | unguessableBytes prior | - prior := UUID new shuffled asInteger. - unguessableBytes := ByteArray streamContents: - [ : stream | - self unpredictableStringsDo: - [ : each | - | current | - current := each size < 30 - ifTrue: - [ "Some of the inputs are pretty short, expand them a little, and take opportunity to inject some extra craziness." - (each asByteArray asInteger - raisedTo: 64 - modulo: 6773186437430423149 "prime") asByteArray ] - ifFalse: [ each ]. - "make each value dependent on the prior values, so the adversary is required to get every single string exactly right AND guess every the randomizations correctly." - current := SHA1 new hashMessage: (current bitXor: prior). - stream nextPutAll: current asByteArray. - prior := current ] ]. - ^ SHA256 new hashMessage: unguessableBytes \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/initialize.st b/source/Cryptography.package/RandomGenerator.class/class/initialize.st deleted file mode 100644 index 0da1074..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/initialize.st +++ /dev/null @@ -1,7 +0,0 @@ -initialize-release -initialize - super initialize. - Smalltalk - addToStartUpList: self ; - addToShutDownList: self. - self startUp \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/key..st b/source/Cryptography.package/RandomGenerator.class/class/key..st deleted file mode 100644 index 5b7ac7b..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/key..st +++ /dev/null @@ -1,3 +0,0 @@ -create -key: anInteger - self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/picker.st b/source/Cryptography.package/RandomGenerator.class/class/picker.st deleted file mode 100644 index 8d6f9da..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/picker.st +++ /dev/null @@ -1,3 +0,0 @@ -create -picker - ^ picker ifNil: [ picker := self withGeneratedKey ] \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/shutDown.st b/source/Cryptography.package/RandomGenerator.class/class/shutDown.st deleted file mode 100644 index fde5348..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/shutDown.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -shutDown - super shutDown. - self destroyPickers \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/startUp.st b/source/Cryptography.package/RandomGenerator.class/class/startUp.st deleted file mode 100644 index c68ade4..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/startUp.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -startUp - super startUp. - self destroyPickers \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/class/unpredictableStringsDo..st b/source/Cryptography.package/RandomGenerator.class/class/unpredictableStringsDo..st deleted file mode 100644 index baf7da0..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/unpredictableStringsDo..st +++ /dev/null @@ -1,22 +0,0 @@ -initialize-release -unpredictableStringsDo: aBlock - "Enumerate sources of information from my environment that should be generally hard to guess." - | time | - time := Time millisecondsToRun: - [ aBlock - value: World imageForm bits compressToByteArray ; - value: Sensor mousePoint x asString ; - value: Sensor mousePoint y asString ; - value: Time millisecondClockValue asByteArray ; - value: Date today asString ; - value: Time now asString ; - value: Display extent asString. - 100 timesRepeat: [ aBlock value: UUID new ]. - #(imagePath lastUpdateString systemInformationString shortImageName datedVersion lastQuitLogPosition licenseStringTemplate) collect: - [ : each | - aBlock value: (SmalltalkImage current perform: each) asByteArray ] ]. - aBlock - value: time asByteArray; - "maybe the pointer has moved, hit it again." - value: Sensor mousePoint asString ; - value: Time millisecondClockValue asByteArray diff --git a/source/Cryptography.package/RandomGenerator.class/class/withGeneratedKey.st b/source/Cryptography.package/RandomGenerator.class/class/withGeneratedKey.st deleted file mode 100644 index 0aae0a5..0000000 --- a/source/Cryptography.package/RandomGenerator.class/class/withGeneratedKey.st +++ /dev/null @@ -1,3 +0,0 @@ -create -withGeneratedKey - ^ self key: self generateKey \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/instance/destroy.st b/source/Cryptography.package/RandomGenerator.class/instance/destroy.st deleted file mode 100644 index 6854804..0000000 --- a/source/Cryptography.package/RandomGenerator.class/instance/destroy.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -destroy - self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/instance/nextBits..st b/source/Cryptography.package/RandomGenerator.class/instance/nextBits..st deleted file mode 100644 index a2187df..0000000 --- a/source/Cryptography.package/RandomGenerator.class/instance/nextBits..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -nextBits: bitLength - self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/instance/nextBytes..st b/source/Cryptography.package/RandomGenerator.class/instance/nextBytes..st deleted file mode 100644 index 23830f2..0000000 --- a/source/Cryptography.package/RandomGenerator.class/instance/nextBytes..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -nextBytes: byteLength - self subclassResponsibility \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/instance/nextFrom.to..st b/source/Cryptography.package/RandomGenerator.class/instance/nextFrom.to..st deleted file mode 100644 index 22eb74a..0000000 --- a/source/Cryptography.package/RandomGenerator.class/instance/nextFrom.to..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -nextFrom: start to: end - "Answer a random integer between start and end." - | r | - r := self nextInt: end-start+1. - ^ r+start-1 \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/instance/nextInt..st b/source/Cryptography.package/RandomGenerator.class/instance/nextInt..st deleted file mode 100644 index ed9393c..0000000 --- a/source/Cryptography.package/RandomGenerator.class/instance/nextInt..st +++ /dev/null @@ -1,10 +0,0 @@ -accessing -nextInt: anInteger - "Answer a random integer in the interval [1, anInteger]." - | r high | - anInteger strictlyPositive ifFalse: [ self error: 'Range must be positive' ]. - high := anInteger-1. - [ (r := self nextBits: anInteger highBit) - between: 0 - and: high ] whileFalse. - ^ r+1 \ No newline at end of file diff --git a/source/Cryptography.package/RandomGenerator.class/properties.json b/source/Cryptography.package/RandomGenerator.class/properties.json deleted file mode 100644 index 33b642a..0000000 --- a/source/Cryptography.package/RandomGenerator.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ - "picker" - ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "RandomGenerator", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/README.md b/source/Cryptography.package/RandomPool.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/RandomPool.class/class/default.st b/source/Cryptography.package/RandomPool.class/class/default.st deleted file mode 100644 index 6e0ae0e..0000000 --- a/source/Cryptography.package/RandomPool.class/class/default.st +++ /dev/null @@ -1,3 +0,0 @@ -default -default - ^ default ifNil: [default := self new: 4096] \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/class/new..st b/source/Cryptography.package/RandomPool.class/class/new..st deleted file mode 100644 index d5d3f15..0000000 --- a/source/Cryptography.package/RandomPool.class/class/new..st +++ /dev/null @@ -1,3 +0,0 @@ -intance creation -new: anInteger - ^ self basicNew initializePoolSize: anInteger \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/class/new.st b/source/Cryptography.package/RandomPool.class/class/new.st deleted file mode 100644 index 588d6b2..0000000 --- a/source/Cryptography.package/RandomPool.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -intance creation -new - ^ self new: 256 \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/atEnd.st b/source/Cryptography.package/RandomPool.class/instance/atEnd.st deleted file mode 100644 index fcf46ee..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/atEnd.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -atEnd - ^ false \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/grabRandomBitsFromSoundInput..st b/source/Cryptography.package/RandomPool.class/instance/grabRandomBitsFromSoundInput..st deleted file mode 100644 index 1eccca6..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/grabRandomBitsFromSoundInput..st +++ /dev/null @@ -1,30 +0,0 @@ -as yet unclassified -grabRandomBitsFromSoundInput: bitCount - "Grab the given number of random bits of 'noise' from a sound input source. Typically, one would use a microphone or line input as the sound source, although many sound cards have enough thermal noise that you get random low-order sample bits even with no microphone connected. Only the least signficant bit of the samples is used. Since not all sound cards support 16-bits of sample resolution, we use the lowest bit that changes." - - | recorder buf mid samples bitMask randomBits bit | - "collect some sound data" - recorder := SoundRecorder new clearRecordedSound. - recorder resumeRecording. - (Delay forSeconds: 1) wait. - recorder stopRecording. - buf := recorder condensedSamples. - - "grab bitCount samples from the middle" - mid := buf monoSampleCount // 2. - samples := buf copyFrom: mid to: mid + bitCount - 1. - - "find the least significant bit that varies" - bitMask := 1. - [bitMask < 16r10000 and: - [(samples collect: [:s | s bitAnd: bitMask]) asSet size < 2]] - whileTrue: [bitMask := bitMask bitShift: 1]. - bitMask = 16r10000 ifTrue: [^ self error: 'sound samples do not vary']. - - "pack the random bits into a positive integer" - randomBits := 0. - 1 to: samples size do: [:i | - bit := ((samples at: i) bitAnd: bitMask) = 0 ifTrue: [0] ifFalse: [1]. - randomBits := (randomBits bitShift: 1) + bit]. - - self nextPutAll: randomBits \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/initializePoolSize..st b/source/Cryptography.package/RandomPool.class/instance/initializePoolSize..st deleted file mode 100644 index d8a8aea..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/initializePoolSize..st +++ /dev/null @@ -1,8 +0,0 @@ -as yet unclassified -initializePoolSize: anInteger - key := ByteArray new: TripleDES keySize. - pool := ByteArray new: anInteger // TripleDES blockSize + 1 * TripleDES blockSize. - outputStream := ByteArray new readStream. - inputIndex := 1. - self nextPutAll: Time millisecondClockValue printString asByteArray. - self stir \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/next..st b/source/Cryptography.package/RandomPool.class/instance/next..st deleted file mode 100644 index dad0b56..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/next..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -next: anInteger - | answer | - answer := ByteArray new: anInteger. - 1 to: anInteger do: [ :each | answer at: each put: self next]. - ^ answer \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/next.st b/source/Cryptography.package/RandomPool.class/instance/next.st deleted file mode 100644 index 849ef8b..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/next.st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -next - outputStream atEnd - ifTrue: [self stir. - outputStream := (pool copyFrom: 1 to: pool size // 2) readStream]. - ^ outputStream next \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/nextPut..st b/source/Cryptography.package/RandomPool.class/instance/nextPut..st deleted file mode 100644 index 6408387..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/nextPut..st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -nextPut: aByte - | keyIndex | - inputIndex = pool size ifTrue: [self stir]. - inputIndex := inputIndex \\ pool size + 1. - pool at: inputIndex put: ((pool at: inputIndex) bitXor: aByte). - keyIndex := inputIndex \\ key size + 1. - key at: keyIndex put: ((key at: keyIndex) bitXor: aByte). - ^ aByte \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/nextPutAll..st b/source/Cryptography.package/RandomPool.class/instance/nextPutAll..st deleted file mode 100644 index 2b7bb12..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/nextPutAll..st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -nextPutAll: aCollection - aCollection do: [ :each | self nextPut: each]. - ^ aCollection \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/instance/stir.st b/source/Cryptography.package/RandomPool.class/instance/stir.st deleted file mode 100644 index 04d160b..0000000 --- a/source/Cryptography.package/RandomPool.class/instance/stir.st +++ /dev/null @@ -1,9 +0,0 @@ -as yet unclassified -stir - | cipher block | - cipher := (TripleDES key: key) cbc. - cipher initialVector: (pool copyFrom: pool size - TripleDES blockSize + 1 to: pool size). - 1 to: pool size - TripleDES blockSize + 1 by: TripleDES blockSize do: [ :startIndex | - block := pool copyFrom: startIndex to: startIndex + TripleDES blockSize - 1. - cipher encryptBlock: block. - pool replaceFrom: startIndex to: startIndex + TripleDES blockSize - 1 with: block] \ No newline at end of file diff --git a/source/Cryptography.package/RandomPool.class/properties.json b/source/Cryptography.package/RandomPool.class/properties.json deleted file mode 100644 index 1fb2ad6..0000000 --- a/source/Cryptography.package/RandomPool.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Stream", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ - "default" - ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "key", - "pool", - "outputStream", - "inputIndex" - ], - "name" : "RandomPool", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/README.md b/source/Cryptography.package/Rijndael.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/Rijndael.class/class/blockSize.st b/source/Cryptography.package/Rijndael.class/class/blockSize.st deleted file mode 100644 index d30c146..0000000 --- a/source/Cryptography.package/Rijndael.class/class/blockSize.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -blockSize - "Rijndael supports variable block length. 128 bits is a good default." - ^ 128 / 8 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/calculateInvTTables.st b/source/Cryptography.package/Rijndael.class/class/calculateInvTTables.st deleted file mode 100644 index 8b43e23..0000000 --- a/source/Cryptography.package/Rijndael.class/class/calculateInvTTables.st +++ /dev/null @@ -1,27 +0,0 @@ -class initialization -calculateInvTTables - | a t coef1 coef2 coef3 coef4 | - InvT0 := Array new: 256. - InvT1 := Array new: 256. - InvT2 := Array new: 256. - InvT3 := Array new: 256. - - coef1 := 14. - coef2 := 9. - coef3 := 13. - coef4 := 11. - 0 to: 255 do: [:avalue | - a := self subByteInverse: avalue. - t := ThirtyTwoBitRegister - byte1: (self multiply: a by: coef1) - byte2: (self multiply: a by: coef2) - byte3: (self multiply: a by: coef3) - byte4: (self multiply: a by: coef4). - InvT0 at: avalue+1 put: t. - t := t copy leftRotateBy: -8. - InvT1 at: avalue+1 put: t. - t := t copy leftRotateBy: -8. - InvT2 at: avalue+1 put: t. - t := t copy leftRotateBy: -8. - InvT3 at: avalue+1 put: t. - ]. diff --git a/source/Cryptography.package/Rijndael.class/class/calculateTTables.st b/source/Cryptography.package/Rijndael.class/class/calculateTTables.st deleted file mode 100644 index 3978427..0000000 --- a/source/Cryptography.package/Rijndael.class/class/calculateTTables.st +++ /dev/null @@ -1,27 +0,0 @@ -class initialization -calculateTTables - | a t coef1 coef2 coef3 coef4 | - T0 := Array new: 256. - T1 := Array new: 256. - T2 := Array new: 256. - T3 := Array new: 256. - - coef1 := 2. - coef2 := 1. - coef3 := 1. - coef4 := 3. - 0 to: 255 do: [:avalue | - a := self subByte: avalue. - t := ThirtyTwoBitRegister - byte1: (self multiply: a by: coef1) - byte2: (self multiply: a by: coef2) - byte3: (self multiply: a by: coef3) - byte4: (self multiply: a by: coef4). - T0 at: avalue+1 put: t. - t := t copy leftRotateBy: -8. - T1 at: avalue+1 put: t. - t := t copy leftRotateBy: -8. - T2 at: avalue+1 put: t. - t := t copy leftRotateBy: -8. - T3 at: avalue+1 put: t. - ]. diff --git a/source/Cryptography.package/Rijndael.class/class/initialize.st b/source/Cryptography.package/Rijndael.class/class/initialize.st deleted file mode 100644 index f130ac8..0000000 --- a/source/Cryptography.package/Rijndael.class/class/initialize.st +++ /dev/null @@ -1,10 +0,0 @@ -class initialization -initialize - self initializeLogTable. - self initializeLogInverseTable. - self initializeRoundConstant. - self initializeSubByte. - self initializeSubByteInverse. - - self calculateTTables. - self calculateInvTTables \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/initializeLogInverseTable.st b/source/Cryptography.package/Rijndael.class/class/initializeLogInverseTable.st deleted file mode 100644 index c06a856..0000000 --- a/source/Cryptography.package/Rijndael.class/class/initializeLogInverseTable.st +++ /dev/null @@ -1,35 +0,0 @@ -class initialization -initializeLogInverseTable - - LogInverseTable := -#(1 3 5 15 17 51 85 255 26 46 114 150 161 248 19 53 - - 95 225 56 72 216 115 149 164 247 2 6 10 30 34 102 170 - - 229 52 92 228 55 89 235 38 106 190 217 112 144 171 230 49 - - 83 245 4 12 20 60 68 204 79 209 104 184 211 110 178 205 - - 76 212 103 169 224 59 77 215 98 166 241 8 24 40 120 136 - - 131 158 185 208 107 189 220 127 129 152 179 206 73 219 118 154 - - 181 196 87 249 16 48 80 240 11 29 39 105 187 214 97 163 - - 254 25 43 125 135 146 173 236 47 113 147 174 233 32 96 160 - - 251 22 58 78 210 109 183 194 93 231 50 86 250 21 63 65 - - 195 94 226 61 71 201 64 192 91 237 44 116 156 191 218 117 - - 159 186 213 100 172 239 42 126 130 157 188 223 122 142 137 128 - - 155 182 193 88 232 35 101 175 234 37 111 177 200 67 197 84 - - 252 31 33 99 165 244 7 9 27 45 119 153 176 203 70 202 - - 69 207 74 222 121 139 134 145 168 227 62 66 198 81 243 14 - - 18 54 90 238 41 123 141 140 143 138 133 148 167 242 13 23 - - 57 75 221 124 132 151 162 253 28 36 108 180 199 82 246 1) \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/initializeLogTable.st b/source/Cryptography.package/Rijndael.class/class/initializeLogTable.st deleted file mode 100644 index 22b4f88..0000000 --- a/source/Cryptography.package/Rijndael.class/class/initializeLogTable.st +++ /dev/null @@ -1,35 +0,0 @@ -class initialization -initializeLogTable - - LogTable := -#(0 0 25 1 50 2 26 198 75 199 27 104 51 238 223 3 - - 100 4 224 14 52 141 129 239 76 113 8 200 248 105 28 193 - - 125 194 29 181 249 185 39 106 77 228 166 114 154 201 9 120 - - 101 47 138 5 33 15 225 36 18 240 130 69 53 147 218 142 - - 150 143 219 189 54 208 206 148 19 92 210 241 64 70 131 56 - - 102 221 253 48 191 6 139 98 179 37 226 152 34 136 145 16 - - 126 110 72 195 163 182 30 66 58 107 40 84 250 133 61 186 - - 43 121 10 21 155 159 94 202 78 212 172 229 243 115 167 87 - - 175 88 168 80 244 234 214 116 79 174 233 213 231 230 173 232 - - 44 215 117 122 235 22 11 245 89 203 95 176 156 169 81 160 - - 127 12 246 111 23 196 73 236 216 67 31 45 164 118 123 183 - - 204 187 62 90 251 96 177 134 59 82 161 108 170 85 41 157 - - 151 178 135 144 97 190 220 252 188 149 207 205 55 63 91 209 - - 83 57 132 60 65 162 109 71 20 42 158 93 86 242 211 171 - - 68 17 146 217 35 32 46 137 180 124 184 38 119 153 227 165 - - 103 74 237 222 197 49 254 24 13 99 140 128 192 247 112 7) \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/initializeRoundConstant.st b/source/Cryptography.package/Rijndael.class/class/initializeRoundConstant.st deleted file mode 100644 index 2a1ec54..0000000 --- a/source/Cryptography.package/Rijndael.class/class/initializeRoundConstant.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -initializeRoundConstant - RoundConstant := -#(1 2 4 8 16 32 64 128 27 54 108 216 171 77 154 47 94 188 99 198 151 53 106 212 179 125 250 239 197 145 57) \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/initializeSubByte.st b/source/Cryptography.package/Rijndael.class/class/initializeSubByte.st deleted file mode 100644 index ac37436..0000000 --- a/source/Cryptography.package/Rijndael.class/class/initializeSubByte.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -initializeSubByte - SubByte := -#(99 124 119 123 242 107 111 197 48 1 103 43 254 215 171 118 202 130 201 125 250 89 71 240 173 212 162 175 156 164 114 192 183 253 147 38 54 63 247 204 52 165 229 241 113 216 49 21 4 199 35 195 24 150 5 154 7 18 128 226 235 39 178 117 9 131 44 26 27 110 90 160 82 59 214 179 41 227 47 132 83 209 0 237 32 252 177 91 106 203 190 57 74 76 88 207 208 239 170 251 67 77 51 133 69 249 2 127 80 60 159 168 81 163 64 143 146 157 56 245 188 182 218 33 16 255 243 210 205 12 19 236 95 151 68 23 196 167 126 61 100 93 25 115 96 129 79 220 34 42 144 136 70 238 184 20 222 94 11 219 224 50 58 10 73 6 36 92 194 211 172 98 145 149 228 121 231 200 55 109 141 213 78 169 108 86 244 234 101 122 174 8 186 120 37 46 28 166 180 198 232 221 116 31 75 189 139 138 112 62 181 102 72 3 246 14 97 53 87 185 134 193 29 158 225 248 152 17 105 217 142 148 155 30 135 233 206 85 40 223 140 161 137 13 191 230 66 104 65 153 45 15 176 84 187 22) \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/initializeSubByteInverse.st b/source/Cryptography.package/Rijndael.class/class/initializeSubByteInverse.st deleted file mode 100644 index 93423c4..0000000 --- a/source/Cryptography.package/Rijndael.class/class/initializeSubByteInverse.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -initializeSubByteInverse - SubByteInverse := -#(82 9 106 213 48 54 165 56 191 64 163 158 129 243 215 251 124 227 57 130 155 47 255 135 52 142 67 68 196 222 233 203 84 123 148 50 166 194 35 61 238 76 149 11 66 250 195 78 8 46 161 102 40 217 36 178 118 91 162 73 109 139 209 37 114 248 246 100 134 104 152 22 212 164 92 204 93 101 182 146 108 112 72 80 253 237 185 218 94 21 70 87 167 141 157 132 144 216 171 0 140 188 211 10 247 228 88 5 184 179 69 6 208 44 30 143 202 63 15 2 193 175 189 3 1 19 138 107 58 145 17 65 79 103 220 234 151 242 207 206 240 180 230 115 150 172 116 34 231 173 53 133 226 249 55 232 28 117 223 110 71 241 26 113 29 41 197 137 111 183 98 14 170 24 190 27 252 86 62 75 198 210 121 32 154 219 192 254 120 205 90 244 31 221 168 51 136 7 199 49 177 18 16 89 39 128 236 95 96 81 127 169 25 181 74 13 45 229 122 159 147 201 156 239 160 224 59 77 174 42 245 176 200 235 187 60 131 83 153 97 23 43 4 126 186 119 214 38 225 105 20 99 85 33 12 125) \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/keySize.st b/source/Cryptography.package/Rijndael.class/class/keySize.st deleted file mode 100644 index 60c47ef..0000000 --- a/source/Cryptography.package/Rijndael.class/class/keySize.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -keySize - "Rijndael supports variable key length. 256 bits is a good default." - ^ 256 / 8 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/multiply.by..st b/source/Cryptography.package/Rijndael.class/class/multiply.by..st deleted file mode 100644 index 8953950..0000000 --- a/source/Cryptography.package/Rijndael.class/class/multiply.by..st +++ /dev/null @@ -1,6 +0,0 @@ -byte functions -multiply: value1 by: value2 - (value1 = 0 or: [value2 = 0]) ifTrue: [^ 0]. - - ^ LogInverseTable at: - ((LogTable at: value1 + 1) + (LogTable at: value2 + 1) \\ 255 + 1) \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/new.st b/source/Cryptography.package/Rijndael.class/class/new.st deleted file mode 100644 index 57c0229..0000000 --- a/source/Cryptography.package/Rijndael.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^ super new keySize: self keySize; blockSize: self blockSize \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/subByte..st b/source/Cryptography.package/Rijndael.class/class/subByte..st deleted file mode 100644 index b24ce5d..0000000 --- a/source/Cryptography.package/Rijndael.class/class/subByte..st +++ /dev/null @@ -1,3 +0,0 @@ -byte functions -subByte: index - ^ SubByte at: index+1 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/class/subByteInverse..st b/source/Cryptography.package/Rijndael.class/class/subByteInverse..st deleted file mode 100644 index 32f8121..0000000 --- a/source/Cryptography.package/Rijndael.class/class/subByteInverse..st +++ /dev/null @@ -1,3 +0,0 @@ -byte functions -subByteInverse: index - ^ SubByteInverse at: index+1 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/addEqRoundKey..st b/source/Cryptography.package/Rijndael.class/instance/addEqRoundKey..st deleted file mode 100644 index f649a1a..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/addEqRoundKey..st +++ /dev/null @@ -1,6 +0,0 @@ -block cipher -addEqRoundKey: roundNumber - | start | - start := roundNumber * nB. - 1 to: nB do: [:k | - (state at: k) bitXor: (eqExpandedKey at: start + k)] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/addRoundKey..st b/source/Cryptography.package/Rijndael.class/instance/addRoundKey..st deleted file mode 100644 index f4c7c03..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/addRoundKey..st +++ /dev/null @@ -1,6 +0,0 @@ -block cipher -addRoundKey: roundNumber - | start | - start := roundNumber * nB. - 1 to: nB do: [:k | - (state at: k) bitXor: (expandedKey at: start + k)] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/blockSize..st b/source/Cryptography.package/Rijndael.class/instance/blockSize..st deleted file mode 100644 index 2583eb5..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/blockSize..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize: anInteger - nB := anInteger * 8 / 32 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/blockSize.st b/source/Cryptography.package/Rijndael.class/instance/blockSize.st deleted file mode 100644 index 4c68e57..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ nB * 32 / 8 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/calculateNumberOfRounds.st b/source/Cryptography.package/Rijndael.class/instance/calculateNumberOfRounds.st deleted file mode 100644 index 45e4f63..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/calculateNumberOfRounds.st +++ /dev/null @@ -1,15 +0,0 @@ -setup -calculateNumberOfRounds - nK = 4 ifTrue: [ - nB = 4 ifTrue: [nR := 10]. - nB = 6 ifTrue: [nR := 12]. - nB = 8 ifTrue: [nR := 14]]. - nK = 6 ifTrue: [ - nB = 4 ifTrue: [nR := 12]. - nB = 6 ifTrue: [nR := 12]. - nB = 8 ifTrue: [nR := 14]]. - nK = 8 ifTrue: [ - nB = 4 ifTrue: [nR := 14]. - nB = 6 ifTrue: [nR := 14]. - nB = 8 ifTrue: [nR := 14]]. - diff --git a/source/Cryptography.package/Rijndael.class/instance/calculateShiftOffsets.st b/source/Cryptography.package/Rijndael.class/instance/calculateShiftOffsets.st deleted file mode 100644 index c776b4b..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/calculateShiftOffsets.st +++ /dev/null @@ -1,4 +0,0 @@ -setup -calculateShiftOffsets - (nB = 4 or: [nB = 6]) ifTrue: [shiftOffset1 := 1. shiftOffset2 := 2. shiftOffset3 := 3]. - nB = 8 ifTrue: [shiftOffset1 := 1. shiftOffset2 := 3. shiftOffset3 := 4] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/decryptBlock..st b/source/Cryptography.package/Rijndael.class/instance/decryptBlock..st deleted file mode 100644 index 5857cb7..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/decryptBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decryptBlock: aByteArray - state := self stateFromBytes: aByteArray. - self decryptState: state. - self storeState: state into: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/decryptState..st b/source/Cryptography.package/Rijndael.class/instance/decryptState..st deleted file mode 100644 index dc1c14c..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/decryptState..st +++ /dev/null @@ -1,7 +0,0 @@ -block cipher -decryptState: aState - state := aState. - self addEqRoundKey: nR. - nR - 1 to: 1 by: -1 do: [:roundNumber | self eqRound: roundNumber]. - self eqFinalRound: 0. - ^ state \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/encryptBlock..st b/source/Cryptography.package/Rijndael.class/instance/encryptBlock..st deleted file mode 100644 index 9ccf79c..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/encryptBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptBlock: aByteArray - state := self stateFromBytes: aByteArray. - self encryptState: state. - self storeState: state into: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/encryptState..st b/source/Cryptography.package/Rijndael.class/instance/encryptState..st deleted file mode 100644 index 3911f56..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/encryptState..st +++ /dev/null @@ -1,7 +0,0 @@ -block cipher -encryptState: aState - state := aState. - self addRoundKey: 0. - 1 to: nR - 1 do: [:roundNumber | self round: roundNumber]. - self finalRound: nR. - ^ state \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/eqExpandKey.st b/source/Cryptography.package/Rijndael.class/instance/eqExpandKey.st deleted file mode 100644 index b9032b6..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/eqExpandKey.st +++ /dev/null @@ -1,15 +0,0 @@ -key schedule -eqExpandKey - eqExpandedKey := Array new: nB * (nR + 1). - - 1 to: nB do: [:j | - eqExpandedKey at: 0*nB + j put: (expandedKey at: 0*nB + j). - eqExpandedKey at: nR*nB + j put: (expandedKey at: nR*nB + j). - ]. - 1 to: nR-1 do: [:i | - 1 to: nB do: [:j | - eqExpandedKey at: i*nB + j put: - (self invMixColumn: (expandedKey at: i*nB + j)) - ] - ]. - diff --git a/source/Cryptography.package/Rijndael.class/instance/eqFinalRound..st b/source/Cryptography.package/Rijndael.class/instance/eqFinalRound..st deleted file mode 100644 index 2039d3e..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/eqFinalRound..st +++ /dev/null @@ -1,18 +0,0 @@ -block cipher -eqFinalRound: roundNumber - | a1 a2 a3 a4 newState start | - newState := Array new: nB. - - "do SubBytesInverse and ShiftRowsInverse in one step" - 0 to: nB-1 do: [:j | - a1 := SubByteInverse at: ((state at: j + 1) byteAt: 1) + 1. - a2 := SubByteInverse at: ((state at: (j - shiftOffset1) \\ nB + 1) byteAt: 2) + 1. - a3 := SubByteInverse at: ((state at: (j - shiftOffset2) \\ nB + 1) byteAt: 3) + 1. - a4 := SubByteInverse at: ((state at: (j - shiftOffset3) \\ nB + 1) byteAt: 4) + 1. - newState at: j+1 put: - (ThirtyTwoBitRegister byte1: a1 byte2: a2 byte3: a3 byte4: a4)]. - - "add equivalent round key" - start := roundNumber * nB. - 1 to: nB do: [:k | - state at: k put: ((newState at: k) bitXor: (eqExpandedKey at: start + k))] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/eqRound..st b/source/Cryptography.package/Rijndael.class/instance/eqRound..st deleted file mode 100644 index 6cce62e..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/eqRound..st +++ /dev/null @@ -1,21 +0,0 @@ -block cipher -eqRound: roundNumber - | a0 a1 a2 a3 result newState start | - newState := Array new: nB. - - "do SubBytesInverse, ShiftRowsInverse and MixColumnsInverse in one step" - 0 to: nB-1 do: [:j | - a0 := (state at: j + 1) byteAt: 1. - a1 := (state at: (j - shiftOffset1) \\ nB + 1) byteAt: 2. - a2 := (state at: (j - shiftOffset2) \\ nB + 1) byteAt: 3. - a3 := (state at: (j - shiftOffset3) \\ nB + 1) byteAt: 4. - result := (InvT0 at: a0+1) copy. - result bitXor: (InvT1 at: a1+1). - result bitXor: (InvT2 at: a2+1). - result bitXor: (InvT3 at: a3+1). - newState at: j+1 put: result]. - - "add equivalent round key" - start := roundNumber * nB. - 1 to: nB do: [:k | - state at: k put: ((newState at: k) bitXor: (eqExpandedKey at: start + k))] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/example.st b/source/Cryptography.package/Rijndael.class/instance/example.st deleted file mode 100644 index a261d5c..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/example.st +++ /dev/null @@ -1,18 +0,0 @@ -examples -example - | k pt | - k := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C). - pt := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34). - - k := #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0). - pt := #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0). - - pt := self stateFromBytes: pt. - self key: k. - 3 timesRepeat: - [Transcript show: pt; cr. - self encryptState: pt]. - 3 timesRepeat: - [Transcript show: pt; cr. - self decryptState: pt]. - Transcript show: pt; cr. \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/example2.st b/source/Cryptography.package/Rijndael.class/instance/example2.st deleted file mode 100644 index 84fa26f..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/example2.st +++ /dev/null @@ -1,11 +0,0 @@ -examples -example2 - | k pt r | - k := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C). - pt := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34). - - pt := self stateFromBytes: pt. - self key: k. - r := Time millisecondsToRun: - [10000 timesRepeat: [self encryptState: pt]]. - ^ r diff --git a/source/Cryptography.package/Rijndael.class/instance/example3.st b/source/Cryptography.package/Rijndael.class/instance/example3.st deleted file mode 100644 index a72db02..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/example3.st +++ /dev/null @@ -1,12 +0,0 @@ -examples -example3 - | k pt | - k := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C) asByteArray. - pt := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34) asByteArray. - - self key: k. - Transcript cr; show: pt hex. - self encryptBlock: pt. - Transcript cr; show: pt hex. - self decryptBlock: pt. - Transcript cr; show: pt hex \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/expandKey..st b/source/Cryptography.package/Rijndael.class/instance/expandKey..st deleted file mode 100644 index 26e8145..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/expandKey..st +++ /dev/null @@ -1,29 +0,0 @@ -key schedule -expandKey: aByteArray - | w total want sw key | - key := self stateFromBytes: aByteArray columns: nK. - total := nB * (nR + 1). - w := Array new: total. - - 1 to: nK do: [:n | - w at: n put: (key at: n)]. - nK + 1 to: total do: [:n | - want := (w at: n - 1) copy. - (n - 1 \\ nK) = 0 ifTrue: - [sw := ByteArray new: 4. - sw at: 1 put: - ((SubByte at: (want byteAt: 2) + 1) bitXor: (RoundConstant at: n-1 / nK)). - 2 to: 4 do: [:i | - sw at: i put: (SubByte at: (want byteAt: i \\ 4 + 1) + 1)]. - sw := ThirtyTwoBitRegister loadFrom: sw at: 1] - ifFalse: - [(n - 1 \\ nK = 4) & (nK > 6) ifTrue: - [sw := ByteArray new: 4. - 1 to: 4 do: [:i | sw at: i put: (SubByte at: (want byteAt: i) + 1)]. - sw := ThirtyTwoBitRegister loadFrom: sw at: 1] - ifFalse: - [sw := want] - ]. - w at: n put: ((w at: n - nK) copy bitXor: sw). - ]. - expandedKey := w \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/finalRound..st b/source/Cryptography.package/Rijndael.class/instance/finalRound..st deleted file mode 100644 index 47ac798..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/finalRound..st +++ /dev/null @@ -1,17 +0,0 @@ -block cipher -finalRound: roundNumber - | a1 a2 a3 a4 newState start | - newState := Array new: nB. - - "do SubBytes and ShiftRows in one step" - 0 to: nB-1 do: [:j | - a1 := SubByte at: ((state at: j + 1) byteAt: 1) + 1. - a2 := SubByte at: ((state at: (j + shiftOffset1) \\ nB + 1) byteAt: 2) + 1. - a3 := SubByte at: ((state at: (j + shiftOffset2) \\ nB + 1) byteAt: 3) + 1. - a4 := SubByte at: ((state at: (j + shiftOffset3) \\ nB + 1) byteAt: 4) + 1. - newState at: j+1 put: (ThirtyTwoBitRegister byte1: a1 byte2: a2 byte3: a3 byte4: a4)]. - - "add round key" - start := roundNumber * nB. - 1 to: nB do: [:k | - state at: k put: ((newState at: k) bitXor: (expandedKey at: start + k))] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/invMixColumn..st b/source/Cryptography.package/Rijndael.class/instance/invMixColumn..st deleted file mode 100644 index f1d87cf..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/invMixColumn..st +++ /dev/null @@ -1,12 +0,0 @@ -key schedule -invMixColumn: aColumn - | a0 a1 a2 a3 result | - a0 := SubByte at: (aColumn byteAt: 1) + 1. - a1 := SubByte at: (aColumn byteAt: 2) + 1. - a2 := SubByte at: (aColumn byteAt: 3) + 1. - a3 := SubByte at: (aColumn byteAt: 4) + 1. - result := (InvT0 at: a0+1) copy. - result bitXor: (InvT1 at: a1+1). - result bitXor: (InvT2 at: a2+1). - result bitXor: (InvT3 at: a3+1). - ^ result \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/key..st b/source/Cryptography.package/Rijndael.class/instance/key..st deleted file mode 100644 index 7bd656c..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/key..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -key: aByteArray -" nK := aByteArray size * 8 / 32." - self setSystem. - self expandKey: aByteArray. - self eqExpandKey \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/keySize..st b/source/Cryptography.package/Rijndael.class/instance/keySize..st deleted file mode 100644 index 5b27aef..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/keySize..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize: anInteger - nK := anInteger * 8 / 32 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/keySize.st b/source/Cryptography.package/Rijndael.class/instance/keySize.st deleted file mode 100644 index 787157f..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ nK * 32 / 8 \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/round..st b/source/Cryptography.package/Rijndael.class/instance/round..st deleted file mode 100644 index c903097..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/round..st +++ /dev/null @@ -1,21 +0,0 @@ -block cipher -round: roundNumber - | a0 a1 a2 a3 result newState start | - newState := Array new: nB. - - "do SubBytes, ShiftRows and MixColumns in one step" - 0 to: nB-1 do: [:j | - a0 := (state at: j + 1) byteAt: 1. - a1 := (state at: (j + shiftOffset1) \\ nB + 1) byteAt: 2. - a2 := (state at: (j + shiftOffset2) \\ nB + 1) byteAt: 3. - a3 := (state at: (j + shiftOffset3) \\ nB + 1) byteAt: 4. - result := (T0 at: a0+1) copy. - result bitXor: (T1 at: a1+1). - result bitXor: (T2 at: a2+1). - result bitXor: (T3 at: a3+1). - newState at: j+1 put: result]. - - "add round key" - start := roundNumber * nB. - 1 to: nB do: [:k | - state at: k put: ((newState at: k) bitXor: (expandedKey at: start + k))] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/setSystem.st b/source/Cryptography.package/Rijndael.class/instance/setSystem.st deleted file mode 100644 index e6211c9..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/setSystem.st +++ /dev/null @@ -1,6 +0,0 @@ -setup -setSystem - self calculateNumberOfRounds. - self calculateShiftOffsets. - - \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/stateFromBytes..st b/source/Cryptography.package/Rijndael.class/instance/stateFromBytes..st deleted file mode 100644 index bd71f76..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/stateFromBytes..st +++ /dev/null @@ -1,3 +0,0 @@ -setup -stateFromBytes: aByteArray - ^ self stateFromBytes: aByteArray columns: nB diff --git a/source/Cryptography.package/Rijndael.class/instance/stateFromBytes.columns..st b/source/Cryptography.package/Rijndael.class/instance/stateFromBytes.columns..st deleted file mode 100644 index 06acfc3..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/stateFromBytes.columns..st +++ /dev/null @@ -1,4 +0,0 @@ -setup -stateFromBytes: aByteArray columns: numberOfColumns - aByteArray size = (4 * numberOfColumns) ifFalse: [^ self error: 'wrong block size']. - ^ (1 to: numberOfColumns) collect: [:k | ThirtyTwoBitRegister loadFrom: aByteArray at: (k-1)*4 + 1] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/instance/storeState.into..st b/source/Cryptography.package/Rijndael.class/instance/storeState.into..st deleted file mode 100644 index a9da394..0000000 --- a/source/Cryptography.package/Rijndael.class/instance/storeState.into..st +++ /dev/null @@ -1,3 +0,0 @@ -setup -storeState: anArray into: aByteArray - anArray withIndexDo: [ :register :k | register storeInto: aByteArray at: (k-1)*4 + 1] \ No newline at end of file diff --git a/source/Cryptography.package/Rijndael.class/properties.json b/source/Cryptography.package/Rijndael.class/properties.json deleted file mode 100644 index d6d4dd9..0000000 --- a/source/Cryptography.package/Rijndael.class/properties.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipher", - "category" : "Cryptography-Rijndael", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "InvT0", - "InvT1", - "InvT2", - "InvT3", - "LogInverseTable", - "LogTable", - "RoundConstant", - "SubByte", - "SubByteInverse", - "T0", - "T1", - "T2", - "T3" - ], - "instvars" : [ - "nB", - "nK", - "nR", - "shiftOffset1", - "shiftOffset2", - "shiftOffset3", - "expandedKey", - "eqExpandedKey", - "state" - ], - "name" : "Rijndael", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/SHA1.extension/class/oidString.st b/source/Cryptography.package/SHA1.extension/class/oidString.st deleted file mode 100644 index a044d25..0000000 --- a/source/Cryptography.package/SHA1.extension/class/oidString.st +++ /dev/null @@ -1,4 +0,0 @@ -*Cryptography -oidString - - ^ '1.3.14.3.2.26'. diff --git a/source/Cryptography.package/SHA1.extension/properties.json b/source/Cryptography.package/SHA1.extension/properties.json deleted file mode 100644 index e324ae0..0000000 --- a/source/Cryptography.package/SHA1.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "SHA1" -} \ No newline at end of file diff --git a/source/Cryptography.package/SHA256.extension/class/isPluginAvailable.st b/source/Cryptography.package/SHA256.extension/class/isPluginAvailable.st deleted file mode 100644 index fcf6b8a..0000000 --- a/source/Cryptography.package/SHA256.extension/class/isPluginAvailable.st +++ /dev/null @@ -1,5 +0,0 @@ -*Cryptography -isPluginAvailable - - - ^false \ No newline at end of file diff --git a/source/Cryptography.package/SHA256.extension/class/new.st b/source/Cryptography.package/SHA256.extension/class/new.st deleted file mode 100644 index 45202bc..0000000 --- a/source/Cryptography.package/SHA256.extension/class/new.st +++ /dev/null @@ -1,6 +0,0 @@ -*Cryptography -new - - self isPluginAvailable - ifTrue: [ ^SHA256WithPrimitive basicNew ] - ifFalse: [ ^SHA256NonPrimitive basicNew ] \ No newline at end of file diff --git a/source/Cryptography.package/SHA256.extension/class/oidString.st b/source/Cryptography.package/SHA256.extension/class/oidString.st deleted file mode 100644 index 13dbc24..0000000 --- a/source/Cryptography.package/SHA256.extension/class/oidString.st +++ /dev/null @@ -1,4 +0,0 @@ -*Cryptography -oidString - - ^ '2.16.840.1.101.3.4.2.2'. diff --git a/source/Cryptography.package/SHA256.extension/properties.json b/source/Cryptography.package/SHA256.extension/properties.json deleted file mode 100644 index 4b111ed..0000000 --- a/source/Cryptography.package/SHA256.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "SHA256" -} \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/README.md b/source/Cryptography.package/SHA256NonPrimitive.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h0.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h0.st deleted file mode 100644 index c754166..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h0.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h0 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16r6A09E667 \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h1.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h1.st deleted file mode 100644 index 1e9cf2a..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h1.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h1 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16rBB67AE85 \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h2.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h2.st deleted file mode 100644 index 0ba5fba..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h2.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h2 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16r3C6EF372 \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h3.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h3.st deleted file mode 100644 index 116841c..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h3.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h3 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16rA54FF53A \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h4.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h4.st deleted file mode 100644 index 0077005..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h4.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h4 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16r510E527F \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h5.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h5.st deleted file mode 100644 index 711a65e..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h5.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h5 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16r9B05688C \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h6.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h6.st deleted file mode 100644 index 26b003f..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h6.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h6 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16r1F83D9AB \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/h7.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/h7.st deleted file mode 100644 index abca12c..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/h7.st +++ /dev/null @@ -1,5 +0,0 @@ -constants -h7 - "2 raisedTo: 32 times the square root of the first 8 primes 2..19" - "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" - ^16r5BE0CD19 \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/class/roundConstants.st b/source/Cryptography.package/SHA256NonPrimitive.class/class/roundConstants.st deleted file mode 100644 index dc46597..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/class/roundConstants.st +++ /dev/null @@ -1,6 +0,0 @@ -constants -roundConstants - "2 raisedTo: 32 times the cube root of the first 64 primes 2..311" - "(Integer primesUpTo: 311) collect: [:x | ((x raisedTo: 1/3) * (2.0 raisedTo: 32)) truncated hex] \\ 32 bits" - ^#(16r428A2F98 16r71374491 16rB5C0FBCF 16rE9B5DBA5 16r3956C25B 16r59F111F1 16r923F82A4 16rAB1C5ED5 16rD807AA98 16r12835B01 16r243185BE 16r550C7DC3 16r72BE5D74 16r80DEB1FE 16r9BDC06A7 16rC19BF174 16rE49B69C1 16rEFBE4786 16r0FC19DC6 16r240CA1CC 16r2DE92C6F 16r4A7484AA 16r5CB0A9DC 16r76F988DA 16r983E5152 16rA831C66D 16rB00327C8 16rBF597FC7 16rC6E00BF3 16rD5A79147 16r06CA6351 16r14292967 16r27B70A85 16r2E1B2138 16r4D2C6DFC 16r53380D13 16r650A7354 16r766A0ABB 16r81C2C92E 16r92722C85 16rA2BFE8A1 16rA81A664B 16rC24B8B70 16rC76C51A3 16rD192E819 16rD6990624 16rF40E3585 16r106AA070 16r19A4C116 16r1E376C08 16r2748774C 16r34B0BCB5 16r391C0CB3 16r4ED8AA4A 16r5B9CCA4F 16r682E6FF3 16r748F82EE 16r78A5636F 16r84C87814 16r8CC70208 16r90BEFFFA 16rA4506CEB 16rBEF9A3F7 16rC67178F2) - \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/instance/expandedBlock..st b/source/Cryptography.package/SHA256NonPrimitive.class/instance/expandedBlock..st deleted file mode 100644 index b3bb8f2..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/instance/expandedBlock..st +++ /dev/null @@ -1,24 +0,0 @@ -private -expandedBlock: aByteArray - "Convert the given 64 byte buffer into 64 32-bit registers and answer the result." - | out src | - out := Array new: 64. - src := 1. - 1 to: 16 do: [:i | - out at: i put: (ThirtyTwoBitRegister new loadFrom: aByteArray at: src). - src := src + 4]. - - 17 to: 64 do: [:i | | s0 s1 wi15 wi2 wi | - wi15 := (out at: i - 15) copy. - wi2 := (out at: i-2) copy. - s0 := wi15 copy. - s0 leftRotateBy: -7; - bitXor: (wi15 copy leftRotateBy: -18); - bitXor: (wi15 copy bitShift: -3). - s1 := wi2 copy. - s1 leftRotateBy: -17; - bitXor: (wi2 copy leftRotateBy: -19); - bitXor: (wi2 copy bitShift: -10). - wi := (out at: i-16) copy += s0 += (out at: i-7) copy += s1. - out at: i put: wi]. - ^ out diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/instance/finalHash.st b/source/Cryptography.package/SHA256NonPrimitive.class/instance/finalHash.st deleted file mode 100644 index 29be2ec..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/instance/finalHash.st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -finalHash - "Concatenate the final totals to build the 256-bit integer result." - - ^ ((totalA asInteger bitShift: 224) + - (totalB asInteger bitShift: 192) + - (totalC asInteger bitShift: 160) + - (totalD asInteger bitShift: 128) + - (totalE asInteger bitShift: 96) + - (totalF asInteger bitShift: 64) + - (totalG asInteger bitShift: 32) + - (totalH asInteger)) asByteArrayOfSize: 32. \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/instance/initialize.st b/source/Cryptography.package/SHA256NonPrimitive.class/instance/initialize.st deleted file mode 100644 index 864a1c3..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/instance/initialize.st +++ /dev/null @@ -1,12 +0,0 @@ -private -initialize - "Initialize totalA through totalH to their seed values." - - totalA := ThirtyTwoBitRegister new load: self class h0. - totalB := ThirtyTwoBitRegister new load: self class h1. - totalC := ThirtyTwoBitRegister new load: self class h2. - totalD := ThirtyTwoBitRegister new load: self class h3. - totalE := ThirtyTwoBitRegister new load: self class h4. - totalF := ThirtyTwoBitRegister new load: self class h5. - totalG := ThirtyTwoBitRegister new load: self class h6. - totalH := ThirtyTwoBitRegister new load: self class h7 diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/instance/processBuffer..st b/source/Cryptography.package/SHA256NonPrimitive.class/instance/processBuffer..st deleted file mode 100644 index 700c8c6..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/instance/processBuffer..st +++ /dev/null @@ -1,51 +0,0 @@ -private -processBuffer: aByteArray - "Process the given 64-byte buffer, accumulating the results in totalA through totalH." - - | a b c d e f g h w | - "initialize registers a through h from the current totals" - a := totalA copy. - b := totalB copy. - c := totalC copy. - d := totalD copy. - e := totalE copy. - f := totalF copy. - g := totalG copy. - h := totalH copy. - - "expand and process the buffer" - w := self expandedBlock: aByteArray. - 1 to: 64 do: [:i | | s0 maj t0 s1 ch t1 | - s0 := (a copy leftRotateBy: -2). - s0 bitXor: (a copy leftRotateBy: -13); - bitXor: (a copy leftRotateBy: -22). - maj := (a copy bitAnd: b). - maj bitOr: (b copy bitAnd: c); - bitOr: (c copy bitAnd: a). - t0 := s0 copy += maj. - s1 := (e copy leftRotateBy: -6). - s1 bitXor: (e copy leftRotateBy: -11); - bitXor: (e copy leftRotateBy: -25). - ch := (e copy bitAnd: f). - ch bitOr: ((e copy bitInvert) bitAnd: g). - t1 := h copy += s1 += ch += (ThirtyTwoBitRegister new load: (self class roundConstants at: i)) += (w at: i) copy. - h := g. - g := f. - f := e. - e := d copy += t1. - d := c. - c := b. - b := a. - a := t0 += t1. - "Transcript cr; show: i asString, String tab, a asString, String tab, b asString, String tab, c asString, String tab, d asString, String tab, e asString, String tab, f asString, String tab, g asString, String tab, h asString, String tab." - ]. - - "add a through h into total accumulators" - totalA += a. - totalB += b. - totalC += c. - totalD += d. - totalE += e. - totalF += f. - totalG += g. - totalH += h \ No newline at end of file diff --git a/source/Cryptography.package/SHA256NonPrimitive.class/properties.json b/source/Cryptography.package/SHA256NonPrimitive.class/properties.json deleted file mode 100644 index d5ad365..0000000 --- a/source/Cryptography.package/SHA256NonPrimitive.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "SHA256", - "category" : "Cryptography-SHA256", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "SHA256NonPrimitive", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/README.md b/source/Cryptography.package/SHA256WithPrimitive.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/class/blockSize.st b/source/Cryptography.package/SHA256WithPrimitive.class/class/blockSize.st deleted file mode 100644 index fd3a560..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ 64 \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/class/hashSize.st b/source/Cryptography.package/SHA256WithPrimitive.class/class/hashSize.st deleted file mode 100644 index f2636e0..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/class/hashSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashSize - ^ 32 \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/class/isPluginAvailable.st b/source/Cryptography.package/SHA256WithPrimitive.class/class/isPluginAvailable.st deleted file mode 100644 index fc30497..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/class/isPluginAvailable.st +++ /dev/null @@ -1,5 +0,0 @@ -as yet unclassified -isPluginAvailable - - - ^false \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/finalHash.st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/finalHash.st deleted file mode 100644 index b95fb90..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/finalHash.st +++ /dev/null @@ -1,7 +0,0 @@ -private -finalHash - - | hash | - hash := ByteArray new: state size. - self primFinalHash: hash fromState: state. - ^hash \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/initialize.st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/initialize.st deleted file mode 100644 index b5f978d..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -private -initialize - - state := ByteArray new: 32. - self primInitializeState: state \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/primFinalHash.fromState..st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/primFinalHash.fromState..st deleted file mode 100644 index 6313d9c..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/primFinalHash.fromState..st +++ /dev/null @@ -1,5 +0,0 @@ -private -primFinalHash: aByteArray fromState: s - - - self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/primInitializeState..st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/primInitializeState..st deleted file mode 100644 index 0f64731..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/primInitializeState..st +++ /dev/null @@ -1,5 +0,0 @@ -private -primInitializeState: s - - - self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/primProcessBuffer.withState..st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/primProcessBuffer.withState..st deleted file mode 100644 index bf78a00..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/primProcessBuffer.withState..st +++ /dev/null @@ -1,5 +0,0 @@ -private -primProcessBuffer: aByteArray withState: s - - - self primitiveFailed \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/processBuffer..st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/processBuffer..st deleted file mode 100644 index bc0f48e..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/processBuffer..st +++ /dev/null @@ -1,5 +0,0 @@ -private -processBuffer: aByteArray - - self primProcessBuffer: aByteArray withState: state. - \ No newline at end of file diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/instance/storeLength.in..st b/source/Cryptography.package/SHA256WithPrimitive.class/instance/storeLength.in..st deleted file mode 100644 index a9ca39c..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/instance/storeLength.in..st +++ /dev/null @@ -1,11 +0,0 @@ -private -storeLength: bitLength in: aByteArray - "Fill in the final 8 bytes of the given ByteArray with a 64-bit big-endian representation of the original message length in bits." - - | n i | - n := bitLength. - i := aByteArray size. - [n > 0] whileTrue: [ - aByteArray at: i put: (n bitAnd: 16rFF). - n := n bitShift: -8. - i := i - 1]. diff --git a/source/Cryptography.package/SHA256WithPrimitive.class/properties.json b/source/Cryptography.package/SHA256WithPrimitive.class/properties.json deleted file mode 100644 index b165d8e..0000000 --- a/source/Cryptography.package/SHA256WithPrimitive.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "SHA256", - "category" : "Cryptography-SHA256", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "state" - ], - "name" : "SHA256WithPrimitive", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/README.md b/source/Cryptography.package/SecureRandom.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/SecureRandom.class/class/fromUser.st b/source/Cryptography.package/SecureRandom.class/class/fromUser.st deleted file mode 100644 index 5a07fc5..0000000 --- a/source/Cryptography.package/SecureRandom.class/class/fromUser.st +++ /dev/null @@ -1,7 +0,0 @@ -instance creation -fromUser - "Ask the user to type a long random string and use the result to seed the secure random number generator." - - | string | - string := FillInTheBlank request: 'Enter a long random string to seed the random generator.'. - ^ self key: string \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/class/initialize.st b/source/Cryptography.package/SecureRandom.class/class/initialize.st deleted file mode 100644 index ff45be3..0000000 --- a/source/Cryptography.package/SecureRandom.class/class/initialize.st +++ /dev/null @@ -1,7 +0,0 @@ -class initialization -initialize - super initialize. - Smalltalk - addToStartUpList: self ; - addToShutDownList: self. - self startUp \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/class/key..st b/source/Cryptography.package/SecureRandom.class/class/key..st deleted file mode 100644 index 8a17e44..0000000 --- a/source/Cryptography.package/SecureRandom.class/class/key..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -key: aByteArray - ^ self basicNew key: aByteArray \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/class/new.st b/source/Cryptography.package/SecureRandom.class/class/new.st deleted file mode 100644 index 3377f86..0000000 --- a/source/Cryptography.package/SecureRandom.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^ self key: (RandomPool default next: 64) \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/destroy.st b/source/Cryptography.package/SecureRandom.class/instance/destroy.st deleted file mode 100644 index c4e38fd..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/destroy.st +++ /dev/null @@ -1,5 +0,0 @@ -initialization-release -destroy - key destroy. - key := 0. - seed := 0 \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/key..st b/source/Cryptography.package/SecureRandom.class/instance/key..st deleted file mode 100644 index f054c6e..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/key..st +++ /dev/null @@ -1,10 +0,0 @@ -initialization-release -key: aByteArray - | srcIndex | - key := LargePositiveInteger new: (aByteArray size min: 64). - srcIndex := 0. - key digitLength to: 1 by: -1 do: [:i | - key digitAt: i put: (aByteArray at: (srcIndex := srcIndex + 1)) asInteger]. - key highBit > 512 ifTrue: [key := key bitShift: key highBit - 512]. - key := key normalize. - seed := 16rEFCDAB8998BADCFE10325476C3D2E1F067452301 "initial seed" \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/next.into..st b/source/Cryptography.package/SecureRandom.class/instance/next.into..st deleted file mode 100644 index 6e7a089..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/next.into..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -next: anInteger into: anArray - 1 to: anInteger do: [:index | anArray at: index put: self next]. - ^ anArray \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/next.st b/source/Cryptography.package/SecureRandom.class/instance/next.st deleted file mode 100644 index 4f263f8..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/next.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -next - ^ self nextRandom160 bitAnd: 16rFF \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/nextBits..st b/source/Cryptography.package/SecureRandom.class/instance/nextBits..st deleted file mode 100644 index 3fd0990..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/nextBits..st +++ /dev/null @@ -1,9 +0,0 @@ -accessing -nextBits: bitLength - | answer extraBits | - answer := 0. - bitLength // 160 - timesRepeat: [answer := (answer bitShift: 160) bitOr: self nextRandom160]. - extraBits := bitLength \\ 160. - answer := (answer bitShift: extraBits) bitOr: (self nextRandom160 bitShift: extraBits - 160). - ^ answer \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/nextBytes..st b/source/Cryptography.package/SecureRandom.class/instance/nextBytes..st deleted file mode 100644 index a7dedca..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/nextBytes..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -nextBytes: byteLength - ^ (self nextBits: byteLength*8) asByteArray \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/nextBytesNonZero..st b/source/Cryptography.package/SecureRandom.class/instance/nextBytesNonZero..st deleted file mode 100644 index d76d0f2..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/nextBytesNonZero..st +++ /dev/null @@ -1,16 +0,0 @@ -accessing -nextBytesNonZero: byteLength - - | answer bytesWritten tempArray tempIndex | - answer := ByteArray new: byteLength. - bytesWritten := 0. - tempIndex := 20. - [bytesWritten < byteLength] - whileTrue: [ - tempIndex >= 20 ifTrue: [ - tempArray := self nextRandom160 asByteArrayOfSize: 20. - tempIndex := 1]. - (tempArray at: tempIndex) ~= 0 ifTrue: [ - answer at: (bytesWritten := bytesWritten + 1) put: (tempArray at: tempIndex)]. - tempIndex := tempIndex + 1]. - ^ answer \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/nextFrom.to..st b/source/Cryptography.package/SecureRandom.class/instance/nextFrom.to..st deleted file mode 100644 index 22eb74a..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/nextFrom.to..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -nextFrom: start to: end - "Answer a random integer between start and end." - | r | - r := self nextInt: end-start+1. - ^ r+start-1 \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/nextInt..st b/source/Cryptography.package/SecureRandom.class/instance/nextInt..st deleted file mode 100644 index ed9393c..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/nextInt..st +++ /dev/null @@ -1,10 +0,0 @@ -accessing -nextInt: anInteger - "Answer a random integer in the interval [1, anInteger]." - | r high | - anInteger strictlyPositive ifFalse: [ self error: 'Range must be positive' ]. - high := anInteger-1. - [ (r := self nextBits: anInteger highBit) - between: 0 - and: high ] whileFalse. - ^ r+1 \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/nextRandom160.st b/source/Cryptography.package/SecureRandom.class/instance/nextRandom160.st deleted file mode 100644 index cb0c2b9..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/nextRandom160.st +++ /dev/null @@ -1,11 +0,0 @@ -private -nextRandom160 - "Answer a newly generated 160-bit random number in the range [1..(2^160 - 1)]." - "Details: Try again in the extremely unlikely chance that zero is encountered." - - | result | - result := 0. - [result = 0] whileTrue: [ - result := SHA1 new hashInteger: key seed: seed. - key := key + result + 1]. - ^ result \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/instance/printOn..st b/source/Cryptography.package/SecureRandom.class/instance/printOn..st deleted file mode 100644 index b1dab2c..0000000 --- a/source/Cryptography.package/SecureRandom.class/instance/printOn..st +++ /dev/null @@ -1,5 +0,0 @@ -printing -printOn: aStream - aStream - nextPutAll: 'a ' ; - nextPutAll: self class name \ No newline at end of file diff --git a/source/Cryptography.package/SecureRandom.class/properties.json b/source/Cryptography.package/SecureRandom.class/properties.json deleted file mode 100644 index 04cfaad..0000000 --- a/source/Cryptography.package/SecureRandom.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "RandomGenerator", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "seed", - "key" - ], - "name" : "SecureRandom", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/README.md b/source/Cryptography.package/SmalltalkImageInstanceID.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/InstanceID..1.st b/source/Cryptography.package/SmalltalkImageInstanceID.class/class/InstanceID..1.st deleted file mode 100644 index 5a7d225..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/InstanceID..1.st +++ /dev/null @@ -1,4 +0,0 @@ -inquires -InstanceID - - ^nil \ No newline at end of file diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/LICENSE.st b/source/Cryptography.package/SmalltalkImageInstanceID.class/class/LICENSE.st deleted file mode 100644 index 6d825ba..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/LICENSE.st +++ /dev/null @@ -1,10 +0,0 @@ -LICENSE -LICENSE - "http://www.opensource.org/licenses/mit-license.php" -^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/initialize.st b/source/Cryptography.package/SmalltalkImageInstanceID.class/class/initialize.st deleted file mode 100644 index ff45be3..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/initialize.st +++ /dev/null @@ -1,7 +0,0 @@ -class initialization -initialize - super initialize. - Smalltalk - addToStartUpList: self ; - addToShutDownList: self. - self startUp \ No newline at end of file diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/instanceID..2.st b/source/Cryptography.package/SmalltalkImageInstanceID.class/class/instanceID..2.st deleted file mode 100644 index 70dc412..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/instanceID..2.st +++ /dev/null @@ -1,11 +0,0 @@ -inquires -instanceID - - ^InstanceID ifNil: [ - Transcript show: thisContext sender. - thisContext sender receiver = self ifTrue: [ - InstanceID := UUID new. - ] ifFalse: [ - InstanceID := nil - ]. - InstanceID]. \ No newline at end of file diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/shutDown.st b/source/Cryptography.package/SmalltalkImageInstanceID.class/class/shutDown.st deleted file mode 100644 index fe4dc9f..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/shutDown.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -shutDown - super shutDown. - InstanceID := nil. \ No newline at end of file diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/startUp.st b/source/Cryptography.package/SmalltalkImageInstanceID.class/class/startUp.st deleted file mode 100644 index 30c7aed..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/class/startUp.st +++ /dev/null @@ -1,5 +0,0 @@ -class initialization -startUp - super startUp. - InstanceID := nil. - self instanceID. \ No newline at end of file diff --git a/source/Cryptography.package/SmalltalkImageInstanceID.class/properties.json b/source/Cryptography.package/SmalltalkImageInstanceID.class/properties.json deleted file mode 100644 index ff4d24a..0000000 --- a/source/Cryptography.package/SmalltalkImageInstanceID.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "Cryptography-RandomAndPrime", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ - "InstanceID" - ], - "instvars" : [ ], - "name" : "SmalltalkImageInstanceID", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/SocketStream.extension/instance/peekInBufferForAll..st b/source/Cryptography.package/SocketStream.extension/instance/peekInBufferForAll..st deleted file mode 100644 index 464431f..0000000 --- a/source/Cryptography.package/SocketStream.extension/instance/peekInBufferForAll..st +++ /dev/null @@ -1,8 +0,0 @@ -*Cryptography-Core -peekInBufferForAll: aString - "Answer whether or not the inbuffer in the receiver - contains aString. If a match is made answer true. - We use findString:startingAt: to avoid copying." - self receiveAvailableData. - ^(inBuffer findString: aString) > 0 - \ No newline at end of file diff --git a/source/Cryptography.package/SocketStream.extension/properties.json b/source/Cryptography.package/SocketStream.extension/properties.json deleted file mode 100644 index 797e09e..0000000 --- a/source/Cryptography.package/SocketStream.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "SocketStream" -} \ No newline at end of file diff --git a/source/Cryptography.package/String.extension/instance/destroy.st b/source/Cryptography.package/String.extension/instance/destroy.st deleted file mode 100644 index cb18dcc..0000000 --- a/source/Cryptography.package/String.extension/instance/destroy.st +++ /dev/null @@ -1,9 +0,0 @@ -*cryptography -destroy - 1 - to: self size - do: - [ : n | - self - at: n - put: (Character value: 0) ] \ No newline at end of file diff --git a/source/Cryptography.package/String.extension/instance/padded.to.with..st b/source/Cryptography.package/String.extension/instance/padded.to.with..st deleted file mode 100644 index 7595d01..0000000 --- a/source/Cryptography.package/String.extension/instance/padded.to.with..st +++ /dev/null @@ -1,5 +0,0 @@ -*Cryptography -padded: directionSymbol to: length with: char - ^directionSymbol = #left - ifTrue: [ self padLeftTo: length with: char ] - ifFalse: [ self padRightTo: length with: char ] \ No newline at end of file diff --git a/source/Cryptography.package/String.extension/properties.json b/source/Cryptography.package/String.extension/properties.json deleted file mode 100644 index b20f2de..0000000 --- a/source/Cryptography.package/String.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "String" -} \ No newline at end of file diff --git a/source/Cryptography.package/ThirtyTwoBitRegister.extension/class/byte1.byte2.byte3.byte4..st b/source/Cryptography.package/ThirtyTwoBitRegister.extension/class/byte1.byte2.byte3.byte4..st deleted file mode 100644 index ee187e1..0000000 --- a/source/Cryptography.package/ThirtyTwoBitRegister.extension/class/byte1.byte2.byte3.byte4..st +++ /dev/null @@ -1,3 +0,0 @@ -*cryptography-core-instance creation -byte1: hi1 byte2: hi2 byte3: low1 byte4: low2 - ^ super new byte1: hi1 byte2: hi2 byte3: low1 byte4: low2 \ No newline at end of file diff --git a/source/Cryptography.package/ThirtyTwoBitRegister.extension/class/loadFrom.at..st b/source/Cryptography.package/ThirtyTwoBitRegister.extension/class/loadFrom.at..st deleted file mode 100644 index a39cfca..0000000 --- a/source/Cryptography.package/ThirtyTwoBitRegister.extension/class/loadFrom.at..st +++ /dev/null @@ -1,3 +0,0 @@ -*cryptography-core-instance creation -loadFrom: aByteArray at: index - ^ super new loadFrom: aByteArray at: index \ No newline at end of file diff --git a/source/Cryptography.package/ThirtyTwoBitRegister.extension/properties.json b/source/Cryptography.package/ThirtyTwoBitRegister.extension/properties.json deleted file mode 100644 index fa24494..0000000 --- a/source/Cryptography.package/ThirtyTwoBitRegister.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "ThirtyTwoBitRegister" -} \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/README.md b/source/Cryptography.package/TripleDES.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/TripleDES.class/class/blockSize.st b/source/Cryptography.package/TripleDES.class/class/blockSize.st deleted file mode 100644 index 1d23ac1..0000000 --- a/source/Cryptography.package/TripleDES.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ 8 \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/class/keySize.st b/source/Cryptography.package/TripleDES.class/class/keySize.st deleted file mode 100644 index 75df6c3..0000000 --- a/source/Cryptography.package/TripleDES.class/class/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ 8*3 \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/class/new.st b/source/Cryptography.package/TripleDES.class/class/new.st deleted file mode 100644 index 777662d..0000000 --- a/source/Cryptography.package/TripleDES.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^ super new initialize \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/instance/decryptBlock..st b/source/Cryptography.package/TripleDES.class/instance/decryptBlock..st deleted file mode 100644 index 32fbbf0..0000000 --- a/source/Cryptography.package/TripleDES.class/instance/decryptBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decryptBlock: plainText - des3 decryptBlock: plainText. - des2 encryptBlock: plainText. - des1 decryptBlock: plainText \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/instance/encryptBlock..st b/source/Cryptography.package/TripleDES.class/instance/encryptBlock..st deleted file mode 100644 index 2cf65e7..0000000 --- a/source/Cryptography.package/TripleDES.class/instance/encryptBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptBlock: plainText - des1 encryptBlock: plainText. - des2 decryptBlock: plainText. - des3 encryptBlock: plainText \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/instance/initialize.st b/source/Cryptography.package/TripleDES.class/instance/initialize.st deleted file mode 100644 index 52cdb7e..0000000 --- a/source/Cryptography.package/TripleDES.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -initialize - des1 := DES new. - des2 := DES new. - des3 := DES new \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/instance/key..st b/source/Cryptography.package/TripleDES.class/instance/key..st deleted file mode 100644 index 396b3a4..0000000 --- a/source/Cryptography.package/TripleDES.class/instance/key..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -key: aByteArray - des1 key: (aByteArray copyFrom: 1 to: 8). - des2 key: (aByteArray copyFrom: 9 to: 16). - des3 key: (aByteArray copyFrom: 17 to: 24) \ No newline at end of file diff --git a/source/Cryptography.package/TripleDES.class/properties.json b/source/Cryptography.package/TripleDES.class/properties.json deleted file mode 100644 index 0562fc9..0000000 --- a/source/Cryptography.package/TripleDES.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "BlockCipher", - "category" : "Cryptography-DES", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "des1", - "des2", - "des3" - ], - "name" : "TripleDES", - "type" : "normal" -} \ No newline at end of file diff --git a/source/Cryptography.package/monticello.meta/categories.st b/source/Cryptography.package/monticello.meta/categories.st deleted file mode 100644 index 89db941..0000000 --- a/source/Cryptography.package/monticello.meta/categories.st +++ /dev/null @@ -1,22 +0,0 @@ -SystemOrganization addCategory: #Cryptography! -SystemOrganization addCategory: #'Cryptography-ARC2'! -SystemOrganization addCategory: #'Cryptography-ASN1'! -SystemOrganization addCategory: #'Cryptography-ASN1-DefinitionModel'! -SystemOrganization addCategory: #'Cryptography-ASN1-Objects'! -SystemOrganization addCategory: #'Cryptography-ASN1-Types'! -SystemOrganization addCategory: #'Cryptography-Core'! -SystemOrganization addCategory: #'Cryptography-DES'! -SystemOrganization addCategory: #'Cryptography-DSA'! -SystemOrganization addCategory: #'Cryptography-ElGamal'! -SystemOrganization addCategory: #'Cryptography-MD4'! -SystemOrganization addCategory: #'Cryptography-MD5'! -SystemOrganization addCategory: #'Cryptography-PKCS12'! -SystemOrganization addCategory: #'Cryptography-RC4'! -SystemOrganization addCategory: #'Cryptography-RSA'! -SystemOrganization addCategory: #'Cryptography-RandomAndPrime'! -SystemOrganization addCategory: #'Cryptography-Rijndael'! -SystemOrganization addCategory: #'Cryptography-SHA256'! -SystemOrganization addCategory: #'Cryptography-Tests'! -SystemOrganization addCategory: #'Cryptography-X509'! -SystemOrganization addCategory: #'Cryptography-X509-Extensions'! -SystemOrganization addCategory: #'Cryptography-X509-Readers'! diff --git a/source/Cryptography.package/monticello.meta/initializers.st b/source/Cryptography.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/Cryptography.package/monticello.meta/package b/source/Cryptography.package/monticello.meta/package deleted file mode 100644 index aec108a..0000000 --- a/source/Cryptography.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'Cryptography') \ No newline at end of file diff --git a/source/Cryptography.package/properties.json b/source/Cryptography.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/Cryptography.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/Cryptography/ARC2.class.st b/source/Cryptography/ARC2.class.st new file mode 100644 index 0000000..506454b --- /dev/null +++ b/source/Cryptography/ARC2.class.st @@ -0,0 +1,1087 @@ +" +Network Working Group R. Rivest +Request for Comments: 2268 MIT Laboratory for Computer Science +Category: Informational and RSA Data Security, Inc. + March 1998 + + + +A Description of the RC2(r) Encryption Algorithm + + +Status of this Memo + + This memo provides information for the Internet community. It does + not specify an Internet standard of any kind. Distribution of this + memo is unlimited. + +Copyright Notice + + Copyright (C) The Internet Society (1998). All Rights Reserved. + +1. Introduction + + + This memo is an RSA Laboratories Technical Note. It is meant for + informational use by the Internet community. + + This memo describes a conventional (secret-key) block encryption + algorithm, called RC2, which may be considered as a proposal for a + DES replacement. The input and output block sizes are 64 bits each. + The key size is variable, from one byte up to 128 bytes, although the + current implementation uses eight bytes. + + The algorithm is designed to be easy to implement on 16-bit + microprocessors. On an IBM AT, the encryption runs about twice as + fast as DES (assuming that key expansion has been done). + +1.1 Algorithm description + + + We use the term ""word"" to denote a 16-bit quantity. The symbol + will + denote twos-complement addition. The symbol & will denote the bitwise + ""and"" operation. The term XOR will denote the bitwise ""exclusive-or"" + operation. The symbol ~ will denote bitwise complement. The symbol ^ + will denote the exponentiation operation. The term MOD will denote + the modulo operation. + + There are three separate algorithms involved: + + Key expansion. This takes a (variable-length) input key and + produces an expanded key consisting of 64 words K[0],...,K[63]. + + + + + +Rivest Informational [Page 1] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + Encryption. This takes a 64-bit input quantity stored in words + R[0], ..., R[3] and encrypts it ""in place"" (the result is left in + R[0], ..., R[3]). + + Decryption. The inverse operation to encryption. + +2. Key expansion + + + Since we will be dealing with eight-bit byte operations as well as + 16-bit word operations, we will use two alternative notations + + for referring to the key buffer: + + For word operations, we will refer to the positions of the + buffer as K[0], ..., K[63]; each K[i] is a 16-bit word. + + For byte operations, we will refer to the key buffer as + L[0], ..., L[127]; each L[i] is an eight-bit byte. + + These are alternative views of the same data buffer. At all times it + will be true that + + K[i] = L[2*i] + 256*L[2*i+1]. + + (Note that the low-order byte of each K word is given before the + high-order byte.) + + We will assume that exactly T bytes of key are supplied, for some T + in the range 1 <= T <= 128. (Our current implementation uses T = 8.) + However, regardless of T, the algorithm has a maximum effective key + length in bits, denoted T1. That is, the search space is 2^(8*T), or + 2^T1, whichever is smaller. + + The purpose of the key-expansion algorithm is to modify the key + buffer so that each bit of the expanded key depends in a complicated + way on every bit of the supplied input key. + + The key expansion algorithm begins by placing the supplied T-byte key + into bytes L[0], ..., L[T-1] of the key buffer. + + The key expansion algorithm then computes the effective key length in + bytes T8 and a mask TM based on the effective key length in bits T1. + It uses the following operations: + + T8 = (T1+7)/8; + TM = 255 MOD 2^(8 + T1 - 8*T8); + + Thus TM has its 8 - (8*T8 - T1) least significant bits set. + + + +Rivest Informational [Page 2] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + For example, with an effective key length of 64 bits, T1 = 64, T8 = 8 + and TM = 0xff. With an effective key length of 63 bits, T1 = 63, T8 + = 8 and TM = 0x7f. + + Here PITABLE[0], ..., PITABLE[255] is an array of ""random"" bytes + based on the digits of PI = 3.14159... . More precisely, the array + PITABLE is a random permutation of the values 0, ..., 255. Here is + the PITABLE in hexadecimal notation: + + 0 1 2 3 4 5 6 7 8 9 a b c d e f + 00: d9 78 f9 c4 19 dd b5 ed 28 e9 fd 79 4a a0 d8 9d + 10: c6 7e 37 83 2b 76 53 8e 62 4c 64 88 44 8b fb a2 + 20: 17 9a 59 f5 87 b3 4f 13 61 45 6d 8d 09 81 7d 32 + 30: bd 8f 40 eb 86 b7 7b 0b f0 95 21 22 5c 6b 4e 82 + 40: 54 d6 65 93 ce 60 b2 1c 73 56 c0 14 a7 8c f1 dc + 50: 12 75 ca 1f 3b be e4 d1 42 3d d4 30 a3 3c b6 26 + 60: 6f bf 0e da 46 69 07 57 27 f2 1d 9b bc 94 43 03 + 70: f8 11 c7 f6 90 ef 3e e7 06 c3 d5 2f c8 66 1e d7 + 80: 08 e8 ea de 80 52 ee f7 84 aa 72 ac 35 4d 6a 2a + 90: 96 1a d2 71 5a 15 49 74 4b 9f d0 5e 04 18 a4 ec + a0: c2 e0 41 6e 0f 51 cb cc 24 91 af 50 a1 f4 70 39 + b0: 99 7c 3a 85 23 b8 b4 7a fc 02 36 5b 25 55 97 31 + c0: 2d 5d fa 98 e3 8a 92 ae 05 df 29 10 67 6c ba c9 + d0: d3 00 e6 cf e1 9e a8 2c 63 16 01 3f 58 e2 89 a9 + e0: 0d 38 34 1b ab 33 ff b0 bb 48 0c 5f b9 b1 cd 2e + f0: c5 f3 db 47 e5 a5 9c 77 0a a6 20 68 fe 7f c1 ad + + The key expansion operation consists of the following two loops and + intermediate step: + + for i = T, T+1, ..., 127 do + L[i] = PITABLE[L[i-1] + L[i-T]]; + + L[128-T8] = PITABLE[L[128-T8] & TM]; + + for i = 127-T8, ..., 0 do + L[i] = PITABLE[L[i+1] XOR L[i+T8]]; + + (In the first loop, the addition of L[i-1] and L[i-T] is performed + modulo 256.) + + The ""effective key"" consists of the values L[128-T8],..., L[127]. + The intermediate step's bitwise ""and"" operation reduces the search + space for L[128-T8] so that the effective number of key bits is T1. + The expanded key depends only on the effective key bits, regardless + + + + + + +Rivest Informational [Page 3] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + of the supplied key K. Since the expanded key is not itself modified + during encryption or decryption, as a pragmatic matter one can expand + the key just once when encrypting or decrypting a large block of + data. + +3. Encryption algorithm + + + The encryption operation is defined in terms of primitive ""mix"" and + ""mash"" operations. + + Here the expression ""x rol k"" denotes the 16-bit word x rotated left + by k bits, with the bits shifted out the top end entering the bottom + end. + +3.1 Mix up R[i] + + + The primitive ""Mix up R[i]"" operation is defined as follows, where + s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices + of the array R are always to be considered ""modulo 4,"" so that R[i-1] + refers to R[3] if i is 0 (these values are + + ""wrapped around"" so that R always has a subscript in the range 0 to 3 + inclusive): + + R[i] = R[i] + K[j] + (R[i-1] & R[i-2]) + ((~R[i-1]) & R[i-3]); + j = j + 1; + R[i] = R[i] rol s[i]; + + In words: The next key word K[j] is added to R[i], and j is advanced. + Then R[i-1] is used to create a ""composite"" word which is added to + R[i]. The composite word is identical with R[i-2] in those positions + where R[i-1] is one, and identical to R[i-3] in those positions where + R[i-1] is zero. Then R[i] is rotated left by s[i] bits (bits rotated + out the left end of R[i] are brought back in at the right). Here j is + a ""global"" variable so that K[j] is always the first key word in the + expanded key which has not yet been used in a ""mix"" operation. + +3.2 Mixing round + + + A ""mixing round"" consists of the following operations: + + Mix up R[0] + Mix up R[1] + Mix up R[2] + Mix up R[3] + + + + + + +Rivest Informational [Page 4] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + +3.3 Mash R[i] + + + The primitive ""Mash R[i]"" operation is defined as follows (using the + previous conventions regarding subscripts for R): + + R[i] = R[i] + K[R[i-1] & 63]; + + In words: R[i] is ""mashed"" by adding to it one of the words of the + expanded key. The key word to be used is determined by looking at the + low-order six bits of R[i-1], and using that as an index into the key + array K. + +3.4 Mashing round + + + A ""mashing round"" consists of: + + Mash R[0] + Mash R[1] + Mash R[2] + Mash R[3] + +3.5 Encryption operation + + + The entire encryption operation can now be described as follows. Here + j is a global integer variable which is affected by the mixing + operations. + + 1. Initialize words R[0], ..., R[3] to contain the + 64-bit input value. + + 2. Expand the key, so that words K[0], ..., K[63] become + defined. + + 3. Initialize j to zero. + + 4. Perform five mixing rounds. + + 5. Perform one mashing round. + + 6. Perform six mixing rounds. + + 7. Perform one mashing round. + + 8. Perform five mixing rounds. + + Note that each mixing round uses four key words, and that there are + 16 mixing rounds altogether, so that each key word is used exactly + + + + +Rivest Informational [Page 5] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + once in a mixing round. The mashing rounds will refer to up to eight + of the key words in a data-dependent manner. (There may be + repetitions, and the actual set of words referred to will vary from + encryption to encryption.) + +4. Decryption algorithm + + + The decryption operation is defined in terms of primitive operations + that undo the ""mix"" and ""mash"" operations of the encryption + algorithm. They are named ""r-mix"" and ""r-mash"" (r- denotes the + reverse operation). + + Here the expression ""x ror k"" denotes the 16-bit word x rotated right + by k bits, with the bits shifted out the bottom end entering the top + end. + +4.1 R-Mix up R[i] + + + The primitive ""R-Mix up R[i]"" operation is defined as follows, where + s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices + of the array R are always to be considered ""modulo 4,"" so that R[i-1] + refers to R[3] if i is 0 (these values are ""wrapped around"" so that R + always has a subscript in the range 0 to 3 inclusive): + + R[i] = R[i] ror s[i]; + R[i] = R[i] - K[j] - (R[i-1] & R[i-2]) - ((~R[i-1]) & R[i-3]); + j = j - 1; + + In words: R[i] is rotated right by s[i] bits (bits rotated out the + right end of R[i] are brought back in at the left). Here j is a + ""global"" variable so that K[j] is always the key word with greatest + index in the expanded key which has not yet been used in a ""r-mix"" + operation. The key word K[j] is subtracted from R[i], and j is + decremented. R[i-1] is used to create a ""composite"" word which is + subtracted from R[i]. The composite word is identical with R[i-2] in + those positions where R[i-1] is one, and identical to R[i-3] in those + positions where R[i-1] is zero. + +4.2 R-Mixing round + + + An ""r-mixing round"" consists of the following operations: + + R-Mix up R[3] + R-Mix up R[2] + R-Mix up R[1] + R-Mix up R[0] + + + + + +Rivest Informational [Page 6] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + +4.3 R-Mash R[i] + + + The primitive ""R-Mash R[i]"" operation is defined as follows (using + the previous conventions regarding subscripts for R): + + R[i] = R[i] - K[R[i-1] & 63]; + + In words: R[i] is ""r-mashed"" by subtracting from it one of the words + of the expanded key. The key word to be used is determined by looking + at the low-order six bits of R[i-1], and using that as an index into + the key array K. + +4.4 R-Mashing round + + + An ""r-mashing round"" consists of: + + R-Mash R[3] + R-Mash R[2] + R-Mash R[1] + R-Mash R[0] + +4.5 Decryption operation + + + The entire decryption operation can now be described as follows. + Here j is a global integer variable which is affected by the mixing + operations. + + 1. Initialize words R[0], ..., R[3] to contain the 64-bit + ciphertext value. + + 2. Expand the key, so that words K[0], ..., K[63] become + defined. + + 3. Initialize j to 63. + + 4. Perform five r-mixing rounds. + + 5. Perform one r-mashing round. + + 6. Perform six r-mixing rounds. + + 7. Perform one r-mashing round. + + 8. Perform five r-mixing rounds. + +5. Test vectors + + + Test vectors for encryption with RC2 are provided below. + + + +Rivest Informational [Page 7] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + All quantities are given in hexadecimal notation. + + Key length (bytes) = 8 + Effective key length (bits) = 63 + Key = 00000000 00000000 + Plaintext = 00000000 00000000 + Ciphertext = ebb773f9 93278eff + + Key length (bytes) = 8 + Effective key length (bits) = 64 + Key = ffffffff ffffffff + Plaintext = ffffffff ffffffff + Ciphertext = 278b27e4 2e2f0d49 + + Key length (bytes) = 8 + Effective key length (bits) = 64 + Key = 30000000 00000000 + Plaintext = 10000000 00000001 + Ciphertext = 30649edf 9be7d2c2 + + Key length (bytes) = 1 + Effective key length (bits) = 64 + Key = 88 + Plaintext = 00000000 00000000 + Ciphertext = 61a8a244 adacccf0 + + Key length (bytes) = 7 + Effective key length (bits) = 64 + Key = 88bca90e 90875a + Plaintext = 00000000 00000000 + Ciphertext = 6ccf4308 974c267f + + Key length (bytes) = 16 + Effective key length (bits) = 64 + Key = 88bca90e 90875a7f 0f79c384 627bafb2 + Plaintext = 00000000 00000000 + Ciphertext = 1a807d27 2bbe5db1 + + Key length (bytes) = 16 + Effective key length (bits) = 128 + Key = 88bca90e 90875a7f 0f79c384 627bafb2 + Plaintext = 00000000 00000000 + Ciphertext = 2269552a b0f85ca6 + + Key length (bytes) = 33 + Effective key length (bits) = 129 + Key = 88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 + c42fceb0 be255daf 1e + + + +Rivest Informational [Page 8] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + Plaintext = 00000000 00000000 + Ciphertext = 5b78d3a4 3dfff1f1 + +6. RC2 Algorithm Object Identifier + + + The Object Identifier for RC2 in cipher block chaining mode is + + rc2CBC OBJECT IDENTIFIER + ::= {iso(1) member-body(2) US(840) rsadsi(113549) + encryptionAlgorithm(3) 2} + + RC2-CBC takes parameters + + RC2-CBCParameter ::= CHOICE { + iv IV, + params SEQUENCE { + version RC2Version, + iv IV + } + } + + where + + IV ::= OCTET STRING -- 8 octets + RC2Version ::= INTEGER -- 1-1024 + + RC2 in CBC mode has two parameters: an 8-byte initialization vector + (IV) and a version number in the range 1-1024 which specifies in a + roundabout manner the number of effective key bits to be used for the + RC2 encryption/decryption. + + The correspondence between effective key bits and version number is + as follows: + + 1. If the number EKB of effective key bits is in the range 1-255, + then the version number is given by Table[EKB], where the 256-byte + translation table Table[] is specified below. Table[] specifies a + permutation on the numbers 0-255; note that it is not the same + table that appears in the key expansion phase of RC2. + + 2. If the number EKB of effective key bits is in the range + 256-1024, then the version number is simply EKB. + + The default number of effective key bits for RC2 is 32. If RC2-CBC + is being performed with 32 effective key bits, the parameters + should be supplied as a simple IV, rather than as a SEQUENCE + containing a version and an IV. + + + + +Rivest Informational [Page 9] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + + 0 1 2 3 4 5 6 7 8 9 a b c d e f + + 00: bd 56 ea f2 a2 f1 ac 2a b0 93 d1 9c 1b 33 fd d0 + 10: 30 04 b6 dc 7d df 32 4b f7 cb 45 9b 31 bb 21 5a + 20: 41 9f e1 d9 4a 4d 9e da a0 68 2c c3 27 5f 80 36 + 30: 3e ee fb 95 1a fe ce a8 34 a9 13 f0 a6 3f d8 0c + 40: 78 24 af 23 52 c1 67 17 f5 66 90 e7 e8 07 b8 60 + 50: 48 e6 1e 53 f3 92 a4 72 8c 08 15 6e 86 00 84 fa + 60: f4 7f 8a 42 19 f6 db cd 14 8d 50 12 ba 3c 06 4e + 70: ec b3 35 11 a1 88 8e 2b 94 99 b7 71 74 d3 e4 bf + 80: 3a de 96 0e bc 0a ed 77 fc 37 6b 03 79 89 62 c6 + 90: d7 c0 d2 7c 6a 8b 22 a3 5b 05 5d 02 75 d5 61 e3 + a0: 18 8f 55 51 ad 1f 0b 5e 85 e5 c2 57 63 ca 3d 6c + b0: b4 c5 cc 70 b2 91 59 0d 47 20 c8 4f 58 e0 01 e2 + c0: 16 38 c4 6f 3b 0f 65 46 be 7e 2d 7b 82 f9 40 b5 + d0: 1d 73 f8 eb 26 c7 87 97 25 54 b1 28 aa 98 9d a5 + e0: 64 6d 7a d4 10 81 44 ef 49 d6 ae 2e dd 76 5c 2f + f0: a7 1c c9 09 69 9a 83 cf 29 39 b9 e9 4c ff 43 ab + +A. Intellectual Property Notice + + RC2 is a registered trademark of RSA Data Security, Inc. RSA's + copyrighted RC2 software is available under license from RSA Data + Security, Inc. + +B. Author's Address + + Ron Rivest + RSA Laboratories + 100 Marine Parkway, #500 + Redwood City, CA 94065 USA + + Phone: (650) 595-7703 + EMail: rsa-labs@rsa.com + + + + + + + + + + + + + + + + + +Rivest Informational [Page 10] + +RFC 2268 RC2(r) Encryption Algorithm March 1998 + + +C. Full Copyright Statement + + Copyright (C) The Internet Society (1998). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + ""AS IS"" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + + + + + + + + + + + + + + + + + + + + + + + +Rivest Informational [Page 11] +" +Class { + #name : #ARC2, + #superclass : #BlockCipher, + #instVars : [ + 'T1', + 'T8', + 'TM', + 'keyHolder', + 'j' + ], + #classVars : [ + 'PITABLE' + ], + #category : #'Cryptography-ARC2' +} + +{ #category : #LICENSE } +ARC2 class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #constants } +ARC2 class >> PITABLE [ + + PITABLE isNil ifTrue: [ + PITABLE := #(217 120 249 196 25 221 181 237 40 233 253 121 74 160 216 157 198 126 55 131 43 118 83 142 98 76 100 136 68 139 251 162 23 154 89 245 135 179 79 19 97 69 109 141 9 129 125 50 189 143 64 235 134 183 123 11 240 149 33 34 92 107 78 130 84 214 101 147 206 96 178 28 115 86 192 20 167 140 241 220 18 117 202 31 59 190 228 209 66 61 212 48 163 60 182 38 111 191 14 218 70 105 7 87 39 242 29 155 188 148 67 3 248 17 199 246 144 239 62 231 6 195 213 47 200 102 30 215 8 232 234 222 128 82 238 247 132 170 114 172 53 77 106 42 150 26 210 113 90 21 73 116 75 159 208 94 4 24 164 236 194 224 65 110 15 81 203 204 36 145 175 80 161 244 112 57 153 124 58 133 35 184 180 122 252 2 54 91 37 85 151 49 45 93 250 152 227 138 146 174 5 223 41 16 103 108 186 201 211 0 230 207 225 158 168 44 99 22 1 63 88 226 137 169 13 56 52 27 171 51 255 176 187 72 12 95 185 177 205 46 197 243 219 71 229 165 156 119 10 166 32 104 254 127 193 173) asByteArray]. + ^ PITABLE +] + +{ #category : #'instance creation' } +ARC2 class >> key: aByteArray [ + ^ self new key: aByteArray; + T1: 128; + setKeySize; + yourself +] + +{ #category : #'instance creation' } +ARC2 class >> key: aByteArray effectiveKeyLength: aKeyStrength [ + ^ self new key: aByteArray; + T1: aKeyStrength; + setKeySize; + yourself +] + +{ #category : #support } +ARC2 class >> rotate16BitWord: a16BitWord leftBy: bitCount [ + | s1 s2 aBitCount | + aBitCount := bitCount \\ 16. + aBitCount < 0 ifTrue: [aBitCount := aBitCount + 16]. + s1 := aBitCount. + s2 := s1 - 16. + ^((a16BitWord bitShift: s1) bitAnd: 16rFFFF) bitOr: (a16BitWord bitShift: s2). +] + +{ #category : #accessing } +ARC2 >> T1 [ + "Answer the value of T1" + + ^ T1 +] + +{ #category : #accessing } +ARC2 >> T1: anObject [ + "Set the value of T1" + + T1 := anObject +] + +{ #category : #accessing } +ARC2 >> T8 [ + "Answer the value of T8" + + ^ T8 +] + +{ #category : #accessing } +ARC2 >> T8: anObject [ + "Set the value of T8" + + T8 := anObject +] + +{ #category : #accessing } +ARC2 >> TM [ + "Answer the value of TM" + + ^ TM +] + +{ #category : #accessing } +ARC2 >> TM: anObject [ + "Set the value of TM" + + TM := anObject +] + +{ #category : #'initialize-release' } +ARC2 >> blockSize [ + ^8 +] + +{ #category : #'encryption/decryption' } +ARC2 >> decryptBlock: cipherText [ + | result | + result := self decryptBlock: cipherText key: self expandedKey. + result withIndexDo: [:a :i | + cipherText at: i put: a + ]. + ^cipherText +] + +{ #category : #'encryption/decryption' } +ARC2 >> decryptBlock: plainText key: expandedKeys [ + "The entire decryption operation can now be described as follows. + Here j is a global integer variable which is affected by the mixing + operations. + + 1. Initialize words R[0], ..., R[3] to contain the 64-bit + ciphertext value. + 2. Expand the key, so that words K[0], ..., K[63] become + defined. + 3. Initialize j to 63. + 4. Perform five r-mixing rounds. + 5. Perform one r-mashing round. + 6. Perform six r-mixing rounds. + 7. Perform one r-mashing round. + 8. Perform five r-mixing rounds." + + | cText rStream result | + self j: 63. + cText := plainText. + rStream := cText readStream. + result := ByteArray new. + [rStream atEnd] whileFalse: [ + result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize: 2) + ]. + cText := result. + 1 to: 5 do: [:i | + cText := self rMixUp: cText withKeys: expandedKeys + ]. + cText := self rMash: cText withKeys: expandedKeys. + 1 to: 6 do: [:i | + cText := self rMixUp: cText withKeys: expandedKeys + ]. + cText := self rMash: cText withKeys: expandedKeys. + 1 to: 5 do: [:i | + cText := self rMixUp: cText withKeys: expandedKeys + ]. + rStream := cText readStream. + result := ByteArray new. + [rStream atEnd] whileFalse: [ + result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize: 2) + ]. + ^result + +] + +{ #category : #services } +ARC2 >> destroy [ + self keyHolder destroy. +] + +{ #category : #'encryption/decryption' } +ARC2 >> encryptBlock: plainText [ + | result | + result := self encryptBlock: plainText key: self expandedKey. + result withIndexDo: [:a :i | + plainText at: i put: a + ]. + ^plainText +] + +{ #category : #'encryption/decryption' } +ARC2 >> encryptBlock: plainText key: expandedKeys [ + "The entire encryption operation can now be described as follows. Here + j is a global integer variable which is affected by the mixing + operations. + 1. Initialize words R[0], ..., R[3] to contain the + 64-bit input value. + 2. Expand the key, so that words K[0], ..., K[63] become + defined. + 3. Initialize j to zero. + 4. Perform five mixing rounds. + 5. Perform one mashing round. + 6. Perform six mixing rounds. + 7. Perform one mashing round. + 8. Perform five mixing rounds." + + | cText rStream result | + self j: 0. + cText := plainText. + rStream := cText readStream. + result := ByteArray new. + [rStream atEnd] whileFalse: [ + result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize:2) + ]. + cText := result. + 1 to: 5 do: [:i | + cText := self mixUp: cText withKeys: expandedKeys + ]. + cText := self mash: cText withKeys: expandedKeys. + 1 to: 6 do: [:i | + cText := self mixUp: cText withKeys: expandedKeys + ]. + cText := self mash: cText withKeys: expandedKeys. + 1 to: 5 do: [:i | + cText := self mixUp: cText withKeys: expandedKeys + ]. + rStream := cText readStream. + result := ByteArray new. + [rStream atEnd] whileFalse: [ + result := result , ((rStream nextLittleEndianNumber: 2) asByteArrayOfSize: 2) + ]. + ^result + +] + +{ #category : #services } +ARC2 >> expandedKey [ + + "for i = T, T+1, ..., 127 do + L[i] = PITABLE[L[i-1] + L[i-T]];" + + | keyBuffer aT v1 v2 pos byteStream result | + keyBuffer := (self key reverse asByteArrayOfSize: 128) reverse. + aT := self key size. + aT to: 127 do: [:i | + v1 := keyBuffer at: (i -1) + 1. + v2 := keyBuffer at: (i - aT) + 1. + keyBuffer at: (i+1) put: (self class PITABLE at: (((v1 + v2) \\ 256) + 1)). + ]. + + "L[128-T8] = PITABLE[L[128-T8] & TM];" + pos := (128 - self T8) + 1. + keyBuffer at: pos put: (self class PITABLE at: (((keyBuffer at: pos) bitAnd: self TM) + 1)). + + "for i = 127-T8, ..., 0 do + L[i] = PITABLE[L[i+1] XOR L[i+T8]]; + " + (127 - self T8) to: 0 by: -1 do: [:i | + keyBuffer at: (i+1) put: (self class PITABLE at: (((keyBuffer at: ((i + 1) +1)) bitXor: (keyBuffer at: ((i + self T8)+1))) +1)) + ]. + byteStream := keyBuffer readStream. + result := OrderedCollection new: byteStream size. + [byteStream atEnd] whileFalse: [ + result add: (byteStream next + (byteStream next bitShift: 8)) "Little Endian" + ]. + ^result + +] + +{ #category : #'initialize-release' } +ARC2 >> initialize [ + self j: 0. +] + +{ #category : #accessing } +ARC2 >> j [ + "Answer the value of j" + + ^ j +] + +{ #category : #accessing } +ARC2 >> j: anInteger [ + "Set the value of j" + + j := anInteger +] + +{ #category : #key } +ARC2 >> key [ + ^self keyHolder key +] + +{ #category : #key } +ARC2 >> key: aByteArray [ + self keyHolder: (KeyHolder holdKey: aByteArray) +] + +{ #category : #accessing } +ARC2 >> keyHolder [ + "Answer the value of keyHolder" + + ^ keyHolder +] + +{ #category : #accessing } +ARC2 >> keyHolder: anObject [ + "Set the value of keyHolder" + + keyHolder := anObject +] + +{ #category : #services } +ARC2 >> mash: a64BitWord withKeys: expandedKeys [ + "The primitive 'Mash R[i]' operation is defined as follows (using the + previous conventions regarding subscripts for R): + + R[i] = R[i] + K[R[i-1] & 63]; + + In words: R[i] is 'mashed; by adding to it one of the words of the + expanded key. The key word to be used is determined by looking at the + low-order six bits of R[i-1], and using that as an index into the key + array K. +" + | aR aByteStream aRi aK result | + aR := Array new: 4. + aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. + 1 to: 4 do: [:i | + aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). + ]. + 0 to: 3 do: [:i | + aRi := aR at: i + 1. + aK := expandedKeys at: (((aR at: ((i - 1) \\ 4)+1) bitAnd: 63) + 1). + aR at: i + 1 put: ((aRi + aK) bitAnd: 16rFFFF). + ]. + result := ByteArray new. + aR do: [:a16BitWord | + result := result, (a16BitWord asByteArrayOfSize: 2) + ]. + ^result. + + + +] + +{ #category : #services } +ARC2 >> mixUp: a64BitWord withKeys: expandedKeys [ + "The primitive 'Mix up R[i]' operation is defined as follows, where + s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices + of the array R are always to be considered 'modulo 4,' so that R[i-1] + refers to R[3] if i is 0 (these values are + + 'wrapped around' so that R always has a subscript in the range 0 to 3 + inclusive): + + R[i] = R[i] + K[j] + (R[i-1] & R[i-2]) + ((~R[i-1]) & R[i-3]); + j = j + 1; + R[i] = R[i] rol s[i]; + " + | aS aR aByteStream aRi aKj aRa aRb aRc aRd si result | + aS := Array with: 1 with: 2 with: 3 with: 5. + aR := Array new: 4. + aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. + 1 to: 4 do: [:i | + aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). + ]. + 0 to: 3 do: [:i | + aRi := aR at: i +1. + aKj := expandedKeys at: self j + 1. "j+1 changes offset from 0 - 3 to 1 to 4" + aRa := aR at: ((i - 1 \\ 4) + 1). + aRb := aR at: ((i - 2 \\ 4) + 1). + aRc := aRa bitXor: 16rFFFF. + aRd := aR at: ((i - 3 \\ 4) + 1). + si := aS at: i +1. + aR at: i+1 put: (self class rotate16BitWord: ((aRi + aKj + (aRa bitAnd: aRb) + (aRc bitAnd: aRd)) bitAnd: 16rFFFF) leftBy: si). + self j: self j + 1. + ]. + result := ByteArray new. + aR do: [:a16BitWord | + result := result, (a16BitWord asByteArrayOfSize: 2) + ]. + ^result. + +] + +{ #category : #services } +ARC2 >> rMash: a64BitWord withKeys: expandedKeys [ + "The primitive 'Mash R[i]' operation is defined as follows (using the + previous conventions regarding subscripts for R): + + R[i] = R[i] - K[R[i-1] & 63]; + + In words: R[i] is 'mashed; by adding to it one of the words of the + expanded key. The key word to be used is determined by looking at the + low-order six bits of R[i-1], and using that as an index into the key + array K. +" + | aR aByteStream aRi aK result | + aR := Array new: 4. + aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. + 1 to: 4 do: [:i | + aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). + ]. + 3 to: 0 by: -1 do: [:i | + aRi := aR at: i + 1. + aK := expandedKeys at: (((aR at: ((i - 1) \\ 4)+1) bitAnd: 63) + 1). + aR at: i + 1 put: ((aRi - aK) bitAnd: 16rFFFF). + ]. + result := ByteArray new. + aR do: [:a16BitWord | + result := result, (a16BitWord asByteArrayOfSize: 2) + ]. + ^result. + + + +] + +{ #category : #services } +ARC2 >> rMixUp: a64BitWord withKeys: expandedKeys [ + "The primitive 'R-Mix up R[i]' operation is defined as follows, where + s[0] is 1, s[1] is 2, s[2] is 3, and s[3] is 5, and where the indices + of the array R are always to be considered 'modulo 4,' so that R[i-1] + refers to R[3] if i is 0 (these values are 'wrapped around' so that R + always has a subscript in the range 0 to 3 inclusive): + + R[i] = R[i] roR s[i]; + R[i] = R[i] - K[j] - (R[i-1] & R[i-2]) - ((~R[i-1]) & R[i-3]); + j = j - 1; + + " + | aS aR aByteStream aRi aKj aRa aRb aRc aRd si result | + aS := Array with: 1 with: 2 with: 3 with: 5. + aR := Array new: 4. + aByteStream := (a64BitWord asByteArrayOfSize: 8) readStream. + 1 to: 4 do: [:i | + aR at: i put: ((aByteStream next bitShift: 8) + aByteStream next). + ]. + 3 to: 0 by: -1 do: [:i | + si := aS at: i +1. + aR at: i + 1 put: (self class rotate16BitWord: (aR at: i +1) leftBy: si negated). + aRi := aR at: i + 1. + aKj := expandedKeys at: self j + 1. "j+1 changes offset from 0 - 3 to 1 to 4" + aRa := aR at: ((i - 1 \\ 4) + 1). + aRb := aR at: ((i - 2 \\ 4) + 1). + aRc := aRa bitXor: 16rFFFF. + aRd := aR at: ((i - 3 \\ 4) + 1). + aR at: i+1 put: ((aRi - aKj - (aRa bitAnd: aRb) - (aRc bitAnd: aRd)) bitAnd: 16rFFFF). + self j: self j - 1. + ]. + result := ByteArray new. + aR do: [:a16BitWord | + result := result, (a16BitWord asByteArrayOfSize: 2) + ]. + ^result. + +] + +{ #category : #key } +ARC2 >> setKeySize [ + self T8: (self T1+7) // 8. + self TM: (255 \\ (2 raisedTo: (8 + self T1 - (8 * self T8)))). +] diff --git a/source/Cryptography/ARC4.class.st b/source/Cryptography/ARC4.class.st new file mode 100644 index 0000000..446037f --- /dev/null +++ b/source/Cryptography/ARC4.class.st @@ -0,0 +1,45 @@ +Class { + #name : #ARC4, + #superclass : #Object, + #instVars : [ + 'sbox', + 'i', + 'j' + ], + #category : #'Cryptography-RC4' +} + +{ #category : #accessing } +ARC4 >> decrypt: aByteArray [ + ^ self encrypt: aByteArray +] + +{ #category : #accessing } +ARC4 >> encrypt: aByteArray [ + | newBytes | + newBytes := aByteArray copy. + 1 to: aByteArray size do: [ :each | newBytes at: each put: ((aByteArray at: each) bitXor: self next)]. + ^ newBytes +] + +{ #category : #accessing } +ARC4 >> key: aByteArray [ + | k other | + sbox := (0 to: 255) asByteArray. + k := (0 to: 255) collect: [ :each | aByteArray at: each \\ aByteArray size + 1]. + other := 0. + 1 to: 256 do: [ :each | + other := other + (sbox at: each) + (k at: each) \\ 256. + sbox swap: each with: other+1]. + i := j := 0 +] + +{ #category : #accessing } +ARC4 >> next [ + | t | + i := i + 1 \\ 256. + j := j + (sbox at: i+1) \\ 256. + sbox swap: i+1 with: j+1. + t := (sbox at: i+1) + (sbox at: j+1) \\ 256. + ^ sbox at: t+1 +] diff --git a/source/Cryptography/BlockCipher.class.st b/source/Cryptography/BlockCipher.class.st new file mode 100644 index 0000000..62dbf1d --- /dev/null +++ b/source/Cryptography/BlockCipher.class.st @@ -0,0 +1,159 @@ +" +Abstract class for blockmode ciphers (those which encrypt/decrypt more than 1 byte at a time, typically 64 bits) +" +Class { + #name : #BlockCipher, + #superclass : #Object, + #category : #'Cryptography-Core' +} + +{ #category : #accessing } +BlockCipher class >> blockSize [ + ^ self subclassResponsibility +] + +{ #category : #'instance creation' } +BlockCipher class >> key: aByteArray [ + ^ self new key: aByteArray +] + +{ #category : #accessing } +BlockCipher class >> keySize [ + ^ self subclassResponsibility +] + +{ #category : #accessing } +BlockCipher >> blockSize [ + ^ self class blockSize +] + +{ #category : #private } +BlockCipher >> blocksIn: aByteArray from: startIndex to: endIndex do: oneArgBlock [ + | tempBlock | + self isStreamCipher + ifFalse: [ self validateEndpointsFrom: startIndex to: endIndex ]. + tempBlock := ByteArray new: self blockSize. + startIndex to: endIndex + by: self blockSize + do: + [ : startPos | + tempBlock + replaceFrom: 1 + to: (self blockSize min: aByteArray size - startPos + 1) + with: aByteArray + startingAt: startPos. + oneArgBlock value: tempBlock. + aByteArray + replaceFrom: startPos + to: (startPos + self blockSize - 1 min: aByteArray size) + with: tempBlock + startingAt: 1] +] + +{ #category : #modes } +BlockCipher >> cbc [ + ^ CBC on: self +] + +{ #category : #modes } +BlockCipher >> cfb [ + ^ CFB on: self +] + +{ #category : #modes } +BlockCipher >> ctr [ + ^ CTR on: self +] + +{ #category : #accessing } +BlockCipher >> decrypt: aByteArray [ + "Answer a copy of aByteArray which is decrypted with my key." + | decryptedBlock | + decryptedBlock := + self + decrypt: aByteArray copy + from: 1 + to: aByteArray size. + ^ self isStreamCipher + ifTrue: [ decryptedBlock ] + ifFalse: + [ decryptedBlock + copyFrom: 1 + to: decryptedBlock unpaddedSize ] +] + +{ #category : #accessing } +BlockCipher >> decrypt: aByteArray from: startPos to: endPos [ + "Decrypt aByteArray in-place." + self + blocksIn: aByteArray + from: startPos + to: endPos + do: [:each | self decryptBlock: each]. + ^ aByteArray +] + +{ #category : #accessing } +BlockCipher >> decryptBlock: cipherText [ + ^ self subclassResponsibility +] + +{ #category : #modes } +BlockCipher >> ecb [ + ^ self +] + +{ #category : #accessing } +BlockCipher >> encrypt: aByteArray [ + "Answer a copy of aByteArray which is encrypted with my key." + | encryptable | + encryptable := self isStreamCipher + ifTrue: [ aByteArray copy ] + ifFalse: [ aByteArray padToMultipleOf: self blockSize ]. + ^ self + encrypt: encryptable + from: 1 + to: encryptable size +] + +{ #category : #accessing } +BlockCipher >> encrypt: aByteArray from: startPos to: endPos [ + "Encrypt aByteArray in place." + self + blocksIn: aByteArray + from: startPos + to: endPos + do: [:each | self encryptBlock: each]. + ^aByteArray +] + +{ #category : #accessing } +BlockCipher >> encryptBlock: plainText [ + ^ self subclassResponsibility +] + +{ #category : #testing } +BlockCipher >> isStreamCipher [ + "Answer whether I have stream characteristics; a Stream cipher typically generates its own stream of pseudo-random bytes which is then XOR'd with plaintext. Another characteristic is no padding is required because the last (odd-sized) block can simply XOR to whatever length needed." + ^ false +] + +{ #category : #accessing } +BlockCipher >> key: aKey [ + ^ self subclassResponsibility +] + +{ #category : #accessing } +BlockCipher >> keySize [ + ^ self class keySize +] + +{ #category : #modes } +BlockCipher >> ofb [ + ^ OFB on: self +] + +{ #category : #private } +BlockCipher >> validateEndpointsFrom: startIndex to: endIndex [ + endIndex-startIndex+1 \\ self blockSize = 0 ifFalse: [ CryptographyError signal: 'message size must be a multiple of my blockSize.' ] +] diff --git a/source/Cryptography/BlockCipherMode.class.st b/source/Cryptography/BlockCipherMode.class.st new file mode 100644 index 0000000..e18e24c --- /dev/null +++ b/source/Cryptography/BlockCipherMode.class.st @@ -0,0 +1,76 @@ +Class { + #name : #BlockCipherMode, + #superclass : #BlockCipher, + #instVars : [ + 'cipher', + 'vector' + ], + #category : #'Cryptography-Core' +} + +{ #category : #accessing } +BlockCipherMode class >> blockSize [ + ^ self shouldNotImplement +] + +{ #category : #'*cryptography-tests' } +BlockCipherMode class >> key: aByteArray [ + Warning signal: 'you do NOT want to use this method in a real program because we use a hard-coded nonce. You should take care of your own nonce.'. + ^ (self on: (Rijndael new keySize: aByteArray size; key: aByteArray)) + initialVector: #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) asByteArray +] + +{ #category : #accessing } +BlockCipherMode class >> keySize [ + ^ self shouldNotImplement +] + +{ #category : #'instance creation' } +BlockCipherMode class >> on: aCipher [ + ^ self new setCipher: aCipher +] + +{ #category : #accessing } +BlockCipherMode >> blockSize [ + ^ cipher blockSize +] + +{ #category : #'initialization-release' } +BlockCipherMode >> destroy [ + vector destroy +] + +{ #category : #accessing } +BlockCipherMode >> initialVector: aByteArray [ + "avoid leakage, shred prior vectors before disconnecting them." + self vector: aByteArray +] + +{ #category : #accessing } +BlockCipherMode >> key: aByteArray [ + cipher key: aByteArray +] + +{ #category : #accessing } +BlockCipherMode >> keySize [ + ^ cipher keySize +] + +{ #category : #printing } +BlockCipherMode >> printOn: aStream [ + aStream print: cipher; nextPut: $-; nextPutAll: self class name +] + +{ #category : #'initialization-release' } +BlockCipherMode >> setCipher: aCipher [ + cipher := aCipher. + self initialVector: (ByteArray new: self blockSize) +] + +{ #category : #accessing } +BlockCipherMode >> vector: aByteArray [ + vector == aByteArray ifFalse: + [ "avoid leakage, shred prior vectors before disconnecting them." + vector ifNotNil: [ vector destroy ]. + vector := aByteArray ] +] diff --git a/source/Cryptography/BlockCipherMode.extension.st b/source/Cryptography/BlockCipherMode.extension.st new file mode 100644 index 0000000..30ae629 --- /dev/null +++ b/source/Cryptography/BlockCipherMode.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #BlockCipherMode } + +{ #category : #'*cryptography-tests' } +BlockCipherMode class >> key: aByteArray [ + Warning signal: 'you do NOT want to use this method in a real program because we use a hard-coded nonce. You should take care of your own nonce.'. + ^ (self on: (Rijndael new keySize: aByteArray size; key: aByteArray)) + initialVector: #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) asByteArray +] diff --git a/source/Cryptography/ByteArray.extension.st b/source/Cryptography/ByteArray.extension.st new file mode 100644 index 0000000..1572589 --- /dev/null +++ b/source/Cryptography/ByteArray.extension.st @@ -0,0 +1,242 @@ +Extension { #name : #ByteArray } + +{ #category : #'*cryptography-core' } +ByteArray >> hexStringInNibbles [ + + + ^ (self + inject: String new writeStream + into: [:stream :byte | + stream + nextPut: ('0123456789ABCDEF' at: byte // 16 + 1); + nextPut: ('0123456789ABCDEF' at: byte \\ 16 + 1); + nextPut: Character space. + stream]) contents. + +] + +{ #category : #'*cryptography-core' } +ByteArray >> isProperlyPadded [ + "Verify my bytes have padding applied by #padToMultipleOf:. The padding scheme used here is option #2 as specified by Ferguson and Schneier in 'Practical Cryptography', p. 68-69." + | pad end start | + pad := self last. + end := self size. + start := end - pad + 1. + ^ start > 0 + and: [ (start to: end) allSatisfy: [ : each | (self at: each) = pad ] ] +] + +{ #category : #'*cryptography-core' } +ByteArray >> padToMultipleOf: blockSize [ + "Answer a new ByteArray that is padded to anInteger bytes. This is used by block-based ciphers where the length of the ByteArray to be encrypted must be a multiple of that ciphers #blockSize. The padding scheme used here is option #2 as specified by Ferguson and Schneier in 'Practical Cryptography', p. 68-69." + | answer pad | + answer := ByteArray new: (self paddedSize: blockSize). + answer + replaceFrom: 1 + to: self size + with: self + startingAt: 1. + pad := answer size - self size. + self size+1 + to: answer size + do: [ : x | answer at: x put: pad ]. + ^ answer +] + +{ #category : #'*cryptography-core' } +ByteArray >> paddedSize: blockSize [ + "If my size is an exact multiple of blockSize, an entire pad-block is required. That's why we have the +1." + ^ (self size+1) roundUpTo: blockSize +] + +{ #category : #'*cryptography-core' } +ByteArray >> toEBase64String [ + + | base64Table stream firstIndex secondIndex thirdIndex fourthIndex extra | + base64Table := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=_'. + + stream := String new writeStream. + 1 to: self size - 2 by: 3 do: [:i | + firstIndex := ((self at: i) bitAnd: 16rFC) >> 2. + secondIndex := ((((self at: i) bitAnd: 16r03) << 4) bitOr: (((self at: i+1) bitAnd: 16rF0) >> 4)). + thirdIndex := ((((self at: i+1) bitAnd: 16r0F) << 2) bitOr: (((self at: i+2) bitAnd: 16rC0) >> 6)). + fourthIndex := ((self at: i+2) bitAnd: 16r3F). + stream nextPut: (base64Table at: firstIndex + 1). + stream nextPut: (base64Table at: secondIndex + 1). + stream nextPut: (base64Table at: thirdIndex + 1). + stream nextPut: (base64Table at: fourthIndex + 1)]. + + extra := self size - (self size // 3 * 3). + extra = 0 ifTrue: [^ stream contents]. + extra = 1 ifTrue: [ + firstIndex := ((self at: self size) bitAnd: 16rFC) >> 2. + secondIndex := ((self at: self size) bitAnd: 16r03) << 4. + stream nextPut: (base64Table at: firstIndex + 1). + stream nextPut: (base64Table at: secondIndex + 1). + ^ stream contents]. + extra = 2 ifTrue: [ + firstIndex := ((self at: self size - 1) bitAnd: 16rFC) >> 2. + secondIndex := ((((self at: self size - 1) bitAnd: 16r03) << 4) bitOr: (((self at: self size) bitAnd: 16rF0) >> 4)). + thirdIndex := ((self at: self size) bitAnd: 16r0F) << 2. + stream nextPut: (base64Table at: firstIndex + 1). + stream nextPut: (base64Table at: secondIndex + 1). + stream nextPut: (base64Table at: thirdIndex + 1). + ^ stream contents]. + +] + +{ #category : #'*cryptography-core' } +ByteArray >> uint: bits at: anInteger [ + + | answer bytes | + bits == 64 ifTrue: [ ^ self unsigned64At: anInteger ]. + bits == 56 ifTrue: [ ^ self unsigned56At: anInteger ]. + bits == 48 ifTrue: [ ^ self unsigned48At: anInteger ]. + bits == 40 ifTrue: [ ^ self unsigned40At: anInteger ]. + bits == 32 + ifTrue: + [ ^ self + unsignedLongAt: anInteger + bigEndian: false ]. + bits == 16 + ifTrue: + [ ^ self + unsignedShortAt: anInteger + bigEndian: false ]. + bits == 8 + ifTrue: + [ ^ self byteAt: anInteger ]. + bytes := bits // 8. + answer := LargePositiveInteger new: bytes. + 1 to: bytes do: + [ :digitPosition | + answer + digitAt: digitPosition + put: (self at: digitPosition + anInteger - 1) ]. + ^answer normalize +] + +{ #category : #'*cryptography-core' } +ByteArray >> uint: bits at: position put: anInteger [ + + position + to: position + (bits // 8) - 1 + do: + [ :pos | + self + at: pos + put: (anInteger digitAt: pos-position+1) ]. + ^ anInteger +] + +{ #category : #'*cryptography-core' } +ByteArray >> unpad [ + | pad end | + self isProperlyPadded ifFalse: [ CryptographyError signal: 'Authentication failure (improperly padded!)' ]. + pad := self last. + end := self size - pad. + ^ self copyFrom: 1 to: end +] + +{ #category : #'*cryptography-core' } +ByteArray >> unpaddedSize [ + "If I was padded by a BlockCipher, answer the size of the original plaintext." + self isProperlyPadded ifFalse: [ CryptographyError signal: 'Authentication failure (improperly padded!)' ]. + ^ self size - self last +] + +{ #category : #'*cryptography-core' } +ByteArray >> unsigned40At: index [ + "Return a unsigned integer quantity starting from the given byte index" + + | b0 b1 b2 b3 w | + + w := self at: index. + b3 := self at: index+1. + b2 := self at: index+2. + b1 := self at: index+3. + b0 := self at: index+4. + + "Minimize LargeInteger arithmetic" + b3 = 0 ifFalse:[w := (b3 bitShift: 8) + w]. + b2 = 0 ifFalse:[w := (b2 bitShift: 16) + w]. + b1 = 0 ifFalse:[w := (b1 bitShift: 24) + w]. + b0 = 0 ifFalse:[w := (b0 bitShift: 32) + w]. + + ^w +] + +{ #category : #'*cryptography-core' } +ByteArray >> unsigned48At: index [ + "Return a unsigned integer quantity starting from the given byte index" + + | b0 b1 b2 b3 b4 w | + + w := self at: index. + b4 := self at: index+1. + b3 := self at: index+2. + b2 := self at: index+3. + b1 := self at: index+4. + b0 := self at: index+5. + + "Minimize LargeInteger arithmetic" + b4 = 0 ifFalse:[w := (b4 bitShift: 8) + w]. + b3 = 0 ifFalse:[w := (b3 bitShift: 16) + w]. + b2 = 0 ifFalse:[w := (b2 bitShift: 24) + w]. + b1 = 0 ifFalse:[w := (b1 bitShift: 32) + w]. + b0 = 0 ifFalse:[w := (b0 bitShift: 40) + w]. + + ^w +] + +{ #category : #'*cryptography-core' } +ByteArray >> unsigned56At: index [ + "Return a unsigned integer quantity starting from the given byte index" + + | b0 b1 b2 b3 b4 b5 w | + + w := self at: index. + b5 := self at: index+1. + b4 := self at: index+2. + b3 := self at: index+3. + b2 := self at: index+4. + b1 := self at: index+5. + b0 := self at: index+6. + + "Minimize LargeInteger arithmetic" + b5 = 0 ifFalse:[w := (b5 bitShift: 8) + w]. + b4 = 0 ifFalse:[w := (b4 bitShift: 16) + w]. + b3 = 0 ifFalse:[w := (b3 bitShift: 24) + w]. + b2 = 0 ifFalse:[w := (b2 bitShift: 32) + w]. + b1 = 0 ifFalse:[w := (b1 bitShift: 40) + w]. + b0 = 0 ifFalse:[w := (b0 bitShift: 48) + w]. + + ^w +] + +{ #category : #'*cryptography-core' } +ByteArray >> unsigned64At: index [ + "Return a unsigned integer quantity starting from the given byte index" + + | b0 b1 b2 b3 b4 b5 b6 w | + + w := self at: index. + b6 := self at: index+1. + b5 := self at: index+2. + b4 := self at: index+3. + b3 := self at: index+4. + b2 := self at: index+5. + b1 := self at: index+6. + b0 := self at: index+7. + + "Minimize LargeInteger arithmetic" + b6 = 0 ifFalse:[w := (b6 bitShift: 8) + w]. + b5 = 0 ifFalse:[w := (b5 bitShift: 16) + w]. + b4 = 0 ifFalse:[w := (b4 bitShift: 24) + w]. + b3 = 0 ifFalse:[w := (b3 bitShift: 32) + w]. + b2 = 0 ifFalse:[w := (b2 bitShift: 40) + w]. + b1 = 0 ifFalse:[w := (b1 bitShift: 48) + w]. + b0 = 0 ifFalse:[w := (b0 bitShift: 56) + w]. + + ^w +] diff --git a/source/Cryptography/ByteString.extension.st b/source/Cryptography/ByteString.extension.st new file mode 100644 index 0000000..7054f9b --- /dev/null +++ b/source/Cryptography/ByteString.extension.st @@ -0,0 +1,53 @@ +Extension { #name : #ByteString } + +{ #category : #'*Cryptography-RandomAndPrime' } +ByteString >> destroy [ + "destroy this string by replacing every character with a space" + 1 to: self size do: [:i | + self at: i put: Character space + ] +] + +{ #category : #'*Cryptography-RandomAndPrime' } +ByteString >> unsignedLongAt: index bigEndian: aBool [ + "Return a 32bit unsigned integer quantity starting from the given byte index" + | b0 b1 b2 w | + aBool ifTrue:[ + b0 := self byteAt: index. + b1 := self byteAt: index+1. + b2 := self byteAt: index+2. + w := self byteAt: index+3. + ] ifFalse:[ + w := self byteAt: index. + b2 := self byteAt: index+1. + b1 := self byteAt: index+2. + b0 := self byteAt: index+3. + ]. + "Minimize LargeInteger arithmetic" + b2 = 0 ifFalse:[w := (b2 bitShift: 8) + w]. + b1 = 0 ifFalse:[w := (b1 bitShift: 16) + w]. + b0 = 0 ifFalse:[w := (b0 bitShift: 24) + w]. + ^w +] + +{ #category : #'*Cryptography-RandomAndPrime' } +ByteString >> unsignedLongAt: index put: value bigEndian: aBool [ + "Store a 32bit unsigned integer quantity starting from the given byte index" + | b0 b1 b2 b3 | + b0 := value bitShift: -24. + b1 := (value bitShift: -16) bitAnd: 255. + b2 := (value bitShift: -8) bitAnd: 255. + b3 := value bitAnd: 255. + aBool ifTrue:[ + self byteAt: index put: b0. + self byteAt: index+1 put: b1. + self byteAt: index+2 put: b2. + self byteAt: index+3 put: b3. + ] ifFalse:[ + self byteAt: index put: b3. + self byteAt: index+1 put: b2. + self byteAt: index+2 put: b1. + self byteAt: index+3 put: b0. + ]. + ^value +] diff --git a/source/Cryptography/CBC.class.st b/source/Cryptography/CBC.class.st new file mode 100644 index 0000000..8273f6b --- /dev/null +++ b/source/Cryptography/CBC.class.st @@ -0,0 +1,33 @@ +Class { + #name : #CBC, + #superclass : #BlockCipherMode, + #category : #'Cryptography-Core' +} + +{ #category : #accessing } +CBC >> decryptBlock: aByteArray [ + | nextVector | + nextVector := aByteArray copy. + cipher decryptBlock: aByteArray. + 1 + to: aByteArray size + do: + [ : i | + aByteArray + at: i + put: ((vector at: i) bitXor: (aByteArray at: i)) ]. + self vector: nextVector +] + +{ #category : #accessing } +CBC >> encryptBlock: aByteArray [ + 1 + to: aByteArray size + do: + [ : i | + aByteArray + at: i + put: ((vector at: i) bitXor: (aByteArray at: i)) ]. + cipher encryptBlock: aByteArray. + self vector: aByteArray copy +] diff --git a/source/Cryptography/CFB.class.st b/source/Cryptography/CFB.class.st new file mode 100644 index 0000000..87916ff --- /dev/null +++ b/source/Cryptography/CFB.class.st @@ -0,0 +1,39 @@ +Class { + #name : #CFB, + #superclass : #BlockCipherMode, + #category : #'Cryptography-Core' +} + +{ #category : #accessing } +CFB >> decryptBlock: aByteArray [ + | nextVector | + nextVector := aByteArray copy. + cipher encryptBlock: vector. + 1 + to: aByteArray size + do: + [ : i | + aByteArray + at: i + put: ((vector at: i) bitXor: (aByteArray at: i)) ]. + self vector: nextVector +] + +{ #category : #accessing } +CFB >> encryptBlock: aByteArray [ + cipher encryptBlock: vector. + 1 + to: aByteArray size + do: + [ : i | + aByteArray + at: i + put: ((vector at: i) bitXor: (aByteArray at: i)) ]. + self vector: aByteArray copy +] + +{ #category : #testing } +CFB >> isStreamCipher [ + "Because the actual ciphertext plays a role in computing the next vector, streaming mode seems inappropriate for CFB. There's also an implementation issue; the vector is shortened after the last (irregularly sized) block, rendering that BlockCipher instance unusable.." + ^ false +] diff --git a/source/Cryptography/CTR.class.st b/source/Cryptography/CTR.class.st new file mode 100644 index 0000000..8f6572b --- /dev/null +++ b/source/Cryptography/CTR.class.st @@ -0,0 +1,158 @@ +" +This CTR mode implementation was guided by + + Nils Ferguson, Bruce Schneier. Pratical Cryptography. + Wiley, 2003. + pp. 75-82, 111-127. + +With CTR, my initialVector is partitioned into a nonce and a counter (""i"" in the book). My blockSize, 128-bits, are available to accommodate both of these ""fields"". The two of them combined together form my #initialVector (IV). The book suggests the nonce portion used as a message-number used also in sequencing messages of a secure-channel (chapter 8). The overall requirement is that the same initialVector (i.e., counter+nonce combination) never be used twice for this key (instance). The counter is re-set to 1 each time the nonce is set. + +If you run out of counter, I signal a CryptographyError. +" +Class { + #name : #CTR, + #superclass : #BlockCipherMode, + #instVars : [ + 'counter', + 'counterBits', + 'maximumCounterValue' + ], + #category : #'Cryptography-Core' +} + +{ #category : #accessing } +CTR >> counter [ + ^ counter +] + +{ #category : #private } +CTR >> counter: anInteger [ + vector + uint: counterBits + at: self positionOfCounter + put: anInteger. + counter := anInteger +] + +{ #category : #'initialization-release' } +CTR >> counterBits: anInteger [ + ((16 to: 128 by: 16) includes: anInteger) ifFalse: + [ CryptographyError signal: 'invalid counter size' ]. + counterBits := anInteger. + maximumCounterValue := (1 bitShift: counterBits) - 1 +] + +{ #category : #private } +CTR >> counterBytes [ + ^ counterBits/8 +] + +{ #category : #accessing } +CTR >> decryptBlock: aByteArray [ + "One of the advantages of CTR mode is that the decrypt implementation is exactly like the encrypt." + self encryptBlock: aByteArray +] + +{ #category : #'initialization-release' } +CTR >> destroy [ + super destroy. + counter := 0 "avoid potential leakage" +] + +{ #category : #accessing } +CTR >> encryptBlock: aByteArray [ + | kSubI | + kSubI := self nextBlock. + aByteArray withIndexDo: + [ : eachByte : x | + aByteArray + at: x + put: (eachByte bitXor: (kSubI at: x)). + "reduce leakage" + kSubI at: x put: 0 ] +] + +{ #category : #private } +CTR >> highestNonce [ + ^ (1 bitShift: self nonceBits) - 1 +] + +{ #category : #private } +CTR >> incrementCounter [ + counter >= maximumCounterValue + ifTrue: + [ CryptographyError signal: 'cannot operate on more than ', maximumCounterValue printString, ' blocks at a time.' ]. + self counter: counter + 1 +] + +{ #category : #accessing } +CTR >> incrementNonce [ + "increment my nonce" + | answer | + answer := self nonce + 1. + self nonce: answer. + ^ answer +] + +{ #category : #'initialization-release' } +CTR >> initialize [ + super initialize. + self counterBits: 32 +] + +{ #category : #private } +CTR >> isExpired [ + ^ self nonce = self highestNonce +] + +{ #category : #testing } +CTR >> isStreamCipher [ + ^ true +] + +{ #category : #private } +CTR >> nextBlock [ + | kSubI | + self incrementCounter. + kSubI := vector copy. "as named in the book" + cipher encryptBlock: kSubI. + ^ kSubI +] + +{ #category : #accessing } +CTR >> nonce [ + ^ vector + uint: self nonceBits + at: self positionOfNonce +] + +{ #category : #accessing } +CTR >> nonce: anInteger [ + vector + uint: self nonceBits + at: self positionOfNonce + put: anInteger. + self counter: 0 +] + +{ #category : #private } +CTR >> nonceBits [ + "The number of bits left over for the nonce." + ^ (self blockSize*8) - counterBits +] + +{ #category : #private } +CTR >> positionOfCounter [ + ^ 1 +] + +{ #category : #private } +CTR >> positionOfNonce [ + ^ self counterBytes + 1 +] + +{ #category : #'initialization-release' } +CTR >> setCipher: aCipher [ + super setCipher: aCipher. + self counter: 0 +] diff --git a/source/Cryptography/CryptoDESTest.class.st b/source/Cryptography/CryptoDESTest.class.st new file mode 100644 index 0000000..5dd9b70 --- /dev/null +++ b/source/Cryptography/CryptoDESTest.class.st @@ -0,0 +1,96 @@ +Class { + #name : #CryptoDESTest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testDES [ + | plain key d | + plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. + key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. + d := DES key: key. + d encryptBlock: plain. + self assert: plain = #(16rC9 16r57 16r44 16r25 16r6A 16r5E 16rD3 16r1D) asByteArray +] + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testDES2 [ + | plain key d | + plain := 'squeaker' asByteArray. + key := 'hacking!' asByteArray. + d := DES key: key. + d encryptBlock: plain. + self assert: plain = #[64 222 70 13 59 145 76 186] +] + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testDES3 [ + | plain plainCopy key d | + plain := 'squeaker'. + key := 'hacking!'. + plainCopy := plain copy. + d := DES key: key. + d encryptBlock: plainCopy. + self assert: plainCopy asByteArray = #[64 222 70 13 59 145 76 186]. + +] + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testDESCBC [ + | plain key encryptor decryptor vector | + plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. + key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. + vector := #(16r00 16r11 16r22 16r33 16r44 16r55 16r66 16r77) asByteArray. + encryptor := (DES key: key) cbc. + encryptor initialVector: vector copy. + decryptor := (DES key: key) cbc. + decryptor initialVector: vector copy. + encryptor encryptBlock: plain. + decryptor decryptBlock: plain. + encryptor encryptBlock: plain. + decryptor decryptBlock: plain. + self assert: plain = #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. +] + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testDESFormal [ + | x d | + x := #(16r94 16r74 16rB8 16rE8 16rC7 16r3B 16rCA 16r7D) asByteArray. + 1 to: 16 do: [:i | + d := DES key: x. + (i - 1) even + ifTrue: [d encryptBlock: x] + ifFalse: [d decryptBlock: x] ]. + self assert: x = #(16r1B 16r1A 16r2D 16rDB 16r4C 16r64 16r24 16r38) asByteArray +] + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testTripleDES [ + | plain key d | + plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. + key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. + d := TripleDES key: key. + d encryptBlock: plain. + self assert: plain = #(16rC9 16r57 16r44 16r25 16r6A 16r5E 16rD3 16r1D) asByteArray. + d decryptBlock: plain. + self assert: plain = #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. + +] + +{ #category : #'as yet unclassified' } +CryptoDESTest >> testTripleDESCBC [ + | plain key encryptor decryptor vector | + plain := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. + key := #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF 16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) asByteArray. + vector := #(16r00 16r11 16r22 16r33 16r44 16r55 16r66 16r77) asByteArray. + encryptor := (TripleDES key: key) cbc. + encryptor initialVector: vector copy. + decryptor := (TripleDES key: key) cbc. + decryptor initialVector: vector copy. + encryptor encryptBlock: plain. + decryptor decryptBlock: plain. + encryptor encryptBlock: plain. + decryptor decryptBlock: plain. + self assert: plain = #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rE7) asByteArray. +] diff --git a/source/Cryptography/CryptoDSATest.class.st b/source/Cryptography/CryptoDSATest.class.st new file mode 100644 index 0000000..5296c91 --- /dev/null +++ b/source/Cryptography/CryptoDSATest.class.st @@ -0,0 +1,31 @@ +Class { + #name : #CryptoDSATest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #DSA } +CryptoDSATest >> dsaPrivateKey [ + ^ DSAPrivateKey + p: 8343811888543852523216773185009428259187948644369498021763210776677854991854533186365944349987509452133156416880596803846631577352387751880552969116768071 + q: 1197175832754339660404549606408619548226315875117 + g: 1433467472198821951822151391684734233265646022897503720591270330985699984763922266163182803556189497900262038518780931942996381297743579119123094520048965 + x: 957348690772296812 +] + +{ #category : #'as yet unclassified' } +CryptoDSATest >> dsaPublicKey [ + ^ DSAPublicKey + p: 8343811888543852523216773185009428259187948644369498021763210776677854991854533186365944349987509452133156416880596803846631577352387751880552969116768071 + q: 1197175832754339660404549606408619548226315875117 + g: 1433467472198821951822151391684734233265646022897503720591270330985699984763922266163182803556189497900262038518780931942996381297743579119123094520048965 + y: 4645213122572190617807944614677917601101008235397095646475699959851618402406173485853587185431290863173614335452934961425661774118334228449202337038283799 +] + +{ #category : #DSA } +CryptoDSATest >> testDSASigningAndVerifying [ + | msg sig | + msg := 'This is a test...'. + sig := self dsaPrivateKey signMessage: msg. + self assert: (self dsaPublicKey verify: sig isSignatureOf: msg) +] diff --git a/source/Cryptography/CryptoDiffieHellmanTest.class.st b/source/Cryptography/CryptoDiffieHellmanTest.class.st new file mode 100644 index 0000000..5ce70cc --- /dev/null +++ b/source/Cryptography/CryptoDiffieHellmanTest.class.st @@ -0,0 +1,43 @@ +Class { + #name : #CryptoDiffieHellmanTest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #testing } +CryptoDiffieHellmanTest >> generator [ + + ^ 19717436579274206947345122013064021491006648667525860934655329476450089156965164852462918009904002231332897658527803 +] + +{ #category : #testing } +CryptoDiffieHellmanTest >> prime [ + + ^ 75736283208334870880874184828066736731062763491072315486250947429607562308928878772529680132938244784039544211105987 +] + +{ #category : #testing } +CryptoDiffieHellmanTest >> testDiffieHellman [ + + | alice bob fromAlice fromBob k1 k2 | + alice := DiffieHellman prime: self prime generator: self generator. + bob := DiffieHellman prime: self prime generator: self generator. + fromAlice := alice sendMessage. + fromBob := bob sendMessage. + k1 := alice receiveMessage: fromBob. + k2 := bob receiveMessage: fromAlice. + self assert: k1 = k2 +] + +{ #category : #testing } +CryptoDiffieHellmanTest >> testDiffieHellmanWithGeneration [ + + | alice bob fromAlice fromBob k1 k2 | + alice := DiffieHellman bits: 64. "very low for speed" + bob := DiffieHellman prime: alice prime generator: alice generator. + fromAlice := alice sendMessage. + fromBob := bob sendMessage. + k1 := alice receiveMessage: fromBob. + k2 := bob receiveMessage: fromAlice. + self assert: k1 = k2 +] diff --git a/source/Cryptography/CryptoElGamalTest.class.st b/source/Cryptography/CryptoElGamalTest.class.st new file mode 100644 index 0000000..0a101e3 --- /dev/null +++ b/source/Cryptography/CryptoElGamalTest.class.st @@ -0,0 +1,85 @@ +Class { + #name : #CryptoElGamalTest, + #superclass : #TestCase, + #instVars : [ + 'elGamalGenerators' + ], + #category : #'Cryptography-Tests' +} + +{ #category : #ElGamal } +CryptoElGamalTest >> elGamalGeneratorOfSize: bits [ + ^ elGamalGenerators + at: bits + ifAbsent: + [ "We should at least run the generator code to be sure it gets tested." + ElGamalKeyGenerator new generateKeysOfSize: bits ] +] + +{ #category : #ElGamal } +CryptoElGamalTest >> elGamalSizes [ +" ^#(384 512 768 1024 2048 )" + + ^#(64 512 ) +] + +{ #category : #initialize } +CryptoElGamalTest >> initialize [ + super initialize. + self + initializeElGamalGenerators +] + +{ #category : #ElGamal } +CryptoElGamalTest >> initializeElGamalGenerators [ + elGamalGenerators := Dictionary new + + at: 512 + put: + (ElGamalKeyGenerator basicNew instVarAt: 1 put: 14997038101000471656908825146898513563002169840799091820711874590927961409550512572428509314042888054869079913003134043613271458211821248434060678863943999; instVarAt: 2 put: 5361564564837954391893723942228287597694468337177799740324910691768071826418893848377283607598491893249419038971685698869752393654611799189607985606751717; instVarAt: 3 put: 14403853607602337679914835868070068312873008366859520925460200717630345023960768832597791608212285651911616689566045479334218776261375380546818169284633222; yourself) ; + at: 768 + put: "time to generate (1.3GHz laptop): 0:00:15:35.71" + (ElGamalKeyGenerator basicNew instVarAt: 1 put: 1627332758910669005349673899493430221060426291376421198672767104943990188121953540024154874632086014644358143872462042844845205724969954316173299451580831206047385225398963232807212824639418997262644394808208010952184597290928279083; instVarAt: 2 put: 637353925196181662716534281309417485695156757195851477182610451877569627941960958993724216664932866527382869766700707821847752783200389297904293272300703210689296849853090260886879923123065483201535107015232963789463552975559327338; instVarAt: 3 put: 1382119909913548250681949383374805537713040446907845318586396338232006123603639447180435936299472529495807027144078416474159199852128556879205262745414383327498575491661863562367989514634268303068691788866483656964224388150042511145; yourself) ; + + at: 1024 + put: "time to generate (1.3GHz laptop): 0:00:47:36.288" + (ElGamalKeyGenerator basicNew instVarAt: 1 put: 187962930112203130099304875066550992472989894755401650849423145019107775415120153753379890896898159468888909642301301426861539004261391697652587719733773666895578476166092219394431668865654035130702071975227577489091637769871178365952593486414574736105032572563196302943313478263258078003344616094907879494183; instVarAt: 2 put: 101379856798288932395208478694565744867478878485170411883016695448216014229040233878325777809530026322981840402000631493588538174303052403820192798556612765069387657111145929959798776355339656977979943366339321986473695320247202765836954753923663960196445984306386126700715069527679925061366367143594939752311; instVarAt: 3 put: 166515262641331249052409678632107998360295620903954709872386461965666190307310785117636796778342643935688990419372071274434257100649608137040102448736492114478048476296404763678373473030171410691968491068014395855534564710476510365843729427792397083999439079005119559363379365315966400331819925035641027782262; yourself) ; + + at: 2048 + put: "time to generate (1.3GHz laptop): 0:10:12:51.318" + (ElGamalKeyGenerator basicNew instVarAt: 1 put: 43744550524640778592149701468321500307659483711161614933780759317538835660018499584863359875319736195497834842011206606111677937058576081833326123611960958651716618573704725631301784031019401088209827585193009767033768284401492225440611202384860046570022594166194086374043414523106999827113761864480276549701342546190042502746170762523030838415181639559467384246646980630730354186842888000169398408845020528778902676590121957276525059882643422002341827009727652951788957728483337275699584610825200769579177116050586037396083453876647282696542617919089209621847548931160771918736412809101535195712578982414848324842023; instVarAt: 2 put: 10712249143584610517062034706393748750841448112842264168635103160726320592857516094777199394038060786699730059487045452474549294208077531478734497996197653738535125856484035290422114479816131356589211862230201414545738081276869984650096988089393906878268413233796553170847827164856623679160971724585707100834284358979484189497136931922824212488771387863590257584963981297527371077585758027526026146064280994391353033474013279212299950762699784082492767463217396754190025401868735342133341990021934718202416382949744384380039458404029702056002896172354530543264720995892165487343788849479311283598302664326567957332056; instVarAt: 3 put: 34071313526526550964319859214388665314022163381999037971182526093331137188777643466498971633059086483606132787656147890791281175830824595869636722657222797206435777085613341792023090529456287226683946127489180430863850983140873843765939491483118681168525418491145087283699270267894578719923555878333437301788432335456184779553157758814789690967079053314015566185742547007752259485986859847843898791493225888341829225652240920951193796829090836607954659113174671564171844005862397483897607655449822950579836313328217159525558966188520476621728360816330014688201932196096220643747293750747578885327851920080280020579421; yourself) ; + + yourself +] + +{ #category : #ElGamal } +CryptoElGamalTest >> performElGamalEncryption: bits [ + | elgamal pub priv c element | + elgamal := self elGamalGeneratorOfSize: bits. + pub := elgamal publicKey. + priv := elgamal privateKey. + element := (SecureRandom picker nextBits: bits). + c := pub encryptElement: element. + self assert: (priv decryptElement: c) = element +] + +{ #category : #ElGamal } +CryptoElGamalTest >> performElGamalSignature: bits [ + | elgamal pub priv signature message | + elgamal := self elGamalGeneratorOfSize: bits. + pub := elgamal publicKey. + priv := elgamal privateKey. + message := SecureRandom picker nextBits: bits. + signature := priv signMessage: message. + self assert: (pub verifySignature: signature onMessage: message) +] + +{ #category : #ElGamal } +CryptoElGamalTest >> testElGamalEncryption [ + self elGamalSizes do: [:eachBits | self performElGamalEncryption: eachBits] +] + +{ #category : #ElGamal } +CryptoElGamalTest >> testElGamalSignature [ + self elGamalSizes do: [:eachBits | self performElGamalSignature: eachBits] +] diff --git a/source/Cryptography/CryptoHashFunctionTest.class.st b/source/Cryptography/CryptoHashFunctionTest.class.st new file mode 100644 index 0000000..a2b6020 --- /dev/null +++ b/source/Cryptography/CryptoHashFunctionTest.class.st @@ -0,0 +1,98 @@ +Class { + #name : #CryptoHashFunctionTest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testHMAC [ + self assert: (MD5 new hmac key: (ByteArray new: 16 withAll: 16r0B); digestMessage: 'Hi There' asByteArray) asInteger = 16r9294727A3638BB1C13F48EF8158BFC9D. + self assert: (MD5 new hmac key: 'Jefe' asByteArray; digestMessage: 'what do ya want for nothing?' asByteArray) asInteger = 16r750C783E6AB0B503EAA86E310A5DB738. + self assert: (MD5 new hmac key: (ByteArray new: 16 withAll: 16rAA); digestMessage: (ByteArray new: 50 withAll: 16rDD)) asInteger = 16r56BE34521D144C88DBB8C733F0E8B3F6 +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testHMACSHA1 [ + self assert: ((SHA1 new hmac key: (ByteArray new: 16 withAll: 16r0B); digestMessage: 'Hi There' asByteArray) asByteArray) = #(16r67 16r5B 16rB 16r3A 16r1B 16r4D 16rDF 16r4E 16r12 16r48 16r72 16rDA 16r6C 16r2F 16r63 16r2B 16rFE 16rD9 16r57 16rE9) asByteArray +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testLargeSHA1 [ + "Here is the third example from the specification document (FIPS PUB 180-1). This example may take several minutes." + self assert: (SHA1 hashMessage: (String new: 1000000 withAll: $a)) asInteger = 16r34AA973CD4C4DAA4F61EEB2BDBAD27316534016F +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testMD2 [ + self assert: (MD2 hashMessage: '') asInteger = 16r8350E5A3E24C153DF2275C9F80692773. + self assert: (MD2 hashMessage: 'a') asInteger = 16r32EC01EC4A6DAC72C0AB96FB34C0B5D1. + self assert: (MD2 hashMessage: 'abc') asInteger = 16rDA853B0D3F88D99B30283A69E6DED6BB. + self assert: (MD2 hashMessage: 'message digest') asInteger = 16rAB4F496BFB2A530B219FF33031FE06B0. + self assert: (MD2 hashMessage: 'abcdefghijklmnopqrstuvwxyz') asInteger = 16r4E8DDFF3650292AB5A4108C3AA47940B. + self assert: (MD2 hashMessage: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') asInteger = 16rDA33DEF2A42DF13975352846C30338CD. + self assert: (MD2 hashMessage: '12345678901234567890123456789012345678901234567890123456789012345678901234567890') asInteger = 16rD5976F79D83D3A0DC9806C3C66F3EFD8. +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testMD4 [ + self assert: (MD4 hashMessage: #(115 0 115 0 110 0) asByteArray) = #(252 63 129 51 180 217 221 240 64 37 167 140 183 214 26 126) asByteArray +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testMD5 [ + + self assert: (MD5 hashMessage: '') asInteger = 16rD41D8CD98F00B204E9800998ECF8427E. + self assert: (MD5 hashMessage: 'a') asInteger = 16r0CC175B9C0F1B6A831C399E269772661. + self assert: (MD5 hashMessage: 'abc') asInteger = 16r900150983CD24FB0D6963F7D28E17F72. + self assert: (MD5 hashMessage: 'message digest') asInteger = 16rF96B697D7CB7938D525A2F31AAF161D0. + self assert: (MD5 hashMessage: 'abcdefghijklmnopqrstuvwxyz') asInteger = 16rC3FCD3D76192E4007DFB496CCA67E13B. + self assert: (MD5 hashMessage: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') asInteger = 16rD174AB98D277D9F5A5611C2C9F419D9F. + self assert: (MD5 hashMessage: '12345678901234567890123456789012345678901234567890123456789012345678901234567890') asInteger = 16r57EDF4A22BE3C955AC49DA2E2107B67A +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testMD5Implementations [ + "Check if the two implementations give the same results. Do nothing if the plugin is not available" + + | data | + MD5 isPluginAvailable ifFalse: [ ^self ]. + data := ''. + 100 timesRepeat: [ + | primitive nonPrimitive | + primitive := MD5NonPrimitive basicNew hashMessage: data. + nonPrimitive := MD5WithPrimitive basicNew hashMessage: data. + self assert: primitive = nonPrimitive. + data := data, 'Squeak' ] +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testSHA1 [ + self assert: (SHA1 hashMessage: 'abc') asInteger = 16rA9993E364706816ABA3E25717850C26C9CD0D89D. + self assert: (SHA1 hashMessage: 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') asInteger = 16r84983E441C3BD26EBAAE4AA1F95129E5E54670F1 + +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testSHA256 [ + "these tests come from http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf" + + self assert: (SHA256 hashMessage: 'abc') asInteger = 16rBA7816BF8F01CFEA414140DE5DAE2223B00361A396177A9CB410FF61F20015AD. + self assert: (SHA256 hashMessage: 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq') asInteger = 16r248D6A61D20638B8E5C026930C3E6039A33CE45964FF2167F6ECEDD419DB06C1. + SHA256 isPluginAvailable ifTrue: [ "takes a while to run without the plugin" + self assert: (SHA256 hashMessage: (String new: 1000000 withAll: $a)) asInteger = 16rCDC76E5C9914FB9281A1C7E284D73E67F1809A48A497200E046D39CCC7112CD0 ] +] + +{ #category : #'hash algorithms' } +CryptoHashFunctionTest >> testSHA256Implementations [ + "Check if the two implementations give the same results. Do nothing if the plugin is not available" + + | data | + SHA256 isPluginAvailable ifFalse: [ ^self ]. + data := ''. + 100 timesRepeat: [ + | primitive nonPrimitive | + primitive := SHA256NonPrimitive basicNew hashMessage: data. + nonPrimitive := SHA256WithPrimitive basicNew hashMessage: data. + self assert: primitive = nonPrimitive. + data := data, 'Squeak' ] +] diff --git a/source/Cryptography/CryptoRC2Test.class.st b/source/Cryptography/CryptoRC2Test.class.st new file mode 100644 index 0000000..555654e --- /dev/null +++ b/source/Cryptography/CryptoRC2Test.class.st @@ -0,0 +1,88 @@ +Class { + #name : #CryptoRC2Test, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #testing } +CryptoRC2Test >> genericARC2TestKey: key effectiveKeyLength: aLength plaintext: plainText ciphertext: ciphertext [ + | vector rc2 | + vector := plainText copy. + rc2 := ARC2 key: key effectiveKeyLength: aLength. + rc2 encryptBlock: vector. + self assert: vector = ciphertext. + + rc2 decryptBlock: vector. + self assert: vector = plainText. + rc2 destroy. +] + +{ #category : #testing } +CryptoRC2Test >> testARC2 [ + " All quantities are given in hexadecimal notation. + + Key length (bytes) = 8 + Effective key length (bits) = 63 + Key = 00000000 00000000 + Plaintext = 00000000 00000000 + Ciphertext = ebb773f9 93278eff " + + self genericARC2TestKey: (ByteArray fromHexString: '0000000000000000') effectiveKeyLength: 63 plaintext: (ByteArray fromHexString: '0000000000000000') ciphertext: (ByteArray fromHexString: 'ebb773f993278eff'). + + "Key length (bytes) = 8 + Effective key length (bits) = 64 + Key = ffffffff ffffffff + Plaintext = ffffffff ffffffff + Ciphertext = 278b27e4 2e2f0d49" + + self genericARC2TestKey: (ByteArray fromHexString: 'ffffffffffffffff') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: 'ffffffffffffffff') ciphertext: (ByteArray fromHexString: '278b27e42e2f0d49'). + + "Key length (bytes) = 8 + Effective key length (bits) = 64 + Key = 30000000 00000000 + Plaintext = 10000000 00000001 + Ciphertext = 30649edf 9be7d2c2" + + self genericARC2TestKey: (ByteArray fromHexString: '3000000000000000') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '1000000000000001') ciphertext: (ByteArray fromHexString: '30649edf9be7d2c2'). + + "Key length (bytes) = 1 + Effective key length (bits) = 64 + Key = 88 + Plaintext = 00000000 00000000 + Ciphertext = 61a8a244 adacccf0" + + self genericARC2TestKey: (ByteArray fromHexString: '88') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '0000000000000000') ciphertext: (ByteArray fromHexString: '61a8a244adacccf0'). + + "Key length (bytes) = 7 + Effective key length (bits) = 64 + Key = 88bca90e 90875a + Plaintext = 00000000 00000000 + Ciphertext = 6ccf4308 974c267f" + + self genericARC2TestKey: (ByteArray fromHexString: '88bca90e90875a') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '0000000000000000') ciphertext: (ByteArray fromHexString: '6ccf4308974c267f'). + + "Key length (bytes) = 16 + Effective key length (bits) = 64 + Key = 88bca90e 90875a7f 0f79c384 627bafb2 + Plaintext = 00000000 00000000 + Ciphertext = 1a807d27 2bbe5db1" + + self genericARC2TestKey: (ByteArray fromHexString: '88bca90e90875a7f0f79c384627bafb2') effectiveKeyLength: 64 plaintext: (ByteArray fromHexString: '0000000000000000') ciphertext: (ByteArray fromHexString: '1a807d272bbe5db1'). + + "Key length (bytes) = 16 + Effective key length (bits) = 128 + Key = 88bca90e 90875a7f 0f79c384 627bafb2 + Plaintext = 00000000 00000000 + Ciphertext = 2269552a b0f85ca6" + + self genericARC2TestKey: (ByteArray fromHexString: '88bca90e90875a7f0f79c384627bafb2') effectiveKeyLength: 128 plaintext: (ByteArray fromHexString: '0000000000000000') ciphertext: (ByteArray fromHexString: '2269552ab0f85ca6'). + + "Key length (bytes) = 33 + Effective key length (bits) = 129 + Key = 88bca90e 90875a7f 0f79c384 627bafb2 16f80a6f 85920584 + c42fceb0 be255daf 1e + Plaintext = 00000000 00000000 + Ciphertext = 5b78d3a4 3dfff1f1" + + self genericARC2TestKey: (ByteArray fromHexString: '88bca90e90875a7f0f79c384627bafb216f80a6f85920584c42fceb0be255daf1e') effectiveKeyLength: 129 plaintext: (ByteArray fromHexString: '0000000000000000') ciphertext: (ByteArray fromHexString: '5b78d3a43dfff1f1'). +] diff --git a/source/Cryptography/CryptoRC4Test.class.st b/source/Cryptography/CryptoRC4Test.class.st new file mode 100644 index 0000000..222496c --- /dev/null +++ b/source/Cryptography/CryptoRC4Test.class.st @@ -0,0 +1,23 @@ +Class { + #name : #CryptoRC4Test, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #'as yet unclassified' } +CryptoRC4Test >> genericARC4TestKey: key plaintext: plaintext ciphertext: ciphertext [ + | vector rc4 | + vector := plaintext copy. + rc4 := ARC4 new. + rc4 key: key. + vector := rc4 encrypt: vector. + self assert: vector = ciphertext +] + +{ #category : #'as yet unclassified' } +CryptoRC4Test >> testARC4 [ + self genericARC4TestKey: #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) plaintext: #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) ciphertext: #(16r75 16rB7 16r87 16r80 16r99 16rE0 16rC5 16r96). + self genericARC4TestKey: #(16r01 16r23 16r45 16r67 16r89 16rAB 16rCD 16rEF) plaintext: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) ciphertext: #(16r74 16r94 16rC2 16rE7 16r10 16r4B 16r08 16r79). + self genericARC4TestKey: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) plaintext: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) ciphertext: #(16rDE 16r18 16r89 16r41 16rA3 16r37 16r5D 16r3A). + self genericARC4TestKey: #(16rEF 16r01 16r23 16r45) plaintext: #(16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r00) ciphertext: #(16rD6 16rA1 16r41 16rA7 16rEC 16r3C 16r38 16rDF 16rBD 16r61) +] diff --git a/source/Cryptography/CryptoRandomTest.class.st b/source/Cryptography/CryptoRandomTest.class.st new file mode 100644 index 0000000..33026f3 --- /dev/null +++ b/source/Cryptography/CryptoRandomTest.class.st @@ -0,0 +1,22 @@ +Class { + #name : #CryptoRandomTest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #others } +CryptoRandomTest >> testRandomGenerators [ + | random randomBytes | + RandomGenerator allSubclassesDo: + [ : each | + random := each withGeneratedKey. + 100 timesRepeat: + [ self assert: ((random nextBits: 1) between: 0 and: 1) ]. + 100 timesRepeat: [ self assert: (random nextBits: 1024) highBit <= 1024 ]. + "Random enough to span all 10 within 100-elements?" + self assert: ((1 to: 100) collect: [ : n | random nextInt: 10 ]) asSet asSortedCollection = (1 to: 10) asSortedCollection. + randomBytes := random nextBytes: 100. + self + assert: randomBytes size = 100 ; + assert: randomBytes asSet size > 1 "if this fails, I wanna see it!" ] +] diff --git a/source/Cryptography/CryptoRigndaelCBCTest.class.st b/source/Cryptography/CryptoRigndaelCBCTest.class.st new file mode 100644 index 0000000..f245e50 --- /dev/null +++ b/source/Cryptography/CryptoRigndaelCBCTest.class.st @@ -0,0 +1,93 @@ +Class { + #name : #CryptoRigndaelCBCTest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #tests } +CryptoRigndaelCBCTest >> testByteArrayFromHexString [ + "this test requres that the cryptography core method fromHexString be loaded the main purpose of the method fromHexString is to + ensure leading zeros are not chopped off and that small case letters in hex strings are allowed" + self assert: (ByteArray fromHexString: '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f') storeString = + '#[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31]'. + self assert: (ByteArray fromHexString: '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f') storeString = + '#[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31]'. +] + +{ #category : #tests } +CryptoRigndaelCBCTest >> testRFC3602Case1 [ + "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html + Case #1: Encrypting 16 bytes (1 block) using AES-CBC with 128-bit key + Key : 0x06a9214036b8a15b512e03d534120006 + IV : 0x3dafba429d9eb430b422da802c9fac41 + Plaintext : 'Single block msg' + Ciphertext: 0xe353779c1079aeb82708942dbe77181a" + | result | + ((CBC on: (Rijndael new keySize: 16; + key: (ByteArray fromHexString: '06a9214036b8a15b512e03d534120006'))) + initialVector: (ByteArray fromHexString: '3dafba429d9eb430b422da802c9fac41')) + encryptBlock: (result := 'Single block msg' asByteArray). + self assert: result hex = 'e353779c1079aeb82708942dbe77181a' +] + +{ #category : #tests } +CryptoRigndaelCBCTest >> testRFC3602Case2 [ + "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html + Case #2: Encrypting 32 bytes (2 blocks) using AES-CBC with 128-bit key + Key : 0xc286696d887c9aa0611bbb3e2025a45a + IV : 0x562e17996d093d28ddb3ba695a2e6f58 + Plaintext : 0x000102030405060708090a0b0c0d0e0f + 101112131415161718191a1b1c1d1e1f + Ciphertext: 0xd296cd94c2cccf8a3a863028b5e1dc0a + 7586602d253cfff91b8266bea6d61ab1" + + | result | + result := ((CBC on: (Rijndael new keySize: 16; + key: (ByteArray fromHexString: 'c286696d887c9aa0611bbb3e2025a45a'))) + initialVector: (ByteArray fromHexString: '562e17996d093d28ddb3ba695a2e6f58')) + encrypt: (result := ByteArray fromHexString: '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f'). + self assert: result hex = 'd296cd94c2cccf8a3a863028b5e1dc0a7586602d253cfff91b8266bea6d61ab1bcfd81022202366bde6dd260a15841a1' +] + +{ #category : #tests } +CryptoRigndaelCBCTest >> testRFC3602Case3 [ + "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html + Case #3: Encrypting 48 bytes (3 blocks) using AES-CBC with 128-bit key + Key : 0x6c3ea0477630ce21a2ce334aa746c2cd + IV : 0xc782dc4c098c66cbd9cd27d825682c81 + Plaintext : This is a 48-byte message (exactly 3 AES blocks) + Ciphertext: 0xd0a02b3836451753d493665d33f0e886 + 2dea54cdb293abc7506939276772f8d5 + 021c19216bad525c8579695d83ba2684" + | result | + result := ((CBC on: (Rijndael new keySize: 16; + + key: (ByteArray fromHexString: '6c3ea0477630ce21a2ce334aa746c2cd'))) + initialVector: (ByteArray fromHexString: 'c782dc4c098c66cbd9cd27d825682c81')) + encrypt: 'This is a 48-byte message (exactly 3 AES blocks)' asByteArray. + self assert: result hex = 'd0a02b3836451753d493665d33f0e8862dea54cdb293abc7506939276772f8d5021c19216bad525c8579695d83ba2684d248b3e0f2388c137102846eb06272ff' +] + +{ #category : #tests } +CryptoRigndaelCBCTest >> testRFC3602Case4 [ + "this test comes from RFC3602 http://www.faqs.org/rfcs/rfc3602.html + Case #4: Encrypting 64 bytes (4 blocks) using AES-CBC with 128-bit key + Key : 0x56e47a38c5598974bc46903dba290349 + IV : 0x8ce82eefbea0da3c44699ed7db51b7d9 + Plaintext : 0xa0a1a2a3a4a5a6a7a8a9aaabacadaeaf + b0b1b2b3b4b5b6b7b8b9babbbcbdbebf + c0c1c2c3c4c5c6c7c8c9cacbcccdcecf + d0d1d2d3d4d5d6d7d8d9dadbdcdddedf + Ciphertext: 0xc30e32ffedc0774e6aff6af0869f71aa + 0f3af07a9a31a9c684db207eb0ef8e4e + 35907aa632c3ffdf868bb7b29d3d46ad + 83ce9f9a102ee99d49a53e87f4c3da55 +" + | result | + result := ((CBC on: (Rijndael new keySize: 16; + + key: (ByteArray fromHexString: '56e47a38c5598974bc46903dba290349'))) + initialVector: (ByteArray fromHexString: '8ce82eefbea0da3c44699ed7db51b7d9')) + encrypt: (ByteArray fromHexString: 'a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf'). + self assert: result hex = 'c30e32ffedc0774e6aff6af0869f71aa0f3af07a9a31a9c684db207eb0ef8e4e35907aa632c3ffdf868bb7b29d3d46ad83ce9f9a102ee99d49a53e87f4c3da5578b8d04731041aa2d9787ca4a4fa3eef' +] diff --git a/source/Cryptography/CryptoRijndaelTest.class.st b/source/Cryptography/CryptoRijndaelTest.class.st new file mode 100644 index 0000000..18f9840 --- /dev/null +++ b/source/Cryptography/CryptoRijndaelTest.class.st @@ -0,0 +1,132 @@ +Class { + #name : #CryptoRijndaelTest, + #superclass : #TestCase, + #category : #'Cryptography-Tests' +} + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> runBlockCipherModeTest: cipherModeSelector [ + | key encipherer decipherer startMsg | + key := #(190 219 189 251 27 38 8 9 135 25 167 8 238 107 29 251 136 65 107 0 37 215 45 130 84 87 13 206 8 55 74 82) asByteArray. + encipherer := (Rijndael key: key) perform: cipherModeSelector. + decipherer := (Rijndael key: key) perform: cipherModeSelector. + "Stream ciphers do not require padding, therefore blocks can be less than the encipherer's blockSize." + startMsg := encipherer isStreamCipher ifTrue: [ 900 ] ifFalse: [ 1000 ]. + startMsg to: 1200 do: + [ : n | | block originalBlock iv | + block := ('some message', n printString) asByteArray. + iv := ByteArray new: Rijndael blockSize. + iv uint: Rijndael blockSize*8 at: 1 put: n. + encipherer initialVector: iv copy. + decipherer initialVector: iv copy. + originalBlock := block copy. + encipherer encryptBlock: block. + self deny: block = originalBlock. + self assert: block size = originalBlock size. + decipherer decryptBlock: block. + self assert: block = originalBlock ] +] + +{ #category : #'as yet unclassified' } +CryptoRijndaelTest >> runEncryptDecrypt: blockCipherClass [ + | msg key1 key2 enc1 enc2 dec1 dec2 ct2 ct1 | + enc1 := blockCipherClass key: (key1 := SecureRandom picker nextBytes: 16). + dec1 := blockCipherClass key: key1. + enc2 := blockCipherClass key: (key2 := SecureRandom picker nextBytes: 16). + dec2 := blockCipherClass key: key2. + msg := 'hello how are you?' asByteArray. + ct2 := enc2 encrypt: msg. + self deny: msg = ct2. + self assert: (dec2 decrypt: ct2) = msg. + "ensure the cipher still works if its key is changed after creation, both for the encryptor instance and decryptor instance." + enc1 key: key2. dec1 key: key2. + ct1 := enc1 encrypt: msg. + self assert: (dec1 decrypt: ct1) = msg +] + +{ #category : #'as yet unclassified' } +CryptoRijndaelTest >> testByteArrayPadding [ + | paddedHello fullBlockPad needsFullPad | + paddedHello := #(104 101 108 108 111 11 11 11 11 11 11 11 11 11 11 11 ) asByteArray. + self assert: paddedHello isProperlyPadded. + self assert: ('hello' asByteArray padToMultipleOf: 16) = paddedHello. + self assert: paddedHello unpaddedSize = 'hello' size. + + fullBlockPad := #(16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16) asByteArray. + self assert: fullBlockPad asByteArray isProperlyPadded. + + needsFullPad := '1234567890123456' asByteArray padToMultipleOf: 16. + self assert: needsFullPad size = 32. + self assert: (needsFullPad copyFrom: 17 to: 32) = fullBlockPad. + self assert: needsFullPad isProperlyPadded. + self assert: needsFullPad unpaddedSize = 16 +] + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> testCBC [ + self runBlockCipherModeTest: #cbc +] + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> testCFB [ + self runBlockCipherModeTest: #cfb +] + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> testCTR [ + self runBlockCipherModeTest: #ctr +] + +{ #category : #others } +CryptoRijndaelTest >> testEncryptDecrypt [ + BlockCipherMode allSubclasses asArray do: + [ : each | + [ self runEncryptDecrypt: each ] + on: Warning + do: [ : warn | warn resume ] ] +] + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> testOFB [ + self runBlockCipherModeTest: #ofb +] + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> testRijndael [ + | rijndael vector | + rijndael := Rijndael new keySize: 16; key: (0 to: 15) asByteArray. + vector := (0 to: 15) asByteArray. + rijndael encryptBlock: vector. + self assert: vector hex = '0a940bb5416ef045f1c39458c653ea5a'. + rijndael decryptBlock: vector. + self assert: vector hex = '000102030405060708090a0b0c0d0e0f'. + + rijndael := Rijndael new blockSize: 16; keySize: 24. + rijndael key: (0 to: 16r17) asByteArray. + vector := (0 to: 15) asByteArray. + rijndael encryptBlock: vector. + self assert: vector hex = '0060bffe46834bb8da5cf9a61ff220ae'. + rijndael decryptBlock: vector. + self assert: vector hex = '000102030405060708090a0b0c0d0e0f'. + + rijndael := Rijndael new blockSize: 16; keySize: 32. + rijndael key: (0 to: 16r1F) asByteArray. + vector := (0 to: 15) asByteArray. + rijndael encryptBlock: vector. + self assert: vector hex = '5a6e045708fb7196f02e553d02c3a692'. + rijndael decryptBlock: vector. + self assert: vector hex = '000102030405060708090a0b0c0d0e0f' +] + +{ #category : #'block ciphers' } +CryptoRijndaelTest >> testRijndael128128 [ + | key vector cipher | + key := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C) asByteArray. + vector := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34) asByteArray. + + cipher := Rijndael new keySize: 16; key: key. + cipher encryptBlock: vector. + self assert: vector hex = '3925841d02dc09fbdc118597196a0b32'. + cipher decryptBlock: vector. + self assert: vector hex = '3243f6a8885a308d313198a2e0370734' +] diff --git a/source/Cryptography/CryptographyError.class.st b/source/Cryptography/CryptographyError.class.st new file mode 100644 index 0000000..f5d6161 --- /dev/null +++ b/source/Cryptography/CryptographyError.class.st @@ -0,0 +1,5 @@ +Class { + #name : #CryptographyError, + #superclass : #Error, + #category : #'Cryptography-RandomAndPrime' +} diff --git a/source/Cryptography/DES.class.st b/source/Cryptography/DES.class.st new file mode 100644 index 0000000..a43e1d5 --- /dev/null +++ b/source/Cryptography/DES.class.st @@ -0,0 +1,126 @@ +" +This class implements the Data Encryption Standard (DES) block cipher per +ANSI X3.92. It requires the presence of the 'DESPlugin'. At some future +date the functionality of the plugin may be provided in pure Smalltalk, but +the slowness would be prohibitive for anything other than trivial usage. +The main barrier to translation is the heavy use of zero-based indexing of +arrays. + +How to use: you first provide an 8-byte key which will be used to encode +and decode the data. Internally, this is 'cooked' into a 32-word format to +speed up the encryption process. The data is then sent in 8-byte packets +to be encoded or decoded. You must externally account for padding. See +the 'testing' category on the class side for examples. + +As of this date (1/26/2000), the U.S. Government has lifted many of the +previous restrictions on the export of encryption software, but you should +check before exporting anything including this code. + +Submitted by Duane Maxwell. + + +" +Class { + #name : #DES, + #superclass : #BlockCipher, + #instVars : [ + 'cookedKey', + 'key', + 'encrypting', + 'nonPrimitive' + ], + #category : #'Cryptography-DES' +} + +{ #category : #accessing } +DES class >> blockSize [ + ^ 8 +] + +{ #category : #accessing } +DES class >> keySize [ + ^ 8 +] + +{ #category : #accessing } +DES >> decryptBlock: aByteArray [ + | int | + self primPluginAvailable + ifTrue: [ + encrypting = false ifFalse: [self key: key encrypt: false]. + ^self transform: aByteArray]. + nonPrimitive isNil ifTrue: [ + nonPrimitive := DESNonPrimitive new setKeyFromByteArray: key]. + int := ((aByteArray unsignedLongAt: 1 bigEndian: true) bitShift: 32) + + (aByteArray unsignedLongAt: 5 bigEndian: true). + int := nonPrimitive decryptBlock: int. + aByteArray unsignedLongAt: 1 put: (int bitShift: -32) bigEndian: true. + aByteArray unsignedLongAt: 5 put: (int bitAnd: 16rFFFFFFFF) bigEndian: true +] + +{ #category : #accessing } +DES >> encryptBlock: aByteArray [ + | int | + self primPluginAvailable + ifTrue: [ + encrypting = true ifFalse: [self key: key encrypt: true]. + ^self transform: aByteArray]. + nonPrimitive isNil ifTrue: [ + nonPrimitive := DESNonPrimitive new setKeyFromByteArray: key]. + int := ((aByteArray unsignedLongAt: 1 bigEndian: true) bitShift: 32) + + (aByteArray unsignedLongAt: 5 bigEndian: true). + int := nonPrimitive encryptBlock: int. + aByteArray unsignedLongAt: 1 put: (int bitShift: -32) bigEndian: true. + aByteArray unsignedLongAt: 5 put: (int bitAnd: 16rFFFFFFFF) bigEndian: true +] + +{ #category : #accessing } +DES >> key: aByteArray [ + key := aByteArray. + encrypting := nil. + nonPrimitive := nil +] + +{ #category : #private } +DES >> key: aByteArray encrypt: aBoolean [ + encrypting := aBoolean. + self primPluginAvailable ifFalse: [^self]. + aByteArray size = 8 ifFalse: [self error: 'DES key must be 8 bytes']. + cookedKey := WordArray new: 32. + cookedKey atAllPut: 0. + self primCookKey: aByteArray mode: (aBoolean ifTrue: [1] ifFalse: +[0]) to: cookedKey +] + +{ #category : #primitives } +DES >> primCookKey: aByteArray mode: flag to: cooked [ + + ^ self primitiveFailed + + +] + +{ #category : #primitives } +DES >> primPluginAvailable [ + + ^ false +] + +{ #category : #primitives } +DES >> primTransform: aByteArray using: cooked [ + + ^ self primitiveFailed +] + +{ #category : #private } +DES >> transform: block [ + + self primPluginAvailable ifFalse: [self error: 'DES plugin missing']. + cookedKey ifNil: [ self error: 'DES key not provided']. + cookedKey size = 32 ifFalse: [ self error: 'DES cooked key damaged']. + block size = 8 ifFalse: [ self error: 'DES block must be 8 +bytes']. + self primTransform: block using: cookedKey. + + +] diff --git a/source/Cryptography/DESBitPermutation.class.st b/source/Cryptography/DESBitPermutation.class.st new file mode 100644 index 0000000..e045bc9 --- /dev/null +++ b/source/Cryptography/DESBitPermutation.class.st @@ -0,0 +1,87 @@ +" +Instances of this class can be used to permute bits in an integer according to a predefined mapping. It's used for DES encryption in several places. +" +Class { + #name : #DESBitPermutation, + #superclass : #Object, + #instVars : [ + 'tables' + ], + #classVars : [ + 'ChunkBits', + 'ChunkMask' + ], + #category : #'Cryptography-DES' +} + +{ #category : #'instance creation' } +DESBitPermutation class >> fromBitIndexes: aCollection [ + "aCollection are bit indexes counting from the right, unlike the DES spec which counts from the left" + "Example: the key permutation table for DES + self fromBitIndexes: (#( + 57 49 41 33 25 17 9 + 1 58 50 42 34 26 18 + 10 2 59 51 43 35 27 + 19 11 3 60 52 44 36 + 63 55 47 39 31 23 15 + 7 62 54 46 38 30 22 + 14 6 61 53 45 37 29 + 21 13 5 28 20 12 4) reverse collect: [:i | 64-i])" + | permutation | + permutation := self new initialize. + aCollection doWithIndex: [:srcBit :dstBit | permutation map: srcBit to: dstBit-1]. + ^permutation +] + +{ #category : #'instance creation' } +DESBitPermutation class >> fromDESBitIndexes: aCollection sourceWidth: sourceWidth [ + "aCollection are bit indexes counting from the right, unlike the DES spec which counts from the left" + "Example: the key permutation table for DES + self fromDESBitIndexes: #( + 57 49 41 33 25 17 9 + 1 58 50 42 34 26 18 + 10 2 59 51 43 35 27 + 19 11 3 60 52 44 36 + 63 55 47 39 31 23 15 + 7 62 54 46 38 30 22 + 14 6 61 53 45 37 29 + 21 13 5 28 20 12 4) sourceWidth: 64" + ^self fromBitIndexes: (aCollection reverse collect: [:i | sourceWidth-i]) +] + +{ #category : #'class initialization' } +DESBitPermutation class >> initialize [ + "DESBitPermutation initialize" + ChunkBits := 6. + ChunkMask := (1 bitShift: ChunkBits) - 1 +] + +{ #category : #'initialize-release' } +DESBitPermutation >> initialize [ + tables := #() +] + +{ #category : #'initialize-release' } +DESBitPermutation >> map: srcBit to: dstBit [ + | i mask array bit | + i := srcBit // ChunkBits + 1. + [tables size < i] whileTrue: [tables := tables copyWith: (Array new: ChunkMask+1 withAll: 0)]. + mask := 1 bitShift: (srcBit \\ ChunkBits). + array := tables at: i. + bit := 1 bitShift: dstBit. + 0 to: ChunkMask do: [:index | + (index bitAnd: mask) = mask ifTrue: [ + array at: index+1 put: ((array at: index+1) bitOr: bit)]] +] + +{ #category : #permuting } +DESBitPermutation >> permute: input [ + | output shift bits | + output := 0. + shift := 0. + tables do: [:array | + bits := (input bitShift: shift) bitAnd: ChunkMask. + output := output + (array at: bits+1). + shift := shift - ChunkBits]. + ^output +] diff --git a/source/Cryptography/DESNonPrimitive.class.st b/source/Cryptography/DESNonPrimitive.class.st new file mode 100644 index 0000000..5362eb4 --- /dev/null +++ b/source/Cryptography/DESNonPrimitive.class.st @@ -0,0 +1,212 @@ +Class { + #name : #DESNonPrimitive, + #superclass : #BlockCipher, + #instVars : [ + 'k' + ], + #classVars : [ + 'EBitSelectionTable', + 'IIP', + 'IP', + 'P', + 'PC1', + 'PC2', + 'SBoxes' + ], + #category : #'Cryptography-DES' +} + +{ #category : #'class initialization' } +DESNonPrimitive class >> initSBox: index from: anArray [ + "Initialization data is given in the same order order as in the spec, which is nonsense. + This method reorders it to avoid reordering in the encryption/decryption process." + "Validity test: + (DESNonPrimitive new applyToSBoxes: 2r011101000101110101000111101000011100101101011101) + = 2r00110100111001011010010110101001" + | row col | + SBoxes at: index put: ((0 to: 63) collect: [:i | + row := i // 32 * 2 + (i \\ 2). + col := i // 2 \\ 16. + anArray at: row * 16 + col + 1]) +] + +{ #category : #'class initialization' } +DESNonPrimitive class >> initialize [ + "DESNonPrimitive initialize" + DESBitPermutation initialize. + PC1 := DESBitPermutation fromDESBitIndexes: #( + 57 49 41 33 25 17 9 + 1 58 50 42 34 26 18 + 10 2 59 51 43 35 27 + 19 11 3 60 52 44 36 + 63 55 47 39 31 23 15 + 7 62 54 46 38 30 22 + 14 6 61 53 45 37 29 + 21 13 5 28 20 12 4) sourceWidth: 64. + PC2 := DESBitPermutation fromDESBitIndexes: #( + 14 17 11 24 1 5 + 3 28 15 6 21 10 + 23 19 12 4 26 8 + 16 7 27 20 13 2 + 41 52 31 37 47 55 + 30 40 51 45 33 48 + 44 49 39 56 34 53 + 46 42 50 36 29 32) sourceWidth: 56. + IP := DESBitPermutation fromDESBitIndexes: #( + 58 50 42 34 26 18 10 2 + 60 52 44 36 28 20 12 4 + 62 54 46 38 30 22 14 6 + 64 56 48 40 32 24 16 8 + 57 49 41 33 25 17 9 1 + 59 51 43 35 27 19 11 3 + 61 53 45 37 29 21 13 5 + 63 55 47 39 31 23 15 7) sourceWidth: 64. + IIP := DESBitPermutation fromDESBitIndexes: #( + 40 8 48 16 56 24 64 32 + 39 7 47 15 55 23 63 31 + 38 6 46 14 54 22 62 30 + 37 5 45 13 53 21 61 29 + 36 4 44 12 52 20 60 28 + 35 3 43 11 51 19 59 27 + 34 2 42 10 50 18 58 26 + 33 1 41 9 49 17 57 25) sourceWidth: 64. + EBitSelectionTable := DESBitPermutation fromDESBitIndexes: #( + 32 1 2 3 4 5 + 4 5 6 7 8 9 + 8 9 10 11 12 13 + 12 13 14 15 16 17 + 16 17 18 19 20 21 + 20 21 22 23 24 25 + 24 25 26 27 28 29 + 28 29 30 31 32 1) sourceWidth: 32. + P := DESBitPermutation fromDESBitIndexes: #( + 16 7 20 21 + 29 12 28 17 + 1 15 23 26 + 5 18 31 10 + 2 8 24 14 + 32 27 3 9 + 19 13 30 6 + 22 11 4 25) sourceWidth: 32. + SBoxes := Array new: 8. + self initSBox: 1 from: #( + 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7 + 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8 + 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0 + 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13). + self initSBox: 2 from: #( + 15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10 + 3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5 + 0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15 + 13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9). + self initSBox: 3 from: #( + 10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8 + 13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1 + 13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7 + 1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12). + self initSBox: 4 from: #( + 7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15 + 13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9 + 10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4 + 3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14). + self initSBox: 5 from: #( + 2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9 + 14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6 + 4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14 + 11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3). + self initSBox: 6 from: #( + 12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11 + 10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8 + 9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6 + 4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13). + self initSBox: 7 from: #( + 4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1 + 13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6 + 1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2 + 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12). + self initSBox: 8 from: #( + 13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7 + 1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2 + 7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8 + 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11) +] + +{ #category : #'encryption/decryption' } +DESNonPrimitive >> applyToSBoxes: anInteger [ + | result bits | + result := 0. + 1 to: 8 do: [:i | + bits := (anInteger bitShift: i*6-48) bitAnd: 63. + result := (result bitShift: 4) + ((SBoxes at: i) at: bits+1)]. + ^result +] + +{ #category : #'encryption/decryption' } +DESNonPrimitive >> blockSize [ + ^8 +] + +{ #category : #'encryption/decryption' } +DESNonPrimitive >> coreProcess: anInteger forward: aBoolean [ + | rLast lLast rCurrent rXored rSBoxed rPermuted | + lLast := anInteger bitShift: -32. + rLast := anInteger bitAnd: 16rFFFFFFFF. + 1 to: 16 do: [:i | + rCurrent := EBitSelectionTable permute: rLast. + rXored := rCurrent bitXor: (k at: (aBoolean ifTrue: [i] ifFalse: [17-i])). + rSBoxed := self applyToSBoxes: rXored. + rPermuted := P permute: rSBoxed. + rCurrent := rPermuted bitXor: lLast. + lLast := rLast. + rLast := rCurrent]. + ^lLast + (rLast bitShift: 32) +] + +{ #category : #'encryption/decryption' } +DESNonPrimitive >> decryptBlock: anInteger [ + | permuted encoded | + permuted := IP permute: anInteger. + encoded := self coreProcess: permuted forward: false. + ^IIP permute: encoded +] + +{ #category : #'encryption/decryption' } +DESNonPrimitive >> encryptBlock: anInteger [ + | permuted encoded | + permuted := IP permute: anInteger. + encoded := self coreProcess: permuted forward: true. + ^IIP permute: encoded +] + +{ #category : #'encryption/decryption' } +DESNonPrimitive >> keySize [ + ^8 +] + +{ #category : #'initialize-release' } +DESNonPrimitive >> setKey: anInteger [ + "anInteger is a 64-bit DES key" + "DES new setKey: 2" + | kCurrent mask28 rot l r | + mask28 := 16rFFFFFFF. + kCurrent := PC1 permute: anInteger. + l := kCurrent bitShift: -28. + r := kCurrent bitAnd: mask28. + k := Array new: 16. + 1 to: 16 do: [:i | + rot := #(1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1) at: i. + false + ifTrue: [ + l := (l bitShift: 0-rot) + (l bitShift: 28-rot) bitAnd: mask28. + r := (r bitShift: 0-rot) + (r bitShift: 28-rot) bitAnd: mask28] + ifFalse: [ + l := (l bitShift: rot) + (l bitShift: rot - 28) bitAnd: mask28. + r := (r bitShift: rot) + (r bitShift: rot - 28) bitAnd: mask28]. + kCurrent := (l bitShift: 28) + r. + k at: i put: (PC2 permute: kCurrent)] +] + +{ #category : #'initialize-release' } +DESNonPrimitive >> setKeyFromByteArray: aByteArray [ + self setKey: ((aByteArray unsignedLongAt: 1 bigEndian: true) bitShift: 32) + (aByteArray unsignedLongAt: 5 bigEndian: true) +] diff --git a/source/Cryptography/DSAKeyPairGenerator.class.st b/source/Cryptography/DSAKeyPairGenerator.class.st new file mode 100644 index 0000000..29125b4 --- /dev/null +++ b/source/Cryptography/DSAKeyPairGenerator.class.st @@ -0,0 +1,71 @@ +Class { + #name : #DSAKeyPairGenerator, + #superclass : #Object, + #instVars : [ + 'p', + 'q', + 'g', + 'x', + 'y', + 'random' + ], + #category : #'Cryptography-DSA' +} + +{ #category : #'as yet unclassified' } +DSAKeyPairGenerator >> generateKeySet [ + "Generate and answer a key set for DSA. The result is a pair (). Each key is an array of four large integers. The private key is (p, q, g, x); the public one is (p, q, g, y). The signer must be sure to record (p, q, g, x), and must keep x secret to prevent someone from forging their signature." + "Note: Key generation can take some time. Open a transcript so you can see what's happening and take a coffee break!" + + | exp h | + random := SecureRandom new. + self generateQandP. + exp := (p - 1) / q. + h := 2. + [g := h raisedTo: exp modulo: p. g = 1] whileTrue: [h := h + 1]. + x := self nextRandom160. + y := g raisedTo: x modulo: p. + +] + +{ #category : #'as yet unclassified' } +DSAKeyPairGenerator >> generateQandP [ + "Generate the two industrial-grade primes, q (160-bits) and p (512-bit) needed to build a key set. Answer the array (q, p, s), where s is the seed that from which q and p were created. This seed is normally discarded, but can be used to verify the key generation process if desired." + + | pBits halfTwoToTheP chunkCount twoQ n c w | + pBits := 512. "desired size of p in bits" + halfTwoToTheP := 2 raisedTo: (pBits - 1). + chunkCount := pBits // 160. + + Transcript show: 'Searching for primes q and p...'; cr. + [true] whileTrue: [ + Transcript show: ' Found a candidate q.'; cr. + q := random nextBits: 160. + q := q bitOr: 1. "ensure it is odd" + q := q bitOr: 1 << 160. "ensure it is of the requiered length" + q := (PrimesFinder candidate: q) nextPrime. + twoQ := q bitShift: 1. + n := 2. + c := 0. + [c < 4096] whileTrue: [ + w := random nextBits: pBits. + x := w + halfTwoToTheP. + p := (x - ( x \\ twoQ)) + 1. + p highBit = pBits ifTrue: [ + Transcript show: ' Testing potential p ', (c + 1) printString, '...'; cr. + (self isProbablyPrime: p) ifTrue: [ + Transcript show: ' Found p!'; cr. + ^ self]]. + n := n + chunkCount + 1. + c := c + 1]] +] + +{ #category : #'as yet unclassified' } +DSAKeyPairGenerator >> privateKey [ + ^ DSAPrivateKey p: p q: q g: g x: x +] + +{ #category : #'as yet unclassified' } +DSAKeyPairGenerator >> publicKey [ + ^ DSAPublicKey p: p q: q g: g y: y +] diff --git a/source/Cryptography/DSAPrivateKey.class.st b/source/Cryptography/DSAPrivateKey.class.st new file mode 100644 index 0000000..cca2497 --- /dev/null +++ b/source/Cryptography/DSAPrivateKey.class.st @@ -0,0 +1,69 @@ +Class { + #name : #DSAPrivateKey, + #superclass : #Object, + #instVars : [ + 'p', + 'q', + 'g', + 'x' + ], + #category : #'Cryptography-DSA' +} + +{ #category : #'instance creation' } +DSAPrivateKey class >> p: p q: q g: g x: x [ + ^ self new p: p q: q g: g x: x +] + +{ #category : #'as yet unclassified' } +DSAPrivateKey >> computeSignatureForMessageHash: hash [ + "Answer the digital signature of the given message hash using the given private key. A signature is a pair of large integers." + + | r s k tmp | + r := s := 0. + [r = 0 or: [s = 0]] whileTrue: [ + k := self nextRandom160 \\ q. + r := (g raisedTo: k modulo: p) \\ q. + tmp := (hash asInteger + (x * r)) \\ q. + s := (k inverseModulo: q) * tmp \\ q]. + ^ Array with: r with: s +] + +{ #category : #'as yet unclassified' } +DSAPrivateKey >> nextRandom160 [ + ^ (RandomPool default next: 20) asInteger +] + +{ #category : #'as yet unclassified' } +DSAPrivateKey >> p: p0 q: q0 g: g0 x: x0 [ + p := p0. + q := q0. + g := g0. + x := x0 +] + +{ #category : #'as yet unclassified' } +DSAPrivateKey >> signMessage: aStringOrStream [ + | hasher h sig | + + hasher := SHA1 new. + (aStringOrStream class isBytes) + ifTrue: [h := hasher hashMessage: aStringOrStream] + ifFalse: [h := hasher hashStream: aStringOrStream]. + sig := self computeSignatureForMessageHash: h. + ^ self signatureToString: sig +] + +{ #category : #'as yet unclassified' } +DSAPrivateKey >> signatureToString: aSignature [ + "Answer a string representation of the given signature. This string can be parsed using the stringToSignature: method." + + | s | + s := WriteStream on: (String new: 2000). + s nextPutAll: '[DSA digital signature '. + s nextPutAll: (aSignature first printStringBase: 16). + s space. + s nextPutAll: (aSignature second printStringBase: 16). + s nextPutAll: ']'. + ^ s contents +] diff --git a/source/Cryptography/DSAPublicKey.class.st b/source/Cryptography/DSAPublicKey.class.st new file mode 100644 index 0000000..5c7c64c --- /dev/null +++ b/source/Cryptography/DSAPublicKey.class.st @@ -0,0 +1,191 @@ +Class { + #name : #DSAPublicKey, + #superclass : #Object, + #instVars : [ + 'p', + 'q', + 'g', + 'y' + ], + #category : #'Cryptography-DSA' +} + +{ #category : #examples } +DSAPublicKey class >> notesOnAsnEncoding [ + +"Smalltalk at: #ASN1Constants put: Dictionary new! +ASN1Constants at: #classApplication put: 64! +ASN1Constants at: #classContextSpecific put: 128! +ASN1Constants at: #classPrivate put: 192! +ASN1Constants at: #classUniversal put: 0! +ASN1Constants at: #idBitString put: 3! +ASN1Constants at: #idBoolean put: 1! +ASN1Constants at: #idIA5String put: 22! +ASN1Constants at: #idInteger put: 2! +ASN1Constants at: #idNull put: 5! +ASN1Constants at: #idObjectIdentifier put: 6! +ASN1Constants at: #idOctetString put: 4! +ASN1Constants at: #idPrintableString put: 19! +ASN1Constants at: #idSequence put: 16! +ASN1Constants at: #idSet put: 17! +ASN1Constants at: #idUTCTime put: 23! +ASN1Constants at: #maskClass put: 192! +ASN1Constants at: #maskConstructed put: 32! +ASN1Constants at: #maskTag put: 31! +ASN1Constants at: #tagHigh put: 31! + +Transcript show: 'ASN1ObjectIdentifiers'; cr! +Smalltalk at: #ASN1ObjectIdentifiers put: Dictionary new! +ASN1ObjectIdentifiers at: #x1x2x840x10040x4x1 put: ('id-dsa')! +ASN1ObjectIdentifiers at: #x1x2x840x10040x4x3 put: ('id-dsa-with-sha1')! +ASN1ObjectIdentifiers at: #x1x2x840x113533x7x65x0 put: ('entrustVersion')! +ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x1 put: ('rsaEncryption')! +ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x2 put: ('md2WithRSAEncryption')! +ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x4 put: ('md5WithRSAEncryption')! +ASN1ObjectIdentifiers at: #x1x2x840x113549x1x1x5 put: ('sha-1WithRSAEncryption')! +ASN1ObjectIdentifiers at: #x1x2x840x113549x1x9x1 put: ('e-mailAddress')! +ASN1ObjectIdentifiers at: #x1x3x14x3x2x12 put: ('dsa')! +ASN1ObjectIdentifiers at: #x1x3x14x3x2x27 put: ('dsa With SHA1')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x1 put: ('netscapeCertificateType')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x12 put: ('SslServerName')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x13 put: ('netscapeCertificateComment')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x2 put: ('BaseURL')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x3 put: ('RevocationURL')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x4 put: ('CARevocationURL')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x7 put: ('renewalURL')! +ASN1ObjectIdentifiers at: #x2x16x840x1x113730x1x8 put: ('netscapeCaPolicyURL')! +ASN1ObjectIdentifiers at: #x2x5x29x14 put: ('subjectKeyIdentifier')! +ASN1ObjectIdentifiers at: #x2x5x29x15 put: ('keyUsage')! +ASN1ObjectIdentifiers at: #x2x5x29x16 put: ('privateKeyUsagePeriod')! +ASN1ObjectIdentifiers at: #x2x5x29x17 put: ('subjectAlternativeName')! +ASN1ObjectIdentifiers at: #x2x5x29x18 put: ('issuerAlternativeName')! +ASN1ObjectIdentifiers at: #x2x5x29x19 put: ('basicConstraints')! +ASN1ObjectIdentifiers at: #x2x5x29x20 put: ('cRLNumber')! +ASN1ObjectIdentifiers at: #x2x5x29x21 put: ('reasonCode')! +ASN1ObjectIdentifiers at: #x2x5x29x23 put: ('holdInstructionCode')! +ASN1ObjectIdentifiers at: #x2x5x29x24 put: ('invalidityDate')! +ASN1ObjectIdentifiers at: #x2x5x29x27 put: ('deltaCRLIndicator')! +ASN1ObjectIdentifiers at: #x2x5x29x28 put: ('issuingDistributionPoint')! +ASN1ObjectIdentifiers at: #x2x5x29x29 put: ('certificateIssuer')! +ASN1ObjectIdentifiers at: #x2x5x29x3 put: ('certificate policies - old')! +ASN1ObjectIdentifiers at: #x2x5x29x30 put: ('nameConstraints')! +ASN1ObjectIdentifiers at: #x2x5x29x31 put: ('cRLDistributionPoints')! +ASN1ObjectIdentifiers at: #x2x5x29x32 put: ('certificatePolicies')! +ASN1ObjectIdentifiers at: #x2x5x29x33 put: ('policyMappings')! +ASN1ObjectIdentifiers at: #x2x5x29x35 put: ('authorityKeyIdentifier')! +ASN1ObjectIdentifiers at: #x2x5x29x36 put: ('policyConstraints')! +ASN1ObjectIdentifiers at: #x2x5x4x10 put: ('O')! +ASN1ObjectIdentifiers at: #x2x5x4x11 put: ('OU')! +ASN1ObjectIdentifiers at: #x2x5x4x13 put: ('??')! +ASN1ObjectIdentifiers at: #x2x5x4x3 put: ('CN')! +ASN1ObjectIdentifiers at: #x2x5x4x6 put: ('C')! +ASN1ObjectIdentifiers at: #x2x5x4x7 put: ('L')! +ASN1ObjectIdentifiers at: #x2x5x4x8 put: ('S')! +ASN1ObjectIdentifiers at: #x2x5x8x1x1 put: ('rsa')! +" +] + +{ #category : #'instance creation' } +DSAPublicKey class >> p: p0 q: q0 g: g0 y: y0 [ + ^ self new p: p0 q: q0 g: g0 y: y0 +] + +{ #category : #examples } +DSAPublicKey class >> test1 [ + + | x509 key hash | + x509 := #(48 130 1 184 48 130 1 44 6 7 42 134 72 206 56 4 1 48 130 1 31 2 129 129 0 253 127 83 129 29 117 18 41 82 223 74 156 46 236 228 231 246 17 183 82 60 239 68 0 195 30 63 128 182 81 38 105 69 93 64 34 81 251 89 61 141 88 250 191 197 245 186 48 246 203 155 85 108 215 129 59 128 29 52 111 242 102 96 183 107 153 80 165 164 159 159 232 4 123 16 34 194 79 187 169 215 254 183 198 27 248 59 87 231 198 168 166 21 15 4 251 131 246 211 197 30 195 2 53 84 19 90 22 145 50 246 117 243 174 43 97 215 42 239 242 34 3 25 157 209 72 1 199 2 21 0 151 96 80 143 21 35 11 204 178 146 185 130 162 235 132 11 240 88 28 245 2 129 129 0 247 225 160 133 214 155 61 222 203 188 171 92 54 184 87 185 121 148 175 187 250 58 234 130 249 87 76 11 61 7 130 103 81 89 87 142 186 212 89 79 230 113 7 16 129 128 180 73 22 113 35 232 76 40 22 19 183 207 9 50 140 200 166 225 60 22 122 139 84 124 141 40 224 163 174 30 43 179 166 117 145 110 163 127 11 250 33 53 98 241 251 98 122 1 36 59 204 164 241 190 168 81 144 137 168 131 223 225 90 229 159 6 146 139 102 94 128 123 85 37 100 1 76 59 254 207 73 42 3 129 133 0 2 129 129 0 209 171 224 141 87 74 186 36 200 200 42 40 228 114 112 206 104 250 213 194 178 215 57 23 135 248 223 239 188 97 167 102 105 90 234 151 109 222 24 29 72 142 144 0 11 95 96 125 132 94 155 201 238 92 229 249 108 218 81 237 57 70 21 226 217 118 235 29 215 214 73 236 204 148 72 7 26 167 85 90 96 4 15 232 157 127 208 172 107 241 4 180 137 245 183 54 97 233 185 114 47 14 37 221 10 6 183 240 46 247 196 150 223 119 107 80 145 214 222 138 248 230 247 102 1 229 209 193) asByteArray. + key := DSAPublicKey fromAsnDerBytes: x509. + (key asAsn1Bytes = x509) + ifFalse: [self error: 'encodings different']. + hash := SHA1 hashMessage: key asAsn1Bytes. + ^ (Base64MimeConverter mimeEncode: hash readStream) contents + +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> = anObject [ + + (anObject isKindOf: self class) ifFalse: [^false]. + ^ self asAsn1Bytes = anObject asAsn1Bytes +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> base64CryptoHash [ + + | encoded hash | + encoded := self asAsn1Bytes. + ((encoded first bitAnd: 16r80) > 0) + ifTrue: [encoded := #(0) asByteArray, encoded]. + hash := (SHA1 hashMessage: encoded) asByteArray reversed. + ((hash first bitAnd: 16r80) > 0) + ifTrue: [hash := #(0) asByteArray, hash]. + ^ hash toEBase64String + +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> dssSig [ + + ^ OrderedCollection with: p with: q with: g +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> p: p0 q: q0 g: g0 y: y0 [ + p := p0. + q := q0. + g := g0. + y := y0 +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> stringToSignature: aString [ + "Answer the signature stored in the given string. A signature string has the format: + + '[DSA digital signature ]' + + where and are large positive integers represented by strings of hexidecimal digits." + + | prefix stream r s | + prefix := '[DSA digital signature '. + (aString beginsWith: prefix) ifFalse: [self error: 'bad signature prefix']. + stream := ReadStream on: aString. + stream position: prefix size. + r := Integer readFrom: stream base: 16. + stream next. + s := Integer readFrom: stream base: 16. + ^ Array with: r with: s + +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> verify: signatureString isSignatureOf: aStringOrStream [ + "Answer true if the given signature string signs the given message (a stream or string)." + "Note: Random numbers are not needed for signature verification; thus, there is no need to call initRandomFromUser before verifying a signature." + + | hasher h sig | + hasher := SHA1 new. + (aStringOrStream class isBytes) + ifTrue: [h := hasher hashMessage: aStringOrStream] + ifFalse: [h := hasher hashStream: aStringOrStream]. + sig := self stringToSignature: signatureString. + ^ self verifySignature: sig ofMessageHash: h +] + +{ #category : #'as yet unclassified' } +DSAPublicKey >> verifySignature: aSignature ofMessageHash: hash [ + "Answer true if the given signature is the authentic signature of the given message hash. That is, if the signature must have been computed using the private key set corresponding to the given public key." + + | r s w u1 u2 v0 v | + r := aSignature first. + s := aSignature last. + ((r > 0) and: [r < q]) ifFalse: [^ false]. "reject" + ((s > 0) and: [s < q]) ifFalse: [^ false]. "reject" + + w := s inverseModulo: q. + u1 := (hash asInteger * w) \\ q. + u2 := (r * w) \\ q. + v0 := (g raisedTo: u1 modulo: p) * (y raisedTo: u2 modulo: p). + v := ( v0 \\ p) \\ q. + ^ v = r +] diff --git a/source/Cryptography/DiffieHellman.class.st b/source/Cryptography/DiffieHellman.class.st new file mode 100644 index 0000000..547168b --- /dev/null +++ b/source/Cryptography/DiffieHellman.class.st @@ -0,0 +1,95 @@ +" +I represent the basic version of the Diffie-Hellman key agreement. +See Handbook of Applied Cryptography, Ch. 12, p. 516 + +One time setup: +* a safe prime p and a generator alpha of Zp* are published. + +Protocol actions: +* Alice chooses a random secret x between 1 and p-2. +* Alice sends Bob message alpha^x mod p. +* Bob chooses a random secret y between 1 and p-2. +* Bob sends Alice message alpha^y mod p. +* Alice receives alpha^y and computes the shared key: + K = (alpha^y)^x mod p. +* Bob receives alpha^x and computes the shared key: + K = (alpha^x)^y mod p. + +Example from testCase: +| alice bob fromAlice fromBob k1 k2 | +alice := DiffieHellman bits: 15. +bob := DiffieHellman prime: alice prime generator: alice generator. +fromAlice := alice sendMessage. +fromBob := bob sendMessage. +k1 := alice receiveMessage: fromBob. +k2 := bob receiveMessage: fromAlice. +self assert: k1 = k2 + +" +Class { + #name : #DiffieHellman, + #superclass : #Object, + #instVars : [ + 'prime', + 'generator', + 'secret', + 'sharedKey' + ], + #category : #'Cryptography-ElGamal' +} + +{ #category : #'instance creation' } +DiffieHellman class >> bits: anInteger [ + | prime generator | + prime := PrimesFinder safePrimeOfSize: anInteger. + generator := ElGamalKeyGenerator generatorOfZp: prime. + ^ self prime: prime generator: generator +] + +{ #category : #'instance creation' } +DiffieHellman class >> prime: prime generator: generator [ + ^ self new prime: prime; generator: generator +] + +{ #category : #accessing } +DiffieHellman >> generator [ + ^ generator +] + +{ #category : #initialization } +DiffieHellman >> generator: anInteger [ + generator := anInteger +] + +{ #category : #accessing } +DiffieHellman >> prime [ + ^ prime +] + +{ #category : #initialization } +DiffieHellman >> prime: anInteger [ + prime := anInteger +] + +{ #category : #protocol } +DiffieHellman >> receiveMessage: anInteger [ + sharedKey := anInteger raisedTo: secret modulo: prime. + ^ sharedKey +] + +{ #category : #protocol } +DiffieHellman >> sendMessage [ + secret := SecureRandom picker nextInt: prime-2. + ^ generator raisedTo: secret modulo: prime +] + +{ #category : #initialization } +DiffieHellman >> setupPrimeOfSize: bits [ + prime := PrimesFinder safePrimeOfSize: bits. + generator := ElGamalKeyGenerator generatorOfZp: prime +] + +{ #category : #protocol } +DiffieHellman >> sharedKey [ + ^ sharedKey +] diff --git a/source/Cryptography/ElGamalKeyGenerator.class.st b/source/Cryptography/ElGamalKeyGenerator.class.st new file mode 100644 index 0000000..6a27a90 --- /dev/null +++ b/source/Cryptography/ElGamalKeyGenerator.class.st @@ -0,0 +1,93 @@ +" +The ElGamal public-key encryption scheme is related to the Diffie-Hellman key agreement. Their security is based on the intractability of the same number theoretic problems (the discrete logarithm problem and the Diffie-Hellman problem). + +See Handbook of Applied Cryptography, Ch. 8, p. 294. + +Key generation: +* Generate a large random prime p and a generator alpha of the multiplicative group Zp* of the integers modulo p +* Select a random integer a between 1 and p-2, and compute alpha^a mod p +* The public key is (p, alpha, alpha^a) + The private key is a + +Example of encryption: +| elgamal pub priv c | +elgamal := ElGamalKeyGenerator new. +elgamal generateKeysOfSize: 15. +pub := elgamal publicKey. +priv := elgamal privateKey. +c := pub encryptElement: 31. +priv decryptElement: c. + + +Example of signature: +| elgamal pub priv signature | +elgamal := ElGamalKeyGenerator new. +elgamal generateKeysOfSize: 15. +pub := elgamal publicKey. +priv := elgamal privateKey. +signature := priv signMessage: 'hello'. +pub verifySignature: signature onMessage: 'hello'. + + +" +Class { + #name : #ElGamalKeyGenerator, + #superclass : #Object, + #instVars : [ + 'p', + 'alpha', + 'a' + ], + #category : #'Cryptography-ElGamal' +} + +{ #category : #'instance creation' } +ElGamalKeyGenerator class >> bits: anInteger [ + ^ self new generateKeysOfSize: anInteger +] + +{ #category : #utils } +ElGamalKeyGenerator class >> generatorOfZp: safePrimeP [ + "Finds a generator of Zp* where p is a safe prime: p = 2q+1 with q prime. + The order of Zp* is n = p-1 = 2q, so we know the factorization of n. + See Handbook of Applied Cryptography, Ch.4, p.163 " + + | alpha p n | + p := safePrimeP. + n := p - 1. + [alpha := SecureRandom picker nextInt: n. + ((alpha raisedTo: n/2 modulo: p) = 1 or: [(alpha raisedTo: 2 modulo: p) = 1])] whileFalse. + ^ alpha +] + +{ #category : #accessing } +ElGamalKeyGenerator >> destroy [ + p destroy. + alpha destroy. + a destroy +] + +{ #category : #private } +ElGamalKeyGenerator >> generateKeysOfSize: numberOfBits [ + p := PrimesFinder safePrimeOfSize: numberOfBits. + alpha := self class generatorOfZp: p. + a := SecureRandom picker nextInt: p-2 +] + +{ #category : #accessing } +ElGamalKeyGenerator >> privateKey [ + ^ ElGamalPrivateKey + setModulo: p + generator: alpha + secretExponent: a + +] + +{ #category : #accessing } +ElGamalKeyGenerator >> publicKey [ + ^ ElGamalPublicKey + setModulo: p + generator: alpha + generatorRaisedToA: (alpha raisedTo: a modulo: p) + +] diff --git a/source/Cryptography/ElGamalPrivateKey.class.st b/source/Cryptography/ElGamalPrivateKey.class.st new file mode 100644 index 0000000..ec63dbd --- /dev/null +++ b/source/Cryptography/ElGamalPrivateKey.class.st @@ -0,0 +1,76 @@ +" +See Handbook of Applied Cryptography, Ch. 8, p. 295. + +Here we use the notation: + p = modulo + alpha = generator + a = secretExponent + +Decryption: +* Receive the ciphertext c = (gamma, delta). +* Use the private key to compute: + gamma^(p-1-a) = gamma^(-a) = alpha^(-a*k) mod p +* Recover m = (gamma^(p-1-a)) * delta mod p + +Signature generation: +* Select a random secret integer k between 1 and p-2, with gcd(k, p-1) = 1. +* Compute r = alpha^k mod p. +* Compute k^(-1) mod (p-1). +* Compute s = k^(-1) * ( h(m) - a*r ) mod (p-1), where h is a hash function. +* The signature for m is the pair (r,s). + + + +" +Class { + #name : #ElGamalPrivateKey, + #superclass : #Object, + #instVars : [ + 'modulo', + 'generator', + 'secretExponent' + ], + #category : #'Cryptography-ElGamal' +} + +{ #category : #'instance creation' } +ElGamalPrivateKey class >> setModulo: p generator: alpha secretExponent: a [ + ^ self new setModulo: p generator: alpha secretExponent: a + + +] + +{ #category : #actions } +ElGamalPrivateKey >> decryptElement: anArray [ + | gamma delta aux | + gamma := anArray at: 1. + delta := anArray at: 2. + aux := gamma raisedTo: (modulo - 1 - secretExponent) modulo: modulo. + ^ aux * delta \\ modulo +] + +{ #category : #accessing } +ElGamalPrivateKey >> hashFunction [ + ^ SHA1 new +] + +{ #category : #accessing } +ElGamalPrivateKey >> setModulo: p generator: alpha secretExponent: a [ + modulo := p. + generator := alpha. + secretExponent := a. +] + +{ #category : #actions } +ElGamalPrivateKey >> signMessage: aByteArray [ + | hm k kinv r s | + hm := (self hashFunction hashMessage: aByteArray) asInteger. + + [k := SecureRandom picker nextInt: modulo - 2. + (k gcd: modulo-1) = 1] whileFalse. + + r := generator raisedTo: k modulo: modulo. + kinv := k inverseModulo: (modulo-1). + s := kinv * (hm - (secretExponent*r)) \\ (modulo-1). + ^ Array with: r with: s +] diff --git a/source/Cryptography/ElGamalPublicKey.class.st b/source/Cryptography/ElGamalPublicKey.class.st new file mode 100644 index 0000000..609b75e --- /dev/null +++ b/source/Cryptography/ElGamalPublicKey.class.st @@ -0,0 +1,77 @@ +" +See Handbook of Applied Cryptography, Ch. 8, p. 295. + +Here we use the notation: + p = modulo + alpha = generator + alpha^a = generatorRaisedToA + +Encryption: +* Obtain A's public key (p, alpha, alpha^a). +* Represent the message as an integer m between 0 and p-1. +* Select a random integer k between 1 and p-2. +* Compute: + gamma = alpha^k mod p + delta = m * (alpha^a)^k mod p. +* Send the ciphertext c = (gamma, delta). + +Signature verification: +* Obtain A's public key (p, alpha, alpha^a). +* Verify that r is between 1 and p-1, if not then reject the signature. +* Compute v1 = (alpha^a)^r * r^s mod p. +* Compute h(m) where h is a hash function +* Compute v2 = alpha^h(m) mod p. +* Accept the signature if and only if v1=v2. + + +" +Class { + #name : #ElGamalPublicKey, + #superclass : #Object, + #instVars : [ + 'modulo', + 'generator', + 'generatorRaisedToA' + ], + #category : #'Cryptography-ElGamal' +} + +{ #category : #'instance creation' } +ElGamalPublicKey class >> setModulo: p generator: alpha generatorRaisedToA: y [ + ^ self new setModulo: p generator: alpha generatorRaisedToA: y +] + +{ #category : #actions } +ElGamalPublicKey >> encryptElement: anInteger [ + | k gamma delta | + k := SecureRandom picker nextInt: modulo-2. + gamma := generator raisedTo: k modulo: modulo. + delta := anInteger * (generatorRaisedToA raisedTo: k modulo: modulo) \\ modulo. + ^ Array with: gamma with: delta +] + +{ #category : #accessing } +ElGamalPublicKey >> hashFunction [ + ^ SHA1 new +] + +{ #category : #accessing } +ElGamalPublicKey >> setModulo: p generator: alpha generatorRaisedToA: y [ + modulo := p. + generator := alpha. + generatorRaisedToA := y. +] + +{ #category : #actions } +ElGamalPublicKey >> verifySignature: anArray onMessage: aByteArray [ + | hm r s v1 v2 | + hm := (self hashFunction hashMessage: aByteArray) asInteger. + r := anArray at: 1. + s := anArray at: 2. + (r between: 1 and: modulo-1) ifFalse: [^ false]. "signature rejected" + + v1 := generatorRaisedToA raisedTo: r modulo: modulo. + v1 := v1 * (r raisedTo: s modulo: modulo) \\ modulo. + v2 := generator raisedTo: hm modulo: modulo. + ^ v1 = v2 "signature accepted if v1=v2" +] diff --git a/source/Cryptography/EuclidAlgorithm.class.st b/source/Cryptography/EuclidAlgorithm.class.st new file mode 100644 index 0000000..8b77a55 --- /dev/null +++ b/source/Cryptography/EuclidAlgorithm.class.st @@ -0,0 +1,145 @@ +Class { + #name : #EuclidAlgorithm, + #superclass : #Object, + #instVars : [ + 'a', + 'b', + 'u', + 'v', + 'gcd' + ], + #category : #'Cryptography-RSA' +} + +{ #category : #'as yet unclassified' } +EuclidAlgorithm class >> with: a with: b [ + ^ self new with: a with: b +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> doBasicAlgorithm [ + | u1 a1 b1 q r | + u := 1. u1 := 0. a1 := a. b1 := b. + [b1 = 0] + whileFalse: + [q := a1 // b1. + r := a1 - (b1 * q). + u1 := u - (q * (u := u1)). + a1 := b1. + b1 := r]. + gcd := a1. + v := b = 0 + ifTrue: [b] + ifFalse: [gcd - (u * a) // b] +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> firstCoefficient [ + ^u +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> gcd [ + ^gcd +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> lehmer [ + "For a desciption of the algorithm below for large integers See 'A Course in Computational Algebraic + Number Theory' by Henri Cohen" + + "do Preprocessing" + | a0 b0 a1 b1 aHat bHat higher aa bb cc dd q t r v1 bcc bdd quoRem e k | + b1 := b abs. + a1 := a abs max: b1. + b1 := a abs min: b1. + a0 := a1. + b0 := b1. "Initialize elements" + u := 1. + v1 := 0. + aa := 1. + bb := 0. + cc := 0. + dd := 1. + higher := 30. "Core.SmallInteger maxVal highBit." + ["Are we done yet" + b1 class == SmallInteger] + whileFalse: + [aHat := a1. + k := higher - a1 highBit. + (aHat bitShift: k) class == SmallInteger + ifFalse: + [k := k - 1. + aHat := aHat bitShift: -1]. + bHat := b1 bitShift: k. + + ["Test the quotient" + bcc := bHat + cc. + bcc ~= 0 + and: + [bdd := bHat + dd. + bdd ~= 0 + and: + [q := aHat + a1 // bcc. + q = (aHat + bb // bdd)]]] + whileTrue: + ["Euclidean step" + aa := cc. + cc := aa - (q * aa). + bb := dd. + dd := bb - (q * bb). + aHat := bHat. + bHat := aHat - (q * aHat)]. + bb = 0 + ifTrue: + ["Multi-precision step" + quoRem := a1 digitDiv: b1 neg: false. + a1 := b1. + b1 := quoRem at: 2. + u := v1. + v1 := u - ((quoRem at: 1) + * u)] + ifFalse: + [t := aa * a1 + (bb * b1). + r := cc * a1 + (dd * b1). + a1 := t. + b1 := r. + t := aa * u + (bb * v1). + r := cc * u + (dd * v1). + u := t. + v1 := r]]. + e := self class with: a1 with: b1. + e doBasicAlgorithm. + gcd := e gcd. + u := u * e firstCoefficient + (v1 * e secondCoefficient). + v := b0 = 0 + ifTrue: [b0] + ifFalse: [gcd - (u * a0) // b0]. + a abs >= b abs + ifFalse: + ["Postprocess" + t := u. + u := v. + v := t]. + a < 0 ifTrue: [u := u negated]. + b < 0 ifTrue: [v := v negated] +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> run [ + ((a isKindOf: LargePositiveInteger) + and: [b isKindOf: LargePositiveInteger]) + ifTrue: [self lehmer] + ifFalse: [self doBasicAlgorithm] +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> secondCoefficient [ + ^ v +] + +{ #category : #'as yet unclassified' } +EuclidAlgorithm >> with: numberA with: numberB [ + a := numberA. + b := numberB +] diff --git a/source/Cryptography/Fortuna.class.st b/source/Cryptography/Fortuna.class.st new file mode 100644 index 0000000..1939f3a --- /dev/null +++ b/source/Cryptography/Fortuna.class.st @@ -0,0 +1,80 @@ +" +Fortuna is a cryptographically secure pseudorandom number generator specified by Niels Ferguson and Bruce Schneier in chapter 10 of ""Practical Cryptography."" This generator utilizes a Rijndael (AES) cipher in CTR mode and is patent-free. +" +Class { + #name : #Fortuna, + #superclass : #RandomGenerator, + #instVars : [ + 'key', + 'ctr' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #'instance creation' } +Fortuna class >> key: aByteArray [ + ^ self new + setKey: aByteArray ; + yourself +] + +{ #category : #initialize } +Fortuna >> destroy [ + key destroy. + ctr destroy +] + +{ #category : #private } +Fortuna >> generateBlocks: anInteger [ + ^ ByteArray streamContents: + [ : stream | + anInteger timesRepeat: + [ stream nextPutAll: ctr nextBlock ] ] +] + +{ #category : #initialize } +Fortuna >> initializeCtr [ + ctr := (Rijndael key: key) ctr +] + +{ #category : #accessing } +Fortuna >> nextBits: anInteger [ + | firstBits bits8 | + firstBits := (self nextBytes: anInteger // 8) + uint: (bits8 := anInteger truncateTo: 8) + at: 1. + ^ bits8 = anInteger + ifTrue: [ firstBits ] + ifFalse: + [ | last8 mask bitsNeeded | + last8 := self nextBytes: 1. + bitsNeeded := anInteger - bits8. + mask := ((1 to: bitsNeeded) + inject: 0 + into: [ : total : n | 1 bitShift: n ]) - 1. + (firstBits bitShift: bitsNeeded) + (last8 first bitAnd: mask) ] +] + +{ #category : #accessing } +Fortuna >> nextBytes: anInteger [ + "Generates and answers a ByteArray of size anInteger filled with random data. This is the #pseudoRandomData: function from p. 166 of Practical Cryptography. I have renamed it to nextBytes: to be more consistent with Squeaks #nextBits: nomenclature." + | data | + (anInteger between: 0 and: 1048576 "2 raisedTo: 20") + ifFalse: + [ CryptographyError signal: 'program error, should not generate this much data with the same key.' ]. + data := self generateBlocks: ((anInteger / 16) roundUpTo: 1). + "Switch to a new key to avoid later compromises of this output." + self setKey: (self generateBlocks: 2). + ^ data size = anInteger + ifTrue: [ data ] + ifFalse: [ data copyFrom: 1 to: anInteger ] +] + +{ #category : #initialize } +Fortuna >> setKey: aByteArray [ + aByteArray size < Rijndael keySize + ifTrue: + [ CryptographyError signal: 'Fortuna requires a ', Rijndael keySize printString, '-byte key' ]. + key := aByteArray copyFrom: 1 to: Rijndael keySize. + self initializeCtr +] diff --git a/source/Cryptography/InputEventSensor.extension.st b/source/Cryptography/InputEventSensor.extension.st new file mode 100644 index 0000000..402e5dc --- /dev/null +++ b/source/Cryptography/InputEventSensor.extension.st @@ -0,0 +1,7 @@ +Extension { #name : #InputEventSensor } + +{ #category : #'*Cryptography' } +InputEventSensor >> mousePoint [ + + ^mousePosition +] diff --git a/source/Cryptography/Integer.extension.st b/source/Cryptography/Integer.extension.st new file mode 100644 index 0000000..1ba0601 --- /dev/null +++ b/source/Cryptography/Integer.extension.st @@ -0,0 +1,81 @@ +Extension { #name : #Integer } + +{ #category : #'*cryptography-core' } +Integer >> areAllBitsSet [ + + ^self digitLength ~= (self + 1) digitLength +] + +{ #category : #'*cryptography-core' } +Integer >> inverseModulo: n [ + "Answer the inverse of the receiver modulus n. That is, the integer y such that (self * y) \\ n is 1. Both self and n must be positive, and it is assumed that self < n and that n is integer." + "Details: Use the extended Euclidean algorithm, Schneier, p. 247." + + | v u k u1 u2 u3 t1 t2 t3 tmp | + ((self <= 0) or: [n <= 0]) ifTrue: [self error: 'number and modulo must be greater than zero']. + self >= n ifTrue: [self error: 'number must be < modulo']. + + v := self. + u := n. + k := 0. + [self even and: [n even and: [u > 0]]] whileTrue: [ "eliminate common factors of two" + k := k + 1. + u := u bitShift: -1. + v := v bitShift: -1]. + + u1 := 1. u2 := 0. u3 := u. + t1 := v. t2 := u - 1. t3 := v. + [ [u3 even ifTrue: [ + ((u1 odd) or: [u2 odd]) ifTrue: [ + u1 := u1 + v. + u2 := u2 + u]. + u1 := u1 bitShift: -1. + u2 := u2 bitShift: -1. + u3 := u3 bitShift: -1]. + ((t3 even) or: [u3 < t3]) ifTrue: [ + tmp := u1. u1 := t1. t1 := tmp. + tmp := u2. u2 := t2. t2 := tmp. + tmp := u3. u3 := t3. t3 := tmp]. + u3 even and: [u3 > 0]] whileTrue: ["loop while u3 is even"]. + + [((u1 < t1) or: [u2 < t2]) and: [u1 > 0]] whileTrue: [ + u1 := u1 + v. + u2 := u2 + u]. + + u1 := u1 - t1. + u2 := u2 - t2. + u3 := u3 - t3. + t3 > 0] whileTrue: ["loop while t3 > 0"]. + + [u1 >= v and: [u2 >= u]] whileTrue: [ + u1 := u1 - v. + u2 := u2 - u]. + + u1 := u1 bitShift: k. + u2 := u2 bitShift: k. + u3 := u3 bitShift: k. + + u3 = 1 ifFalse: [self error: 'no inverse']. + ^ u - u2 +] + +{ #category : #'*cryptography-core' } +Integer >> toEBase64String [ + + self < 0 ifTrue: [^ '-', self negated toEBase64String]. + ^ self asByteArray toEBase64String. + +] + +{ #category : #'*cryptography-core' } +Integer >> twosComplement [ + | complement digit length | + length := self digitLength + 1. + complement := Integer new: length neg: false. + 1 to: length-1 do: [:index | + digit := self digitAt: index. + digit := digit bitXor: 16rFF. "flip bits without 2's complement logic in bitInvert" + complement digitAt: index put: digit]. + self areAllBitsSet ifTrue: [complement digitAt: length put: 16rFF]. + ^complement + 1 +] diff --git a/source/Cryptography/KeyHolder.class.st b/source/Cryptography/KeyHolder.class.st new file mode 100644 index 0000000..b2637f0 --- /dev/null +++ b/source/Cryptography/KeyHolder.class.st @@ -0,0 +1,182 @@ +" +A KeyHolder is a construct that holds key information safely in memory. The key is never stored in plain text in memory. The system encrypts the key using two different objects and therefore two different memory locations. A random key is generated and used to encrypt the key. That random key is changed every 100ms. To retrieve the key send the message #key. You must send in a byteArray. If you are storing a key that is a string then do: + +KeyHolder holdKey: 'aPassword' asByteArray. + +when asking for key you will get back aByteArray so if you are looking for a string use + +aByteArray := aKeyHolder key. +pKey := aByteArray asString. +aByteArray destroy. + +When you are done with the byteArray send the message destroy to it, to keep your secret key from being written to disk. Never leave your key in memory for very log. Get it, use it and destroy it as quickly as possible in the same message chain. + +If you no longer need this keyHolder you must send the message destroy to it to stop the process and wipe the memory clean. + +Instance Variables + data: KeyHolderData + random: aByteArray + randomChangeProcess: aProcess + +data + - holds onto an instance of KeyHolderData which holds your encrypted key. + +random + - the key used to encrypt your key + +randomChangeProcess + - the process that changes random + +" +Class { + #name : #KeyHolder, + #superclass : #Object, + #instVars : [ + 'data', + 'random', + 'randomChangeProcess' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #LICENSE } +KeyHolder class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #'instance creation' } +KeyHolder class >> holdKey: aKey [ + "store a key scrambled in memory" + ^self new + data: (KeyHolderData new); + encryptKey: aKey; + randomChangeLoop; + yourself +] + +{ #category : #'instance creation' } +KeyHolder class >> readFromFile: aFileName password: aPassword [ + "this method takes a long time on purpose, the idea is to increase the amount of time and resources needed to crack password" + | pwHash cipher cData pwHashAndSalt pwSalt eData aStream aKeyHolder | + [eData := ((aStream := FileStream fileNamed: aFileName) ifNil: [^nil]) binary contents asByteArray] ensure: [aStream close]. + pwSalt := eData copyFrom: eData size - 31 to: eData size. + eData := eData copyFrom: 1 to: eData size - 32. + pwHashAndSalt := PasswordSaltAndStretch hashForPassword: aPassword s: pwSalt. + pwHash := pwHashAndSalt key. + pwSalt := pwHashAndSalt value. + cipher := (TripleDES key: pwHash) cbc. + cData := cipher decrypt: eData. + aKeyHolder := self holdKey: cData. + cData destroy. + ^aKeyHolder + +] + +{ #category : #accessing } +KeyHolder >> data [ + "Answer the value of data" + + ^ data +] + +{ #category : #accessing } +KeyHolder >> data: anObject [ + "Set the value of data" + + data := anObject +] + +{ #category : #'initialize-release' } +KeyHolder >> destroy [ + self randomChangeProcess terminate. + self randomChangeProcess: nil. + self random destroy. + self data key destroy. + self data: nil. +] + +{ #category : #services } +KeyHolder >> encryptKey: pKey [ + | eKey | + eKey := (TripleDES key: self random) cbc encrypt: pKey. + self data key: eKey +] + +{ #category : #'initialize-release' } +KeyHolder >> initialize [ + self random: (SecureRandom picker nextBytesNonZero: 32) +] + +{ #category : #services } +KeyHolder >> key [ + ^[(TripleDES key: self random) cbc decrypt: self data key] on: CryptographyError do: [:ex | ex retry] +] + +{ #category : #accessing } +KeyHolder >> random [ + "Answer the value of random" + + ^ random +] + +{ #category : #accessing } +KeyHolder >> random: anObject [ + "Set the value of random" + + random := anObject +] + +{ #category : #processes } +KeyHolder >> randomChangeLoop [ + "This loop changes the random and reencrypts the data every 100ms" + | pKey randomGenerator | + self randomChangeProcess: ([ + randomGenerator := SecureRandom picker. + [ + pKey := self key. + self random: (randomGenerator nextBytesNonZero: 32). + self encryptKey: pKey. + pKey destroy. + (Delay forMilliseconds: 100) wait. + true. + ] whileTrue. + ] forkAt: Processor highIOPriority) +] + +{ #category : #accessing } +KeyHolder >> randomChangeProcess [ + "Answer the value of randomChangeProcess" + + ^ randomChangeProcess +] + +{ #category : #accessing } +KeyHolder >> randomChangeProcess: anObject [ + "Set the value of randomChangeProcess" + + randomChangeProcess := anObject +] + +{ #category : #services } +KeyHolder >> writeToFile: aFileName password: aPassword [ + "this method takes a long time on purpose, the idea is to increase the amount of time and resources needed to crack password" + | pwHash cipher cData pwHashAndSalt pwSalt | + pwHashAndSalt := PasswordSaltAndStretch hashForPassword: aPassword. + pwHash := pwHashAndSalt key. + pwSalt := pwHashAndSalt value. + cipher := (TripleDES key: pwHash) cbc. + cData := cipher encrypt: self key. + (FileStream forceNewFileNamed: aFileName) + nextPutAll: cData; + nextPutAll: pwSalt; + close. + +] diff --git a/source/Cryptography/KeyHolderData.class.st b/source/Cryptography/KeyHolderData.class.st new file mode 100644 index 0000000..0d2dc01 --- /dev/null +++ b/source/Cryptography/KeyHolderData.class.st @@ -0,0 +1,45 @@ +" +A KeyHolderData is used by KeyHolder see comments there. + +Instance Variables + key: + +key + - key that was encrypted by KeyHolder. This value is changed frequently by KeyHolder. + +" +Class { + #name : #KeyHolderData, + #superclass : #Object, + #instVars : [ + 'key' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #LICENSE } +KeyHolderData class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #accessing } +KeyHolderData >> key [ + "Answer the value of key" + + ^ key +] + +{ #category : #accessing } +KeyHolderData >> key: anObject [ + "Set the value of key" + + key := anObject +] diff --git a/source/Cryptography/LargePositiveInteger.extension.st b/source/Cryptography/LargePositiveInteger.extension.st new file mode 100644 index 0000000..0102eba --- /dev/null +++ b/source/Cryptography/LargePositiveInteger.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #LargePositiveInteger } + +{ #category : #'*cryptography-core' } +LargePositiveInteger >> destroy [ + "Wipe my bytes so that they cannot possibly be discovered." + 1 to: self size do: + [ : x | + self + digitAt: x + put: 0 ] +] diff --git a/source/Cryptography/MD2.class.st b/source/Cryptography/MD2.class.st new file mode 100644 index 0000000..58903cc --- /dev/null +++ b/source/Cryptography/MD2.class.st @@ -0,0 +1,129 @@ +Class { + #name : #MD2, + #superclass : #HashFunction, + #classVars : [ + 'PITable' + ], + #category : #'Cryptography-MD4' +} + +{ #category : #'as yet unclassified' } +MD2 class >> initialize [ + + PITable := OrderedCollection new. + self initializeFirstHalfPITable. + self initializeSecondHalfPITable. + +] + +{ #category : #'as yet unclassified' } +MD2 class >> initializeFirstHalfPITable [ + + PITable addAll: { + 41. 46. 67. 201. 162. 216. 124. 1. 61. 54. 84. 161. 236. 240. 6. + 19. 98. 167. 5. 243. 192. 199. 115. 140. 152. 147. 43. 217. 188. + 76. 130. 202. 30. 155. 87. 60. 253. 212. 224. 22. 103. 66. 111. 24. + 138. 23. 229. 18. 190. 78. 196. 214. 218. 158. 222. 73. 160. 251. + 245. 142. 187. 47. 238. 122. 169. 104. 121. 145. 21. 178. 7. 63. + 148. 194. 16. 137. 11. 34. 95. 33. 128. 127. 93. 154. 90. 144. 50. + 39. 53. 62. 204. 231. 191. 247. 151. 3. 255. 25. 48. 179. 72. 165. + 181. 209. 215. 94. 146. 42. 172. 86. 170. 198. 79. 184. 56. 210. + 150. 164. 125. 182. 118. 252. 107. 226. 156. 116. 4. 241. 69. 157. + }. + +] + +{ #category : #'as yet unclassified' } +MD2 class >> initializeSecondHalfPITable [ + + PITable addAll: { + 112. 89. 100. 113. 135. 32. 134. 91. 207. 101. 230. 45. 168. 2. 27. + 96. 37. 173. 174. 176. 185. 246. 28. 70. 97. 105. 52. 64. 126. 15. + 85. 71. 163. 35. 221. 81. 175. 58. 195. 92. 249. 206. 186. 197. + 234. 38. 44. 83. 13. 110. 133. 40. 132. 9. 211. 223. 205. 244. 65. + 129. 77. 82. 106. 220. 55. 200. 108. 193. 171. 250. 36. 225. 123. + 8. 12. 189. 177. 74. 120. 136. 149. 139. 227. 99. 232. 109. 233. + 203. 213. 254. 59. 0. 29. 57. 242. 239. 183. 14. 102. 88. 208. 228. + 166. 119. 114. 248. 235. 117. 75. 10. 49. 68. 80. 180. 143. 237. + 31. 26. 219. 153. 141. 51. 159. 17. 131. 20 + }. + +] + +{ #category : #'as yet unclassified' } +MD2 class >> oidString [ + + ^ '1.2.840.113549.2.2'. + +] + +{ #category : #'as yet unclassified' } +MD2 class >> piTable [ + + ^ PITable +] + +{ #category : #accessing } +MD2 >> appendChecksumToInput: input [ + + | checksum l c | + checksum := ByteArray new: 16 withAll: 0. + l := 0. + + 0 to: (input size // 16) - 1 do: [:i | + 1 to: 16 do: [:j | + c := input at: (i * 16 + j). + checksum at: j put: ((checksum at: j) bitXor: (self piTable at: (c bitXor: l) + 1)). + l := checksum at: j]]. + + ^ input, checksum + +] + +{ #category : #accessing } +MD2 >> appendPaddingToInput: input [ + + | paddingLength newInput | + paddingLength := 16 - (input size \\ 16). + newInput := input asByteArray, (ByteArray new: paddingLength withAll: paddingLength). + newInput size \\ 16 = 0 + ifFalse: [self error: 'bad padding']. + ^ newInput + +] + +{ #category : #accessing } +MD2 >> hashMessage: aStringOrByteArray [ + + | input | + input := self appendPaddingToInput: aStringOrByteArray asByteArray. + input := self appendChecksumToInput: input. + ^ self processBlocks: input. + +] + +{ #category : #accessing } +MD2 >> piTable [ + + ^ self class piTable. + +] + +{ #category : #accessing } +MD2 >> processBlocks: data [ + + | buffer t | + buffer := ByteArray new: 48 withAll: 0. + 0 to: (data size // 16) - 1 do: [:i | + 1 to: 16 do: [:j | + buffer at: (16 + j) put: (data at: (i * 16 + j)). + buffer at: (32 + j) put: ((buffer at: (16 + j)) bitXor: (buffer at: j))]. + t := 0. + 1 to: 18 do: [:j | + 1 to: 48 do: [:k | + t := (buffer at: k) bitXor: (self piTable at: t + 1). + buffer at: k put: t]. + t := (t+j-1) \\ 256]]. + ^ buffer copyFrom: 1 to: 16. + +] diff --git a/source/Cryptography/MD4.class.st b/source/Cryptography/MD4.class.st new file mode 100644 index 0000000..6625e0c --- /dev/null +++ b/source/Cryptography/MD4.class.st @@ -0,0 +1,218 @@ +Class { + #name : #MD4, + #superclass : #HashFunction, + #instVars : [ + 'a', + 'b', + 'c', + 'd', + 'input', + 'output' + ], + #category : #'Cryptography-MD4' +} + +{ #category : #'instance creation' } +MD4 class >> encode: aString [ + ^ (self input: aString) + run; + output +] + +{ #category : #'instance creation' } +MD4 class >> input: anArray [ + ^ self new input: anArray +] + +{ #category : #'instance creation' } +MD4 class >> new [ + ^ super new initialize +] + +{ #category : #'instance creation' } +MD4 class >> oidString [ + + ^ '1.2.840.113549.2.5'. + +] + +{ #category : #copying } +MD4 >> copy4: u to: anArray startingAt: n [ + anArray + at: n put: (u bitAnd: 16rFF); + at: n + 1 put: (u >> 8 bitAnd: 16rFF); + at: n + 2 put: (u >> 16 bitAnd: 16rFF); + at: n + 3 put: (u >> 24 bitAnd: 16rFF) +] + +{ #category : #copying } +MD4 >> copy4ToOutput [ + self + copy4: a to: output startingAt: 1; + copy4: b to: output startingAt: 5; + copy4: c to: output startingAt: 9; + copy4: d to: output startingAt: 13 +] + +{ #category : #copying } +MD4 >> copy64: anArray [ + ^ self copy64: anArray startingAt: 1 +] + +{ #category : #copying } +MD4 >> copy64: anArray startingAt: n [ + | array u answer | + array := anArray collect: [:char | char asInteger]. + answer := Array new: 16. + 1 to: answer size + do: + [:i | + u := (array at: i - 1 * 4 + 3 + n) << 24. + u := u bitOr: (array at: i - 1 * 4 + 2 + n) << 16. + u := u bitOr: (array at: i - 1 * 4 + 1 + n) << 8. + u := u bitOr: (array at: i - 1 * 4 + 0 + n) << 0. + answer at: i put: u]. + ^ answer +] + +{ #category : #functions } +MD4 >> fFunction: x [ + ^ ((b bitAnd: c) + bitOr: (b bitInvert bitAnd: d)) + + x +] + +{ #category : #functions } +MD4 >> fRound: x shift: s [ + a := self lshift: a + (self fFunction: x) bits: s +] + +{ #category : #functions } +MD4 >> gFunction: x [ + ^ ((b bitAnd: c) + bitOr: ((b bitAnd: d) + bitOr: (c bitAnd: d))) + + x + 16r5A827999 +] + +{ #category : #functions } +MD4 >> gRound: x shift: s [ + a := self lshift: a + (self gFunction: x) bits: s +] + +{ #category : #functions } +MD4 >> hFunction: x [ + ^ ((b bitXor: c) + bitXor: d) + + x + 16r6ED9EBA1 +] + +{ #category : #functions } +MD4 >> hRound: x shift: s [ + a := self lshift: a + (self hFunction: x) bits: s +] + +{ #category : #accessing } +MD4 >> hashMessage: aStringOrByteArray [ + self input: aStringOrByteArray asByteArray. + self run. + ^ self output +] + +{ #category : #accessing } +MD4 >> hashStream: aStream [ + ^ self hashMessage: aStream upToEnd +] + +{ #category : #initialization } +MD4 >> initialize [ + a := 16r67452301. + b := 16rEFCDAB89. + c := 16r98BADCFE. + d := 16r10325476. + output := ByteArray new: 16 +] + +{ #category : #accessing } +MD4 >> input: anArray [ + input := anArray +] + +{ #category : #functions } +MD4 >> lshift: u bits: s [ + " + (Md4 new lshift: 1 s: 33) printStringRadix: 2 + " + + | lo | + lo := u bitAnd: 16rFFFFFFFF. + ^ (lo << s bitAnd: 16rFFFFFFFF) + bitOr: lo >> (32 - s) +] + +{ #category : #computing } +MD4 >> mdFour64: array [ + | aa bb cc dd indexes s | + aa := a. + bb := b. + cc := c. + dd := d. + indexes := #(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) readStream. + s := #(3 7 11 19 3 7 11 19 3 7 11 19 3 7 11 19) readStream. + [indexes atEnd] + whileFalse: [self fRound: (array at: indexes next) + shift: s next; turn]. + indexes := #(1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16) readStream. + s := #(3 5 9 13 3 5 9 13 3 5 9 13 3 5 9 13) readStream. + [indexes atEnd] + whileFalse: [self gRound: (array at: indexes next) + shift: s next; turn]. + indexes := #(1 9 5 13 3 11 7 15 2 10 6 14 4 12 8 16) readStream. + s := #(3 9 11 15 3 9 11 15 3 9 11 15 3 9 11 15) readStream. + [indexes atEnd] + whileFalse: [self hRound: (array at: indexes next) + shift: s next; turn]. + a := a + aa bitAnd: 16rFFFFFFFF. + b := b + bb bitAnd: 16rFFFFFFFF. + c := c + cc bitAnd: 16rFFFFFFFF. + d := d + dd bitAnd: 16rFFFFFFFF +] + +{ #category : #accessing } +MD4 >> output [ + ^ output +] + +{ #category : #computing } +MD4 >> run [ + | n buffer bb j offset | + buffer := ByteArray new: 128. + n := input size. + bb := n * 8. + j := 0. + [n > 64] + whileTrue: + [self mdFour64: (self copy64: input startingAt: j + 1). + j := j + 64. + n := n - 64]. + buffer atAllPut: 0. + 1 to: n do: [:i | buffer at: i put: (input at: j + i)]. + buffer at: n + 1 put: 16r80. + offset := n <= 55 ifTrue: [56] ifFalse: [120]. + self copy4: bb to: buffer startingAt: offset + 1. + self mdFour64: (self copy64: buffer). + n > 55 ifTrue: [self mdFour64: (self copy64: buffer startingAt: 64)]. + buffer atAllPut: 0. + self copy4ToOutput. + a := b := c := d := 0 +] + +{ #category : #functions } +MD4 >> turn [ + | temp | + temp := d. + d := c. + c := b. + b := a. + a := temp +] diff --git a/source/Cryptography/MD5.extension.st b/source/Cryptography/MD5.extension.st new file mode 100644 index 0000000..1b59e83 --- /dev/null +++ b/source/Cryptography/MD5.extension.st @@ -0,0 +1,13 @@ +Extension { #name : #MD5 } + +{ #category : #'*Cryptography' } +MD5 >> finalHash [ + + self subclassResponsibility +] + +{ #category : #'*Cryptography' } +MD5 >> initializeState [ + + self subclassResponsibility +] diff --git a/source/Cryptography/MD5NonPrimitive.extension.st b/source/Cryptography/MD5NonPrimitive.extension.st new file mode 100644 index 0000000..78b0332 --- /dev/null +++ b/source/Cryptography/MD5NonPrimitive.extension.st @@ -0,0 +1,21 @@ +Extension { #name : #MD5NonPrimitive } + +{ #category : #'*Cryptography' } +MD5NonPrimitive >> finalHash [ + "Concatenate the state values to produce the 128-bite result" + + ^ (state at: 1) asByteArray, (state at: 2) asByteArray, (state at: 3) asByteArray, (state at: 4) asByteArray +] + +{ #category : #'*Cryptography' } +MD5NonPrimitive >> initializeState [ + "Some magic numbers to get the process started" + + state := OrderedCollection newFrom: { + (ThirtyTwoBitRegister new load: 16r67452301). + (ThirtyTwoBitRegister new load: 16rEFCDAB89). + (ThirtyTwoBitRegister new load: 16r98BADCFE). + (ThirtyTwoBitRegister new load: 16r10325476)}. + + +] diff --git a/source/Cryptography/MD5WithPrimitive.class.st b/source/Cryptography/MD5WithPrimitive.class.st new file mode 100644 index 0000000..282de1f --- /dev/null +++ b/source/Cryptography/MD5WithPrimitive.class.st @@ -0,0 +1,48 @@ +Class { + #name : #MD5WithPrimitive, + #superclass : #MD5, + #category : #'Cryptography-MD5' +} + +{ #category : #'private-buffers' } +MD5WithPrimitive >> finalHash [ + + self primDecodeState: state. + ^state +] + +{ #category : #initialization } +MD5WithPrimitive >> initializeState [ + + state := ByteArray new: 16. + self primInitializeState: state + +] + +{ #category : #initialization } +MD5WithPrimitive >> primDecodeState: s [ + + + self primitiveFailed +] + +{ #category : #initialization } +MD5WithPrimitive >> primInitializeState: s [ + + + self primitiveFailed +] + +{ #category : #'private-buffers' } +MD5WithPrimitive >> primProcessBuffer: aByteArray withState: s [ + + + self primitiveFailed +] + +{ #category : #'private-buffers' } +MD5WithPrimitive >> processBuffer: aByteArray [ + + self primProcessBuffer: aByteArray withState: state. + +] diff --git a/source/Cryptography/MillerRabin.class.st b/source/Cryptography/MillerRabin.class.st new file mode 100644 index 0000000..a54065b --- /dev/null +++ b/source/Cryptography/MillerRabin.class.st @@ -0,0 +1,78 @@ +" +My instances are Miller-Rabin algorithms. Miller-Rabin is a probabilistic algorithm for primality testing. +" +Class { + #name : #MillerRabin, + #superclass : #Object, + #instVars : [ + 'target', + 'iterations', + 'satisfied', + 'samples', + 'minusOne', + 'k', + 'n0' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #'primality testing' } +MillerRabin class >> isProbablyPrime: p [ + | probabilistic | + probabilistic := self new. + probabilistic target: p. + [probabilistic satisfied + and: + ["error > (1 / 1024)" + probabilistic iterations < 5]] + whileTrue: [probabilistic iterate]. + ^ probabilistic satisfied +] + +{ #category : #accessing } +MillerRabin >> error [ + ^ 1 / (4 raisedTo: iterations) +] + +{ #category : #computing } +MillerRabin >> iterate [ + | b t x | + iterations := iterations + 1. + b := SecureRandom picker nextInt: samples. + (target gcd: b) = 1 ifFalse: [^ satisfied := false]. + t := 0. + x := b raisedTo: n0 modulo: target. + (x = 1 or: [x = minusOne]) ifFalse: [ + [x := x squared \\ target. + t := t + 1. + satisfied := x = minusOne. + satisfied not and: [t < k]] whileTrue. + satisfied ifFalse: [^ satisfied]] + +] + +{ #category : #accessing } +MillerRabin >> iterations [ + ^ iterations +] + +{ #category : #computing } +MillerRabin >> reset [ + iterations := 0. + satisfied := true. + minusOne := target - 1. + samples := minusOne. + k := minusOne lowBit - 1. + n0 := minusOne bitShift: k negated +] + +{ #category : #accessing } +MillerRabin >> satisfied [ + ^ satisfied +] + +{ #category : #accessing } +MillerRabin >> target: anInteger [ + target := anInteger. + self reset +] diff --git a/source/Cryptography/OFB.class.st b/source/Cryptography/OFB.class.st new file mode 100644 index 0000000..3aafbb8 --- /dev/null +++ b/source/Cryptography/OFB.class.st @@ -0,0 +1,31 @@ +Class { + #name : #OFB, + #superclass : #BlockCipherMode, + #category : #'Cryptography-Core' +} + +{ #category : #private } +OFB >> advanceVector [ + cipher encryptBlock: vector +] + +{ #category : #accessing } +OFB >> decryptBlock: aByteArray [ + "One of the nice attributes of OFB is there is no difference between the encrypt and decrypt implementations." + ^ self encryptBlock: aByteArray +] + +{ #category : #accessing } +OFB >> encryptBlock: aByteArray [ + self advanceVector. + aByteArray withIndexDo: + [ : eachByte : x | + aByteArray + at: x + put: ((aByteArray at: x) bitXor: (vector at: x)) ] +] + +{ #category : #testing } +OFB >> isStreamCipher [ + ^ true +] diff --git a/source/Cryptography/PasswordSaltAndStretch.class.st b/source/Cryptography/PasswordSaltAndStretch.class.st new file mode 100644 index 0000000..d172a6c --- /dev/null +++ b/source/Cryptography/PasswordSaltAndStretch.class.st @@ -0,0 +1,115 @@ +" +A PasswordSaltAndStretch is way to increase the entropy of bad passwords. The idea is to increase the amount of work needed for an attacker to try random passwords. The class returns two values a hash and a salt value. The salt value is random data used to calculate the hash. If the hash is used as a key then store the salt value along with the encrypted data. Then to calculate the key or verify a password use hashForPassword: aPassword s: theSalt. + +So + +| result | +(result := PasswordSaltAndStretch hashForPassword: 'password') = (PasswordSaltAndStretch hashForPassword: 'password' s: result value) + +should be true. + +Instance Variables + r: + s: + +r + - the number of rounds used to stretch the password + +s + - salt which is random data used to make the hash unique. The salt should be stored with encrypted data, or with the hash because it is needed to verify the hash later. + +" +Class { + #name : #PasswordSaltAndStretch, + #superclass : #Object, + #instVars : [ + 'r', + 's' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #LICENSE } +PasswordSaltAndStretch class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #constants } +PasswordSaltAndStretch class >> defaultR [ + "this value is way too low when there is a primitive SHA256 this should be increased" + ^250 +] + +{ #category : #'instance creation' } +PasswordSaltAndStretch class >> hashForPassword: aPassword [ + "the default for r is way to small. Once we have a primitive SHA256 this should be increased so that this method takes at least 1 second" + ^self hashForPassword: aPassword r: self defaultR + +] + +{ #category : #'instance creation' } +PasswordSaltAndStretch class >> hashForPassword: aPassword r: aStretchInteger [ + ^self hashForPassword: aPassword r: aStretchInteger s: (SecureRandom picker nextBytesNonZero: 32) +] + +{ #category : #'instance creation' } +PasswordSaltAndStretch class >> hashForPassword: aPassword r: aStretchInteger s: salt [ + ^self new + r: aStretchInteger; + s: salt; + saltAndStretch: aPassword +] + +{ #category : #'instance creation' } +PasswordSaltAndStretch class >> hashForPassword: aPassword s: salt [ + ^self new + r: self defaultR; + s: salt; + saltAndStretch: aPassword +] + +{ #category : #accessing } +PasswordSaltAndStretch >> r [ + "Answer the value of r" + + ^ r +] + +{ #category : #accessing } +PasswordSaltAndStretch >> r: anObject [ + "Set the value of r" + + r := anObject +] + +{ #category : #accessing } +PasswordSaltAndStretch >> s [ + "Answer the value of s" + + ^ s +] + +{ #category : #accessing } +PasswordSaltAndStretch >> s: anObject [ + "Set the value of s" + + s := anObject +] + +{ #category : #services } +PasswordSaltAndStretch >> saltAndStretch: aPassword [ + | result | + result := ByteArray new. + 1 to: r do: [:i | + result := SHA256 new hashMessage: (result, aPassword asByteArray, self s) + ]. + ^result -> self s +] diff --git a/source/Cryptography/PositionableStream.extension.st b/source/Cryptography/PositionableStream.extension.st new file mode 100644 index 0000000..1a6feac --- /dev/null +++ b/source/Cryptography/PositionableStream.extension.st @@ -0,0 +1,16 @@ +Extension { #name : #PositionableStream } + +{ #category : #'*cryptography-core' } +PositionableStream >> nextUtfString [ + + ^ (self next: self uint16) asString. + +] + +{ #category : #'*cryptography-core' } +PositionableStream >> nextUtfStringPut: s [ + + self uint16: s size. + self nextPutAll: s asByteArray. + +] diff --git a/source/Cryptography/PrimesFinder.class.st b/source/Cryptography/PrimesFinder.class.st new file mode 100644 index 0000000..d0196d9 --- /dev/null +++ b/source/Cryptography/PrimesFinder.class.st @@ -0,0 +1,75 @@ +" +My instances search for primes of a given size. They implement a probabilistic method. For speed, they first test for divisibility by the primest up to 2000 (in a deterministic way). Next, they employ a probabilistic test (such as MillerRabin). +" +Class { + #name : #PrimesFinder, + #superclass : #Object, + #instVars : [ + 'wheel', + 'candidate' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #'instance creation' } +PrimesFinder class >> bits: numberOfBits [ + | shift b | + shift := numberOfBits - 1. + b := (SecureRandom picker nextBits: shift)+1. + b := b bitOr: 1. "ensure it is odd" + b := b bitOr: (1 << shift). "ensure it is of the requiered length" + ^ self candidate: b +] + +{ #category : #'instance creation' } +PrimesFinder class >> candidate: n [ + ^ self new setCandidate: n +] + +{ #category : #'primes generation' } +PrimesFinder class >> primeOfSize: numberOfBits [ + ^ (self bits: numberOfBits) nextPrime +] + +{ #category : #'primes generation' } +PrimesFinder class >> safePrimeOfSize: numberOfBits [ + ^ (self bits: numberOfBits) nextSafePrime +] + +{ #category : #accessing } +PrimesFinder >> += anInteger [ + candidate := candidate + anInteger. + wheel += anInteger +] + +{ #category : #accessing } +PrimesFinder >> nextPrime [ + [self += 2. self satisfied] whileFalse. + ^ candidate +] + +{ #category : #accessing } +PrimesFinder >> nextSafePrime [ + [self += 2. self satisfiedSafe] whileFalse. + ^ 2*candidate + 1 +] + +{ #category : #testing } +PrimesFinder >> satisfied [ + wheel satisfied ifFalse: [^ false]. + ^ MillerRabin isProbablyPrime: candidate +] + +{ #category : #testing } +PrimesFinder >> satisfiedSafe [ + wheel satisfiedSafe ifFalse: [^ false]. + ^ (MillerRabin isProbablyPrime: candidate) + and: [MillerRabin isProbablyPrime: 2*candidate+1] +] + +{ #category : #initialization } +PrimesFinder >> setCandidate: n [ + n < 4 ifTrue: [self error: 'the candidate is too small']. + candidate := n even ifTrue: [n + 1] ifFalse: [n]. + wheel := (PrimesWheel upTo: 2000) += candidate +] diff --git a/source/Cryptography/PrimesWheel.class.st b/source/Cryptography/PrimesWheel.class.st new file mode 100644 index 0000000..2e1e2b4 --- /dev/null +++ b/source/Cryptography/PrimesWheel.class.st @@ -0,0 +1,97 @@ +" +My instances are wheels of primes. See the class comment in PrimesFinder. +" +Class { + #name : #PrimesWheel, + #superclass : #Object, + #instVars : [ + 'primes', + 'residues', + 'satisfied' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #precomputed } +PrimesWheel class >> primes2000 [ + ^ #(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 1087 1091 1093 1097 1103 1109 1117 1123 1129 1151 1153 1163 1171 1181 1187 1193 1201 1213 1217 1223 1229 1231 1237 1249 1259 1277 1279 1283 1289 1291 1297 1301 1303 1307 1319 1321 1327 1361 1367 1373 1381 1399 1409 1423 1427 1429 1433 1439 1447 1451 1453 1459 1471 1481 1483 1487 1489 1493 1499 1511 1523 1531 1543 1549 1553 1559 1567 1571 1579 1583 1597 1601 1607 1609 1613 1619 1621 1627 1637 1657 1663 1667 1669 1693 1697 1699 1709 1721 1723 1733 1741 1747 1753 1759 1777 1783 1787 1789 1801 1811 1823 1831 1847 1861 1867 1871 1873 1877 1879 1889 1901 1907 1913 1931 1933 1949 1951 1973 1979 1987 1993 1997 1999) +] + +{ #category : #'instance creation' } +PrimesWheel class >> upTo: n [ + ^ self new initialize: n + +] + +{ #category : #arithmetic } +PrimesWheel >> *= anInteger [ + | s r | + s := true. + 1 to: primes size do: [:i | + r := (residues at: i) * anInteger \\ (primes at: i). + residues at: i put: r. + r isZero ifTrue: [s := false]]. + satisfied := s +] + +{ #category : #arithmetic } +PrimesWheel >> += anInteger [ + | s r | + s := true. + 1 to: primes size do: [:i | + r := (residues at: i) + anInteger \\ (primes at: i). + residues at: i put: r. + r isZero ifTrue: [s := false]]. + satisfied := s +] + +{ #category : #arithmetic } +PrimesWheel >> -= anInteger [ + self += anInteger negated +] + +{ #category : #initialization } +PrimesWheel >> initialize: n [ + self initializePrimes: n. + residues := (Array new: primes size) atAllPut: 0. + satisfied := false +] + +{ #category : #initialization } +PrimesWheel >> initializePrimes: n [ + | primes2000 last p | + primes2000 := self class primes2000. + n = 2000 + ifTrue: + [primes := primes2000. + ^ self]. + n < 2000 + ifTrue: + [last := primes2000 findLast: [:prime | prime <= n]. + primes := primes2000 copyFrom: 1 to: last. + ^ self]. + primes := (OrderedCollection new: n // 2) addAll: primes2000; yourself. + p := primes2000 last + 2. + [p <= n] + whileTrue: + [primes detect: [:one | p \\ one = 0] ifNone: [primes add: p]. + p := p + 2]. + primes := primes asArray + +] + +{ #category : #testing } +PrimesWheel >> satisfied [ + "residues noneSatisfy: [:r | r isZero]" + ^ satisfied + +] + +{ #category : #testing } +PrimesWheel >> satisfiedSafe [ + "Answer true if the condition for a safe prime is satisfied." + satisfied ifFalse: [^ false]. + 1 to: primes size do: [:i | + ((residues at: i) * 2 + 1 \\ (primes at: i)) isZero ifTrue: [^ false]]. + ^ true +] diff --git a/source/Cryptography/RSAEncryptionScheme.class.st b/source/Cryptography/RSAEncryptionScheme.class.st new file mode 100644 index 0000000..c257bf7 --- /dev/null +++ b/source/Cryptography/RSAEncryptionScheme.class.st @@ -0,0 +1,145 @@ +" +Example: + +| rsa pub priv rsaes c | +rsa := RSAKeyPairGenerator new. +rsa bits: 1024. +pub := rsa publicKey. +priv := rsa privateKey. + +rsaes := RSAEncryptionScheme new. +rsaes setPublicKey: pub privateKey: priv parameter: 'p'. + +c := rsaes encrypt: 'hola'. +(rsaes decrypt: c) asString. + + +" +Class { + #name : #RSAEncryptionScheme, + #superclass : #Object, + #instVars : [ + 'hash', + 'hashLen', + 'rand', + 'publicKey', + 'privateKey', + 'encodingParameter' + ], + #category : #'Cryptography-RSA' +} + +{ #category : #'instance creation' } +RSAEncryptionScheme class >> new [ + ^ super new initialize +] + +{ #category : #'instance creation' } +RSAEncryptionScheme class >> publicKey: aRSAPublicKey privateKey: aRSAPrivateKey parameter: aString [ + ^ self new setPublicKey: aRSAPublicKey privateKey: aRSAPrivateKey parameter: aString +] + +{ #category : #'OAEP encoder' } +RSAEncryptionScheme >> decode: em parameter: parameter [ + | emLen maskedSeed maskedDB seedMask seed dbMask dataBlock dbLen pHash pHashPrima i terminado b | + parameter size > (2 raisedTo: 60) ifTrue: [self error: 'decoding error']. + emLen := em size. + emLen < (2 * hashLen + 1) ifTrue: [self error: 'decoding error']. + + maskedSeed := em copyFrom: 1 to: hashLen. + maskedDB := em copyFrom: (hashLen + 1) to: emLen. + seedMask := self maskOfLength: hashLen fromString: maskedDB. + seed := maskedSeed bitXor: seedMask. + dbMask := self maskOfLength: (emLen - hashLen) fromString: seed. + dataBlock := maskedDB bitXor: dbMask. + dbLen := dataBlock size. + + pHash := (hash hashMessage: parameter) asByteArrayOfSize: hashLen. + pHashPrima := dataBlock copyFrom: 1 to: hashLen. + i := hashLen + 1. + terminado := false. + [terminado] whileFalse: + [b := dataBlock at: i. + b=0 ifTrue: + [i := i+1. + i > dbLen ifTrue: [self error: 'decoding error']] + ifFalse: + [b=1 + ifTrue: [terminado := true] + ifFalse: [self error: 'decoding error'] + ] + ]. + pHash = pHashPrima ifFalse: [self error: 'decoding error']. + ^ dataBlock copyFrom: i+1 to: dbLen +] + +{ #category : #'encryption scheme' } +RSAEncryptionScheme >> decrypt: aByteArray [ + | m | + m := privateKey crypt: aByteArray asInteger. + ^ self decode: m asByteArray parameter: encodingParameter. + + + +] + +{ #category : #'OAEP encoder' } +RSAEncryptionScheme >> encode: message parameter: parameter length: emLen [ + | messageLen paddingString pHash dataBlock seed dbMask maskedDB seedMask maskedSeed em | + + parameter size > (2 raisedTo: 60) ifTrue: + [self error: 'parameter string too long']. + messageLen := message size. + messageLen > (emLen - (2 * hashLen) - 1) ifTrue: + [self error: 'message too long']. + + paddingString := 0 asByteArrayOfSize: (emLen - messageLen - (2*hashLen) - 1). + pHash := (hash hashMessage: parameter) asByteArrayOfSize: hashLen. + dataBlock := pHash, paddingString, (ByteArray with: 1), message. + + seed := ByteArray new: hashLen. + 1 to: hashLen do: + [:i | seed at: i put: (rand next * 256) floor]. + dbMask := self maskOfLength: (emLen - hashLen) fromString: seed. + maskedDB := dataBlock bitXor: dbMask. + seedMask := self maskOfLength: hashLen fromString: maskedDB. + maskedSeed := seed bitXor: seedMask. + em := maskedSeed, maskedDB. + ^ em +] + +{ #category : #'encryption scheme' } +RSAEncryptionScheme >> encrypt: aByteArray [ + | k em c | + k := publicKey bits // 8. + em := self encode: aByteArray parameter: encodingParameter length: k-1. + c := publicKey crypt: em asInteger. + ^ c asByteArray +] + +{ #category : #initialization } +RSAEncryptionScheme >> initialize [ + rand := Random new. + hash := SHA1 new. + hashLen := 20 +] + +{ #category : #'mask generator' } +RSAEncryptionScheme >> maskOfLength: numberOfBytes fromString: seedString [ + | t c | + numberOfBytes > ((2 raisedTo: 32) * hashLen) ifTrue: + [self error: 'mask too long']. + t := ByteArray new. + 0 to: (numberOfBytes / hashLen) floor do: [:counter | + c := counter asByteArrayOfSize: 4. + t := t, ((hash hashMessage: seedString, c) asByteArrayOfSize: hashLen)]. + ^ t copyFrom: 1 to: numberOfBytes + +] + +{ #category : #initialization } +RSAEncryptionScheme >> setPublicKey: aRSAPublicKey privateKey: aRSAPrivateKey parameter: aString [ + publicKey := aRSAPublicKey. + privateKey := aRSAPrivateKey. + encodingParameter := aString +] diff --git a/source/Cryptography/RSAKeyPairGenerator.class.st b/source/Cryptography/RSAKeyPairGenerator.class.st new file mode 100644 index 0000000..5c1fedd --- /dev/null +++ b/source/Cryptography/RSAKeyPairGenerator.class.st @@ -0,0 +1,102 @@ +" +My instances generate public/private RSA pairs. +" +Class { + #name : #RSAKeyPairGenerator, + #superclass : #Object, + #instVars : [ + 'bits', + 'p', + 'q', + 'd', + 'dP', + 'dQ', + 'qInv' + ], + #category : #'Cryptography-RSA' +} + +{ #category : #'instance creation' } +RSAKeyPairGenerator class >> bits: anInteger [ + ^ self new bits: anInteger +] + +{ #category : #initialization } +RSAKeyPairGenerator >> bits: anInteger [ + bits := anInteger +] + +{ #category : #private } +RSAKeyPairGenerator >> computePrimes [ + [p := self findPrime. p - 1 \\ self e = 0] whileTrue. + [q := self findPrime. p - 1 * (q - 1) \\ self e = 0] whileTrue +] + +{ #category : #private } +RSAKeyPairGenerator >> d [ + d isNil ifFalse: [^ d]. + ^ d := self e inverseModulo: self p - 1 * (self q - 1) +] + +{ #category : #private } +RSAKeyPairGenerator >> dp [ + + ^dP ifNil: [ dP := self d \\ ( self p - 1 ) ] +] + +{ #category : #private } +RSAKeyPairGenerator >> dq [ + + ^dQ ifNil: [ dQ := self d \\ (self q - 1) ] +] + +{ #category : #private } +RSAKeyPairGenerator >> e [ + ^ 65537 +] + +{ #category : #private } +RSAKeyPairGenerator >> findPrime [ + ^ PrimesFinder primeOfSize: bits // 2 +] + +{ #category : #private } +RSAKeyPairGenerator >> p [ + p isNil ifTrue: [self computePrimes]. + ^ p +] + +{ #category : #private } +RSAKeyPairGenerator >> p: anInteger [ + p := anInteger +] + +{ #category : #accessing } +RSAKeyPairGenerator >> privateKey [ + ^ RSAPrivateKey p: self p q: self q dP: self dp dQ: self dq qInv: self qInv +] + +{ #category : #accessing } +RSAKeyPairGenerator >> publicKey [ + ^ RSAPublicKey exponent: self e modulo: self p * self q +] + +{ #category : #private } +RSAKeyPairGenerator >> q [ + q isNil ifTrue: [self computePrimes]. + ^ q +] + +{ #category : #private } +RSAKeyPairGenerator >> q: anInteger [ + q := anInteger +] + +{ #category : #private } +RSAKeyPairGenerator >> qInv [ + + ^qInv ifNil: [ "qInv = 1 / q mod p" + qInv := (EuclidAlgorithm with: q with: p) doBasicAlgorithm; firstCoefficient. + qInv < 0 ifTrue: [ qInv := qInv \\ p ]. + qInv ] +] diff --git a/source/Cryptography/RSAPrivateKey.class.st b/source/Cryptography/RSAPrivateKey.class.st new file mode 100644 index 0000000..1449ff0 --- /dev/null +++ b/source/Cryptography/RSAPrivateKey.class.st @@ -0,0 +1,117 @@ +Class { + #name : #RSAPrivateKey, + #superclass : #Object, + #instVars : [ + 'p', + 'q', + 'dP', + 'dQ', + 'qInv' + ], + #category : #'Cryptography-RSA' +} + +{ #category : #'instance creation' } +RSAPrivateKey class >> p: int1 q: int2 dP: int3 dQ: int4 qInv: int5 [ + + ^ self new + p: int1 q: int2 dP: int3 dQ: int4 qInv: int5; + yourself +] + +{ #category : #process } +RSAPrivateKey >> crypt: anInteger [ + + | m1 m2 h | + m1 := anInteger raisedTo: self dP modulo: self p. + m2 := anInteger raisedTo: self dQ modulo: self q. + h := (m1 - m2) * self qInv \\ self p. + ^ m2 + (self q * h). + +] + +{ #category : #accessing } +RSAPrivateKey >> dP [ + "Answer the value of dP" + + ^ dP +] + +{ #category : #accessing } +RSAPrivateKey >> dQ [ + "Answer the value of dQ" + + ^ dQ +] + +{ #category : #accessing } +RSAPrivateKey >> p [ + "Answer the value of p" + + ^ p +] + +{ #category : #accessing } +RSAPrivateKey >> p: int1 q: int2 dP: int3 dQ: int4 qInv: int5 [ + + p := int1. + q := int2. + dP := int3. + dQ := int4. + qInv := int5. + +] + +{ #category : #accessing } +RSAPrivateKey >> q [ + "Answer the value of q" + + ^ q +] + +{ #category : #accessing } +RSAPrivateKey >> qInv [ + "Answer the value of qInv" + + ^ qInv +] + +{ #category : #process } +RSAPrivateKey >> v15Decrypt: aByteArray [ + + | em stream | + em := self crypt: aByteArray asInteger. + stream := em asByteArray readStream. + stream upTo: 16r02. + stream upTo: 16r00. + ^ stream upToEnd. + +] + +{ #category : #process } +RSAPrivateKey >> v15SignMessage: aMessage [ + + ^ self v15SignMessageHash: ( + SHA1 digestInfoAsn1DerEncodingFromMessage: aMessage). + +] + +{ #category : #process } +RSAPrivateKey >> v15SignMessageHash: encodedMsg [ + + | int emLen | + + emLen := (p * q) digitLength -1. + + int := LargePositiveInteger basicNew: emLen. + " Our LargeIntegers are little endian, so we have to reverse the bytes" + encodedMsg with: (encodedMsg size to: 1 by: -1) do: [:each :index | + int basicAt: index put: each]. + int basicAt: encodedMsg size + 1 put: 0. + + encodedMsg size + 2 to: emLen - 1 do: [ :ind | int basicAt: ind put: 255]. + int basicAt: emLen put: 1. + + ^ (self crypt: int) asByteArray. + +] diff --git a/source/Cryptography/RSAPublicKey.class.st b/source/Cryptography/RSAPublicKey.class.st new file mode 100644 index 0000000..abe1954 --- /dev/null +++ b/source/Cryptography/RSAPublicKey.class.st @@ -0,0 +1,107 @@ +" +My instances are RSA algorithms. +" +Class { + #name : #RSAPublicKey, + #superclass : #Object, + #instVars : [ + 'exponent', + 'modulo' + ], + #category : #'Cryptography-RSA' +} + +{ #category : #'instance creation' } +RSAPublicKey class >> exponent: anInteger modulo: anotherInteger [ + ^ self new setExponent: anInteger modulo: anotherInteger +] + +{ #category : #accessing } +RSAPublicKey >> bits [ + ^ modulo highBit +] + +{ #category : #process } +RSAPublicKey >> crypt: anInteger [ + ^ anInteger raisedTo: exponent modulo: modulo +] + +{ #category : #accessing } +RSAPublicKey >> exponent [ + ^ exponent +] + +{ #category : #accessing } +RSAPublicKey >> modulo [ + ^ modulo +] + +{ #category : #initialization } +RSAPublicKey >> setExponent: anInteger modulo: anotherInteger [ + exponent := anInteger. + modulo := anotherInteger +] + +{ #category : #process } +RSAPublicKey >> v15Decrypt: aByteArray [ + + | em stream | + em := self crypt: aByteArray asInteger. + stream := em asByteArray readStream. + stream upTo: 16r02. + stream upTo: 16r00. + ^ stream upToEnd. + +] + +{ #category : #process } +RSAPublicKey >> v15Encrypt: aByteArray [ + + | em k ps | + k := self modulo asByteArray size. + ps := SecureRandom new nextBytesNonZero: (k - aByteArray size - 3). + em := 16r00 asByteArray, 16r02 asByteArray, ps, 16r00 asByteArray, aByteArray. + ^ (self crypt: em asInteger) asByteArray. + +] + +{ #category : #process } +RSAPublicKey >> v15SignMessage: aMessage [ + + ^ self v15SignMessageHash: ( + SHA1 digestInfoAsn1DerEncodingFromMessage: aMessage). + +] + +{ #category : #process } +RSAPublicKey >> v15SignMessageHash: encodedMsg [ + + | padded toBeSigned | + padded := ByteArray new: (256 - encodedMsg size - 3) withAll: 255. + toBeSigned := #(0) asByteArray, #(1) asByteArray, padded, #(0) asByteArray, encodedMsg. + ^ (self crypt: toBeSigned asInteger) asByteArray. + +] + +{ #category : #process } +RSAPublicKey >> v15Verify: aSignature isSignatureOf: aMessage [ + "Answer true if the given signature string signs the given message." + + ^ self + v15VerifySignature: aSignature + ofMessageHash: ( + SHA1 digestInfoAsn1DerEncodingFromMessage: aMessage). + +] + +{ #category : #process } +RSAPublicKey >> v15VerifySignature: aSignature ofMessageHash: encodedMsg [ + "Answer true if the given signature string signs the given message (a stream or string)." + "Note: Random numbers are not needed for signature verification; thus, there is no need to call initRandomFromUser before verifying a signature." + + | bytes signedMsg | + bytes := (self crypt: aSignature asInteger) asByteArray. + signedMsg := bytes readStream upTo: 1; upTo: 0; upToEnd. + ^ encodedMsg = signedMsg + +] diff --git a/source/Cryptography/RandomGenerator.class.st b/source/Cryptography/RandomGenerator.class.st new file mode 100644 index 0000000..1054780 --- /dev/null +++ b/source/Cryptography/RandomGenerator.class.st @@ -0,0 +1,146 @@ +Class { + #name : #RandomGenerator, + #superclass : #Object, + #classInstVars : [ + 'picker' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #'initialize-release' } +RandomGenerator class >> destroyPickers [ + self withAllSubclassesDo: + [ : each | + (each instVarNamed: 'picker') ifNotNil: [ : thePicker | thePicker destroy ]. + each + instVarNamed: 'picker' + put: nil ] +] + +{ #category : #create } +RandomGenerator class >> fromUser [ + "Ask the user to type a long random string and use the result to seed the secure random number generator." + + | string | + string := FillInTheBlank request: 'Enter a long random string to seed the random generator.'. + ^ self key: string +] + +{ #category : #'initialize-release' } +RandomGenerator class >> generateKey [ + | unguessableBytes prior | + prior := UUID new shuffled asInteger. + unguessableBytes := ByteArray streamContents: + [ : stream | + self unpredictableStringsDo: + [ : each | + | current | + current := each size < 30 + ifTrue: + [ "Some of the inputs are pretty short, expand them a little, and take opportunity to inject some extra craziness." + (each asByteArray asInteger + raisedTo: 64 + modulo: 6773186437430423149 "prime") asByteArray ] + ifFalse: [ each ]. + "make each value dependent on the prior values, so the adversary is required to get every single string exactly right AND guess every the randomizations correctly." + current := SHA1 new hashMessage: (current bitXor: prior). + stream nextPutAll: current asByteArray. + prior := current ] ]. + ^ SHA256 new hashMessage: unguessableBytes +] + +{ #category : #'initialize-release' } +RandomGenerator class >> initialize [ + super initialize. + Smalltalk + addToStartUpList: self ; + addToShutDownList: self. + self startUp +] + +{ #category : #create } +RandomGenerator class >> key: anInteger [ + self subclassResponsibility +] + +{ #category : #create } +RandomGenerator class >> picker [ + ^ picker ifNil: [ picker := self withGeneratedKey ] +] + +{ #category : #'initialize-release' } +RandomGenerator class >> shutDown [ + super shutDown. + self destroyPickers +] + +{ #category : #'initialize-release' } +RandomGenerator class >> startUp [ + super startUp. + self destroyPickers +] + +{ #category : #'initialize-release' } +RandomGenerator class >> unpredictableStringsDo: aBlock [ + "Enumerate sources of information from my environment that should be generally hard to guess." + | time | + time := Time millisecondsToRun: + [ aBlock + value: World imageForm bits compressToByteArray ; + value: Sensor mousePoint x asString ; + value: Sensor mousePoint y asString ; + value: Time millisecondClockValue asByteArray ; + value: Date today asString ; + value: Time now asString ; + value: Display extent asString. + 100 timesRepeat: [ aBlock value: UUID new ]. + #(imagePath lastUpdateString systemInformationString shortImageName datedVersion lastQuitLogPosition licenseStringTemplate) collect: + [ : each | + aBlock value: (SmalltalkImage current perform: each) asByteArray ] ]. + aBlock + value: time asByteArray; + "maybe the pointer has moved, hit it again." + value: Sensor mousePoint asString ; + value: Time millisecondClockValue asByteArray + +] + +{ #category : #create } +RandomGenerator class >> withGeneratedKey [ + ^ self key: self generateKey +] + +{ #category : #'initialize-release' } +RandomGenerator >> destroy [ + self subclassResponsibility +] + +{ #category : #accessing } +RandomGenerator >> nextBits: bitLength [ + self subclassResponsibility +] + +{ #category : #accessing } +RandomGenerator >> nextBytes: byteLength [ + self subclassResponsibility +] + +{ #category : #accessing } +RandomGenerator >> nextFrom: start to: end [ + "Answer a random integer between start and end." + | r | + r := self nextInt: end-start+1. + ^ r+start-1 +] + +{ #category : #accessing } +RandomGenerator >> nextInt: anInteger [ + "Answer a random integer in the interval [1, anInteger]." + | r high | + anInteger strictlyPositive ifFalse: [ self error: 'Range must be positive' ]. + high := anInteger-1. + [ (r := self nextBits: anInteger highBit) + between: 0 + and: high ] whileFalse. + ^ r+1 +] diff --git a/source/Cryptography/RandomPool.class.st b/source/Cryptography/RandomPool.class.st new file mode 100644 index 0000000..9cee4ea --- /dev/null +++ b/source/Cryptography/RandomPool.class.st @@ -0,0 +1,120 @@ +Class { + #name : #RandomPool, + #superclass : #Stream, + #instVars : [ + 'key', + 'pool', + 'outputStream', + 'inputIndex' + ], + #classInstVars : [ + 'default' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #default } +RandomPool class >> default [ + ^ default ifNil: [default := self new: 4096] +] + +{ #category : #'intance creation' } +RandomPool class >> new [ + ^ self new: 256 +] + +{ #category : #'intance creation' } +RandomPool class >> new: anInteger [ + ^ self basicNew initializePoolSize: anInteger +] + +{ #category : #'as yet unclassified' } +RandomPool >> atEnd [ + ^ false +] + +{ #category : #'as yet unclassified' } +RandomPool >> grabRandomBitsFromSoundInput: bitCount [ + "Grab the given number of random bits of 'noise' from a sound input source. Typically, one would use a microphone or line input as the sound source, although many sound cards have enough thermal noise that you get random low-order sample bits even with no microphone connected. Only the least signficant bit of the samples is used. Since not all sound cards support 16-bits of sample resolution, we use the lowest bit that changes." + + | recorder buf mid samples bitMask randomBits bit | + "collect some sound data" + recorder := SoundRecorder new clearRecordedSound. + recorder resumeRecording. + (Delay forSeconds: 1) wait. + recorder stopRecording. + buf := recorder condensedSamples. + + "grab bitCount samples from the middle" + mid := buf monoSampleCount // 2. + samples := buf copyFrom: mid to: mid + bitCount - 1. + + "find the least significant bit that varies" + bitMask := 1. + [bitMask < 16r10000 and: + [(samples collect: [:s | s bitAnd: bitMask]) asSet size < 2]] + whileTrue: [bitMask := bitMask bitShift: 1]. + bitMask = 16r10000 ifTrue: [^ self error: 'sound samples do not vary']. + + "pack the random bits into a positive integer" + randomBits := 0. + 1 to: samples size do: [:i | + bit := ((samples at: i) bitAnd: bitMask) = 0 ifTrue: [0] ifFalse: [1]. + randomBits := (randomBits bitShift: 1) + bit]. + + self nextPutAll: randomBits +] + +{ #category : #'as yet unclassified' } +RandomPool >> initializePoolSize: anInteger [ + key := ByteArray new: TripleDES keySize. + pool := ByteArray new: anInteger // TripleDES blockSize + 1 * TripleDES blockSize. + outputStream := ByteArray new readStream. + inputIndex := 1. + self nextPutAll: Time millisecondClockValue printString asByteArray. + self stir +] + +{ #category : #'as yet unclassified' } +RandomPool >> next [ + outputStream atEnd + ifTrue: [self stir. + outputStream := (pool copyFrom: 1 to: pool size // 2) readStream]. + ^ outputStream next +] + +{ #category : #'as yet unclassified' } +RandomPool >> next: anInteger [ + | answer | + answer := ByteArray new: anInteger. + 1 to: anInteger do: [ :each | answer at: each put: self next]. + ^ answer +] + +{ #category : #'as yet unclassified' } +RandomPool >> nextPut: aByte [ + | keyIndex | + inputIndex = pool size ifTrue: [self stir]. + inputIndex := inputIndex \\ pool size + 1. + pool at: inputIndex put: ((pool at: inputIndex) bitXor: aByte). + keyIndex := inputIndex \\ key size + 1. + key at: keyIndex put: ((key at: keyIndex) bitXor: aByte). + ^ aByte +] + +{ #category : #'as yet unclassified' } +RandomPool >> nextPutAll: aCollection [ + aCollection do: [ :each | self nextPut: each]. + ^ aCollection +] + +{ #category : #'as yet unclassified' } +RandomPool >> stir [ + | cipher block | + cipher := (TripleDES key: key) cbc. + cipher initialVector: (pool copyFrom: pool size - TripleDES blockSize + 1 to: pool size). + 1 to: pool size - TripleDES blockSize + 1 by: TripleDES blockSize do: [ :startIndex | + block := pool copyFrom: startIndex to: startIndex + TripleDES blockSize - 1. + cipher encryptBlock: block. + pool replaceFrom: startIndex to: startIndex + TripleDES blockSize - 1 with: block] +] diff --git a/source/Cryptography/Rijndael.class.st b/source/Cryptography/Rijndael.class.st new file mode 100644 index 0000000..accabd9 --- /dev/null +++ b/source/Cryptography/Rijndael.class.st @@ -0,0 +1,551 @@ +Class { + #name : #Rijndael, + #superclass : #BlockCipher, + #instVars : [ + 'nB', + 'nK', + 'nR', + 'shiftOffset1', + 'shiftOffset2', + 'shiftOffset3', + 'expandedKey', + 'eqExpandedKey', + 'state' + ], + #classVars : [ + 'InvT0', + 'InvT1', + 'InvT2', + 'InvT3', + 'LogInverseTable', + 'LogTable', + 'RoundConstant', + 'SubByte', + 'SubByteInverse', + 'T0', + 'T1', + 'T2', + 'T3' + ], + #category : #'Cryptography-Rijndael' +} + +{ #category : #accessing } +Rijndael class >> blockSize [ + "Rijndael supports variable block length. 128 bits is a good default." + ^ 128 / 8 +] + +{ #category : #'class initialization' } +Rijndael class >> calculateInvTTables [ + | a t coef1 coef2 coef3 coef4 | + InvT0 := Array new: 256. + InvT1 := Array new: 256. + InvT2 := Array new: 256. + InvT3 := Array new: 256. + + coef1 := 14. + coef2 := 9. + coef3 := 13. + coef4 := 11. + 0 to: 255 do: [:avalue | + a := self subByteInverse: avalue. + t := ThirtyTwoBitRegister + byte1: (self multiply: a by: coef1) + byte2: (self multiply: a by: coef2) + byte3: (self multiply: a by: coef3) + byte4: (self multiply: a by: coef4). + InvT0 at: avalue+1 put: t. + t := t copy leftRotateBy: -8. + InvT1 at: avalue+1 put: t. + t := t copy leftRotateBy: -8. + InvT2 at: avalue+1 put: t. + t := t copy leftRotateBy: -8. + InvT3 at: avalue+1 put: t. + ]. + +] + +{ #category : #'class initialization' } +Rijndael class >> calculateTTables [ + | a t coef1 coef2 coef3 coef4 | + T0 := Array new: 256. + T1 := Array new: 256. + T2 := Array new: 256. + T3 := Array new: 256. + + coef1 := 2. + coef2 := 1. + coef3 := 1. + coef4 := 3. + 0 to: 255 do: [:avalue | + a := self subByte: avalue. + t := ThirtyTwoBitRegister + byte1: (self multiply: a by: coef1) + byte2: (self multiply: a by: coef2) + byte3: (self multiply: a by: coef3) + byte4: (self multiply: a by: coef4). + T0 at: avalue+1 put: t. + t := t copy leftRotateBy: -8. + T1 at: avalue+1 put: t. + t := t copy leftRotateBy: -8. + T2 at: avalue+1 put: t. + t := t copy leftRotateBy: -8. + T3 at: avalue+1 put: t. + ]. + +] + +{ #category : #'class initialization' } +Rijndael class >> initialize [ + self initializeLogTable. + self initializeLogInverseTable. + self initializeRoundConstant. + self initializeSubByte. + self initializeSubByteInverse. + + self calculateTTables. + self calculateInvTTables +] + +{ #category : #'class initialization' } +Rijndael class >> initializeLogInverseTable [ + + LogInverseTable := +#(1 3 5 15 17 51 85 255 26 46 114 150 161 248 19 53 + + 95 225 56 72 216 115 149 164 247 2 6 10 30 34 102 170 + + 229 52 92 228 55 89 235 38 106 190 217 112 144 171 230 49 + + 83 245 4 12 20 60 68 204 79 209 104 184 211 110 178 205 + + 76 212 103 169 224 59 77 215 98 166 241 8 24 40 120 136 + + 131 158 185 208 107 189 220 127 129 152 179 206 73 219 118 154 + + 181 196 87 249 16 48 80 240 11 29 39 105 187 214 97 163 + + 254 25 43 125 135 146 173 236 47 113 147 174 233 32 96 160 + + 251 22 58 78 210 109 183 194 93 231 50 86 250 21 63 65 + + 195 94 226 61 71 201 64 192 91 237 44 116 156 191 218 117 + + 159 186 213 100 172 239 42 126 130 157 188 223 122 142 137 128 + + 155 182 193 88 232 35 101 175 234 37 111 177 200 67 197 84 + + 252 31 33 99 165 244 7 9 27 45 119 153 176 203 70 202 + + 69 207 74 222 121 139 134 145 168 227 62 66 198 81 243 14 + + 18 54 90 238 41 123 141 140 143 138 133 148 167 242 13 23 + + 57 75 221 124 132 151 162 253 28 36 108 180 199 82 246 1) +] + +{ #category : #'class initialization' } +Rijndael class >> initializeLogTable [ + + LogTable := +#(0 0 25 1 50 2 26 198 75 199 27 104 51 238 223 3 + + 100 4 224 14 52 141 129 239 76 113 8 200 248 105 28 193 + + 125 194 29 181 249 185 39 106 77 228 166 114 154 201 9 120 + + 101 47 138 5 33 15 225 36 18 240 130 69 53 147 218 142 + + 150 143 219 189 54 208 206 148 19 92 210 241 64 70 131 56 + + 102 221 253 48 191 6 139 98 179 37 226 152 34 136 145 16 + + 126 110 72 195 163 182 30 66 58 107 40 84 250 133 61 186 + + 43 121 10 21 155 159 94 202 78 212 172 229 243 115 167 87 + + 175 88 168 80 244 234 214 116 79 174 233 213 231 230 173 232 + + 44 215 117 122 235 22 11 245 89 203 95 176 156 169 81 160 + + 127 12 246 111 23 196 73 236 216 67 31 45 164 118 123 183 + + 204 187 62 90 251 96 177 134 59 82 161 108 170 85 41 157 + + 151 178 135 144 97 190 220 252 188 149 207 205 55 63 91 209 + + 83 57 132 60 65 162 109 71 20 42 158 93 86 242 211 171 + + 68 17 146 217 35 32 46 137 180 124 184 38 119 153 227 165 + + 103 74 237 222 197 49 254 24 13 99 140 128 192 247 112 7) +] + +{ #category : #'class initialization' } +Rijndael class >> initializeRoundConstant [ + RoundConstant := +#(1 2 4 8 16 32 64 128 27 54 108 216 171 77 154 47 94 188 99 198 151 53 106 212 179 125 250 239 197 145 57) +] + +{ #category : #'class initialization' } +Rijndael class >> initializeSubByte [ + SubByte := +#(99 124 119 123 242 107 111 197 48 1 103 43 254 215 171 118 202 130 201 125 250 89 71 240 173 212 162 175 156 164 114 192 183 253 147 38 54 63 247 204 52 165 229 241 113 216 49 21 4 199 35 195 24 150 5 154 7 18 128 226 235 39 178 117 9 131 44 26 27 110 90 160 82 59 214 179 41 227 47 132 83 209 0 237 32 252 177 91 106 203 190 57 74 76 88 207 208 239 170 251 67 77 51 133 69 249 2 127 80 60 159 168 81 163 64 143 146 157 56 245 188 182 218 33 16 255 243 210 205 12 19 236 95 151 68 23 196 167 126 61 100 93 25 115 96 129 79 220 34 42 144 136 70 238 184 20 222 94 11 219 224 50 58 10 73 6 36 92 194 211 172 98 145 149 228 121 231 200 55 109 141 213 78 169 108 86 244 234 101 122 174 8 186 120 37 46 28 166 180 198 232 221 116 31 75 189 139 138 112 62 181 102 72 3 246 14 97 53 87 185 134 193 29 158 225 248 152 17 105 217 142 148 155 30 135 233 206 85 40 223 140 161 137 13 191 230 66 104 65 153 45 15 176 84 187 22) +] + +{ #category : #'class initialization' } +Rijndael class >> initializeSubByteInverse [ + SubByteInverse := +#(82 9 106 213 48 54 165 56 191 64 163 158 129 243 215 251 124 227 57 130 155 47 255 135 52 142 67 68 196 222 233 203 84 123 148 50 166 194 35 61 238 76 149 11 66 250 195 78 8 46 161 102 40 217 36 178 118 91 162 73 109 139 209 37 114 248 246 100 134 104 152 22 212 164 92 204 93 101 182 146 108 112 72 80 253 237 185 218 94 21 70 87 167 141 157 132 144 216 171 0 140 188 211 10 247 228 88 5 184 179 69 6 208 44 30 143 202 63 15 2 193 175 189 3 1 19 138 107 58 145 17 65 79 103 220 234 151 242 207 206 240 180 230 115 150 172 116 34 231 173 53 133 226 249 55 232 28 117 223 110 71 241 26 113 29 41 197 137 111 183 98 14 170 24 190 27 252 86 62 75 198 210 121 32 154 219 192 254 120 205 90 244 31 221 168 51 136 7 199 49 177 18 16 89 39 128 236 95 96 81 127 169 25 181 74 13 45 229 122 159 147 201 156 239 160 224 59 77 174 42 245 176 200 235 187 60 131 83 153 97 23 43 4 126 186 119 214 38 225 105 20 99 85 33 12 125) +] + +{ #category : #accessing } +Rijndael class >> keySize [ + "Rijndael supports variable key length. 256 bits is a good default." + ^ 256 / 8 +] + +{ #category : #'byte functions' } +Rijndael class >> multiply: value1 by: value2 [ + (value1 = 0 or: [value2 = 0]) ifTrue: [^ 0]. + + ^ LogInverseTable at: + ((LogTable at: value1 + 1) + (LogTable at: value2 + 1) \\ 255 + 1) +] + +{ #category : #'instance creation' } +Rijndael class >> new [ + ^ super new keySize: self keySize; blockSize: self blockSize +] + +{ #category : #'byte functions' } +Rijndael class >> subByte: index [ + ^ SubByte at: index+1 +] + +{ #category : #'byte functions' } +Rijndael class >> subByteInverse: index [ + ^ SubByteInverse at: index+1 +] + +{ #category : #'block cipher' } +Rijndael >> addEqRoundKey: roundNumber [ + | start | + start := roundNumber * nB. + 1 to: nB do: [:k | + (state at: k) bitXor: (eqExpandedKey at: start + k)] +] + +{ #category : #'block cipher' } +Rijndael >> addRoundKey: roundNumber [ + | start | + start := roundNumber * nB. + 1 to: nB do: [:k | + (state at: k) bitXor: (expandedKey at: start + k)] +] + +{ #category : #accessing } +Rijndael >> blockSize [ + ^ nB * 32 / 8 +] + +{ #category : #accessing } +Rijndael >> blockSize: anInteger [ + nB := anInteger * 8 / 32 +] + +{ #category : #setup } +Rijndael >> calculateNumberOfRounds [ + nK = 4 ifTrue: [ + nB = 4 ifTrue: [nR := 10]. + nB = 6 ifTrue: [nR := 12]. + nB = 8 ifTrue: [nR := 14]]. + nK = 6 ifTrue: [ + nB = 4 ifTrue: [nR := 12]. + nB = 6 ifTrue: [nR := 12]. + nB = 8 ifTrue: [nR := 14]]. + nK = 8 ifTrue: [ + nB = 4 ifTrue: [nR := 14]. + nB = 6 ifTrue: [nR := 14]. + nB = 8 ifTrue: [nR := 14]]. + + +] + +{ #category : #setup } +Rijndael >> calculateShiftOffsets [ + (nB = 4 or: [nB = 6]) ifTrue: [shiftOffset1 := 1. shiftOffset2 := 2. shiftOffset3 := 3]. + nB = 8 ifTrue: [shiftOffset1 := 1. shiftOffset2 := 3. shiftOffset3 := 4] +] + +{ #category : #accessing } +Rijndael >> decryptBlock: aByteArray [ + state := self stateFromBytes: aByteArray. + self decryptState: state. + self storeState: state into: aByteArray +] + +{ #category : #'block cipher' } +Rijndael >> decryptState: aState [ + state := aState. + self addEqRoundKey: nR. + nR - 1 to: 1 by: -1 do: [:roundNumber | self eqRound: roundNumber]. + self eqFinalRound: 0. + ^ state +] + +{ #category : #accessing } +Rijndael >> encryptBlock: aByteArray [ + state := self stateFromBytes: aByteArray. + self encryptState: state. + self storeState: state into: aByteArray +] + +{ #category : #'block cipher' } +Rijndael >> encryptState: aState [ + state := aState. + self addRoundKey: 0. + 1 to: nR - 1 do: [:roundNumber | self round: roundNumber]. + self finalRound: nR. + ^ state +] + +{ #category : #'key schedule' } +Rijndael >> eqExpandKey [ + eqExpandedKey := Array new: nB * (nR + 1). + + 1 to: nB do: [:j | + eqExpandedKey at: 0*nB + j put: (expandedKey at: 0*nB + j). + eqExpandedKey at: nR*nB + j put: (expandedKey at: nR*nB + j). + ]. + 1 to: nR-1 do: [:i | + 1 to: nB do: [:j | + eqExpandedKey at: i*nB + j put: + (self invMixColumn: (expandedKey at: i*nB + j)) + ] + ]. + + +] + +{ #category : #'block cipher' } +Rijndael >> eqFinalRound: roundNumber [ + | a1 a2 a3 a4 newState start | + newState := Array new: nB. + + "do SubBytesInverse and ShiftRowsInverse in one step" + 0 to: nB-1 do: [:j | + a1 := SubByteInverse at: ((state at: j + 1) byteAt: 1) + 1. + a2 := SubByteInverse at: ((state at: (j - shiftOffset1) \\ nB + 1) byteAt: 2) + 1. + a3 := SubByteInverse at: ((state at: (j - shiftOffset2) \\ nB + 1) byteAt: 3) + 1. + a4 := SubByteInverse at: ((state at: (j - shiftOffset3) \\ nB + 1) byteAt: 4) + 1. + newState at: j+1 put: + (ThirtyTwoBitRegister byte1: a1 byte2: a2 byte3: a3 byte4: a4)]. + + "add equivalent round key" + start := roundNumber * nB. + 1 to: nB do: [:k | + state at: k put: ((newState at: k) bitXor: (eqExpandedKey at: start + k))] +] + +{ #category : #'block cipher' } +Rijndael >> eqRound: roundNumber [ + | a0 a1 a2 a3 result newState start | + newState := Array new: nB. + + "do SubBytesInverse, ShiftRowsInverse and MixColumnsInverse in one step" + 0 to: nB-1 do: [:j | + a0 := (state at: j + 1) byteAt: 1. + a1 := (state at: (j - shiftOffset1) \\ nB + 1) byteAt: 2. + a2 := (state at: (j - shiftOffset2) \\ nB + 1) byteAt: 3. + a3 := (state at: (j - shiftOffset3) \\ nB + 1) byteAt: 4. + result := (InvT0 at: a0+1) copy. + result bitXor: (InvT1 at: a1+1). + result bitXor: (InvT2 at: a2+1). + result bitXor: (InvT3 at: a3+1). + newState at: j+1 put: result]. + + "add equivalent round key" + start := roundNumber * nB. + 1 to: nB do: [:k | + state at: k put: ((newState at: k) bitXor: (eqExpandedKey at: start + k))] +] + +{ #category : #examples } +Rijndael >> example [ + | k pt | + k := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C). + pt := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34). + + k := #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0). + pt := #(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0). + + pt := self stateFromBytes: pt. + self key: k. + 3 timesRepeat: + [Transcript show: pt; cr. + self encryptState: pt]. + 3 timesRepeat: + [Transcript show: pt; cr. + self decryptState: pt]. + Transcript show: pt; cr. +] + +{ #category : #examples } +Rijndael >> example2 [ + | k pt r | + k := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C). + pt := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34). + + pt := self stateFromBytes: pt. + self key: k. + r := Time millisecondsToRun: + [10000 timesRepeat: [self encryptState: pt]]. + ^ r + +] + +{ #category : #examples } +Rijndael >> example3 [ + | k pt | + k := #(16r2B 16r7E 16r15 16r16 16r28 16rAE 16rD2 16rA6 16rAB 16rF7 16r15 16r88 16r09 16rCF 16r4F 16r3C) asByteArray. + pt := #(16r32 16r43 16rF6 16rA8 16r88 16r5A 16r30 16r8D 16r31 16r31 16r98 16rA2 16rE0 16r37 16r07 16r34) asByteArray. + + self key: k. + Transcript cr; show: pt hex. + self encryptBlock: pt. + Transcript cr; show: pt hex. + self decryptBlock: pt. + Transcript cr; show: pt hex +] + +{ #category : #'key schedule' } +Rijndael >> expandKey: aByteArray [ + | w total want sw key | + key := self stateFromBytes: aByteArray columns: nK. + total := nB * (nR + 1). + w := Array new: total. + + 1 to: nK do: [:n | + w at: n put: (key at: n)]. + nK + 1 to: total do: [:n | + want := (w at: n - 1) copy. + (n - 1 \\ nK) = 0 ifTrue: + [sw := ByteArray new: 4. + sw at: 1 put: + ((SubByte at: (want byteAt: 2) + 1) bitXor: (RoundConstant at: n-1 / nK)). + 2 to: 4 do: [:i | + sw at: i put: (SubByte at: (want byteAt: i \\ 4 + 1) + 1)]. + sw := ThirtyTwoBitRegister loadFrom: sw at: 1] + ifFalse: + [(n - 1 \\ nK = 4) & (nK > 6) ifTrue: + [sw := ByteArray new: 4. + 1 to: 4 do: [:i | sw at: i put: (SubByte at: (want byteAt: i) + 1)]. + sw := ThirtyTwoBitRegister loadFrom: sw at: 1] + ifFalse: + [sw := want] + ]. + w at: n put: ((w at: n - nK) copy bitXor: sw). + ]. + expandedKey := w +] + +{ #category : #'block cipher' } +Rijndael >> finalRound: roundNumber [ + | a1 a2 a3 a4 newState start | + newState := Array new: nB. + + "do SubBytes and ShiftRows in one step" + 0 to: nB-1 do: [:j | + a1 := SubByte at: ((state at: j + 1) byteAt: 1) + 1. + a2 := SubByte at: ((state at: (j + shiftOffset1) \\ nB + 1) byteAt: 2) + 1. + a3 := SubByte at: ((state at: (j + shiftOffset2) \\ nB + 1) byteAt: 3) + 1. + a4 := SubByte at: ((state at: (j + shiftOffset3) \\ nB + 1) byteAt: 4) + 1. + newState at: j+1 put: (ThirtyTwoBitRegister byte1: a1 byte2: a2 byte3: a3 byte4: a4)]. + + "add round key" + start := roundNumber * nB. + 1 to: nB do: [:k | + state at: k put: ((newState at: k) bitXor: (expandedKey at: start + k))] +] + +{ #category : #'key schedule' } +Rijndael >> invMixColumn: aColumn [ + | a0 a1 a2 a3 result | + a0 := SubByte at: (aColumn byteAt: 1) + 1. + a1 := SubByte at: (aColumn byteAt: 2) + 1. + a2 := SubByte at: (aColumn byteAt: 3) + 1. + a3 := SubByte at: (aColumn byteAt: 4) + 1. + result := (InvT0 at: a0+1) copy. + result bitXor: (InvT1 at: a1+1). + result bitXor: (InvT2 at: a2+1). + result bitXor: (InvT3 at: a3+1). + ^ result +] + +{ #category : #accessing } +Rijndael >> key: aByteArray [ +" nK := aByteArray size * 8 / 32." + self setSystem. + self expandKey: aByteArray. + self eqExpandKey +] + +{ #category : #accessing } +Rijndael >> keySize [ + ^ nK * 32 / 8 +] + +{ #category : #accessing } +Rijndael >> keySize: anInteger [ + nK := anInteger * 8 / 32 +] + +{ #category : #'block cipher' } +Rijndael >> round: roundNumber [ + | a0 a1 a2 a3 result newState start | + newState := Array new: nB. + + "do SubBytes, ShiftRows and MixColumns in one step" + 0 to: nB-1 do: [:j | + a0 := (state at: j + 1) byteAt: 1. + a1 := (state at: (j + shiftOffset1) \\ nB + 1) byteAt: 2. + a2 := (state at: (j + shiftOffset2) \\ nB + 1) byteAt: 3. + a3 := (state at: (j + shiftOffset3) \\ nB + 1) byteAt: 4. + result := (T0 at: a0+1) copy. + result bitXor: (T1 at: a1+1). + result bitXor: (T2 at: a2+1). + result bitXor: (T3 at: a3+1). + newState at: j+1 put: result]. + + "add round key" + start := roundNumber * nB. + 1 to: nB do: [:k | + state at: k put: ((newState at: k) bitXor: (expandedKey at: start + k))] +] + +{ #category : #setup } +Rijndael >> setSystem [ + self calculateNumberOfRounds. + self calculateShiftOffsets. + + +] + +{ #category : #setup } +Rijndael >> stateFromBytes: aByteArray [ + ^ self stateFromBytes: aByteArray columns: nB + +] + +{ #category : #setup } +Rijndael >> stateFromBytes: aByteArray columns: numberOfColumns [ + aByteArray size = (4 * numberOfColumns) ifFalse: [^ self error: 'wrong block size']. + ^ (1 to: numberOfColumns) collect: [:k | ThirtyTwoBitRegister loadFrom: aByteArray at: (k-1)*4 + 1] +] + +{ #category : #setup } +Rijndael >> storeState: anArray into: aByteArray [ + anArray withIndexDo: [ :register :k | register storeInto: aByteArray at: (k-1)*4 + 1] +] diff --git a/source/Cryptography/SHA1.extension.st b/source/Cryptography/SHA1.extension.st new file mode 100644 index 0000000..cfb4e52 --- /dev/null +++ b/source/Cryptography/SHA1.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #SHA1 } + +{ #category : #'*Cryptography' } +SHA1 class >> oidString [ + + ^ '1.3.14.3.2.26'. + +] diff --git a/source/Cryptography/SHA256.extension.st b/source/Cryptography/SHA256.extension.st new file mode 100644 index 0000000..536a378 --- /dev/null +++ b/source/Cryptography/SHA256.extension.st @@ -0,0 +1,23 @@ +Extension { #name : #SHA256 } + +{ #category : #'*Cryptography' } +SHA256 class >> isPluginAvailable [ + + + ^false +] + +{ #category : #'*Cryptography' } +SHA256 class >> new [ + + self isPluginAvailable + ifTrue: [ ^SHA256WithPrimitive basicNew ] + ifFalse: [ ^SHA256NonPrimitive basicNew ] +] + +{ #category : #'*Cryptography' } +SHA256 class >> oidString [ + + ^ '2.16.840.1.101.3.4.2.2'. + +] diff --git a/source/Cryptography/SHA256NonPrimitive.class.st b/source/Cryptography/SHA256NonPrimitive.class.st new file mode 100644 index 0000000..cb16c05 --- /dev/null +++ b/source/Cryptography/SHA256NonPrimitive.class.st @@ -0,0 +1,178 @@ +Class { + #name : #SHA256NonPrimitive, + #superclass : #SHA256, + #category : #'Cryptography-SHA256' +} + +{ #category : #constants } +SHA256NonPrimitive class >> h0 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16r6A09E667 +] + +{ #category : #constants } +SHA256NonPrimitive class >> h1 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16rBB67AE85 +] + +{ #category : #constants } +SHA256NonPrimitive class >> h2 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16r3C6EF372 +] + +{ #category : #constants } +SHA256NonPrimitive class >> h3 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16rA54FF53A +] + +{ #category : #constants } +SHA256NonPrimitive class >> h4 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16r510E527F +] + +{ #category : #constants } +SHA256NonPrimitive class >> h5 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16r9B05688C +] + +{ #category : #constants } +SHA256NonPrimitive class >> h6 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16r1F83D9AB +] + +{ #category : #constants } +SHA256NonPrimitive class >> h7 [ + "2 raisedTo: 32 times the square root of the first 8 primes 2..19" + "#(2 3 5 7 11 13 17 19) collect: [:x | ((x sqrt) * (2.0 raisedTo: 32)) truncated hex] // 32 bits" + ^16r5BE0CD19 +] + +{ #category : #constants } +SHA256NonPrimitive class >> roundConstants [ + "2 raisedTo: 32 times the cube root of the first 64 primes 2..311" + "(Integer primesUpTo: 311) collect: [:x | ((x raisedTo: 1/3) * (2.0 raisedTo: 32)) truncated hex] \\ 32 bits" + ^#(16r428A2F98 16r71374491 16rB5C0FBCF 16rE9B5DBA5 16r3956C25B 16r59F111F1 16r923F82A4 16rAB1C5ED5 16rD807AA98 16r12835B01 16r243185BE 16r550C7DC3 16r72BE5D74 16r80DEB1FE 16r9BDC06A7 16rC19BF174 16rE49B69C1 16rEFBE4786 16r0FC19DC6 16r240CA1CC 16r2DE92C6F 16r4A7484AA 16r5CB0A9DC 16r76F988DA 16r983E5152 16rA831C66D 16rB00327C8 16rBF597FC7 16rC6E00BF3 16rD5A79147 16r06CA6351 16r14292967 16r27B70A85 16r2E1B2138 16r4D2C6DFC 16r53380D13 16r650A7354 16r766A0ABB 16r81C2C92E 16r92722C85 16rA2BFE8A1 16rA81A664B 16rC24B8B70 16rC76C51A3 16rD192E819 16rD6990624 16rF40E3585 16r106AA070 16r19A4C116 16r1E376C08 16r2748774C 16r34B0BCB5 16r391C0CB3 16r4ED8AA4A 16r5B9CCA4F 16r682E6FF3 16r748F82EE 16r78A5636F 16r84C87814 16r8CC70208 16r90BEFFFA 16rA4506CEB 16rBEF9A3F7 16rC67178F2) + +] + +{ #category : #private } +SHA256NonPrimitive >> expandedBlock: aByteArray [ + "Convert the given 64 byte buffer into 64 32-bit registers and answer the result." + | out src | + out := Array new: 64. + src := 1. + 1 to: 16 do: [:i | + out at: i put: (ThirtyTwoBitRegister new loadFrom: aByteArray at: src). + src := src + 4]. + + 17 to: 64 do: [:i | | s0 s1 wi15 wi2 wi | + wi15 := (out at: i - 15) copy. + wi2 := (out at: i-2) copy. + s0 := wi15 copy. + s0 leftRotateBy: -7; + bitXor: (wi15 copy leftRotateBy: -18); + bitXor: (wi15 copy bitShift: -3). + s1 := wi2 copy. + s1 leftRotateBy: -17; + bitXor: (wi2 copy leftRotateBy: -19); + bitXor: (wi2 copy bitShift: -10). + wi := (out at: i-16) copy += s0 += (out at: i-7) copy += s1. + out at: i put: wi]. + ^ out + +] + +{ #category : #accessing } +SHA256NonPrimitive >> finalHash [ + "Concatenate the final totals to build the 256-bit integer result." + + ^ ((totalA asInteger bitShift: 224) + + (totalB asInteger bitShift: 192) + + (totalC asInteger bitShift: 160) + + (totalD asInteger bitShift: 128) + + (totalE asInteger bitShift: 96) + + (totalF asInteger bitShift: 64) + + (totalG asInteger bitShift: 32) + + (totalH asInteger)) asByteArrayOfSize: 32. +] + +{ #category : #private } +SHA256NonPrimitive >> initialize [ + "Initialize totalA through totalH to their seed values." + + totalA := ThirtyTwoBitRegister new load: self class h0. + totalB := ThirtyTwoBitRegister new load: self class h1. + totalC := ThirtyTwoBitRegister new load: self class h2. + totalD := ThirtyTwoBitRegister new load: self class h3. + totalE := ThirtyTwoBitRegister new load: self class h4. + totalF := ThirtyTwoBitRegister new load: self class h5. + totalG := ThirtyTwoBitRegister new load: self class h6. + totalH := ThirtyTwoBitRegister new load: self class h7 + +] + +{ #category : #private } +SHA256NonPrimitive >> processBuffer: aByteArray [ + "Process the given 64-byte buffer, accumulating the results in totalA through totalH." + + | a b c d e f g h w | + "initialize registers a through h from the current totals" + a := totalA copy. + b := totalB copy. + c := totalC copy. + d := totalD copy. + e := totalE copy. + f := totalF copy. + g := totalG copy. + h := totalH copy. + + "expand and process the buffer" + w := self expandedBlock: aByteArray. + 1 to: 64 do: [:i | | s0 maj t0 s1 ch t1 | + s0 := (a copy leftRotateBy: -2). + s0 bitXor: (a copy leftRotateBy: -13); + bitXor: (a copy leftRotateBy: -22). + maj := (a copy bitAnd: b). + maj bitOr: (b copy bitAnd: c); + bitOr: (c copy bitAnd: a). + t0 := s0 copy += maj. + s1 := (e copy leftRotateBy: -6). + s1 bitXor: (e copy leftRotateBy: -11); + bitXor: (e copy leftRotateBy: -25). + ch := (e copy bitAnd: f). + ch bitOr: ((e copy bitInvert) bitAnd: g). + t1 := h copy += s1 += ch += (ThirtyTwoBitRegister new load: (self class roundConstants at: i)) += (w at: i) copy. + h := g. + g := f. + f := e. + e := d copy += t1. + d := c. + c := b. + b := a. + a := t0 += t1. + "Transcript cr; show: i asString, String tab, a asString, String tab, b asString, String tab, c asString, String tab, d asString, String tab, e asString, String tab, f asString, String tab, g asString, String tab, h asString, String tab." + ]. + + "add a through h into total accumulators" + totalA += a. + totalB += b. + totalC += c. + totalD += d. + totalE += e. + totalF += f. + totalG += g. + totalH += h +] diff --git a/source/Cryptography/SHA256WithPrimitive.class.st b/source/Cryptography/SHA256WithPrimitive.class.st new file mode 100644 index 0000000..5bf93cf --- /dev/null +++ b/source/Cryptography/SHA256WithPrimitive.class.st @@ -0,0 +1,83 @@ +Class { + #name : #SHA256WithPrimitive, + #superclass : #SHA256, + #instVars : [ + 'state' + ], + #category : #'Cryptography-SHA256' +} + +{ #category : #accessing } +SHA256WithPrimitive class >> blockSize [ + ^ 64 +] + +{ #category : #accessing } +SHA256WithPrimitive class >> hashSize [ + ^ 32 +] + +{ #category : #'as yet unclassified' } +SHA256WithPrimitive class >> isPluginAvailable [ + + + ^false +] + +{ #category : #private } +SHA256WithPrimitive >> finalHash [ + + | hash | + hash := ByteArray new: state size. + self primFinalHash: hash fromState: state. + ^hash +] + +{ #category : #private } +SHA256WithPrimitive >> initialize [ + + state := ByteArray new: 32. + self primInitializeState: state +] + +{ #category : #private } +SHA256WithPrimitive >> primFinalHash: aByteArray fromState: s [ + + + self primitiveFailed +] + +{ #category : #private } +SHA256WithPrimitive >> primInitializeState: s [ + + + self primitiveFailed +] + +{ #category : #private } +SHA256WithPrimitive >> primProcessBuffer: aByteArray withState: s [ + + + self primitiveFailed +] + +{ #category : #private } +SHA256WithPrimitive >> processBuffer: aByteArray [ + + self primProcessBuffer: aByteArray withState: state. + +] + +{ #category : #private } +SHA256WithPrimitive >> storeLength: bitLength in: aByteArray [ + "Fill in the final 8 bytes of the given ByteArray with a 64-bit big-endian representation of the original message length in bits." + + | n i | + n := bitLength. + i := aByteArray size. + [n > 0] whileTrue: [ + aByteArray at: i put: (n bitAnd: 16rFF). + n := n bitShift: -8. + i := i - 1]. + +] diff --git a/source/Cryptography/SecureRandom.class.st b/source/Cryptography/SecureRandom.class.st new file mode 100644 index 0000000..c240e2a --- /dev/null +++ b/source/Cryptography/SecureRandom.class.st @@ -0,0 +1,141 @@ +Class { + #name : #SecureRandom, + #superclass : #RandomGenerator, + #instVars : [ + 'seed', + 'key' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #'instance creation' } +SecureRandom class >> fromUser [ + "Ask the user to type a long random string and use the result to seed the secure random number generator." + + | string | + string := FillInTheBlank request: 'Enter a long random string to seed the random generator.'. + ^ self key: string +] + +{ #category : #'class initialization' } +SecureRandom class >> initialize [ + super initialize. + Smalltalk + addToStartUpList: self ; + addToShutDownList: self. + self startUp +] + +{ #category : #'instance creation' } +SecureRandom class >> key: aByteArray [ + ^ self basicNew key: aByteArray +] + +{ #category : #'instance creation' } +SecureRandom class >> new [ + ^ self key: (RandomPool default next: 64) +] + +{ #category : #'initialization-release' } +SecureRandom >> destroy [ + key destroy. + key := 0. + seed := 0 +] + +{ #category : #'initialization-release' } +SecureRandom >> key: aByteArray [ + | srcIndex | + key := LargePositiveInteger new: (aByteArray size min: 64). + srcIndex := 0. + key digitLength to: 1 by: -1 do: [:i | + key digitAt: i put: (aByteArray at: (srcIndex := srcIndex + 1)) asInteger]. + key highBit > 512 ifTrue: [key := key bitShift: key highBit - 512]. + key := key normalize. + seed := 16rEFCDAB8998BADCFE10325476C3D2E1F067452301 "initial seed" +] + +{ #category : #accessing } +SecureRandom >> next [ + ^ self nextRandom160 bitAnd: 16rFF +] + +{ #category : #accessing } +SecureRandom >> next: anInteger into: anArray [ + 1 to: anInteger do: [:index | anArray at: index put: self next]. + ^ anArray +] + +{ #category : #accessing } +SecureRandom >> nextBits: bitLength [ + | answer extraBits | + answer := 0. + bitLength // 160 + timesRepeat: [answer := (answer bitShift: 160) bitOr: self nextRandom160]. + extraBits := bitLength \\ 160. + answer := (answer bitShift: extraBits) bitOr: (self nextRandom160 bitShift: extraBits - 160). + ^ answer +] + +{ #category : #accessing } +SecureRandom >> nextBytes: byteLength [ + ^ (self nextBits: byteLength*8) asByteArray +] + +{ #category : #accessing } +SecureRandom >> nextBytesNonZero: byteLength [ + + | answer bytesWritten tempArray tempIndex | + answer := ByteArray new: byteLength. + bytesWritten := 0. + tempIndex := 20. + [bytesWritten < byteLength] + whileTrue: [ + tempIndex >= 20 ifTrue: [ + tempArray := self nextRandom160 asByteArrayOfSize: 20. + tempIndex := 1]. + (tempArray at: tempIndex) ~= 0 ifTrue: [ + answer at: (bytesWritten := bytesWritten + 1) put: (tempArray at: tempIndex)]. + tempIndex := tempIndex + 1]. + ^ answer +] + +{ #category : #accessing } +SecureRandom >> nextFrom: start to: end [ + "Answer a random integer between start and end." + | r | + r := self nextInt: end-start+1. + ^ r+start-1 +] + +{ #category : #accessing } +SecureRandom >> nextInt: anInteger [ + "Answer a random integer in the interval [1, anInteger]." + | r high | + anInteger strictlyPositive ifFalse: [ self error: 'Range must be positive' ]. + high := anInteger-1. + [ (r := self nextBits: anInteger highBit) + between: 0 + and: high ] whileFalse. + ^ r+1 +] + +{ #category : #private } +SecureRandom >> nextRandom160 [ + "Answer a newly generated 160-bit random number in the range [1..(2^160 - 1)]." + "Details: Try again in the extremely unlikely chance that zero is encountered." + + | result | + result := 0. + [result = 0] whileTrue: [ + result := SHA1 new hashInteger: key seed: seed. + key := key + result + 1]. + ^ result +] + +{ #category : #printing } +SecureRandom >> printOn: aStream [ + aStream + nextPutAll: 'a ' ; + nextPutAll: self class name +] diff --git a/source/Cryptography/SmalltalkImageInstanceID.class.st b/source/Cryptography/SmalltalkImageInstanceID.class.st new file mode 100644 index 0000000..e0ad886 --- /dev/null +++ b/source/Cryptography/SmalltalkImageInstanceID.class.st @@ -0,0 +1,62 @@ +Class { + #name : #SmalltalkImageInstanceID, + #superclass : #Object, + #classVars : [ + 'InstanceID' + ], + #category : #'Cryptography-RandomAndPrime' +} + +{ #category : #inquires } +SmalltalkImageInstanceID class >> InstanceID [ + + ^nil +] + +{ #category : #LICENSE } +SmalltalkImageInstanceID class >> LICENSE [ + "http://www.opensource.org/licenses/mit-license.php" +^'Copyright (c) 2006 Ron Teitelbaum * US Medical Record Specialists * Ron@USMedRec.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' + +] + +{ #category : #'class initialization' } +SmalltalkImageInstanceID class >> initialize [ + super initialize. + Smalltalk + addToStartUpList: self ; + addToShutDownList: self. + self startUp +] + +{ #category : #inquires } +SmalltalkImageInstanceID class >> instanceID [ + + ^InstanceID ifNil: [ + Transcript show: thisContext sender. + thisContext sender receiver = self ifTrue: [ + InstanceID := UUID new. + ] ifFalse: [ + InstanceID := nil + ]. + InstanceID]. +] + +{ #category : #'class initialization' } +SmalltalkImageInstanceID class >> shutDown [ + super shutDown. + InstanceID := nil. +] + +{ #category : #'class initialization' } +SmalltalkImageInstanceID class >> startUp [ + super startUp. + InstanceID := nil. + self instanceID. +] diff --git a/source/Cryptography/SocketStream.extension.st b/source/Cryptography/SocketStream.extension.st new file mode 100644 index 0000000..5c7d925 --- /dev/null +++ b/source/Cryptography/SocketStream.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #SocketStream } + +{ #category : #'*Cryptography-Core' } +SocketStream >> peekInBufferForAll: aString [ + "Answer whether or not the inbuffer in the receiver + contains aString. If a match is made answer true. + We use findString:startingAt: to avoid copying." + self receiveAvailableData. + ^(inBuffer findString: aString) > 0 + +] diff --git a/source/Cryptography/String.extension.st b/source/Cryptography/String.extension.st new file mode 100644 index 0000000..c7157d9 --- /dev/null +++ b/source/Cryptography/String.extension.st @@ -0,0 +1,19 @@ +Extension { #name : #String } + +{ #category : #'*cryptography' } +String >> destroy [ + 1 + to: self size + do: + [ : n | + self + at: n + put: (Character value: 0) ] +] + +{ #category : #'*Cryptography' } +String >> padded: directionSymbol to: length with: char [ + ^directionSymbol = #left + ifTrue: [ self padLeftTo: length with: char ] + ifFalse: [ self padRightTo: length with: char ] +] diff --git a/source/Cryptography/ThirtyTwoBitRegister.extension.st b/source/Cryptography/ThirtyTwoBitRegister.extension.st new file mode 100644 index 0000000..d9aaaff --- /dev/null +++ b/source/Cryptography/ThirtyTwoBitRegister.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #ThirtyTwoBitRegister } + +{ #category : #'*cryptography-core-instance creation' } +ThirtyTwoBitRegister class >> byte1: hi1 byte2: hi2 byte3: low1 byte4: low2 [ + ^ super new byte1: hi1 byte2: hi2 byte3: low1 byte4: low2 +] + +{ #category : #'*cryptography-core-instance creation' } +ThirtyTwoBitRegister class >> loadFrom: aByteArray at: index [ + ^ super new loadFrom: aByteArray at: index +] diff --git a/source/Cryptography/TripleDES.class.st b/source/Cryptography/TripleDES.class.st new file mode 100644 index 0000000..a8ac080 --- /dev/null +++ b/source/Cryptography/TripleDES.class.st @@ -0,0 +1,53 @@ +Class { + #name : #TripleDES, + #superclass : #BlockCipher, + #instVars : [ + 'des1', + 'des2', + 'des3' + ], + #category : #'Cryptography-DES' +} + +{ #category : #accessing } +TripleDES class >> blockSize [ + ^ 8 +] + +{ #category : #accessing } +TripleDES class >> keySize [ + ^ 8*3 +] + +{ #category : #'instance creation' } +TripleDES class >> new [ + ^ super new initialize +] + +{ #category : #accessing } +TripleDES >> decryptBlock: plainText [ + des3 decryptBlock: plainText. + des2 encryptBlock: plainText. + des1 decryptBlock: plainText +] + +{ #category : #accessing } +TripleDES >> encryptBlock: plainText [ + des1 encryptBlock: plainText. + des2 decryptBlock: plainText. + des3 encryptBlock: plainText +] + +{ #category : #accessing } +TripleDES >> initialize [ + des1 := DES new. + des2 := DES new. + des3 := DES new +] + +{ #category : #accessing } +TripleDES >> key: aByteArray [ + des1 key: (aByteArray copyFrom: 1 to: 8). + des2 key: (aByteArray copyFrom: 9 to: 16). + des3 key: (aByteArray copyFrom: 17 to: 24) +] diff --git a/source/Cryptography/package.st b/source/Cryptography/package.st new file mode 100644 index 0000000..2f00f2c --- /dev/null +++ b/source/Cryptography/package.st @@ -0,0 +1 @@ +Package { #name : #Cryptography } diff --git a/source/LayeredProtocol.package/.filetree b/source/LayeredProtocol.package/.filetree deleted file mode 100644 index 8998102..0000000 --- a/source/LayeredProtocol.package/.filetree +++ /dev/null @@ -1,4 +0,0 @@ -{ - "noMethodMetaData" : true, - "separateMethodMetaAndSource" : false, - "useCypressPropertiesFile" : true } diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/README.md b/source/LayeredProtocol.package/BinaryChunkProtocol.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/class/new.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/class/new.st deleted file mode 100644 index de94db4..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/class/new.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -new - - ^ self newHeaderSize: 2 diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/class/newHeaderSize..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/class/newHeaderSize..st deleted file mode 100644 index 655ce83..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/class/newHeaderSize..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -newHeaderSize: headerSize - - ^self basicNew - headerSize: headerSize; - yourself. diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/buffer.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/buffer.st deleted file mode 100644 index d5480d6..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/buffer.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -buffer - "Answer the receiver's instance variable buffer." - - ^buffer \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/downcall..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/downcall..st deleted file mode 100644 index acc2a36..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/downcall..st +++ /dev/null @@ -1,4 +0,0 @@ -stack -downcall: arg - - self downcallAll: (ByteArray with: arg) \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/downcallAll..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/downcallAll..st deleted file mode 100644 index cc3f716..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/downcallAll..st +++ /dev/null @@ -1,7 +0,0 @@ -stack -downcallAll: chunk - - | downHeader | - downHeader := self headerForChunk: chunk. - down downcallAll: downHeader. - down downcallAll: chunk. diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/hasNextHeader.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/hasNextHeader.st deleted file mode 100644 index 43e440d..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/hasNextHeader.st +++ /dev/null @@ -1,9 +0,0 @@ -stack -hasNextHeader - - self header isNil ifFalse: [^ true]. - self buffer size >= self headerSize - ifTrue: [ - self header: (self buffer next: self headerSize) asInteger. - ^true]. - ^false diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/header..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/header..st deleted file mode 100644 index 479ccf9..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/header..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -header: anObject - "Set the receiver's instance variable header to anObject." - - header := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/header.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/header.st deleted file mode 100644 index 593ff61..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/header.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -header - "Answer the receiver's instance variable header." - - ^header \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerForChunk..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerForChunk..st deleted file mode 100644 index 4cc4add..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerForChunk..st +++ /dev/null @@ -1,8 +0,0 @@ -stack -headerForChunk: chunk - - | size byteStream | - byteStream := (ByteArray new: self headerSize) writeStream. - size := chunk size. - 1 to: self headerSize do: [:i | byteStream nextPut: (size digitAt: self headerSize+1-i)]. - ^ byteStream contents diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerSize..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerSize..st deleted file mode 100644 index d43f5fb..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerSize..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -headerSize: anObject - "Set the receiver's instance variable headerSize to anObject." - - headerSize := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerSize.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerSize.st deleted file mode 100644 index 677db1f..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/headerSize.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -headerSize - "Answer the receiver's instance variable headerSize." - - ^headerSize \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/install.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/install.st deleted file mode 100644 index 3442fef..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/install.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize -install - - buffer := BufferStream on: (ByteArray new: 0). \ No newline at end of file diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/processChunk.st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/processChunk.st deleted file mode 100644 index 9ad2754..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/processChunk.st +++ /dev/null @@ -1,14 +0,0 @@ -stack -processChunk - "We may be able to use a virtual stream on the buffer segment for speed" - - self header isNil ifTrue: [^ false]. - up isNil ifTrue: [^ false]. - self buffer size >= self header - ifTrue: [ - | chunk | - chunk := self buffer next: self header. - up upcallAll: chunk. - self header: nil. - ^true]. - ^false diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/upcall..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/upcall..st deleted file mode 100644 index 9e0ab72..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/upcall..st +++ /dev/null @@ -1,4 +0,0 @@ -stack -upcall: arg - - self upcallAll: (ByteArray with: arg). diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/upcallAll..st b/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/upcallAll..st deleted file mode 100644 index ea4f88b..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/instance/upcallAll..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -upcallAll: bytes - - self buffer nextPutAll: bytes. - [self hasNextHeader and: [self processChunk]] whileTrue. diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/methodProperties.json b/source/LayeredProtocol.package/BinaryChunkProtocol.class/methodProperties.json deleted file mode 100644 index 255d06d..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/methodProperties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "class" : { - "new" : " 7/23/2018 10:01:06", - "newHeaderSize:" : " 7/23/2018 10:01:06" }, - "instance" : { - "buffer" : " 7/23/2018 10:01:06", - "downcall:" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06", - "hasNextHeader" : " 7/23/2018 10:01:06", - "header" : " 7/23/2018 10:01:06", - "header:" : " 7/23/2018 10:01:06", - "headerForChunk:" : " 7/23/2018 10:01:06", - "headerSize" : " 7/23/2018 10:01:06", - "headerSize:" : " 7/23/2018 10:01:06", - "install" : " 7/23/2018 10:01:06", - "processChunk" : " 7/23/2018 10:01:06", - "upcall:" : " 7/23/2018 10:01:06", - "upcallAll:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/BinaryChunkProtocol.class/properties.json b/source/LayeredProtocol.package/BinaryChunkProtocol.class/properties.json deleted file mode 100644 index a1629a1..0000000 --- a/source/LayeredProtocol.package/BinaryChunkProtocol.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "headerSize", - "header", - "buffer" ], - "name" : "BinaryChunkProtocol", - "pools" : [ - ], - "super" : "ProtocolLayer", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/BufferListLayer.class/README.md b/source/LayeredProtocol.package/BufferListLayer.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/bufferList.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/bufferList.st deleted file mode 100644 index f5c61ed..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/bufferList.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -bufferList - - ^ bufferList \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/close.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/close.st deleted file mode 100644 index dc6df4f..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/close.st +++ /dev/null @@ -1,5 +0,0 @@ -control -close - "Spawn a background process running the serverLoop." - - super close. diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/downcallAll..st b/source/LayeredProtocol.package/BufferListLayer.class/instance/downcallAll..st deleted file mode 100644 index d8e6319..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/downcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -stack -downcallAll: chunk - - bufferList addLast: chunk \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/install.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/install.st deleted file mode 100644 index 9f52216..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/install.st +++ /dev/null @@ -1,4 +0,0 @@ -stack -install - - bufferList := OrderedCollection new: 10. \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/note.with..st b/source/LayeredProtocol.package/BufferListLayer.class/instance/note.with..st deleted file mode 100644 index bcc7e7e..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/note.with..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -note: aSymbol with: anObject - - super note: aSymbol with: anObject. - aSymbol == #endpointClosed ifTrue: [^self terminateServer]. - aSymbol == #windowClosed ifTrue: [^self close]. \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/processBuffer.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/processBuffer.st deleted file mode 100644 index aa5f9b8..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/processBuffer.st +++ /dev/null @@ -1,13 +0,0 @@ -stack -processBuffer - - | pallet | - [self session isNil - ifTrue: [^ nil]. - (self bufferList notEmpty and: [down notNil]) - ifTrue: [ - pallet := self bufferList. - bufferList := OrderedCollection new: 10. - self basicDowncallAll: pallet] - ifFalse: [(Delay forMilliseconds: 100) wait]] - repeat. diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/run.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/run.st deleted file mode 100644 index 6a71287..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/run.st +++ /dev/null @@ -1,6 +0,0 @@ -stack -run - "Spawn a background process running the serverLoop." - - super run. - "serverProcess := [self serverLoop] forkAt: Processor userSchedulingPriority." \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/serverLoop.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/serverLoop.st deleted file mode 100644 index 39839b6..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/serverLoop.st +++ /dev/null @@ -1,8 +0,0 @@ -control -serverLoop - - [self processBuffer] - ensure: [ - serverProcess := nil. - self sessionNote: #endpointClosed. - self close]. diff --git a/source/LayeredProtocol.package/BufferListLayer.class/instance/terminateServer.st b/source/LayeredProtocol.package/BufferListLayer.class/instance/terminateServer.st deleted file mode 100644 index 9b2ca4a..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/instance/terminateServer.st +++ /dev/null @@ -1,9 +0,0 @@ -control -terminateServer - "Terminate the serverLoop process. This should never be called directly: use #close instead." - - serverProcess isNil - ifFalse: - [serverProcess terminate. - serverProcess := nil. - self sessionNote: #disconnected] \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferListLayer.class/methodProperties.json b/source/LayeredProtocol.package/BufferListLayer.class/methodProperties.json deleted file mode 100644 index 1cf2b12..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/methodProperties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "bufferList" : " 7/23/2018 10:01:06", - "close" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06", - "install" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "processBuffer" : " 7/23/2018 10:01:06", - "run" : " 7/23/2018 10:01:06", - "serverLoop" : " 7/23/2018 10:01:06", - "terminateServer" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/BufferListLayer.class/properties.json b/source/LayeredProtocol.package/BufferListLayer.class/properties.json deleted file mode 100644 index 1edee3d..0000000 --- a/source/LayeredProtocol.package/BufferListLayer.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "bufferList", - "serverProcess" ], - "name" : "BufferListLayer", - "pools" : [ - ], - "super" : "ProtocolLayer", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/BufferStream.class/README.md b/source/LayeredProtocol.package/BufferStream.class/README.md deleted file mode 100644 index 60fba06..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Kom48 (Comanche beta 4.8) -bolot 4/2/2001 18:43 - -BufferStream - -Comment in Com46: -- is-a ReadWriteStream on a String -- like a queue - removeNext:/nextPutAll: protocol \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/class/on..st b/source/LayeredProtocol.package/BufferStream.class/class/on..st deleted file mode 100644 index e0bc39f..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/class/on..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -on: aString - ^self basicNew on: aString \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/contents.st b/source/LayeredProtocol.package/BufferStream.class/instance/contents.st deleted file mode 100644 index d7224e6..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/contents.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -contents - "return contents, non-destructive" - ^buffer copyFrom: startPos to: endPos \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/includes..st b/source/LayeredProtocol.package/BufferStream.class/instance/includes..st deleted file mode 100644 index 4fa2b32..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/includes..st +++ /dev/null @@ -1,9 +0,0 @@ -testing -includes: aChar - "answer whether buffer includes aChar within bounds" - | tmp | - tmp := buffer - indexOf: aChar - startingAt: startPos - ifAbsent: [0]. - ^(tmp >= startPos) and: [tmp <= endPos] \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/includesAll..st b/source/LayeredProtocol.package/BufferStream.class/instance/includesAll..st deleted file mode 100644 index 06b9e27..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/includesAll..st +++ /dev/null @@ -1,6 +0,0 @@ -testing -includesAll: aString - "answer whether the buffer contains aString" - | tmp | - tmp := buffer indexOfSubCollection: aString startingAt: startPos. - ^(tmp >= startPos) and: [tmp <= endPos] \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/isEmpty.st b/source/LayeredProtocol.package/BufferStream.class/instance/isEmpty.st deleted file mode 100644 index 6a54495..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/isEmpty.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isEmpty - ^self size <= 0 \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/match..st b/source/LayeredProtocol.package/BufferStream.class/instance/match..st deleted file mode 100644 index 477e8cc..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/match..st +++ /dev/null @@ -1,8 +0,0 @@ -accessing -match: aString - self size < aString size - ifTrue: [^false]. - (self next: aString size) = aString - ifTrue: [^true] - ifFalse: [self on: aString, self upToEnd]. - ^false \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/next..st b/source/LayeredProtocol.package/BufferStream.class/instance/next..st deleted file mode 100644 index 6e6573c..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/next..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -next: anInteger - "return next anInteger characters" - "consumes them" - ^buffer copyFrom: startPos to: (startPos := startPos + anInteger) - 1 \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/next.st b/source/LayeredProtocol.package/BufferStream.class/instance/next.st deleted file mode 100644 index c79566f..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/next.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -next - "return the next character" - "consume it" - ^buffer at: (startPos := startPos + 1) - 1 \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/nextPutAll..st b/source/LayeredProtocol.package/BufferStream.class/instance/nextPutAll..st deleted file mode 100644 index 7fe1586..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/nextPutAll..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -nextPutAll: aString - buffer := (buffer copyFrom: startPos to: endPos), aString. - startPos := 1. - endPos := buffer size \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/on..st b/source/LayeredProtocol.package/BufferStream.class/instance/on..st deleted file mode 100644 index d227ce2..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/on..st +++ /dev/null @@ -1,5 +0,0 @@ -initialize-release -on: aString - buffer := aString. - startPos := 1. - endPos := buffer size \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/printOn..st b/source/LayeredProtocol.package/BufferStream.class/instance/printOn..st deleted file mode 100644 index 2441222..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/printOn..st +++ /dev/null @@ -1,4 +0,0 @@ -printing -printOn: aStream - super printOn: aStream. - aStream nextPutAll: '(', self size asString, ')' \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/reset.st b/source/LayeredProtocol.package/BufferStream.class/instance/reset.st deleted file mode 100644 index 52f4bc3..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/reset.st +++ /dev/null @@ -1,7 +0,0 @@ -initialize-release -reset - "hack" - self on: - (buffer - ifNil: [''] - ifNotNil: [buffer class new: 0]) \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/size.st b/source/LayeredProtocol.package/BufferStream.class/instance/size.st deleted file mode 100644 index d4f3f76..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/size.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -size - ^endPos - startPos + 1 \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/upTo..st b/source/LayeredProtocol.package/BufferStream.class/instance/upTo..st deleted file mode 100644 index 41ca898..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/upTo..st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -upTo: aChar - "return String up to aChar, but not including" - "consumes the returned string" - | i | - i := buffer - indexOf: aChar - startingAt: startPos - ifAbsent: [0]. - (i <= 0 or: [i > endPos]) - ifTrue: [^self upToEnd]. - ^self next: (i-startPos) \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/upToAll..st b/source/LayeredProtocol.package/BufferStream.class/instance/upToAll..st deleted file mode 100644 index 801bc40..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/upToAll..st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -upToAll: aString - "return a string before the occurence of aString, if any" - "consume it" - | i | - i := buffer - indexOfSubCollection: aString - startingAt: startPos - ifAbsent: [0]. - (i <= 0 or: [i > endPos]) - ifTrue: [^self upToEnd]. - ^self next: (i-startPos) \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/instance/upToEnd.st b/source/LayeredProtocol.package/BufferStream.class/instance/upToEnd.st deleted file mode 100644 index 3c14448..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/instance/upToEnd.st +++ /dev/null @@ -1,8 +0,0 @@ -accessing -upToEnd - "return buffer contents, - consume all my buffer" - | string | - string := self contents. - self reset. - ^string \ No newline at end of file diff --git a/source/LayeredProtocol.package/BufferStream.class/methodProperties.json b/source/LayeredProtocol.package/BufferStream.class/methodProperties.json deleted file mode 100644 index 113e8d5..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/methodProperties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "class" : { - "on:" : " 7/23/2018 10:01:06" }, - "instance" : { - "contents" : " 7/23/2018 10:01:06", - "includes:" : " 7/23/2018 10:01:06", - "includesAll:" : " 7/23/2018 10:01:06", - "isEmpty" : " 7/23/2018 10:01:06", - "match:" : " 7/23/2018 10:01:06", - "next" : " 7/23/2018 10:01:06", - "next:" : " 7/23/2018 10:01:06", - "nextPutAll:" : " 7/23/2018 10:01:06", - "on:" : " 7/23/2018 10:01:06", - "printOn:" : " 7/23/2018 10:01:06", - "reset" : " 7/23/2018 10:01:06", - "size" : " 7/23/2018 10:01:06", - "upTo:" : " 7/23/2018 10:01:06", - "upToAll:" : " 7/23/2018 10:01:06", - "upToEnd" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/BufferStream.class/properties.json b/source/LayeredProtocol.package/BufferStream.class/properties.json deleted file mode 100644 index f3ca1bd..0000000 --- a/source/LayeredProtocol.package/BufferStream.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "category" : "LayeredProtocol-Endpoints", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "buffer", - "startPos", - "endPos" ], - "name" : "BufferStream", - "pools" : [ - ], - "super" : "Stream", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/README.md b/source/LayeredProtocol.package/ConnectionHandler.class/README.md deleted file mode 100644 index 179f704..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/README.md +++ /dev/null @@ -1,10 +0,0 @@ -Kom48 (Comanche beta 4.8) -bolot 4/2/2001 18:44 - -ConnectionHandler - -Comment from kom46: -- also see ConnectionQueue -- does not keep the queue of open sockets -- launches the applications/modules immediately - upon accepting a connection \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/class/onPort.handler.priority..st b/source/LayeredProtocol.package/ConnectionHandler.class/class/onPort.handler.priority..st deleted file mode 100644 index 754d9db..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/class/onPort.handler.priority..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -onPort: aNumber handler: aBlock priority: pNum - ^self new - initializeOnPort: aNumber - handler: aBlock - priority: pNum \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/class/register..st b/source/LayeredProtocol.package/ConnectionHandler.class/class/register..st deleted file mode 100644 index ca0748c..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/class/register..st +++ /dev/null @@ -1,4 +0,0 @@ -registry -register: anObject - - self registry add: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/class/registry.st b/source/LayeredProtocol.package/ConnectionHandler.class/class/registry.st deleted file mode 100644 index 1a947fd..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/class/registry.st +++ /dev/null @@ -1,7 +0,0 @@ -registry -registry - - Registry == nil ifTrue: [ - Registry := WeakRegistry new - ]. - ^Registry \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/class/unregister..st b/source/LayeredProtocol.package/ConnectionHandler.class/class/unregister..st deleted file mode 100644 index 2717076..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/class/unregister..st +++ /dev/null @@ -1,4 +0,0 @@ -registry -unregister: anObject - - self registry remove: anObject ifAbsent: [ ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/destroySockets.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/destroySockets.st deleted file mode 100644 index 3fee3d8..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/destroySockets.st +++ /dev/null @@ -1,6 +0,0 @@ -initialize-release -destroySockets - socketsToDestroy ~~ nil ifTrue: [ - socketsToDestroy do: [ :ea | ea destroy ]. - ]. - socketsToDestroy := OrderedCollection new \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/finalize.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/finalize.st deleted file mode 100644 index 24889cf..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/finalize.st +++ /dev/null @@ -1,12 +0,0 @@ -initialize-release -finalize - - "Like #stop, but without the #unregister" - - process ~~ nil ifTrue: [ - process terminate. - ]. - process := nil. - self destroySockets. - - diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/initializeOnPort.handler.priority..st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/initializeOnPort.handler.priority..st deleted file mode 100644 index 3c480e4..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/initializeOnPort.handler.priority..st +++ /dev/null @@ -1,6 +0,0 @@ -initialize-release -initializeOnPort: aNumber handler: aBlock priority: pNumber - portNumber := aNumber. - handlerBlock := aBlock. - priority := pNumber. - socketsToDestroy := OrderedCollection new \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/initializeProcessAtPriority..st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/initializeProcessAtPriority..st deleted file mode 100644 index 7ce08a2..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/initializeProcessAtPriority..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initializeProcessAtPriority: pNumber - process := [ self pvtListenLoop ] newProcess. - process priority: pNumber \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/isRunning.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/isRunning.st deleted file mode 100644 index a80f805..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/isRunning.st +++ /dev/null @@ -1,4 +0,0 @@ -queries -isRunning - - ^process ~~ nil \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/newListener.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/newListener.st deleted file mode 100644 index 1c4f2c4..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/newListener.st +++ /dev/null @@ -1,11 +0,0 @@ -private -newListener - | listener | - - self flag: #todo. "listener _ self socketClass newTCP." - listener := Socket newTCP. - listener setOption: 'SO_REUSEADDR' value: true. - "listener setOption: 'SO_LINGER' value: false." - "backlog is how many simultaneous connections to accept at the same time" - listener listenOn: portNumber backlogSize: 10. - ^listener diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/portNumber.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/portNumber.st deleted file mode 100644 index d657d34..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/portNumber.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -portNumber - ^portNumber \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/printOn..st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/printOn..st deleted file mode 100644 index a2cb1d6..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/printOn..st +++ /dev/null @@ -1,8 +0,0 @@ -printing -printOn: aStream - aStream nextPutAll: (self class name asString, ' port: ', self portNumber asString). - self isRunning ifTrue: [ - aStream nextPutAll: ' [running]' - ] ifFalse:[ - aStream nextPutAll: ' [stopped]' - ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/priority.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/priority.st deleted file mode 100644 index 0a99d26..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/priority.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -priority - ^priority \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/process.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/process.st deleted file mode 100644 index ac8fe50..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/process.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -process - process == nil ifTrue: [ - self initializeProcessAtPriority: self priority. - ]. - ^process \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtListenLoop.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtListenLoop.st deleted file mode 100644 index a4d3c3a..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtListenLoop.st +++ /dev/null @@ -1,9 +0,0 @@ -private -pvtListenLoop - [ - self pvtNewListenLoop - ] on: Error do: [ :ex | - process := nil. - self destroySockets. - ex pass. - ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtNewListenLoop.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtNewListenLoop.st deleted file mode 100644 index 9027e44..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtNewListenLoop.st +++ /dev/null @@ -1,26 +0,0 @@ -private -pvtNewListenLoop - | socket listener | - listener _ self newListener. - self socketsToDestroy add: listener. - - "If the listener is not valid then the we cannot use the - BSD style accept() mechanism." - listener isValid ifFalse: [^self pvtOldListenLoop]. - [ [ true ] whileTrue: [ - socket := listener waitForAcceptFor: 10 ifTimedOut: [nil]. - (socket notNil and: [ socket isConnected ]) - ifTrue: [ - handlerBlock value: socket. - socket := nil] - ifFalse: [ - socket notNil ifTrue: [socket destroy]. - listener isValid - ifFalse: [(Delay forMilliseconds: 100) wait. - listener destroy. - listener := self newListener]. - ]. - ] ] on: Error do: [ :ex | - self halt. - ex pass. - ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtOldListenLoop.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtOldListenLoop.st deleted file mode 100644 index acaf136..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/pvtOldListenLoop.st +++ /dev/null @@ -1,32 +0,0 @@ -private -pvtOldListenLoop - "see comment on ConnectionQueue>>oldStyleListenLoop" - | socket | - socket := nil. - - [ true ] whileTrue: [ - (socket == nil) ifTrue: [ - "try to create a new socket for listening" - socket := Socket createIfFail: [ nil ]]. - - (socket == nil) - ifTrue: [(Delay forMilliseconds: 100) wait] - ifFalse: [ - socket setOption: 'SO_REUSEADDR' value: true. - socket isUnconnected ifTrue: [ socket listenOn: portNumber ]. - socket waitForConnectionUntil: (Socket deadlineSecs: 10). - socket isConnected - ifTrue: ["connection established" - "mutex critical: [" handlerBlock value: socket "]". - socket := nil] - ifFalse: [ - socket isWaitingForConnection - ifFalse: [ - socket destroy. - socket := nil. - (NetworkError new - messageText: 'port unavailable: ', portNumber asString; - signal; - yourself)]]. - ]. - ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/register.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/register.st deleted file mode 100644 index 9d89664..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/register.st +++ /dev/null @@ -1,4 +0,0 @@ -registry -register - - ^self class register: self \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/socketsToDestroy.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/socketsToDestroy.st deleted file mode 100644 index 132ece0..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/socketsToDestroy.st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -socketsToDestroy - - socketsToDestroy == nil ifTrue: [ - socketsToDestroy := OrderedCollection new. - ]. - ^socketsToDestroy \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/start.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/start.st deleted file mode 100644 index 47a58a7..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/start.st +++ /dev/null @@ -1,5 +0,0 @@ -starting and stopping -start - self stop. - self process resume. - self register \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/stop.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/stop.st deleted file mode 100644 index c3cb7d1..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/stop.st +++ /dev/null @@ -1,14 +0,0 @@ -starting and stopping -stop - self unregister. - process ~~ nil ifTrue: [ - process terminate. - ]. - process := nil. - - "We do the following in a timely manner instead of relying on - finalization because we may want to turn right around and start - listening again. If an old socket is still around an listening, it may - interfere with a new one's ability to hear." - - self destroySockets \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/instance/unregister.st b/source/LayeredProtocol.package/ConnectionHandler.class/instance/unregister.st deleted file mode 100644 index 7045f66..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/instance/unregister.st +++ /dev/null @@ -1,4 +0,0 @@ -registry -unregister - - ^self class unregister: self \ No newline at end of file diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/methodProperties.json b/source/LayeredProtocol.package/ConnectionHandler.class/methodProperties.json deleted file mode 100644 index 3a88674..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/methodProperties.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "class" : { - "onPort:handler:priority:" : " 7/23/2018 10:01:06", - "register:" : " 7/23/2018 10:01:06", - "registry" : " 7/23/2018 10:01:06", - "unregister:" : " 7/23/2018 10:01:06" }, - "instance" : { - "destroySockets" : " 7/23/2018 10:01:06", - "finalize" : " 7/23/2018 10:01:06", - "initializeOnPort:handler:priority:" : " 7/23/2018 10:01:06", - "initializeProcessAtPriority:" : " 7/23/2018 10:01:06", - "isRunning" : " 7/23/2018 10:01:06", - "newListener" : " 7/23/2018 10:01:06", - "portNumber" : " 7/23/2018 10:01:06", - "printOn:" : " 7/23/2018 10:01:06", - "priority" : " 7/23/2018 10:01:06", - "process" : " 7/23/2018 10:01:06", - "pvtListenLoop" : " 7/23/2018 10:01:06", - "pvtNewListenLoop" : " 7/23/2018 10:01:06", - "pvtOldListenLoop" : " 7/23/2018 10:01:06", - "register" : " 7/23/2018 10:01:06", - "socketsToDestroy" : " 7/23/2018 10:01:06", - "start" : " 7/23/2018 10:01:06", - "stop" : " 7/23/2018 10:01:06", - "unregister" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ConnectionHandler.class/properties.json b/source/LayeredProtocol.package/ConnectionHandler.class/properties.json deleted file mode 100644 index 5f2bdcb..0000000 --- a/source/LayeredProtocol.package/ConnectionHandler.class/properties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "category" : "LayeredProtocol-Endpoints", - "classinstvars" : [ - ], - "classvars" : [ - "Registry" ], - "commentStamp" : "", - "instvars" : [ - "portNumber", - "socketClass", - "process", - "priority", - "handlerBlock", - "lastError", - "socketsToDestroy" ], - "name" : "ConnectionHandler", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/README.md b/source/LayeredProtocol.package/LayeredProtocol.class/README.md deleted file mode 100644 index 0b15b0c..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/README.md +++ /dev/null @@ -1,3 +0,0 @@ -I am a complete protocol implemented as a stack of subprotocols. One end of the stack (the bottom or `tail') is usually an endpoint communicating with some remote host or process. The other end (the top or `head') is either the point of communication for my client (which reads and writes only application-oriented data) or even the client itself. - -I am created by sending my class the message #on: aSubProtocol. You can then send me #push: aProtocol as many times as you like, to push aProtocol onto the head of my protocol stack. When the stack is complete you must send me #install which tells me to finish creating the internal connections between each subprotocol in the stack. Finally you send me #run which tells the entire protocol stack to start. \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/class/example.st b/source/LayeredProtocol.package/LayeredProtocol.class/class/example.st deleted file mode 100644 index 6492bb2..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/class/example.st +++ /dev/null @@ -1,13 +0,0 @@ -examples -example - "Send 42 down a stack and then reflect it back up." - "LayeredProtocol example" - - (ProtocolAdaptor new reflect asProtocolStack - push: ProtocolAdaptor new trace; - push: ProtocolAdaptor new trace; - push: (ProtocolAdaptor new trace - upBlock: [:arg | Transcript cr; show: 'ping ' , arg printString]); - install; - run; - first) downcall: 42 \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/class/new.st b/source/LayeredProtocol.package/LayeredProtocol.class/class/new.st deleted file mode 100644 index 58d8f2c..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/class/new.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -new - - ^super new initializeProperties \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/class/on..st b/source/LayeredProtocol.package/LayeredProtocol.class/class/on..st deleted file mode 100644 index c9ad655..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/class/on..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -on: proto - - ^self new push: proto \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/addDown..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/addDown..st deleted file mode 100644 index ccde2ca..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/addDown..st +++ /dev/null @@ -1,4 +0,0 @@ -private -addDown: proto - - ^self addLast: proto \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/addUp..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/addUp..st deleted file mode 100644 index 46cb48b..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/addUp..st +++ /dev/null @@ -1,4 +0,0 @@ -private -addUp: proto - - ^self addFirst: proto \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/endpoint.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/endpoint.st deleted file mode 100644 index 8b0d01c..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/endpoint.st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -endpoint - - ^self last \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/head.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/head.st deleted file mode 100644 index 6cc2d7d..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/head.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -head - "Answer the head of the stack." - - ^self first \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/initializeProperties.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/initializeProperties.st deleted file mode 100644 index 66e8135..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/initializeProperties.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initializeProperties - - properties := IdentityDictionary new \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/install.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/install.st deleted file mode 100644 index 4a1a917..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/install.st +++ /dev/null @@ -1,10 +0,0 @@ -protocol -install - - | prev | - prev := nil. - self do: [:this | - this session: self. - prev isNil ifFalse: [this up: prev. prev down: this]. - this install. - prev := this] \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/isConnected.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/isConnected.st deleted file mode 100644 index 7767f43..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/isConnected.st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -isConnected - - ^self endpoint isConnected \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/kill.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/kill.st deleted file mode 100644 index ef04b58..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/kill.st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -kill - - [self notEmpty] whileTrue: [ - self head close. self pop]. \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/note.with..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/note.with..st deleted file mode 100644 index b5efb45..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/note.with..st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -note: aSymbol with: anObject - "Inform my members that something has happened." - - self do: [:proto | proto note: aSymbol with: anObject]. diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/pop.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/pop.st deleted file mode 100644 index eff8926..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/pop.st +++ /dev/null @@ -1,11 +0,0 @@ -protocol -pop - "Remove the head of the stack." - | aProto | - self isEmpty ifTrue: [^ nil]. - aProto := self removeFirst. - self isEmpty - ifFalse: [aProto down: nil. - self head up: nil]. - aProto session: nil. - ^ aProto \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt..st deleted file mode 100644 index fe1242b..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -propertyAt: aKey - - ^properties at: aKey ifAbsent: [] \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt.ifAbsent..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt.ifAbsent..st deleted file mode 100644 index 4ec3515..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt.ifAbsent..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -propertyAt: aKey ifAbsent: aBlock - - ^properties at: aKey ifAbsent: aBlock \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt.put..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt.put..st deleted file mode 100644 index 46e832d..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/propertyAt.put..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -propertyAt: aKey put: aValue - - ^properties at: aKey put: aValue \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/push..st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/push..st deleted file mode 100644 index 3e4161e..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/push..st +++ /dev/null @@ -1,8 +0,0 @@ -protocol -push: aProto - "Push a new protocol onto the head of the stack." - - aProto session: self. - self isEmpty ifFalse: [aProto down: self head. self head up: aProto]. - aProto install. - self addFirst: aProto \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/removeUp.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/removeUp.st deleted file mode 100644 index 83b5ea6..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/removeUp.st +++ /dev/null @@ -1,4 +0,0 @@ -private -removeUp - - ^self removeFirst \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/run.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/run.st deleted file mode 100644 index a29b345..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/run.st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -run - - self do: [:proto | proto run] \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/stop.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/stop.st deleted file mode 100644 index 3805e93..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/stop.st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -stop - self - do: [:proto | proto close]. - self kill \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/instance/tail.st b/source/LayeredProtocol.package/LayeredProtocol.class/instance/tail.st deleted file mode 100644 index 28c99e3..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/instance/tail.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tail - "Answer the tail of the stack." - - ^self last \ No newline at end of file diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/methodProperties.json b/source/LayeredProtocol.package/LayeredProtocol.class/methodProperties.json deleted file mode 100644 index 53fb3cc..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/methodProperties.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "class" : { - "example" : " 7/23/2018 10:01:06", - "new" : " 7/23/2018 10:01:06", - "on:" : " 7/23/2018 10:01:06" }, - "instance" : { - "addDown:" : " 7/23/2018 10:01:06", - "addUp:" : " 7/23/2018 10:01:06", - "endpoint" : " 7/23/2018 10:01:06", - "head" : " 7/23/2018 10:01:06", - "initializeProperties" : " 7/23/2018 10:01:06", - "install" : " 7/23/2018 10:01:06", - "isConnected" : " 7/23/2018 10:01:06", - "kill" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "pop" : " 7/23/2018 10:01:06", - "propertyAt:" : " 7/23/2018 10:01:06", - "propertyAt:ifAbsent:" : " 7/23/2018 10:01:06", - "propertyAt:put:" : " 7/23/2018 10:01:06", - "push:" : " 7/23/2018 10:01:06", - "removeUp" : " 7/23/2018 10:01:06", - "run" : " 7/23/2018 10:01:06", - "stop" : " 7/23/2018 10:01:06", - "tail" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/LayeredProtocol.class/properties.json b/source/LayeredProtocol.package/LayeredProtocol.class/properties.json deleted file mode 100644 index b15db78..0000000 --- a/source/LayeredProtocol.package/LayeredProtocol.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "properties" ], - "name" : "LayeredProtocol", - "pools" : [ - ], - "super" : "OrderedCollection", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/README.md b/source/LayeredProtocol.package/NetworkEndpoint.class/README.md deleted file mode 100644 index fe03cc1..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/README.md +++ /dev/null @@ -1,5 +0,0 @@ -I am an endpoint for network communication. I am also a ProtocolLayer and I therefore expect to be inserted as the lowest element in a LayeredProtocol stack. - -Structure: - - socket (Socket) -- the socket on which I communicate. diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/class/example.st b/source/LayeredProtocol.package/NetworkEndpoint.class/class/example.st deleted file mode 100644 index 3e530aa..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/class/example.st +++ /dev/null @@ -1,12 +0,0 @@ -examples -example - "NetworkEndpoint example" - - ^NetworkEndpoint new - socket: ((Socket initializeNetwork; new) - connectTo: (NetNameResolver addressForName: 'localhost') port: 13; - waitForConnectionUntil: (Socket deadlineSecs: 1); - yourself); - up: (ProtocolAdaptor new - upBlock: [:arg | Transcript nextPut: arg asCharacter; endEntry]); - run. \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/class/example2.st b/source/LayeredProtocol.package/NetworkEndpoint.class/class/example2.st deleted file mode 100644 index c1ad395..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/class/example2.st +++ /dev/null @@ -1,16 +0,0 @@ -examples -example2 - "NetworkEndpoint example2" - - | s | - NetworkEndpoint new - socket: ((s := Socket initializeNetwork; new) - connectTo: (NetNameResolver addressForName: 'localhost') port: 7; - waitForConnectionUntil: (Socket deadlineSecs: 1); - yourself); - up: (ProtocolAdaptor new - upBlock: [:arg | Transcript nextPut: arg asCharacter; endEntry]); - run. - s sendData: 'send this back to me'. - (Delay forSeconds: 1) wait. - s close \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/class/example3.st b/source/LayeredProtocol.package/NetworkEndpoint.class/class/example3.st deleted file mode 100644 index 9839069..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/class/example3.st +++ /dev/null @@ -1,12 +0,0 @@ -examples -example3 - "NetworkEndpoint example3" - - | ep | - (ep := NetworkEndpoint newConnection: 'localhost' port: 7) - up: (ProtocolAdaptor upBlock: - [:arg | Transcript nextPut: arg asCharacter; endEntry]); - run. - ep socket sendData: 'send this back to me'. - (Delay forSeconds: 1) wait. - ep socket close \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/class/newConnection.port..st b/source/LayeredProtocol.package/NetworkEndpoint.class/class/newConnection.port..st deleted file mode 100644 index d1111c7..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/class/newConnection.port..st +++ /dev/null @@ -1,12 +0,0 @@ -examples -newConnection: host port: port - - | s addr | - Socket initializeNetwork. - (addr := NetNameResolver addressForName: host) isNil - ifTrue: [^nil]. - (s := Socket new) - connectTo: addr port: port waitForConnectionFor: 5. - s isWaitingForConnection - ifTrue: [s destroy. ^nil]. - ^self new socket: s \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/class/newConnectionAddress.port..st b/source/LayeredProtocol.package/NetworkEndpoint.class/class/newConnectionAddress.port..st deleted file mode 100644 index cdafb96..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/class/newConnectionAddress.port..st +++ /dev/null @@ -1,10 +0,0 @@ -examples -newConnectionAddress: addr port: port - - | s | - Socket initializeNetwork. - (s := Socket new) - connectTo: addr - port: port - waitForConnectionFor: 5. - ^self new socket: s \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/close.st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/close.st deleted file mode 100644 index 9751a2a..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/close.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -close - - socket notNil ifTrue: [socket closeAndDestroy: 10] \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/downcall..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/downcall..st deleted file mode 100644 index 7e7b55c..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/downcall..st +++ /dev/null @@ -1,6 +0,0 @@ -protocol stack -downcall: char - - socket isConnected - ifTrue: [socket sendData: (ByteArray with: char)] - ifFalse: [socket closeAndDestroy] \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/downcallAll..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/downcallAll..st deleted file mode 100644 index 5cbcbe7..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/downcallAll..st +++ /dev/null @@ -1,7 +0,0 @@ -protocol stack -downcallAll: collection - "This is just for speed in telnet negotiation." - - socket isConnected - ifTrue: [socket sendData: collection] - ifFalse: [socket closeAndDestroy] \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/getData.st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/getData.st deleted file mode 100644 index ba586f3..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/getData.st +++ /dev/null @@ -1,17 +0,0 @@ -accessing -getData - - | buf count | - Processor yield. - buf := ByteArray new: 1024. - [socket dataAvailable - ifTrue: - [[count := socket receiveDataInto: buf. - ^buf copyFrom: 1 to: count] - on: Error - do: [:ex | ^ nil]] - ifFalse: - [[socket waitForDataFor: 10] on: Error do: [:e | ]]. - socket isConnected] - whileTrue. - ^nil \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/isConnected.st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/isConnected.st deleted file mode 100644 index 096c70c..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/isConnected.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -isConnected - - ^socket notNil and: [socket isConnected] \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/name.st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/name.st deleted file mode 100644 index bd0cdff..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/name.st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -name - "Answer the name of the peer." - - (socket isNil or: [socket isConnected not]) - ifTrue: [^'not connected']. - ^NetNameResolver stringFromAddress: socket remoteAddress \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/note.with..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/note.with..st deleted file mode 100644 index 2b7ae83..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/note.with..st +++ /dev/null @@ -1,6 +0,0 @@ -protocol stack -note: aSymbol with: anObject - - super note: aSymbol with: anObject. - aSymbol == #oobInlineEndpoint ifTrue: [^socket setOption: 'SO_OOBINLINE' value: 1]. - aSymbol == #savePreferences ifTrue: [^self savePreferences: anObject]. \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/rcvd..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/rcvd..st deleted file mode 100644 index 9233223..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/rcvd..st +++ /dev/null @@ -1,7 +0,0 @@ -debugging -rcvd: char - - | str | - str := char asInteger printStringBase: 16. - str := str copyFrom: 4 to: str size. - Transcript cr; nextPut: $<; tab; nextPutAll: (str padded: #left to: 2 with: $0); tab; nextPut: char asCharacter \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/run.st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/run.st deleted file mode 100644 index f25d2c3..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/run.st +++ /dev/null @@ -1,5 +0,0 @@ -protocol stack -run - - self isConnected ifTrue: [self sessionNote: #connectedTo with: self name]. - super run \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/savePreferences..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/savePreferences..st deleted file mode 100644 index 5e6edc8..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/savePreferences..st +++ /dev/null @@ -1,6 +0,0 @@ -private -savePreferences: dict - - dict at: #endpointClass put: self class name. - dict at: #endpointCreate put: #newConnection:port:. - dict at: #endpointArguments put: (Array with: socket name with: socket remotePort) \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/sent..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/sent..st deleted file mode 100644 index c93d64a..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/sent..st +++ /dev/null @@ -1,7 +0,0 @@ -debugging -sent: char - - | str | - str := char asInteger printStringBase: 16. - str := str copyFrom: 4 to: str size. - Transcript cr; nextPut: $>; tab; nextPutAll: (str padded: #left to: 2 with: $0); tab; nextPut: char asCharacter \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/socket..st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/socket..st deleted file mode 100644 index 5b76e82..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/socket..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -socket: aSocket - - socket := aSocket \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/socket.st b/source/LayeredProtocol.package/NetworkEndpoint.class/instance/socket.st deleted file mode 100644 index 2a9f3bc..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/instance/socket.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -socket - - ^socket \ No newline at end of file diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/methodProperties.json b/source/LayeredProtocol.package/NetworkEndpoint.class/methodProperties.json deleted file mode 100644 index b2ec440..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/methodProperties.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "class" : { - "example" : " 7/23/2018 10:01:06", - "example2" : " 7/23/2018 10:01:06", - "example3" : " 7/23/2018 10:01:06", - "newConnection:port:" : " 7/23/2018 10:01:06", - "newConnectionAddress:port:" : " 7/23/2018 10:01:06" }, - "instance" : { - "close" : " 7/23/2018 10:01:06", - "downcall:" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06", - "getData" : " 7/23/2018 10:01:06", - "isConnected" : " 7/23/2018 10:01:06", - "name" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "rcvd:" : " 7/23/2018 10:01:06", - "run" : " 7/23/2018 10:01:06", - "savePreferences:" : " 7/23/2018 10:01:06", - "sent:" : " 7/23/2018 10:01:06", - "socket" : " 7/23/2018 10:01:06", - "socket:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/NetworkEndpoint.class/properties.json b/source/LayeredProtocol.package/NetworkEndpoint.class/properties.json deleted file mode 100644 index 59125a2..0000000 --- a/source/LayeredProtocol.package/NetworkEndpoint.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Endpoints", - "classinstvars" : [ - ], - "classvars" : [ - "InstanceList" ], - "commentStamp" : "", - "instvars" : [ - "socket" ], - "name" : "NetworkEndpoint", - "pools" : [ - ], - "super" : "ProtocolEndpoint", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/README.md b/source/LayeredProtocol.package/ProtocolAdaptor.class/README.md deleted file mode 100644 index cfb7a80..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/README.md +++ /dev/null @@ -1,42 +0,0 @@ -I am a pluggable ProtocolLayer. You can insert me anywhere in a LayeredProtocol stack. - -Communication between protocol stack layers is accomplished using the following messages: - - upcall: datum -- receive data from the protocol below me in the stack - downcall: datum -- receive data from the protocol above me - flush -- the protocol below me might become idle for a while - note: aSymbol with: anObject -- I am being informed that something "global" has happened - -By default I am completely transparent. In other words I react to the above messages as follows: - - upcall: datum -- I pass datum on to the protocol above me - downcall: dataum -- I pass datum on to the protocol below me - flush -- I pass the message to the protocol above me - note: sym with: obj -- is ignored entirely - -Any or all of these default reactions can be changed by installing blocks which I will execute in response to the above messages. You install such blocks by sending me the following messages: - - upBlock: unaryBlock -- evaluated on #up: passing datum as argument - downBlock: unaryBlock -- evaluated on #down: passing datum as argument - flushBlock: aBlock -- evaulated on #flush with no arguments - noteBlock: binaryBlock -- evaulated on #note:with: passing aSym and anObj as arguments - -By now you've probably guess that my default behaviour is simply to install the following blocks when I am created: - - upBlock: [:datum | up upcall: datum] - downBlock: [:datum | down downcall: datum] - flushBlock: [] - noteBlock: [:aSymbol :anObject | ] - -My class knows how to instantiate particular kinds of default behaviour in me, including: - - pass -- the default (transparency) - trace -- prints each datum on the Transcript as it whizzes by - reflect -- bounces downward data back up the stack and vice-versa - -Here's one example, possibly the shortest known means to create an "echo" server: - - (NetworkEndpoint socket: anAcceptedSocket) asProtocolStack - push: ProtocolAdaptor reflect; - install; - run \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/class/new.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/class/new.st deleted file mode 100644 index a107c43..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/class/new.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -new - - ^super new initialize \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/class/upBlock..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/class/upBlock..st deleted file mode 100644 index 7165e16..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/class/upBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -upBlock: aBlock - - ^self new upBlock: aBlock \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/downBlock..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/downBlock..st deleted file mode 100644 index 2260e0c..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/downBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -downBlock: block - - downBlock := block \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/downcall..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/downcall..st deleted file mode 100644 index e860601..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/downcall..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -downcall: arg - - downBlock value: arg \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/flush.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/flush.st deleted file mode 100644 index 9f6f749..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/flush.st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -flush - - flushBlock value \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/flushBlock..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/flushBlock..st deleted file mode 100644 index 8111afe..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/flushBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -flushBlock: block - - flushBlock := block \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/initialize.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/initialize.st deleted file mode 100644 index d6f742b..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/initialize.st +++ /dev/null @@ -1,7 +0,0 @@ -initialize-release -initialize - - upBlock := [:arg | self notify: 'up ' , arg printString]. - downBlock := [:arg | self notify: 'down ' , arg printString]. - flushBlock := []. - noteBlock := [:s :a | ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/localEcho.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/localEcho.st deleted file mode 100644 index 3d867d2..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/localEcho.st +++ /dev/null @@ -1,12 +0,0 @@ -canned protocols -localEcho - "A reflect suitable for local echo on dumb ttys, when placed immediately below a TtyMorph, recognising a few of the ASCII control characters." - - | c | - ^self - upBlock: [:arg | down downcall: arg]; - downBlock: [:arg | c := arg bitAnd: 127. - (c == 8) | (c == 127) ifTrue: [up bs; upcall: 32; bs] - ifFalse: [(c == 10) | (c == 13) ifTrue: [up newline] - ifFalse: [c >= 32 ifTrue: [up upcall: c]]]. - up flush.] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/note.with..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/note.with..st deleted file mode 100644 index 86c8a8e..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/note.with..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -note: aSymbol with: anObject - - noteBlock value: aSymbol value: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/noteBlock..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/noteBlock..st deleted file mode 100644 index fadaf6d..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/noteBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -noteBlock: block - - noteBlock := block \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/pass.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/pass.st deleted file mode 100644 index 7fee459..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/pass.st +++ /dev/null @@ -1,6 +0,0 @@ -canned protocols -pass - - ^self - upBlock: [:arg | up upcall: arg]; - downBlock: [:arg | down downcall: arg] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/reflect.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/reflect.st deleted file mode 100644 index e94b74b..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/reflect.st +++ /dev/null @@ -1,6 +0,0 @@ -canned protocols -reflect - - ^self - upBlock: [:arg | down downcall: arg]; - downBlock: [:arg | up upcall: arg; flush] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/trace.st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/trace.st deleted file mode 100644 index 2bbabaf..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/trace.st +++ /dev/null @@ -1,10 +0,0 @@ -canned protocols -trace - - ^self - upBlock: [:arg | - Transcript cr; nextPutAll: 'up ' , arg printString; endEntry. - up upcall: arg]; - downBlock: [:arg | - Transcript cr; nextPutAll: 'down ' , arg printString; endEntry. - down downcall: arg] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/upBlock..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/upBlock..st deleted file mode 100644 index 884dd3b..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/upBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -upBlock: block - - upBlock := block \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/upcall..st b/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/upcall..st deleted file mode 100644 index 77e6fa5..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/instance/upcall..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -upcall: arg - - upBlock value: arg \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolAdaptor.class/methodProperties.json deleted file mode 100644 index 5b9f61d..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/methodProperties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "class" : { - "new" : " 7/23/2018 10:01:06", - "upBlock:" : " 7/23/2018 10:01:06" }, - "instance" : { - "downBlock:" : " 7/23/2018 10:01:06", - "downcall:" : " 7/23/2018 10:01:06", - "flush" : " 7/23/2018 10:01:06", - "flushBlock:" : " 7/23/2018 10:01:06", - "initialize" : " 7/23/2018 10:01:06", - "localEcho" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "noteBlock:" : " 7/23/2018 10:01:06", - "pass" : " 7/23/2018 10:01:06", - "reflect" : " 7/23/2018 10:01:06", - "trace" : " 7/23/2018 10:01:06", - "upBlock:" : " 7/23/2018 10:01:06", - "upcall:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolAdaptor.class/properties.json b/source/LayeredProtocol.package/ProtocolAdaptor.class/properties.json deleted file mode 100644 index 65f3949..0000000 --- a/source/LayeredProtocol.package/ProtocolAdaptor.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "upBlock", - "downBlock", - "flushBlock", - "noteBlock" ], - "name" : "ProtocolAdaptor", - "pools" : [ - ], - "super" : "ProtocolLayer", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/README.md b/source/LayeredProtocol.package/ProtocolEndpoint.class/README.md deleted file mode 100644 index 32b50ac..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/README.md +++ /dev/null @@ -1 +0,0 @@ -I am an abstract endpoint for communication within a LayeredProtocol stack. (I therefore expect to be the lowest element in that stack.) I implement a server which waits for incoming data and then passes it up the stack for processing by higher protocol layers. The actual reading of data from the remote entity must be implemented by my concrete subclasses. \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/close.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/close.st deleted file mode 100644 index 2cf42f1..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/close.st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -close - "Terminate the connection to the remote entity." - - ^self subclassResponsibility \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/downcall..st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/downcall..st deleted file mode 100644 index 447434e..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/downcall..st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -downcall: anObject - "Receive anObject from my high protocol. The default behaviour (in Protocol) is to pass it down to my low protocol. ProtocolEndpoints however are at the bottom of the ProtocolStack and thus have no low protocol, so they have to treat this specially (e.g., by sending the data over the network or to another process)." - - ^self subclassResponsibility \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/getData.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/getData.st deleted file mode 100644 index 1b5b208..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/getData.st +++ /dev/null @@ -1,5 +0,0 @@ -server loop -getData - "Answer a collection of data to be passed up the protocol stack, or nil if the endpoint has failed." - - ^self subclassResponsibility \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/isConnected.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/isConnected.st deleted file mode 100644 index 46c4874..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/isConnected.st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -isConnected - "Answer whether the endpoint is still connected." - - ^self subclassResponsibility \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/name.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/name.st deleted file mode 100644 index bfb06bd..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/name.st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -name - "Answer the name of the remote entity." - - ^self subclassResponsibility \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/note.with..st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/note.with..st deleted file mode 100644 index 46a78a3..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/note.with..st +++ /dev/null @@ -1,6 +0,0 @@ -protocol -note: aSymbol with: anObject - - super note: aSymbol with: anObject. - aSymbol == #endpointClosed ifTrue: [^self terminateServer]. - aSymbol == #windowClosed ifTrue: [^self close]. \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/run.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/run.st deleted file mode 100644 index c547533..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/run.st +++ /dev/null @@ -1,6 +0,0 @@ -protocol -run - "Spawn a background process running the serverLoop." - - super run. - serverProcess := [self serverLoop] forkAt: Processor userBackgroundPriority. \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/serverLoop.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/serverLoop.st deleted file mode 100644 index 2cbbf81..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/serverLoop.st +++ /dev/null @@ -1,11 +0,0 @@ -server loop -serverLoop - "I sit in a loop (usually in a background Process) waiting for data to arrive on my underlying connection then pass anything received up to my high protocol. When #getData answers nil to inform me that my underlying connection has been destroyed I close down the entire endpoint, inform my session of the fact and then exit. See also ProtocolEndpoint>>run." - - | buf | - [[(buf := self getData) notNil] whileTrue: [up upcallAll: buf]] - on: Error - do: [:ex | ex pass]. - serverProcess := nil. - self sessionNote: #endpointClosed. - self session ifNotNil: [self session kill]. diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/terminateServer.st b/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/terminateServer.st deleted file mode 100644 index 7ab2b87..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/instance/terminateServer.st +++ /dev/null @@ -1,10 +0,0 @@ -server loop -terminateServer - "Terminate the serverLoop process. This should never be called directly: use #close instead." - - serverProcess isNil - ifFalse: - [serverProcess terminate. - serverProcess _ nil. - self sessionNote: #disconnected. - Transcript cr; show: self class name, ' server terminated'] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolEndpoint.class/methodProperties.json deleted file mode 100644 index a7be550..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/methodProperties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "close" : " 7/23/2018 10:01:06", - "downcall:" : " 7/23/2018 10:01:06", - "getData" : " 7/23/2018 10:01:06", - "isConnected" : " 7/23/2018 10:01:06", - "name" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "run" : " 7/23/2018 10:01:06", - "serverLoop" : " 7/23/2018 10:01:06", - "terminateServer" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolEndpoint.class/properties.json b/source/LayeredProtocol.package/ProtocolEndpoint.class/properties.json deleted file mode 100644 index 1487916..0000000 --- a/source/LayeredProtocol.package/ProtocolEndpoint.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Endpoints", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "serverProcess" ], - "name" : "ProtocolEndpoint", - "pools" : [ - ], - "super" : "ProtocolLayer", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/README.md b/source/LayeredProtocol.package/ProtocolLayer.class/README.md deleted file mode 100644 index 1b0f7ad..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/README.md +++ /dev/null @@ -1,6 +0,0 @@ -I am a single layer in a LayeredProtocol stack. I pass information up and down the stack, possibly transforming it in the process. - -Structure: - down (ProtocolLayer) My low protocol, one element closer to the "remote connection" end of the stack. - up (ProtocolLayer) My high protocol, one element closer to the user interface or other "local client". - session (LayeredProtocol) The entire collection of ProtocolLayers of which I am one. diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/asProtocolStack.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/asProtocolStack.st deleted file mode 100644 index 125e68d..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/asProtocolStack.st +++ /dev/null @@ -1,5 +0,0 @@ -control -asProtocolStack - "Answer a new LayeredProtocol in which I am the lowest element." - - ^LayeredProtocol on: self \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/basicDowncallAll..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/basicDowncallAll..st deleted file mode 100644 index 2f0d47f..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/basicDowncallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -stack -basicDowncallAll: chunk - - down notNil ifTrue: [down downcallAll: chunk]. diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/basicUpcallAll..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/basicUpcallAll..st deleted file mode 100644 index 46c66ca..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/basicUpcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -stack -basicUpcallAll: chunk - - (up notNil and: [chunk notNil]) ifTrue: [up upcallAll: chunk]. diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/close.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/close.st deleted file mode 100644 index 8d6c881..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/close.st +++ /dev/null @@ -1,3 +0,0 @@ -control -close - "Perform any additional actions when stopping the protocol (i.e., just after data transfer ends)." \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/down..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/down..st deleted file mode 100644 index e089048..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/down..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -down: protoLo - - down := protoLo \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/downcall..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/downcall..st deleted file mode 100644 index 32f0e34..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/downcall..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -downcall: anObject - "Receive anObject from my high protocol. The default behaviour is to pass it down unmodified to my low protocol (i.e., I am transparent)." - - down downcall: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/downcallAll..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/downcallAll..st deleted file mode 100644 index ba28718..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/downcallAll..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -downcallAll: aCollection - "Receive aCollection of data from my high protocol. The default behaviour is to act as if each datum was received individually." - - aCollection do: [:elt | self downcall: elt] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/flush.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/flush.st deleted file mode 100644 index ab12a1a..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/flush.st +++ /dev/null @@ -1,5 +0,0 @@ -stack -flush - "Inform my high protocol that we might be about to pause for a while." - - up flush \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/install.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/install.st deleted file mode 100644 index b3fe739..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/install.st +++ /dev/null @@ -1,3 +0,0 @@ -control -install - "Perform any additional actions when creating the initial up/down connections between elements in the ProtocolStack." \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/isConnected.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/isConnected.st deleted file mode 100644 index 15cf602..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/isConnected.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isConnected - - ^false \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/note.with..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/note.with..st deleted file mode 100644 index 2593a28..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/note.with..st +++ /dev/null @@ -1,3 +0,0 @@ -session -note: aSymbol with: anArgument - "My session is informing me that something has happened. By default I don't care about it." \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/passUp..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/passUp..st deleted file mode 100644 index 1aa7967..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/passUp..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -passUp: anObject - "Pass anObject up to my high protocol." - - up upcall: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/push..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/push..st deleted file mode 100644 index 6932035..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/push..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -push: aProtocol - "Push aProtocol on top of the receiver." - - ^(LayeredProtocol on: self) push: aProtocol \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/run.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/run.st deleted file mode 100644 index b30bc91..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/run.st +++ /dev/null @@ -1,3 +0,0 @@ -control -run - "Perform any additional actions when starting the protocol running (i.e., just before data transfer begins)." \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/session..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/session..st deleted file mode 100644 index 241bf00..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/session..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -session: aSession - - session := aSession \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/session.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/session.st deleted file mode 100644 index 4cc6a4f..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/session.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -session - - ^session \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/sessionNote..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/sessionNote..st deleted file mode 100644 index 2ade2fb..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/sessionNote..st +++ /dev/null @@ -1,5 +0,0 @@ -session -sessionNote: aSymbol - "Tell my session that something has happened. If I have no session then do nothing." - - session isNil ifFalse: [session note: aSymbol with: nil] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/sessionNote.with..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/sessionNote.with..st deleted file mode 100644 index 71d3ab7..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/sessionNote.with..st +++ /dev/null @@ -1,5 +0,0 @@ -session -sessionNote: aSymbol with: anArgument - "Tell my session that something has happened. If I have no session then do nothing." - - session isNil ifFalse: [session note: aSymbol with: anArgument] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/stop.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/stop.st deleted file mode 100644 index 0c9157b..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/stop.st +++ /dev/null @@ -1,3 +0,0 @@ -control -stop - "Perform any additional actions when stopping the protocol (i.e., just after data transfer ends)." \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyCR.st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyCR.st deleted file mode 100644 index 078475c..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyCR.st +++ /dev/null @@ -1,4 +0,0 @@ -diagnostics -ttyCR - - self ttyMsg: String cr \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyMsg..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyMsg..st deleted file mode 100644 index a04d8e3..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyMsg..st +++ /dev/null @@ -1,5 +0,0 @@ -diagnostics -ttyMsg: aString - - aString withInternetLineEndings asByteArray do: [:b | up upcall: b]. - up flush \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyMsgCR..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyMsgCR..st deleted file mode 100644 index fc0c6d7..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/ttyMsgCR..st +++ /dev/null @@ -1,4 +0,0 @@ -diagnostics -ttyMsgCR: aString - - self ttyMsg: aString, String cr \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/up..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/up..st deleted file mode 100644 index 87149fb..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/up..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -up: protoHi - - up := protoHi \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/upcall..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/upcall..st deleted file mode 100644 index fb16012..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/upcall..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -upcall: anObject - "Receive anObject from my low protocol. Default is to pass it on to my high protocol unmodified (in other words, I am transparent)." - - up upcall: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/instance/upcallAll..st b/source/LayeredProtocol.package/ProtocolLayer.class/instance/upcallAll..st deleted file mode 100644 index fe9cb39..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/instance/upcallAll..st +++ /dev/null @@ -1,5 +0,0 @@ -stack -upcallAll: aCollection - "Receive aCollection of data from my low protocol. By default I act as if each datum had been received individually." - - aCollection do: [:b | self upcall: b] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolLayer.class/methodProperties.json deleted file mode 100644 index a7b4853..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/methodProperties.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "asProtocolStack" : " 7/23/2018 10:01:06", - "basicDowncallAll:" : " 7/23/2018 10:01:06", - "basicUpcallAll:" : " 7/23/2018 10:01:06", - "close" : " 7/23/2018 10:01:06", - "down:" : " 7/23/2018 10:01:06", - "downcall:" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06", - "flush" : " 7/23/2018 10:01:06", - "install" : " 7/23/2018 10:01:06", - "isConnected" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "passUp:" : " 7/23/2018 10:01:06", - "push:" : " 7/23/2018 10:01:06", - "run" : " 7/23/2018 10:01:06", - "session" : " 7/23/2018 10:01:06", - "session:" : " 7/23/2018 10:01:06", - "sessionNote:" : " 7/23/2018 10:01:06", - "sessionNote:with:" : " 7/23/2018 10:01:06", - "stop" : " 7/23/2018 10:01:06", - "ttyCR" : " 7/23/2018 10:01:06", - "ttyMsg:" : " 7/23/2018 10:01:06", - "ttyMsgCR:" : " 7/23/2018 10:01:06", - "up:" : " 7/23/2018 10:01:06", - "upcall:" : " 7/23/2018 10:01:06", - "upcallAll:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolLayer.class/properties.json b/source/LayeredProtocol.package/ProtocolLayer.class/properties.json deleted file mode 100644 index 712a4b3..0000000 --- a/source/LayeredProtocol.package/ProtocolLayer.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "session", - "up", - "down" ], - "name" : "ProtocolLayer", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/README.md b/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/instance/basicUpcallAll..st b/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/instance/basicUpcallAll..st deleted file mode 100644 index 07cdaed..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/instance/basicUpcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -basicUpcallAll: chunk - - self protocolLayer basicUpcallAll: chunk. diff --git a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/instance/upcallAll..st b/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/instance/upcallAll..st deleted file mode 100644 index 84e397e..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/instance/upcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -upcallAll: chunk - - self basicUpcallAll: chunk \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/methodProperties.json deleted file mode 100644 index 03e04e7..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/methodProperties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "basicUpcallAll:" : " 7/23/2018 10:01:06", - "upcallAll:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/properties.json b/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/properties.json deleted file mode 100644 index ca51633..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerReadStrategy.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "ProtocolLayerReadStrategy", - "pools" : [ - ], - "super" : "ProtocolLayerStrategy", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/README.md b/source/LayeredProtocol.package/ProtocolLayerStrategy.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/class/newOnLayer..st b/source/LayeredProtocol.package/ProtocolLayerStrategy.class/class/newOnLayer..st deleted file mode 100644 index 401427a..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/class/newOnLayer..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -newOnLayer: layer - - ^ self new - protocolLayer: layer; - yourself \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/instance/protocolLayer..st b/source/LayeredProtocol.package/ProtocolLayerStrategy.class/instance/protocolLayer..st deleted file mode 100644 index c3df53d..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/instance/protocolLayer..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -protocolLayer: anObject - "Set the receiver's instance variable protocolLayer to anObject." - - protocolLayer := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/instance/protocolLayer.st b/source/LayeredProtocol.package/ProtocolLayerStrategy.class/instance/protocolLayer.st deleted file mode 100644 index 55bfb0e..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/instance/protocolLayer.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -protocolLayer - "Answer the receiver's instance variable protocolLayer." - - ^protocolLayer \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolLayerStrategy.class/methodProperties.json deleted file mode 100644 index f98f32c..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/methodProperties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "class" : { - "newOnLayer:" : " 7/23/2018 10:01:06" }, - "instance" : { - "protocolLayer" : " 7/23/2018 10:01:06", - "protocolLayer:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/properties.json b/source/LayeredProtocol.package/ProtocolLayerStrategy.class/properties.json deleted file mode 100644 index 2deb3f6..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerStrategy.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "protocolLayer" ], - "name" : "ProtocolLayerStrategy", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/README.md b/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/instance/basicDowncallAll..st b/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/instance/basicDowncallAll..st deleted file mode 100644 index 6de7b7b..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/instance/basicDowncallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -basicDowncallAll: chunk - - self protocolLayer basicDowncallAll: chunk. diff --git a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/instance/downcallAll..st b/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/instance/downcallAll..st deleted file mode 100644 index 67cbc95..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/instance/downcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -downcallAll: chunk - - self basicDowncallAll: chunk. diff --git a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/methodProperties.json deleted file mode 100644 index 799dfc0..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/methodProperties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "basicDowncallAll:" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/properties.json b/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/properties.json deleted file mode 100644 index 9dc3552..0000000 --- a/source/LayeredProtocol.package/ProtocolLayerWriteStrategy.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "ProtocolLayerWriteStrategy", - "pools" : [ - ], - "super" : "ProtocolLayerStrategy", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolState.class/README.md b/source/LayeredProtocol.package/ProtocolState.class/README.md deleted file mode 100644 index dace025..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/README.md +++ /dev/null @@ -1,9 +0,0 @@ -I am a single state within a cyclic graph of states. My values are edges leading to another state in the graph. If the edge has an action associated with it then I perform the method of that name in my client object, passing the object which stepped me as argument, before following the edge. - -Structure: - name Symbol -- my state's name - keys Object -- the input tokens that cause me to step - values #(Symbol1 Symbol2) -- an edge: the next state and a client action selector - default #(Symbol1 Symbol2) -- the edge I follow if no key matches the stepping object - -I am intended to be inserted somewhere in the middle of a LayeredProtocol stack. \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/class/example.st b/source/LayeredProtocol.package/ProtocolState.class/class/example.st deleted file mode 100644 index 82a7aed..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/class/example.st +++ /dev/null @@ -1,7 +0,0 @@ -examples -example - "ProtocolState example" - - ^(self name: #initial default: #echo: -> #initial) - at: 42 put: #echo42: -> #initial; - yourself \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/class/name.default..st b/source/LayeredProtocol.package/ProtocolState.class/class/name.default..st deleted file mode 100644 index 55ae8a1..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/class/name.default..st +++ /dev/null @@ -1,5 +0,0 @@ -instance creation -name: myName default: aTransition - ^self new - name: myName; - default: aTransition \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/add..st b/source/LayeredProtocol.package/ProtocolState.class/instance/add..st deleted file mode 100644 index a8bb01f..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/add..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -add: anAssociation - - ^self transitionAt: anAssociation key put: (self transitionFor: anAssociation value) \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/addAll..st b/source/LayeredProtocol.package/ProtocolState.class/instance/addAll..st deleted file mode 100644 index 9589886..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/addAll..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -addAll: anAssociation - - ^self atAll: anAssociation key put: anAssociation value \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/addAllInteger..st b/source/LayeredProtocol.package/ProtocolState.class/instance/addAllInteger..st deleted file mode 100644 index 180f364..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/addAllInteger..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -addAllInteger: anAssociation - - ^self atAllInteger: anAssociation key put: anAssociation value \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/addInteger..st b/source/LayeredProtocol.package/ProtocolState.class/instance/addInteger..st deleted file mode 100644 index f7c2bb2..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/addInteger..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -addInteger: anAssociation - - ^self transitionAt: anAssociation key asInteger put: (self transitionFor: anAssociation value) \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/at.put..st b/source/LayeredProtocol.package/ProtocolState.class/instance/at.put..st deleted file mode 100644 index 0183454..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/at.put..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -at: key put: transition - - ^self transitionAt: key put: (self transitionFor: transition) \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/at.to.put..st b/source/LayeredProtocol.package/ProtocolState.class/instance/at.to.put..st deleted file mode 100644 index be35222..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/at.to.put..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -at: anObject to: limit put: transition - - | edge | - edge := self transitionFor: transition. - anObject to: limit do: [:target | self transitionAt: target put: edge] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/atAll.put..st b/source/LayeredProtocol.package/ProtocolState.class/instance/atAll.put..st deleted file mode 100644 index ff0a851..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/atAll.put..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -atAll: collection put: transition - | edge | - edge := self transitionFor: transition. - collection do: [:elt | self transitionAt: elt put: edge] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/atAllInteger.put..st b/source/LayeredProtocol.package/ProtocolState.class/instance/atAllInteger.put..st deleted file mode 100644 index d9fd4e9..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/atAllInteger.put..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -atAllInteger: collection put: transition - | edge | - edge := self transitionFor: transition. - collection do: [:elt | self transitionAt: elt asInteger put: edge] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/default..st b/source/LayeredProtocol.package/ProtocolState.class/instance/default..st deleted file mode 100644 index c5ca8e1..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/default..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -default: transition - - self defaultTransition: (self transitionFor: transition) \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/default.st b/source/LayeredProtocol.package/ProtocolState.class/instance/default.st deleted file mode 100644 index d0faabb..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/default.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -default - - ^default \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/defaultTransition..st b/source/LayeredProtocol.package/ProtocolState.class/instance/defaultTransition..st deleted file mode 100644 index 5faffa7..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/defaultTransition..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -defaultTransition: aTransition - - default := aTransition \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/name..st b/source/LayeredProtocol.package/ProtocolState.class/instance/name..st deleted file mode 100644 index 5f4fdd5..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/name..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -name: aSymbol - - name := aSymbol \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/name.st b/source/LayeredProtocol.package/ProtocolState.class/instance/name.st deleted file mode 100644 index e1d7de5..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/name.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -name - - ^name \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/printElementsOn..st b/source/LayeredProtocol.package/ProtocolState.class/instance/printElementsOn..st deleted file mode 100644 index d8d078f..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/printElementsOn..st +++ /dev/null @@ -1,8 +0,0 @@ -printing -printElementsOn: aStream - - aStream nextPutAll: '(name: ' , name printString. - aStream nextPutAll: ' default: ' , default printString. - aStream nextPutAll: ' transitions:'. - self associationsDo: [:transition | aStream space. transition printOn: aStream.]. - aStream nextPut: $). \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/transitionAt..st b/source/LayeredProtocol.package/ProtocolState.class/instance/transitionAt..st deleted file mode 100644 index 4464202..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/transitionAt..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -transitionAt: key - - ^super at: key ifAbsent: [default] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/transitionAt.put..st b/source/LayeredProtocol.package/ProtocolState.class/instance/transitionAt.put..st deleted file mode 100644 index 4554ce5..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/transitionAt.put..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -transitionAt: key put: edge - - ^super at: key put: edge \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/instance/transitionFor..st b/source/LayeredProtocol.package/ProtocolState.class/instance/transitionFor..st deleted file mode 100644 index 8e4c572..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/instance/transitionFor..st +++ /dev/null @@ -1,4 +0,0 @@ -private -transitionFor: transition - - ^ProtocolStateTransition action: transition key state: transition value \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolState.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolState.class/methodProperties.json deleted file mode 100644 index c2f3e6a..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/methodProperties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "class" : { - "example" : " 7/23/2018 10:01:06", - "name:default:" : " 7/23/2018 10:01:06" }, - "instance" : { - "add:" : " 7/23/2018 10:01:06", - "addAll:" : " 7/23/2018 10:01:06", - "addAllInteger:" : " 7/23/2018 10:01:06", - "addInteger:" : " 7/23/2018 10:01:06", - "at:put:" : " 7/23/2018 10:01:06", - "at:to:put:" : " 7/23/2018 10:01:06", - "atAll:put:" : " 7/23/2018 10:01:06", - "atAllInteger:put:" : " 7/23/2018 10:01:06", - "default" : " 7/23/2018 10:01:06", - "default:" : " 7/23/2018 10:01:06", - "defaultTransition:" : " 7/23/2018 10:01:06", - "name" : " 7/23/2018 10:01:06", - "name:" : " 7/23/2018 10:01:06", - "printElementsOn:" : " 7/23/2018 10:01:06", - "transitionAt:" : " 7/23/2018 10:01:06", - "transitionAt:put:" : " 7/23/2018 10:01:06", - "transitionFor:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolState.class/properties.json b/source/LayeredProtocol.package/ProtocolState.class/properties.json deleted file mode 100644 index 9cd448b..0000000 --- a/source/LayeredProtocol.package/ProtocolState.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "name", - "default" ], - "name" : "ProtocolState", - "pools" : [ - ], - "super" : "IdentityDictionary", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/README.md b/source/LayeredProtocol.package/ProtocolStateTransition.class/README.md deleted file mode 100644 index 4b7bcf9..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/README.md +++ /dev/null @@ -1 +0,0 @@ -I am a transition to a new ProtocolState. While making the transition I can perform some action association with the change from the old to the new state. \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/action..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/class/action..st deleted file mode 100644 index 9c6e5ec..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/action..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -action: aSymbol - - ^self new state: nil; action: aSymbol \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/action.state..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/class/action.state..st deleted file mode 100644 index dd5c088..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/action.state..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -action: aSymbol state: aState - - ^self new state: aState; action: aSymbol \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/state..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/class/state..st deleted file mode 100644 index b69ad30..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/state..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -state: aState - - ^self new state: aState; action: nil \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/state.action..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/class/state.action..st deleted file mode 100644 index f690697..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/class/state.action..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -state: aState action: aSymbol - - ^self new state: aState; action: aSymbol \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/action..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/action..st deleted file mode 100644 index 03e7aeb..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/action..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -action: aSymbol - - action := aSymbol \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/action.st b/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/action.st deleted file mode 100644 index b49b330..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/action.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -action - - ^action \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/printOn..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/printOn..st deleted file mode 100644 index 3651698..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/printOn..st +++ /dev/null @@ -1,10 +0,0 @@ -printing -printOn: aStream - - aStream nextPut: ${. - action printOn: aStream. - aStream nextPutAll: ' -> '. - aStream nextPutAll: ((state isMemberOf: Symbol) - ifTrue: [state] - ifFalse: [state name]) printString. - aStream nextPut: $} \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/state..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/state..st deleted file mode 100644 index 6ccd71f..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/state..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -state: aState - - state := aState \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/state.st b/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/state.st deleted file mode 100644 index 4c6fab8..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/state.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -state - - ^state \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/transitionFrom.for.with..st b/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/transitionFrom.for.with..st deleted file mode 100644 index 483f788..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/instance/transitionFrom.for.with..st +++ /dev/null @@ -1,5 +0,0 @@ -state transitions -transitionFrom: lastState for: aClient with: anObject - - action isNil ifFalse: [aClient perform: action with: anObject]. - ^state isNil ifTrue: [lastState] ifFalse: [state] \ No newline at end of file diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/methodProperties.json b/source/LayeredProtocol.package/ProtocolStateTransition.class/methodProperties.json deleted file mode 100644 index f723a62..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/methodProperties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "class" : { - "action:" : " 7/23/2018 10:01:06", - "action:state:" : " 7/23/2018 10:01:06", - "state:" : " 7/23/2018 10:01:06", - "state:action:" : " 7/23/2018 10:01:06" }, - "instance" : { - "action" : " 7/23/2018 10:01:06", - "action:" : " 7/23/2018 10:01:06", - "printOn:" : " 7/23/2018 10:01:06", - "state" : " 7/23/2018 10:01:06", - "state:" : " 7/23/2018 10:01:06", - "transitionFrom:for:with:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/ProtocolStateTransition.class/properties.json b/source/LayeredProtocol.package/ProtocolStateTransition.class/properties.json deleted file mode 100644 index 5289a04..0000000 --- a/source/LayeredProtocol.package/ProtocolStateTransition.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "state", - "action" ], - "name" : "ProtocolStateTransition", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/README.md b/source/LayeredProtocol.package/StatefulChunkProtocol.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/downcall..st b/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/downcall..st deleted file mode 100644 index e3c86ab..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/downcall..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -downcall: aByte - - down downcall: aByte \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/downcallAll..st b/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/downcallAll..st deleted file mode 100644 index d993f1f..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/downcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -downcallAll: chunks - - down downcallAll: chunks. \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/transitionEvent.with..st b/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/transitionEvent.with..st deleted file mode 100644 index 45a1bb1..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/transitionEvent.with..st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -transitionEvent: anEvent with: anObject - - currentState := (currentState transitionAt: anEvent) - transitionFrom: currentState for: client with: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/upcall..st b/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/upcall..st deleted file mode 100644 index e6d895a..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/upcall..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -upcall: aChunkStream - - self shouldNotImplement \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/upcallAll..st b/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/upcallAll..st deleted file mode 100644 index d7a86eb..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/instance/upcallAll..st +++ /dev/null @@ -1,6 +0,0 @@ -protocol -upcallAll: chunk - - | chunkStream | - chunkStream := chunk readStream. - self transitionEvent: chunkStream next with: chunkStream. diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/methodProperties.json b/source/LayeredProtocol.package/StatefulChunkProtocol.class/methodProperties.json deleted file mode 100644 index b5de3e4..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/methodProperties.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "downcall:" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06", - "transitionEvent:with:" : " 7/23/2018 10:01:06", - "upcall:" : " 7/23/2018 10:01:06", - "upcallAll:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/StatefulChunkProtocol.class/properties.json b/source/LayeredProtocol.package/StatefulChunkProtocol.class/properties.json deleted file mode 100644 index af9b068..0000000 --- a/source/LayeredProtocol.package/StatefulChunkProtocol.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "StatefulChunkProtocol", - "pools" : [ - ], - "super" : "StatefulProtocol", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/README.md b/source/LayeredProtocol.package/StatefulProtocol.class/README.md deleted file mode 100644 index 0a59ff4..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/README.md +++ /dev/null @@ -1 +0,0 @@ -I am a ProtocolLayer. I implement my protocol as a state machine, transitioning from one state to another according to patterns that I recognise in the data flowing through me. \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/class/initialState..st b/source/LayeredProtocol.package/StatefulProtocol.class/class/initialState..st deleted file mode 100644 index df61090..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/class/initialState..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -initialState: stateNode - - ^self new initialState: stateNode \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/class/initialState.client..st b/source/LayeredProtocol.package/StatefulProtocol.class/class/initialState.client..st deleted file mode 100644 index b8d1f92..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/class/initialState.client..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -initialState: stateNode client: aClient - - ^self new initialState: stateNode; client: aClient \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/instance/client..st b/source/LayeredProtocol.package/StatefulProtocol.class/instance/client..st deleted file mode 100644 index 96c693d..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/instance/client..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -client: anObject - - client := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/instance/initialState..st b/source/LayeredProtocol.package/StatefulProtocol.class/instance/initialState..st deleted file mode 100644 index 9952c1c..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/instance/initialState..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -initialState: stateNode - - currentState := stateNode. - self client: self \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/instance/state.st b/source/LayeredProtocol.package/StatefulProtocol.class/instance/state.st deleted file mode 100644 index 45c9b70..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/instance/state.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -state - - ^currentState \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/instance/transitionEvent.with..st b/source/LayeredProtocol.package/StatefulProtocol.class/instance/transitionEvent.with..st deleted file mode 100644 index 45a1bb1..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/instance/transitionEvent.with..st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -transitionEvent: anEvent with: anObject - - currentState := (currentState transitionAt: anEvent) - transitionFrom: currentState for: client with: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/instance/upcall..st b/source/LayeredProtocol.package/StatefulProtocol.class/instance/upcall..st deleted file mode 100644 index 992754c..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/instance/upcall..st +++ /dev/null @@ -1,5 +0,0 @@ -protocol -upcall: anObject - - currentState := (currentState transitionAt: anObject) - transitionFrom: currentState for: client with: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/methodProperties.json b/source/LayeredProtocol.package/StatefulProtocol.class/methodProperties.json deleted file mode 100644 index b5716b2..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/methodProperties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "class" : { - "initialState:" : " 7/23/2018 10:01:06", - "initialState:client:" : " 7/23/2018 10:01:06" }, - "instance" : { - "client:" : " 7/23/2018 10:01:06", - "initialState:" : " 7/23/2018 10:01:06", - "state" : " 7/23/2018 10:01:06", - "transitionEvent:with:" : " 7/23/2018 10:01:06", - "upcall:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/StatefulProtocol.class/properties.json b/source/LayeredProtocol.package/StatefulProtocol.class/properties.json deleted file mode 100644 index 29935e8..0000000 --- a/source/LayeredProtocol.package/StatefulProtocol.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "currentState", - "client" ], - "name" : "StatefulProtocol", - "pools" : [ - ], - "super" : "ProtocolLayer", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/README.md b/source/LayeredProtocol.package/StatefulProtocolDescription.class/README.md deleted file mode 100644 index 59e7d0e..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/README.md +++ /dev/null @@ -1,6 +0,0 @@ -I am a collection of ProtocolStates constituting a transition graph for a StatefulProtocol. See my class side for some examples of how I construct state machine descriptions for you. - -Note that before I can be used to drive a StatefulProtocol you *must* send me #compile. I will answer the initial ProtocolState in the compiled transition graph. (I will also complain if your protocol is broken. ;-) You subsequently pass this ProtocolState as the argument to StatefulProtocol class>>initialState: in order to instantiate a new StatefulProtocol. - -Structure: - initialState Symbol -- the name of the initial (root) node in my transition graph \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example.st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example.st deleted file mode 100644 index 70dab3a..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example.st +++ /dev/null @@ -1,14 +0,0 @@ -examples -example - "A state machine that recognises occurrences of 'x' 'xy' and 'xy[digits...]z' in a stream of characters. Note: this is used by StateMachineTester, so don't modify it. See StateMachineTester class>>test for an example of use." - "StatefulProtocolDescription example" - - | desc | - desc := self new. - (desc newState: #initial -> (#echo: -> #initial)) add: $x -> (nil -> #statex). - (desc newState: #statex -> (#echox: -> #initial)) add: $y -> (#initPrefix: -> #statexy). - (desc newState: #statexy -> (#echoxy: -> #initial)) - add: $z -> (#echoxyz: -> #initial); - addAll: '0123456789' -> (#addPrefix: -> nil). - desc initialState: #initial. - ^desc \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example2.st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example2.st deleted file mode 100644 index 03a0916..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example2.st +++ /dev/null @@ -1,5 +0,0 @@ -examples -example2 - "StatefulProtocolDescription example2 explore" - - ^self example compile \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example3.st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example3.st deleted file mode 100644 index b06a089..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/example3.st +++ /dev/null @@ -1,12 +0,0 @@ -examples -example3 "Note: this example should pop up an error notifier during compilation" - - "StatefulProtocolDescription example3 compile" - - | desc | - desc := self new. - (desc newState: #initial -> (#echo: -> #initial)) add: $x -> (nil -> #statex). - (desc newState: #statex -> (#echox: -> #initial)) add: $y -> (nil -> #statexy). - (desc newState: #statexy -> (#echoxy: -> #initial)) add: $z -> (#echoxy: -> #statexyz). - desc initialState: #initial. - ^desc \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/initialState..st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/initialState..st deleted file mode 100644 index 1764cb4..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/class/initialState..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -initialState: stateName - - ^self new initialState: stateName \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/compile.st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/compile.st deleted file mode 100644 index 6db7db8..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/compile.st +++ /dev/null @@ -1,12 +0,0 @@ -compiling -compile - "Compile my symbolic representation into a cyclic DAG and answer the root node" - - | edge | - self valuesDo: [:state | - state defaultTransition: (self resolve: state default). - state keysDo: [:key | - edge := state at: key. - state transitionAt: key put: (self resolve: edge)]]. - - ^self at: initialState \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/initialState..st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/initialState..st deleted file mode 100644 index 06b6d8e..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/initialState..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initialState: stateName - - initialState := stateName \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/newState..st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/newState..st deleted file mode 100644 index dbb0e41..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/newState..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -newState: rule - - ^self newState: rule key default: rule value \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/newState.default..st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/newState.default..st deleted file mode 100644 index 55fa4ea..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/newState.default..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -newState: stateName default: transition - - ^self at: stateName put: (ProtocolState name: stateName default: transition) \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/printElementsOn..st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/printElementsOn..st deleted file mode 100644 index 7d9ebe4..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/printElementsOn..st +++ /dev/null @@ -1,6 +0,0 @@ -printing -printElementsOn: aStream - - aStream nextPutAll: '(initial: ' , initialState printString , ' states:'. - self keysDo: [:key | aStream space. key printOn: aStream]. - aStream nextPut: $) \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/resolve..st b/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/resolve..st deleted file mode 100644 index c2428db..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/instance/resolve..st +++ /dev/null @@ -1,12 +0,0 @@ -compiling -resolve: edge - - | target action | - target := edge state. - action := edge action. - target := (self includesKey: target) - ifTrue: [self at: target] - ifFalse: [target isNil - ifTrue: [nil] - ifFalse: [self error: 'unknown target state ' , edge printString]]. - ^ProtocolStateTransition action: action state: target \ No newline at end of file diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/methodProperties.json b/source/LayeredProtocol.package/StatefulProtocolDescription.class/methodProperties.json deleted file mode 100644 index 8cca2dd..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/methodProperties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "class" : { - "example" : " 7/23/2018 10:01:06", - "example2" : " 7/23/2018 10:01:06", - "example3" : " 7/23/2018 10:01:06", - "initialState:" : " 7/23/2018 10:01:06" }, - "instance" : { - "compile" : " 7/23/2018 10:01:06", - "initialState:" : " 7/23/2018 10:01:06", - "newState:" : " 7/23/2018 10:01:06", - "newState:default:" : " 7/23/2018 10:01:06", - "printElementsOn:" : " 7/23/2018 10:01:06", - "resolve:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/StatefulProtocolDescription.class/properties.json b/source/LayeredProtocol.package/StatefulProtocolDescription.class/properties.json deleted file mode 100644 index 75638d1..0000000 --- a/source/LayeredProtocol.package/StatefulProtocolDescription.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "LayeredProtocol-Abstract", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "initialState" ], - "name" : "StatefulProtocolDescription", - "pools" : [ - ], - "super" : "IdentityDictionary", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/README.md b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/example.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/example.st deleted file mode 100644 index 4314164..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/example.st +++ /dev/null @@ -1,13 +0,0 @@ -instance creation -example - "Send 42 down a stack and then reflect it back up." - "StreamProtocolAdaptor example" - - (StreamProtocolAdaptor new reflect asProtocolStack - push: StreamProtocolAdaptor new trace; - push: StreamProtocolAdaptor new trace; - push: (StreamProtocolAdaptor new trace - upBlock: [:stream | Transcript cr; show: 'ping ' , stream upToEnd printString]); - install; - run; - first) downcall: 42 \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/new.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/new.st deleted file mode 100644 index a107c43..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/new.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -new - - ^super new initialize \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/upBlock..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/upBlock..st deleted file mode 100644 index 7165e16..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/class/upBlock..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -upBlock: aBlock - - ^self new upBlock: aBlock \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/cannedString..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/cannedString..st deleted file mode 100644 index f2ef310..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/cannedString..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -cannedString: anObject - "Set the value of cannedString" - - cannedString := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/cannedString.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/cannedString.st deleted file mode 100644 index 67d57e7..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/cannedString.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -cannedString - "Answer the value of cannedString" - - ^ cannedString \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/close.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/close.st deleted file mode 100644 index c890c28..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/close.st +++ /dev/null @@ -1,2 +0,0 @@ -control -close \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downBlock..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downBlock..st deleted file mode 100644 index 65c6123..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -downBlock: anObject - "Set the receiver's instance variable downBlock to anObject." - - downBlock := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downcall..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downcall..st deleted file mode 100644 index 2f3eca7..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downcall..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -downcall: arg - - self downcallAll: (ByteArray with: arg) \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downcallAll..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downcallAll..st deleted file mode 100644 index 0a48a73..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/downcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -downcallAll: bytes - - downBlock value: bytes. diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/flush.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/flush.st deleted file mode 100644 index 9f6f749..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/flush.st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -flush - - flushBlock value \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/flushBlock..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/flushBlock..st deleted file mode 100644 index 545c1fa..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/flushBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -flushBlock: anObject - "Set the receiver's instance variable flushBlock to anObject." - - flushBlock := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/initialize.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/initialize.st deleted file mode 100644 index 665317d..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/initialize.st +++ /dev/null @@ -1,6 +0,0 @@ -initialization -initialize - - self pass. - flushBlock := []. - noteBlock := [:s :a | ] \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/kill.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/kill.st deleted file mode 100644 index 432f250..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/kill.st +++ /dev/null @@ -1,2 +0,0 @@ -control -kill \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/note.with..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/note.with..st deleted file mode 100644 index 86c8a8e..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/note.with..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -note: aSymbol with: anObject - - noteBlock value: aSymbol value: anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/noteBlock..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/noteBlock..st deleted file mode 100644 index 1347fef..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/noteBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -noteBlock: anObject - "Set the receiver's instance variable noteBlock to anObject." - - noteBlock := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/pass.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/pass.st deleted file mode 100644 index f4ad398..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/pass.st +++ /dev/null @@ -1,7 +0,0 @@ -canned protocols -pass - - self cannedString: 'pass'. - ^self - upBlock: [:chunk | up upcallAll: chunk]; - downBlock: [:chunk | down downcallAll: chunk] \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/reflect.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/reflect.st deleted file mode 100644 index 9016bbe..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/reflect.st +++ /dev/null @@ -1,7 +0,0 @@ -canned protocols -reflect - - self cannedString: 'reflect'. - ^self - upBlock: [:chunk | down downcallAll: chunk]; - downBlock: [:chunk | up upcallAll: chunk; flush] diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/reflectDown.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/reflectDown.st deleted file mode 100644 index baf82d3..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/reflectDown.st +++ /dev/null @@ -1,7 +0,0 @@ -canned protocols -reflectDown - - self cannedString: 'reflectDown'. - ^self - upBlock: [:chunk | down downcallAll: chunk]; - downBlock: [:chunk | down downcallAll: chunk] diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/trace.st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/trace.st deleted file mode 100644 index b0bc816..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/trace.st +++ /dev/null @@ -1,13 +0,0 @@ -canned protocols -trace - - self cannedString: 'trace'. - ^self - upBlock: [:chunk | - Transcript cr; nextPutAll: 'up ' , chunk asString; endEntry. - self triggerEvent: #upcallAll. - up ifNotNil: [:localUp | localUp upcallAll: chunk]]; - downBlock: [:chunk | - Transcript cr; nextPutAll: 'down ' , chunk asString; endEntry. - self triggerEvent: #downcallAll. - down ifNotNil: [:localDown | localDown downcallAll: chunk]] \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upBlock..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upBlock..st deleted file mode 100644 index 6bd9077..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upBlock..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -upBlock: anObject - "Set the receiver's instance variable upBlock to anObject." - - upBlock := anObject \ No newline at end of file diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upcall..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upcall..st deleted file mode 100644 index 2037ffd..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upcall..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -upcall: arg - - self upcallAll: (ByteArray with: arg). diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upcallAll..st b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upcallAll..st deleted file mode 100644 index 015f5c8..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/instance/upcallAll..st +++ /dev/null @@ -1,4 +0,0 @@ -protocol -upcallAll: bytes - - upBlock value: bytes. diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/methodProperties.json b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/methodProperties.json deleted file mode 100644 index b4b7916..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/methodProperties.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "class" : { - "example" : " 7/23/2018 10:01:06", - "new" : " 7/23/2018 10:01:06", - "upBlock:" : " 7/23/2018 10:01:06" }, - "instance" : { - "cannedString" : " 7/23/2018 10:01:06", - "cannedString:" : " 7/23/2018 10:01:06", - "close" : " 7/23/2018 10:01:06", - "downBlock:" : " 7/23/2018 10:01:06", - "downcall:" : " 7/23/2018 10:01:06", - "downcallAll:" : " 7/23/2018 10:01:06", - "flush" : " 7/23/2018 10:01:06", - "flushBlock:" : " 7/23/2018 10:01:06", - "initialize" : " 7/23/2018 10:01:06", - "kill" : " 7/23/2018 10:01:06", - "note:with:" : " 7/23/2018 10:01:06", - "noteBlock:" : " 7/23/2018 10:01:06", - "pass" : " 7/23/2018 10:01:06", - "reflect" : " 7/23/2018 10:01:06", - "reflectDown" : " 7/23/2018 10:01:06", - "trace" : " 7/23/2018 10:01:06", - "upBlock:" : " 7/23/2018 10:01:06", - "upcall:" : " 7/23/2018 10:01:06", - "upcallAll:" : " 7/23/2018 10:01:06" } } diff --git a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/properties.json b/source/LayeredProtocol.package/StreamProtocolAdaptor.class/properties.json deleted file mode 100644 index ee3530b..0000000 --- a/source/LayeredProtocol.package/StreamProtocolAdaptor.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "category" : "LayeredProtocol-Extras", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "upBlock", - "downBlock", - "flushBlock", - "noteBlock", - "cannedString" ], - "name" : "StreamProtocolAdaptor", - "pools" : [ - ], - "super" : "ProtocolLayer", - "type" : "normal" } diff --git a/source/LayeredProtocol.package/monticello.meta/categories.st b/source/LayeredProtocol.package/monticello.meta/categories.st deleted file mode 100644 index 63dc6d9..0000000 --- a/source/LayeredProtocol.package/monticello.meta/categories.st +++ /dev/null @@ -1,4 +0,0 @@ -SystemOrganization addCategory: #LayeredProtocol! -SystemOrganization addCategory: 'LayeredProtocol-Abstract'! -SystemOrganization addCategory: 'LayeredProtocol-Endpoints'! -SystemOrganization addCategory: 'LayeredProtocol-Extras'! diff --git a/source/LayeredProtocol.package/monticello.meta/initializers.st b/source/LayeredProtocol.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/LayeredProtocol.package/monticello.meta/package b/source/LayeredProtocol.package/monticello.meta/package deleted file mode 100644 index b7c3e22..0000000 --- a/source/LayeredProtocol.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'LayeredProtocol') \ No newline at end of file diff --git a/source/LayeredProtocol.package/monticello.meta/version b/source/LayeredProtocol.package/monticello.meta/version deleted file mode 100644 index 54ecb02..0000000 --- a/source/LayeredProtocol.package/monticello.meta/version +++ /dev/null @@ -1 +0,0 @@ -(name 'LayeredProtocol-NorbertHartl.2' message 'Saving once for package declaration' id '4b3990f7-0704-42b3-9765-97739e1c5a22' date '23 July 2018' time '10:30:31.815519 am' author 'NorbertHartl' ancestors ((name 'LayeredProtocol-cypress.1' message 'fabricated from a Cypress format repository' id '7dc12e93-0b03-485b-b9da-0ef3201f8853' date '23 July 2018' time '10:01:06.39708 am' author '' ancestors () stepChildren ())) stepChildren ()) \ No newline at end of file diff --git a/source/LayeredProtocol.package/properties.json b/source/LayeredProtocol.package/properties.json deleted file mode 100644 index f037444..0000000 --- a/source/LayeredProtocol.package/properties.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - } diff --git a/source/LayeredProtocol/BinaryChunkProtocol.class.st b/source/LayeredProtocol/BinaryChunkProtocol.class.st new file mode 100644 index 0000000..7fe5fe7 --- /dev/null +++ b/source/LayeredProtocol/BinaryChunkProtocol.class.st @@ -0,0 +1,138 @@ +Class { + #name : #BinaryChunkProtocol, + #superclass : #ProtocolLayer, + #instVars : [ + 'headerSize', + 'header', + 'buffer' + ], + #category : 'LayeredProtocol-Extras' +} + +{ #category : #'instance creation' } +BinaryChunkProtocol class >> new [ + + ^ self newHeaderSize: 2 + +] + +{ #category : #'instance creation' } +BinaryChunkProtocol class >> newHeaderSize: headerSize [ + + ^self basicNew + headerSize: headerSize; + yourself. + +] + +{ #category : #accessing } +BinaryChunkProtocol >> buffer [ + "Answer the receiver's instance variable buffer." + + ^buffer +] + +{ #category : #stack } +BinaryChunkProtocol >> downcall: arg [ + + self downcallAll: (ByteArray with: arg) +] + +{ #category : #stack } +BinaryChunkProtocol >> downcallAll: chunk [ + + | downHeader | + downHeader := self headerForChunk: chunk. + down downcallAll: downHeader. + down downcallAll: chunk. + +] + +{ #category : #stack } +BinaryChunkProtocol >> hasNextHeader [ + + self header isNil ifFalse: [^ true]. + self buffer size >= self headerSize + ifTrue: [ + self header: (self buffer next: self headerSize) asInteger. + ^true]. + ^false + +] + +{ #category : #accessing } +BinaryChunkProtocol >> header [ + "Answer the receiver's instance variable header." + + ^header +] + +{ #category : #accessing } +BinaryChunkProtocol >> header: anObject [ + "Set the receiver's instance variable header to anObject." + + header := anObject +] + +{ #category : #stack } +BinaryChunkProtocol >> headerForChunk: chunk [ + + | size byteStream | + byteStream := (ByteArray new: self headerSize) writeStream. + size := chunk size. + 1 to: self headerSize do: [:i | byteStream nextPut: (size digitAt: self headerSize+1-i)]. + ^ byteStream contents + +] + +{ #category : #accessing } +BinaryChunkProtocol >> headerSize [ + "Answer the receiver's instance variable headerSize." + + ^headerSize +] + +{ #category : #accessing } +BinaryChunkProtocol >> headerSize: anObject [ + "Set the receiver's instance variable headerSize to anObject." + + headerSize := anObject +] + +{ #category : #initialize } +BinaryChunkProtocol >> install [ + + buffer := BufferStream on: (ByteArray new: 0). +] + +{ #category : #stack } +BinaryChunkProtocol >> processChunk [ + "We may be able to use a virtual stream on the buffer segment for speed" + + self header isNil ifTrue: [^ false]. + up isNil ifTrue: [^ false]. + self buffer size >= self header + ifTrue: [ + | chunk | + chunk := self buffer next: self header. + up upcallAll: chunk. + self header: nil. + ^true]. + ^false + +] + +{ #category : #stack } +BinaryChunkProtocol >> upcall: arg [ + + self upcallAll: (ByteArray with: arg). + +] + +{ #category : #stack } +BinaryChunkProtocol >> upcallAll: bytes [ + + self buffer nextPutAll: bytes. + [self hasNextHeader and: [self processChunk]] whileTrue. + +] diff --git a/source/LayeredProtocol/BufferListLayer.class.st b/source/LayeredProtocol/BufferListLayer.class.st new file mode 100644 index 0000000..c14c886 --- /dev/null +++ b/source/LayeredProtocol/BufferListLayer.class.st @@ -0,0 +1,89 @@ +Class { + #name : #BufferListLayer, + #superclass : #ProtocolLayer, + #instVars : [ + 'bufferList', + 'serverProcess' + ], + #category : 'LayeredProtocol-Extras' +} + +{ #category : #accessing } +BufferListLayer >> bufferList [ + + ^ bufferList +] + +{ #category : #control } +BufferListLayer >> close [ + "Spawn a background process running the serverLoop." + + super close. + +] + +{ #category : #stack } +BufferListLayer >> downcallAll: chunk [ + + bufferList addLast: chunk +] + +{ #category : #stack } +BufferListLayer >> install [ + + bufferList := OrderedCollection new: 10. +] + +{ #category : #'as yet unclassified' } +BufferListLayer >> note: aSymbol with: anObject [ + + super note: aSymbol with: anObject. + aSymbol == #endpointClosed ifTrue: [^self terminateServer]. + aSymbol == #windowClosed ifTrue: [^self close]. +] + +{ #category : #stack } +BufferListLayer >> processBuffer [ + + | pallet | + [self session isNil + ifTrue: [^ nil]. + (self bufferList notEmpty and: [down notNil]) + ifTrue: [ + pallet := self bufferList. + bufferList := OrderedCollection new: 10. + self basicDowncallAll: pallet] + ifFalse: [(Delay forMilliseconds: 100) wait]] + repeat. + +] + +{ #category : #stack } +BufferListLayer >> run [ + "Spawn a background process running the serverLoop." + + super run. + "serverProcess := [self serverLoop] forkAt: Processor userSchedulingPriority." +] + +{ #category : #control } +BufferListLayer >> serverLoop [ + + [self processBuffer] + ensure: [ + serverProcess := nil. + self sessionNote: #endpointClosed. + self close]. + +] + +{ #category : #control } +BufferListLayer >> terminateServer [ + "Terminate the serverLoop process. This should never be called directly: use #close instead." + + serverProcess isNil + ifFalse: + [serverProcess terminate. + serverProcess := nil. + self sessionNote: #disconnected] +] diff --git a/source/LayeredProtocol/BufferStream.class.st b/source/LayeredProtocol/BufferStream.class.st new file mode 100644 index 0000000..accbeb5 --- /dev/null +++ b/source/LayeredProtocol/BufferStream.class.st @@ -0,0 +1,152 @@ +" +Kom48 (Comanche beta 4.8) +bolot 4/2/2001 18:43 + +BufferStream + +Comment in Com46: +- is-a ReadWriteStream on a String +- like a queue + removeNext:/nextPutAll: protocol +" +Class { + #name : #BufferStream, + #superclass : #Stream, + #instVars : [ + 'buffer', + 'startPos', + 'endPos' + ], + #category : 'LayeredProtocol-Endpoints' +} + +{ #category : #'instance creation' } +BufferStream class >> on: aString [ + ^self basicNew on: aString +] + +{ #category : #accessing } +BufferStream >> contents [ + "return contents, non-destructive" + ^buffer copyFrom: startPos to: endPos +] + +{ #category : #testing } +BufferStream >> includes: aChar [ + "answer whether buffer includes aChar within bounds" + | tmp | + tmp := buffer + indexOf: aChar + startingAt: startPos + ifAbsent: [0]. + ^(tmp >= startPos) and: [tmp <= endPos] +] + +{ #category : #testing } +BufferStream >> includesAll: aString [ + "answer whether the buffer contains aString" + | tmp | + tmp := buffer indexOfSubCollection: aString startingAt: startPos. + ^(tmp >= startPos) and: [tmp <= endPos] +] + +{ #category : #testing } +BufferStream >> isEmpty [ + ^self size <= 0 +] + +{ #category : #accessing } +BufferStream >> match: aString [ + self size < aString size + ifTrue: [^false]. + (self next: aString size) = aString + ifTrue: [^true] + ifFalse: [self on: aString, self upToEnd]. + ^false +] + +{ #category : #accessing } +BufferStream >> next [ + "return the next character" + "consume it" + ^buffer at: (startPos := startPos + 1) - 1 +] + +{ #category : #accessing } +BufferStream >> next: anInteger [ + "return next anInteger characters" + "consumes them" + ^buffer copyFrom: startPos to: (startPos := startPos + anInteger) - 1 +] + +{ #category : #accessing } +BufferStream >> nextPutAll: aString [ + buffer := (buffer copyFrom: startPos to: endPos), aString. + startPos := 1. + endPos := buffer size +] + +{ #category : #'initialize-release' } +BufferStream >> on: aString [ + buffer := aString. + startPos := 1. + endPos := buffer size +] + +{ #category : #printing } +BufferStream >> printOn: aStream [ + super printOn: aStream. + aStream nextPutAll: '(', self size asString, ')' +] + +{ #category : #'initialize-release' } +BufferStream >> reset [ + "hack" + self on: + (buffer + ifNil: [''] + ifNotNil: [buffer class new: 0]) +] + +{ #category : #accessing } +BufferStream >> size [ + ^endPos - startPos + 1 +] + +{ #category : #accessing } +BufferStream >> upTo: aChar [ + "return String up to aChar, but not including" + "consumes the returned string" + | i | + i := buffer + indexOf: aChar + startingAt: startPos + ifAbsent: [0]. + (i <= 0 or: [i > endPos]) + ifTrue: [^self upToEnd]. + ^self next: (i-startPos) +] + +{ #category : #accessing } +BufferStream >> upToAll: aString [ + "return a string before the occurence of aString, if any" + "consume it" + | i | + i := buffer + indexOfSubCollection: aString + startingAt: startPos + ifAbsent: [0]. + (i <= 0 or: [i > endPos]) + ifTrue: [^self upToEnd]. + ^self next: (i-startPos) +] + +{ #category : #accessing } +BufferStream >> upToEnd [ + "return buffer contents, + consume all my buffer" + | string | + string := self contents. + self reset. + ^string +] diff --git a/source/LayeredProtocol/ConnectionHandler.class.st b/source/LayeredProtocol/ConnectionHandler.class.st new file mode 100644 index 0000000..844c50f --- /dev/null +++ b/source/LayeredProtocol/ConnectionHandler.class.st @@ -0,0 +1,260 @@ +" +Kom48 (Comanche beta 4.8) +bolot 4/2/2001 18:44 + +ConnectionHandler + +Comment from kom46: +- also see ConnectionQueue +- does not keep the queue of open sockets +- launches the applications/modules immediately + upon accepting a connection +" +Class { + #name : #ConnectionHandler, + #superclass : #Object, + #instVars : [ + 'portNumber', + 'socketClass', + 'process', + 'priority', + 'handlerBlock', + 'lastError', + 'socketsToDestroy' + ], + #classVars : [ + 'Registry' + ], + #category : 'LayeredProtocol-Endpoints' +} + +{ #category : #'instance creation' } +ConnectionHandler class >> onPort: aNumber handler: aBlock priority: pNum [ + ^self new + initializeOnPort: aNumber + handler: aBlock + priority: pNum +] + +{ #category : #registry } +ConnectionHandler class >> register: anObject [ + + self registry add: anObject +] + +{ #category : #registry } +ConnectionHandler class >> registry [ + + Registry == nil ifTrue: [ + Registry := WeakRegistry new + ]. + ^Registry +] + +{ #category : #registry } +ConnectionHandler class >> unregister: anObject [ + + self registry remove: anObject ifAbsent: [ ] +] + +{ #category : #'initialize-release' } +ConnectionHandler >> destroySockets [ + socketsToDestroy ~~ nil ifTrue: [ + socketsToDestroy do: [ :ea | ea destroy ]. + ]. + socketsToDestroy := OrderedCollection new +] + +{ #category : #'initialize-release' } +ConnectionHandler >> finalize [ + + "Like #stop, but without the #unregister" + + process ~~ nil ifTrue: [ + process terminate. + ]. + process := nil. + self destroySockets. + + + +] + +{ #category : #'initialize-release' } +ConnectionHandler >> initializeOnPort: aNumber handler: aBlock priority: pNumber [ + portNumber := aNumber. + handlerBlock := aBlock. + priority := pNumber. + socketsToDestroy := OrderedCollection new +] + +{ #category : #'initialize-release' } +ConnectionHandler >> initializeProcessAtPriority: pNumber [ + process := [ self pvtListenLoop ] newProcess. + process priority: pNumber +] + +{ #category : #queries } +ConnectionHandler >> isRunning [ + + ^process ~~ nil +] + +{ #category : #private } +ConnectionHandler >> newListener [ + | listener | + + self flag: #todo. "listener _ self socketClass newTCP." + listener := Socket newTCP. + listener setOption: 'SO_REUSEADDR' value: true. + "listener setOption: 'SO_LINGER' value: false." + "backlog is how many simultaneous connections to accept at the same time" + listener listenOn: portNumber backlogSize: 10. + ^listener + +] + +{ #category : #accessing } +ConnectionHandler >> portNumber [ + ^portNumber +] + +{ #category : #printing } +ConnectionHandler >> printOn: aStream [ + aStream nextPutAll: (self class name asString, ' port: ', self portNumber asString). + self isRunning ifTrue: [ + aStream nextPutAll: ' [running]' + ] ifFalse:[ + aStream nextPutAll: ' [stopped]' + ] +] + +{ #category : #accessing } +ConnectionHandler >> priority [ + ^priority +] + +{ #category : #accessing } +ConnectionHandler >> process [ + process == nil ifTrue: [ + self initializeProcessAtPriority: self priority. + ]. + ^process +] + +{ #category : #private } +ConnectionHandler >> pvtListenLoop [ + [ + self pvtNewListenLoop + ] on: Error do: [ :ex | + process := nil. + self destroySockets. + ex pass. + ] +] + +{ #category : #private } +ConnectionHandler >> pvtNewListenLoop [ + | socket listener | + listener _ self newListener. + self socketsToDestroy add: listener. + + "If the listener is not valid then the we cannot use the + BSD style accept() mechanism." + listener isValid ifFalse: [^self pvtOldListenLoop]. + [ [ true ] whileTrue: [ + socket := listener waitForAcceptFor: 10 ifTimedOut: [nil]. + (socket notNil and: [ socket isConnected ]) + ifTrue: [ + handlerBlock value: socket. + socket := nil] + ifFalse: [ + socket notNil ifTrue: [socket destroy]. + listener isValid + ifFalse: [(Delay forMilliseconds: 100) wait. + listener destroy. + listener := self newListener]. + ]. + ] ] on: Error do: [ :ex | + self halt. + ex pass. + ] +] + +{ #category : #private } +ConnectionHandler >> pvtOldListenLoop [ + "see comment on ConnectionQueue>>oldStyleListenLoop" + | socket | + socket := nil. + + [ true ] whileTrue: [ + (socket == nil) ifTrue: [ + "try to create a new socket for listening" + socket := Socket createIfFail: [ nil ]]. + + (socket == nil) + ifTrue: [(Delay forMilliseconds: 100) wait] + ifFalse: [ + socket setOption: 'SO_REUSEADDR' value: true. + socket isUnconnected ifTrue: [ socket listenOn: portNumber ]. + socket waitForConnectionUntil: (Socket deadlineSecs: 10). + socket isConnected + ifTrue: ["connection established" + "mutex critical: [" handlerBlock value: socket "]". + socket := nil] + ifFalse: [ + socket isWaitingForConnection + ifFalse: [ + socket destroy. + socket := nil. + (NetworkError new + messageText: 'port unavailable: ', portNumber asString; + signal; + yourself)]]. + ]. + ] +] + +{ #category : #registry } +ConnectionHandler >> register [ + + ^self class register: self +] + +{ #category : #accessing } +ConnectionHandler >> socketsToDestroy [ + + socketsToDestroy == nil ifTrue: [ + socketsToDestroy := OrderedCollection new. + ]. + ^socketsToDestroy +] + +{ #category : #'starting and stopping' } +ConnectionHandler >> start [ + self stop. + self process resume. + self register +] + +{ #category : #'starting and stopping' } +ConnectionHandler >> stop [ + self unregister. + process ~~ nil ifTrue: [ + process terminate. + ]. + process := nil. + + "We do the following in a timely manner instead of relying on + finalization because we may want to turn right around and start + listening again. If an old socket is still around an listening, it may + interfere with a new one's ability to hear." + + self destroySockets +] + +{ #category : #registry } +ConnectionHandler >> unregister [ + + ^self class unregister: self +] diff --git a/source/LayeredProtocol/LayeredProtocol.class.st b/source/LayeredProtocol/LayeredProtocol.class.st new file mode 100644 index 0000000..0c583b6 --- /dev/null +++ b/source/LayeredProtocol/LayeredProtocol.class.st @@ -0,0 +1,171 @@ +" +I am a complete protocol implemented as a stack of subprotocols. One end of the stack (the bottom or `tail') is usually an endpoint communicating with some remote host or process. The other end (the top or `head') is either the point of communication for my client (which reads and writes only application-oriented data) or even the client itself. + +I am created by sending my class the message #on: aSubProtocol. You can then send me #push: aProtocol as many times as you like, to push aProtocol onto the head of my protocol stack. When the stack is complete you must send me #install which tells me to finish creating the internal connections between each subprotocol in the stack. Finally you send me #run which tells the entire protocol stack to start. +" +Class { + #name : #LayeredProtocol, + #superclass : #OrderedCollection, + #instVars : [ + 'properties' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #examples } +LayeredProtocol class >> example [ + "Send 42 down a stack and then reflect it back up." + "LayeredProtocol example" + + (ProtocolAdaptor new reflect asProtocolStack + push: ProtocolAdaptor new trace; + push: ProtocolAdaptor new trace; + push: (ProtocolAdaptor new trace + upBlock: [:arg | Transcript cr; show: 'ping ' , arg printString]); + install; + run; + first) downcall: 42 +] + +{ #category : #'instance creation' } +LayeredProtocol class >> new [ + + ^super new initializeProperties +] + +{ #category : #'instance creation' } +LayeredProtocol class >> on: proto [ + + ^self new push: proto +] + +{ #category : #private } +LayeredProtocol >> addDown: proto [ + + ^self addLast: proto +] + +{ #category : #private } +LayeredProtocol >> addUp: proto [ + + ^self addFirst: proto +] + +{ #category : #protocol } +LayeredProtocol >> endpoint [ + + ^self last +] + +{ #category : #accessing } +LayeredProtocol >> head [ + "Answer the head of the stack." + + ^self first +] + +{ #category : #'initialize-release' } +LayeredProtocol >> initializeProperties [ + + properties := IdentityDictionary new +] + +{ #category : #protocol } +LayeredProtocol >> install [ + + | prev | + prev := nil. + self do: [:this | + this session: self. + prev isNil ifFalse: [this up: prev. prev down: this]. + this install. + prev := this] +] + +{ #category : #protocol } +LayeredProtocol >> isConnected [ + + ^self endpoint isConnected +] + +{ #category : #protocol } +LayeredProtocol >> kill [ + + [self notEmpty] whileTrue: [ + self head close. self pop]. +] + +{ #category : #protocol } +LayeredProtocol >> note: aSymbol with: anObject [ + "Inform my members that something has happened." + + self do: [:proto | proto note: aSymbol with: anObject]. + +] + +{ #category : #protocol } +LayeredProtocol >> pop [ + "Remove the head of the stack." + | aProto | + self isEmpty ifTrue: [^ nil]. + aProto := self removeFirst. + self isEmpty + ifFalse: [aProto down: nil. + self head up: nil]. + aProto session: nil. + ^ aProto +] + +{ #category : #accessing } +LayeredProtocol >> propertyAt: aKey [ + + ^properties at: aKey ifAbsent: [] +] + +{ #category : #accessing } +LayeredProtocol >> propertyAt: aKey ifAbsent: aBlock [ + + ^properties at: aKey ifAbsent: aBlock +] + +{ #category : #accessing } +LayeredProtocol >> propertyAt: aKey put: aValue [ + + ^properties at: aKey put: aValue +] + +{ #category : #protocol } +LayeredProtocol >> push: aProto [ + "Push a new protocol onto the head of the stack." + + aProto session: self. + self isEmpty ifFalse: [aProto down: self head. self head up: aProto]. + aProto install. + self addFirst: aProto +] + +{ #category : #private } +LayeredProtocol >> removeUp [ + + ^self removeFirst +] + +{ #category : #protocol } +LayeredProtocol >> run [ + + self do: [:proto | proto run] +] + +{ #category : #protocol } +LayeredProtocol >> stop [ + self + do: [:proto | proto close]. + self kill +] + +{ #category : #accessing } +LayeredProtocol >> tail [ + "Answer the tail of the stack." + + ^self last +] diff --git a/source/LayeredProtocol/NetworkEndpoint.class.st b/source/LayeredProtocol/NetworkEndpoint.class.st new file mode 100644 index 0000000..16981c2 --- /dev/null +++ b/source/LayeredProtocol/NetworkEndpoint.class.st @@ -0,0 +1,201 @@ +" +I am an endpoint for network communication. I am also a ProtocolLayer and I therefore expect to be inserted as the lowest element in a LayeredProtocol stack. + +Structure: + + socket (Socket) -- the socket on which I communicate. + +" +Class { + #name : #NetworkEndpoint, + #superclass : #ProtocolEndpoint, + #instVars : [ + 'socket' + ], + #classVars : [ + 'InstanceList' + ], + #category : 'LayeredProtocol-Endpoints' +} + +{ #category : #examples } +NetworkEndpoint class >> example [ + "NetworkEndpoint example" + + ^NetworkEndpoint new + socket: ((Socket initializeNetwork; new) + connectTo: (NetNameResolver addressForName: 'localhost') port: 13; + waitForConnectionUntil: (Socket deadlineSecs: 1); + yourself); + up: (ProtocolAdaptor new + upBlock: [:arg | Transcript nextPut: arg asCharacter; endEntry]); + run. +] + +{ #category : #examples } +NetworkEndpoint class >> example2 [ + "NetworkEndpoint example2" + + | s | + NetworkEndpoint new + socket: ((s := Socket initializeNetwork; new) + connectTo: (NetNameResolver addressForName: 'localhost') port: 7; + waitForConnectionUntil: (Socket deadlineSecs: 1); + yourself); + up: (ProtocolAdaptor new + upBlock: [:arg | Transcript nextPut: arg asCharacter; endEntry]); + run. + s sendData: 'send this back to me'. + (Delay forSeconds: 1) wait. + s close +] + +{ #category : #examples } +NetworkEndpoint class >> example3 [ + "NetworkEndpoint example3" + + | ep | + (ep := NetworkEndpoint newConnection: 'localhost' port: 7) + up: (ProtocolAdaptor upBlock: + [:arg | Transcript nextPut: arg asCharacter; endEntry]); + run. + ep socket sendData: 'send this back to me'. + (Delay forSeconds: 1) wait. + ep socket close +] + +{ #category : #examples } +NetworkEndpoint class >> newConnection: host port: port [ + + | s addr | + Socket initializeNetwork. + (addr := NetNameResolver addressForName: host) isNil + ifTrue: [^nil]. + (s := Socket new) + connectTo: addr port: port waitForConnectionFor: 5. + s isWaitingForConnection + ifTrue: [s destroy. ^nil]. + ^self new socket: s +] + +{ #category : #examples } +NetworkEndpoint class >> newConnectionAddress: addr port: port [ + + | s | + Socket initializeNetwork. + (s := Socket new) + connectTo: addr + port: port + waitForConnectionFor: 5. + ^self new socket: s +] + +{ #category : #'initialize-release' } +NetworkEndpoint >> close [ + + socket notNil ifTrue: [socket closeAndDestroy: 10] +] + +{ #category : #'protocol stack' } +NetworkEndpoint >> downcall: char [ + + socket isConnected + ifTrue: [socket sendData: (ByteArray with: char)] + ifFalse: [socket closeAndDestroy] +] + +{ #category : #'protocol stack' } +NetworkEndpoint >> downcallAll: collection [ + "This is just for speed in telnet negotiation." + + socket isConnected + ifTrue: [socket sendData: collection] + ifFalse: [socket closeAndDestroy] +] + +{ #category : #accessing } +NetworkEndpoint >> getData [ + + | buf count | + Processor yield. + buf := ByteArray new: 1024. + [socket dataAvailable + ifTrue: + [[count := socket receiveDataInto: buf. + ^buf copyFrom: 1 to: count] + on: Error + do: [:ex | ^ nil]] + ifFalse: + [[socket waitForDataFor: 10] on: Error do: [:e | ]]. + socket isConnected] + whileTrue. + ^nil +] + +{ #category : #accessing } +NetworkEndpoint >> isConnected [ + + ^socket notNil and: [socket isConnected] +] + +{ #category : #accessing } +NetworkEndpoint >> name [ + "Answer the name of the peer." + + (socket isNil or: [socket isConnected not]) + ifTrue: [^'not connected']. + ^NetNameResolver stringFromAddress: socket remoteAddress +] + +{ #category : #'protocol stack' } +NetworkEndpoint >> note: aSymbol with: anObject [ + + super note: aSymbol with: anObject. + aSymbol == #oobInlineEndpoint ifTrue: [^socket setOption: 'SO_OOBINLINE' value: 1]. + aSymbol == #savePreferences ifTrue: [^self savePreferences: anObject]. +] + +{ #category : #debugging } +NetworkEndpoint >> rcvd: char [ + + | str | + str := char asInteger printStringBase: 16. + str := str copyFrom: 4 to: str size. + Transcript cr; nextPut: $<; tab; nextPutAll: (str padded: #left to: 2 with: $0); tab; nextPut: char asCharacter +] + +{ #category : #'protocol stack' } +NetworkEndpoint >> run [ + + self isConnected ifTrue: [self sessionNote: #connectedTo with: self name]. + super run +] + +{ #category : #private } +NetworkEndpoint >> savePreferences: dict [ + + dict at: #endpointClass put: self class name. + dict at: #endpointCreate put: #newConnection:port:. + dict at: #endpointArguments put: (Array with: socket name with: socket remotePort) +] + +{ #category : #debugging } +NetworkEndpoint >> sent: char [ + + | str | + str := char asInteger printStringBase: 16. + str := str copyFrom: 4 to: str size. + Transcript cr; nextPut: $>; tab; nextPutAll: (str padded: #left to: 2 with: $0); tab; nextPut: char asCharacter +] + +{ #category : #accessing } +NetworkEndpoint >> socket [ + + ^socket +] + +{ #category : #'initialize-release' } +NetworkEndpoint >> socket: aSocket [ + + socket := aSocket +] diff --git a/source/LayeredProtocol/ProtocolAdaptor.class.st b/source/LayeredProtocol/ProtocolAdaptor.class.st new file mode 100644 index 0000000..ed95c20 --- /dev/null +++ b/source/LayeredProtocol/ProtocolAdaptor.class.st @@ -0,0 +1,166 @@ +" +I am a pluggable ProtocolLayer. You can insert me anywhere in a LayeredProtocol stack. + +Communication between protocol stack layers is accomplished using the following messages: + + upcall: datum -- receive data from the protocol below me in the stack + downcall: datum -- receive data from the protocol above me + flush -- the protocol below me might become idle for a while + note: aSymbol with: anObject -- I am being informed that something ""global"" has happened + +By default I am completely transparent. In other words I react to the above messages as follows: + + upcall: datum -- I pass datum on to the protocol above me + downcall: dataum -- I pass datum on to the protocol below me + flush -- I pass the message to the protocol above me + note: sym with: obj -- is ignored entirely + +Any or all of these default reactions can be changed by installing blocks which I will execute in response to the above messages. You install such blocks by sending me the following messages: + + upBlock: unaryBlock -- evaluated on #up: passing datum as argument + downBlock: unaryBlock -- evaluated on #down: passing datum as argument + flushBlock: aBlock -- evaulated on #flush with no arguments + noteBlock: binaryBlock -- evaulated on #note:with: passing aSym and anObj as arguments + +By now you've probably guess that my default behaviour is simply to install the following blocks when I am created: + + upBlock: [:datum | up upcall: datum] + downBlock: [:datum | down downcall: datum] + flushBlock: [] + noteBlock: [:aSymbol :anObject | ] + +My class knows how to instantiate particular kinds of default behaviour in me, including: + + pass -- the default (transparency) + trace -- prints each datum on the Transcript as it whizzes by + reflect -- bounces downward data back up the stack and vice-versa + +Here's one example, possibly the shortest known means to create an ""echo"" server: + + (NetworkEndpoint socket: anAcceptedSocket) asProtocolStack + push: ProtocolAdaptor reflect; + install; + run +" +Class { + #name : #ProtocolAdaptor, + #superclass : #ProtocolLayer, + #instVars : [ + 'upBlock', + 'downBlock', + 'flushBlock', + 'noteBlock' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #'instance creation' } +ProtocolAdaptor class >> new [ + + ^super new initialize +] + +{ #category : #'instance creation' } +ProtocolAdaptor class >> upBlock: aBlock [ + + ^self new upBlock: aBlock +] + +{ #category : #accessing } +ProtocolAdaptor >> downBlock: block [ + + downBlock := block +] + +{ #category : #protocol } +ProtocolAdaptor >> downcall: arg [ + + downBlock value: arg +] + +{ #category : #protocol } +ProtocolAdaptor >> flush [ + + flushBlock value +] + +{ #category : #accessing } +ProtocolAdaptor >> flushBlock: block [ + + flushBlock := block +] + +{ #category : #'initialize-release' } +ProtocolAdaptor >> initialize [ + + upBlock := [:arg | self notify: 'up ' , arg printString]. + downBlock := [:arg | self notify: 'down ' , arg printString]. + flushBlock := []. + noteBlock := [:s :a | ] +] + +{ #category : #'canned protocols' } +ProtocolAdaptor >> localEcho [ + "A reflect suitable for local echo on dumb ttys, when placed immediately below a TtyMorph, recognising a few of the ASCII control characters." + + | c | + ^self + upBlock: [:arg | down downcall: arg]; + downBlock: [:arg | c := arg bitAnd: 127. + (c == 8) | (c == 127) ifTrue: [up bs; upcall: 32; bs] + ifFalse: [(c == 10) | (c == 13) ifTrue: [up newline] + ifFalse: [c >= 32 ifTrue: [up upcall: c]]]. + up flush.] +] + +{ #category : #protocol } +ProtocolAdaptor >> note: aSymbol with: anObject [ + + noteBlock value: aSymbol value: anObject +] + +{ #category : #accessing } +ProtocolAdaptor >> noteBlock: block [ + + noteBlock := block +] + +{ #category : #'canned protocols' } +ProtocolAdaptor >> pass [ + + ^self + upBlock: [:arg | up upcall: arg]; + downBlock: [:arg | down downcall: arg] +] + +{ #category : #'canned protocols' } +ProtocolAdaptor >> reflect [ + + ^self + upBlock: [:arg | down downcall: arg]; + downBlock: [:arg | up upcall: arg; flush] +] + +{ #category : #'canned protocols' } +ProtocolAdaptor >> trace [ + + ^self + upBlock: [:arg | + Transcript cr; nextPutAll: 'up ' , arg printString; endEntry. + up upcall: arg]; + downBlock: [:arg | + Transcript cr; nextPutAll: 'down ' , arg printString; endEntry. + down downcall: arg] +] + +{ #category : #accessing } +ProtocolAdaptor >> upBlock: block [ + + upBlock := block +] + +{ #category : #protocol } +ProtocolAdaptor >> upcall: arg [ + + upBlock value: arg +] diff --git a/source/LayeredProtocol/ProtocolEndpoint.class.st b/source/LayeredProtocol/ProtocolEndpoint.class.st new file mode 100644 index 0000000..d56d0a4 --- /dev/null +++ b/source/LayeredProtocol/ProtocolEndpoint.class.st @@ -0,0 +1,88 @@ +" +I am an abstract endpoint for communication within a LayeredProtocol stack. (I therefore expect to be the lowest element in that stack.) I implement a server which waits for incoming data and then passes it up the stack for processing by higher protocol layers. The actual reading of data from the remote entity must be implemented by my concrete subclasses. +" +Class { + #name : #ProtocolEndpoint, + #superclass : #ProtocolLayer, + #instVars : [ + 'serverProcess' + ], + #category : 'LayeredProtocol-Endpoints' +} + +{ #category : #protocol } +ProtocolEndpoint >> close [ + "Terminate the connection to the remote entity." + + ^self subclassResponsibility +] + +{ #category : #protocol } +ProtocolEndpoint >> downcall: anObject [ + "Receive anObject from my high protocol. The default behaviour (in Protocol) is to pass it down to my low protocol. ProtocolEndpoints however are at the bottom of the ProtocolStack and thus have no low protocol, so they have to treat this specially (e.g., by sending the data over the network or to another process)." + + ^self subclassResponsibility +] + +{ #category : #'server loop' } +ProtocolEndpoint >> getData [ + "Answer a collection of data to be passed up the protocol stack, or nil if the endpoint has failed." + + ^self subclassResponsibility +] + +{ #category : #protocol } +ProtocolEndpoint >> isConnected [ + "Answer whether the endpoint is still connected." + + ^self subclassResponsibility +] + +{ #category : #protocol } +ProtocolEndpoint >> name [ + "Answer the name of the remote entity." + + ^self subclassResponsibility +] + +{ #category : #protocol } +ProtocolEndpoint >> note: aSymbol with: anObject [ + + super note: aSymbol with: anObject. + aSymbol == #endpointClosed ifTrue: [^self terminateServer]. + aSymbol == #windowClosed ifTrue: [^self close]. +] + +{ #category : #protocol } +ProtocolEndpoint >> run [ + "Spawn a background process running the serverLoop." + + super run. + serverProcess := [self serverLoop] forkAt: Processor userBackgroundPriority. +] + +{ #category : #'server loop' } +ProtocolEndpoint >> serverLoop [ + "I sit in a loop (usually in a background Process) waiting for data to arrive on my underlying connection then pass anything received up to my high protocol. When #getData answers nil to inform me that my underlying connection has been destroyed I close down the entire endpoint, inform my session of the fact and then exit. See also ProtocolEndpoint>>run." + + | buf | + [[(buf := self getData) notNil] whileTrue: [up upcallAll: buf]] + on: Error + do: [:ex | ex pass]. + serverProcess := nil. + self sessionNote: #endpointClosed. + self session ifNotNil: [self session kill]. + +] + +{ #category : #'server loop' } +ProtocolEndpoint >> terminateServer [ + "Terminate the serverLoop process. This should never be called directly: use #close instead." + + serverProcess isNil + ifFalse: + [serverProcess terminate. + serverProcess _ nil. + self sessionNote: #disconnected. + Transcript cr; show: self class name, ' server terminated'] +] diff --git a/source/LayeredProtocol/ProtocolLayer.class.st b/source/LayeredProtocol/ProtocolLayer.class.st new file mode 100644 index 0000000..84dfed0 --- /dev/null +++ b/source/LayeredProtocol/ProtocolLayer.class.st @@ -0,0 +1,177 @@ +" +I am a single layer in a LayeredProtocol stack. I pass information up and down the stack, possibly transforming it in the process. + +Structure: + down (ProtocolLayer) My low protocol, one element closer to the ""remote connection"" end of the stack. + up (ProtocolLayer) My high protocol, one element closer to the user interface or other ""local client"". + session (LayeredProtocol) The entire collection of ProtocolLayers of which I am one. + +" +Class { + #name : #ProtocolLayer, + #superclass : #Object, + #instVars : [ + 'session', + 'up', + 'down' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #control } +ProtocolLayer >> asProtocolStack [ + "Answer a new LayeredProtocol in which I am the lowest element." + + ^LayeredProtocol on: self +] + +{ #category : #stack } +ProtocolLayer >> basicDowncallAll: chunk [ + + down notNil ifTrue: [down downcallAll: chunk]. + +] + +{ #category : #stack } +ProtocolLayer >> basicUpcallAll: chunk [ + + (up notNil and: [chunk notNil]) ifTrue: [up upcallAll: chunk]. + +] + +{ #category : #control } +ProtocolLayer >> close [ + "Perform any additional actions when stopping the protocol (i.e., just after data transfer ends)." +] + +{ #category : #accessing } +ProtocolLayer >> down: protoLo [ + + down := protoLo +] + +{ #category : #stack } +ProtocolLayer >> downcall: anObject [ + "Receive anObject from my high protocol. The default behaviour is to pass it down unmodified to my low protocol (i.e., I am transparent)." + + down downcall: anObject +] + +{ #category : #stack } +ProtocolLayer >> downcallAll: aCollection [ + "Receive aCollection of data from my high protocol. The default behaviour is to act as if each datum was received individually." + + aCollection do: [:elt | self downcall: elt] +] + +{ #category : #stack } +ProtocolLayer >> flush [ + "Inform my high protocol that we might be about to pause for a while." + + up flush +] + +{ #category : #control } +ProtocolLayer >> install [ + "Perform any additional actions when creating the initial up/down connections between elements in the ProtocolStack." +] + +{ #category : #testing } +ProtocolLayer >> isConnected [ + + ^false +] + +{ #category : #session } +ProtocolLayer >> note: aSymbol with: anArgument [ + "My session is informing me that something has happened. By default I don't care about it." +] + +{ #category : #stack } +ProtocolLayer >> passUp: anObject [ + "Pass anObject up to my high protocol." + + up upcall: anObject +] + +{ #category : #stack } +ProtocolLayer >> push: aProtocol [ + "Push aProtocol on top of the receiver." + + ^(LayeredProtocol on: self) push: aProtocol +] + +{ #category : #control } +ProtocolLayer >> run [ + "Perform any additional actions when starting the protocol running (i.e., just before data transfer begins)." +] + +{ #category : #accessing } +ProtocolLayer >> session [ + + ^session +] + +{ #category : #accessing } +ProtocolLayer >> session: aSession [ + + session := aSession +] + +{ #category : #session } +ProtocolLayer >> sessionNote: aSymbol [ + "Tell my session that something has happened. If I have no session then do nothing." + + session isNil ifFalse: [session note: aSymbol with: nil] +] + +{ #category : #session } +ProtocolLayer >> sessionNote: aSymbol with: anArgument [ + "Tell my session that something has happened. If I have no session then do nothing." + + session isNil ifFalse: [session note: aSymbol with: anArgument] +] + +{ #category : #control } +ProtocolLayer >> stop [ + "Perform any additional actions when stopping the protocol (i.e., just after data transfer ends)." +] + +{ #category : #diagnostics } +ProtocolLayer >> ttyCR [ + + self ttyMsg: String cr +] + +{ #category : #diagnostics } +ProtocolLayer >> ttyMsg: aString [ + + aString withInternetLineEndings asByteArray do: [:b | up upcall: b]. + up flush +] + +{ #category : #diagnostics } +ProtocolLayer >> ttyMsgCR: aString [ + + self ttyMsg: aString, String cr +] + +{ #category : #accessing } +ProtocolLayer >> up: protoHi [ + + up := protoHi +] + +{ #category : #stack } +ProtocolLayer >> upcall: anObject [ + "Receive anObject from my low protocol. Default is to pass it on to my high protocol unmodified (in other words, I am transparent)." + + up upcall: anObject +] + +{ #category : #stack } +ProtocolLayer >> upcallAll: aCollection [ + "Receive aCollection of data from my low protocol. By default I act as if each datum had been received individually." + + aCollection do: [:b | self upcall: b] +] diff --git a/source/LayeredProtocol/ProtocolLayerReadStrategy.class.st b/source/LayeredProtocol/ProtocolLayerReadStrategy.class.st new file mode 100644 index 0000000..13ecac9 --- /dev/null +++ b/source/LayeredProtocol/ProtocolLayerReadStrategy.class.st @@ -0,0 +1,18 @@ +Class { + #name : #ProtocolLayerReadStrategy, + #superclass : #ProtocolLayerStrategy, + #category : 'LayeredProtocol-Extras' +} + +{ #category : #protocol } +ProtocolLayerReadStrategy >> basicUpcallAll: chunk [ + + self protocolLayer basicUpcallAll: chunk. + +] + +{ #category : #protocol } +ProtocolLayerReadStrategy >> upcallAll: chunk [ + + self basicUpcallAll: chunk +] diff --git a/source/LayeredProtocol/ProtocolLayerStrategy.class.st b/source/LayeredProtocol/ProtocolLayerStrategy.class.st new file mode 100644 index 0000000..d4ab4ce --- /dev/null +++ b/source/LayeredProtocol/ProtocolLayerStrategy.class.st @@ -0,0 +1,30 @@ +Class { + #name : #ProtocolLayerStrategy, + #superclass : #Object, + #instVars : [ + 'protocolLayer' + ], + #category : 'LayeredProtocol-Extras' +} + +{ #category : #'instance creation' } +ProtocolLayerStrategy class >> newOnLayer: layer [ + + ^ self new + protocolLayer: layer; + yourself +] + +{ #category : #accessing } +ProtocolLayerStrategy >> protocolLayer [ + "Answer the receiver's instance variable protocolLayer." + + ^protocolLayer +] + +{ #category : #accessing } +ProtocolLayerStrategy >> protocolLayer: anObject [ + "Set the receiver's instance variable protocolLayer to anObject." + + protocolLayer := anObject +] diff --git a/source/LayeredProtocol/ProtocolLayerWriteStrategy.class.st b/source/LayeredProtocol/ProtocolLayerWriteStrategy.class.st new file mode 100644 index 0000000..3930975 --- /dev/null +++ b/source/LayeredProtocol/ProtocolLayerWriteStrategy.class.st @@ -0,0 +1,19 @@ +Class { + #name : #ProtocolLayerWriteStrategy, + #superclass : #ProtocolLayerStrategy, + #category : 'LayeredProtocol-Extras' +} + +{ #category : #protocol } +ProtocolLayerWriteStrategy >> basicDowncallAll: chunk [ + + self protocolLayer basicDowncallAll: chunk. + +] + +{ #category : #protocol } +ProtocolLayerWriteStrategy >> downcallAll: chunk [ + + self basicDowncallAll: chunk. + +] diff --git a/source/LayeredProtocol/ProtocolState.class.st b/source/LayeredProtocol/ProtocolState.class.st new file mode 100644 index 0000000..3d03bd1 --- /dev/null +++ b/source/LayeredProtocol/ProtocolState.class.st @@ -0,0 +1,146 @@ +" +I am a single state within a cyclic graph of states. My values are edges leading to another state in the graph. If the edge has an action associated with it then I perform the method of that name in my client object, passing the object which stepped me as argument, before following the edge. + +Structure: + name Symbol -- my state's name + keys Object -- the input tokens that cause me to step + values #(Symbol1 Symbol2) -- an edge: the next state and a client action selector + default #(Symbol1 Symbol2) -- the edge I follow if no key matches the stepping object + +I am intended to be inserted somewhere in the middle of a LayeredProtocol stack. +" +Class { + #name : #ProtocolState, + #superclass : #IdentityDictionary, + #instVars : [ + 'name', + 'default' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #examples } +ProtocolState class >> example [ + "ProtocolState example" + + ^(self name: #initial default: #echo: -> #initial) + at: 42 put: #echo42: -> #initial; + yourself +] + +{ #category : #'instance creation' } +ProtocolState class >> name: myName default: aTransition [ + ^self new + name: myName; + default: aTransition +] + +{ #category : #accessing } +ProtocolState >> add: anAssociation [ + + ^self transitionAt: anAssociation key put: (self transitionFor: anAssociation value) +] + +{ #category : #accessing } +ProtocolState >> addAll: anAssociation [ + + ^self atAll: anAssociation key put: anAssociation value +] + +{ #category : #accessing } +ProtocolState >> addAllInteger: anAssociation [ + + ^self atAllInteger: anAssociation key put: anAssociation value +] + +{ #category : #accessing } +ProtocolState >> addInteger: anAssociation [ + + ^self transitionAt: anAssociation key asInteger put: (self transitionFor: anAssociation value) +] + +{ #category : #accessing } +ProtocolState >> at: key put: transition [ + + ^self transitionAt: key put: (self transitionFor: transition) +] + +{ #category : #accessing } +ProtocolState >> at: anObject to: limit put: transition [ + + | edge | + edge := self transitionFor: transition. + anObject to: limit do: [:target | self transitionAt: target put: edge] +] + +{ #category : #accessing } +ProtocolState >> atAll: collection put: transition [ + | edge | + edge := self transitionFor: transition. + collection do: [:elt | self transitionAt: elt put: edge] +] + +{ #category : #accessing } +ProtocolState >> atAllInteger: collection put: transition [ + | edge | + edge := self transitionFor: transition. + collection do: [:elt | self transitionAt: elt asInteger put: edge] +] + +{ #category : #accessing } +ProtocolState >> default [ + + ^default +] + +{ #category : #accessing } +ProtocolState >> default: transition [ + + self defaultTransition: (self transitionFor: transition) +] + +{ #category : #accessing } +ProtocolState >> defaultTransition: aTransition [ + + default := aTransition +] + +{ #category : #accessing } +ProtocolState >> name [ + + ^name +] + +{ #category : #accessing } +ProtocolState >> name: aSymbol [ + + name := aSymbol +] + +{ #category : #printing } +ProtocolState >> printElementsOn: aStream [ + + aStream nextPutAll: '(name: ' , name printString. + aStream nextPutAll: ' default: ' , default printString. + aStream nextPutAll: ' transitions:'. + self associationsDo: [:transition | aStream space. transition printOn: aStream.]. + aStream nextPut: $). +] + +{ #category : #accessing } +ProtocolState >> transitionAt: key [ + + ^super at: key ifAbsent: [default] +] + +{ #category : #accessing } +ProtocolState >> transitionAt: key put: edge [ + + ^super at: key put: edge +] + +{ #category : #private } +ProtocolState >> transitionFor: transition [ + + ^ProtocolStateTransition action: transition key state: transition value +] diff --git a/source/LayeredProtocol/ProtocolStateTransition.class.st b/source/LayeredProtocol/ProtocolStateTransition.class.st new file mode 100644 index 0000000..95ee418 --- /dev/null +++ b/source/LayeredProtocol/ProtocolStateTransition.class.st @@ -0,0 +1,79 @@ +" +I am a transition to a new ProtocolState. While making the transition I can perform some action association with the change from the old to the new state. +" +Class { + #name : #ProtocolStateTransition, + #superclass : #Object, + #instVars : [ + 'state', + 'action' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #'instance creation' } +ProtocolStateTransition class >> action: aSymbol [ + + ^self new state: nil; action: aSymbol +] + +{ #category : #'instance creation' } +ProtocolStateTransition class >> action: aSymbol state: aState [ + + ^self new state: aState; action: aSymbol +] + +{ #category : #'instance creation' } +ProtocolStateTransition class >> state: aState [ + + ^self new state: aState; action: nil +] + +{ #category : #'instance creation' } +ProtocolStateTransition class >> state: aState action: aSymbol [ + + ^self new state: aState; action: aSymbol +] + +{ #category : #accessing } +ProtocolStateTransition >> action [ + + ^action +] + +{ #category : #accessing } +ProtocolStateTransition >> action: aSymbol [ + + action := aSymbol +] + +{ #category : #printing } +ProtocolStateTransition >> printOn: aStream [ + + aStream nextPut: ${. + action printOn: aStream. + aStream nextPutAll: ' -> '. + aStream nextPutAll: ((state isMemberOf: Symbol) + ifTrue: [state] + ifFalse: [state name]) printString. + aStream nextPut: $} +] + +{ #category : #accessing } +ProtocolStateTransition >> state [ + + ^state +] + +{ #category : #accessing } +ProtocolStateTransition >> state: aState [ + + state := aState +] + +{ #category : #'state transitions' } +ProtocolStateTransition >> transitionFrom: lastState for: aClient with: anObject [ + + action isNil ifFalse: [aClient perform: action with: anObject]. + ^state isNil ifTrue: [lastState] ifFalse: [state] +] diff --git a/source/LayeredProtocol/StatefulChunkProtocol.class.st b/source/LayeredProtocol/StatefulChunkProtocol.class.st new file mode 100644 index 0000000..11a1ee6 --- /dev/null +++ b/source/LayeredProtocol/StatefulChunkProtocol.class.st @@ -0,0 +1,39 @@ +Class { + #name : #StatefulChunkProtocol, + #superclass : #StatefulProtocol, + #category : 'LayeredProtocol-Extras' +} + +{ #category : #protocol } +StatefulChunkProtocol >> downcall: aByte [ + + down downcall: aByte +] + +{ #category : #protocol } +StatefulChunkProtocol >> downcallAll: chunks [ + + down downcallAll: chunks. +] + +{ #category : #protocol } +StatefulChunkProtocol >> transitionEvent: anEvent with: anObject [ + + currentState := (currentState transitionAt: anEvent) + transitionFrom: currentState for: client with: anObject +] + +{ #category : #protocol } +StatefulChunkProtocol >> upcall: aChunkStream [ + + self shouldNotImplement +] + +{ #category : #protocol } +StatefulChunkProtocol >> upcallAll: chunk [ + + | chunkStream | + chunkStream := chunk readStream. + self transitionEvent: chunkStream next with: chunkStream. + +] diff --git a/source/LayeredProtocol/StatefulProtocol.class.st b/source/LayeredProtocol/StatefulProtocol.class.st new file mode 100644 index 0000000..ba3a60a --- /dev/null +++ b/source/LayeredProtocol/StatefulProtocol.class.st @@ -0,0 +1,57 @@ +" +I am a ProtocolLayer. I implement my protocol as a state machine, transitioning from one state to another according to patterns that I recognise in the data flowing through me. +" +Class { + #name : #StatefulProtocol, + #superclass : #ProtocolLayer, + #instVars : [ + 'currentState', + 'client' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #'instance creation' } +StatefulProtocol class >> initialState: stateNode [ + + ^self new initialState: stateNode +] + +{ #category : #'instance creation' } +StatefulProtocol class >> initialState: stateNode client: aClient [ + + ^self new initialState: stateNode; client: aClient +] + +{ #category : #accessing } +StatefulProtocol >> client: anObject [ + + client := anObject +] + +{ #category : #accessing } +StatefulProtocol >> initialState: stateNode [ + + currentState := stateNode. + self client: self +] + +{ #category : #accessing } +StatefulProtocol >> state [ + + ^currentState +] + +{ #category : #protocol } +StatefulProtocol >> transitionEvent: anEvent with: anObject [ + + currentState := (currentState transitionAt: anEvent) + transitionFrom: currentState for: client with: anObject +] + +{ #category : #protocol } +StatefulProtocol >> upcall: anObject [ + + currentState := (currentState transitionAt: anObject) + transitionFrom: currentState for: client with: anObject +] diff --git a/source/LayeredProtocol/StatefulProtocolDescription.class.st b/source/LayeredProtocol/StatefulProtocolDescription.class.st new file mode 100644 index 0000000..90e3b8d --- /dev/null +++ b/source/LayeredProtocol/StatefulProtocolDescription.class.st @@ -0,0 +1,113 @@ +" +I am a collection of ProtocolStates constituting a transition graph for a StatefulProtocol. See my class side for some examples of how I construct state machine descriptions for you. + +Note that before I can be used to drive a StatefulProtocol you *must* send me #compile. I will answer the initial ProtocolState in the compiled transition graph. (I will also complain if your protocol is broken. ;-) You subsequently pass this ProtocolState as the argument to StatefulProtocol class>>initialState: in order to instantiate a new StatefulProtocol. + +Structure: + initialState Symbol -- the name of the initial (root) node in my transition graph +" +Class { + #name : #StatefulProtocolDescription, + #superclass : #IdentityDictionary, + #instVars : [ + 'initialState' + ], + #category : 'LayeredProtocol-Abstract' +} + +{ #category : #examples } +StatefulProtocolDescription class >> example [ + "A state machine that recognises occurrences of 'x' 'xy' and 'xy[digits...]z' in a stream of characters. Note: this is used by StateMachineTester, so don't modify it. See StateMachineTester class>>test for an example of use." + "StatefulProtocolDescription example" + + | desc | + desc := self new. + (desc newState: #initial -> (#echo: -> #initial)) add: $x -> (nil -> #statex). + (desc newState: #statex -> (#echox: -> #initial)) add: $y -> (#initPrefix: -> #statexy). + (desc newState: #statexy -> (#echoxy: -> #initial)) + add: $z -> (#echoxyz: -> #initial); + addAll: '0123456789' -> (#addPrefix: -> nil). + desc initialState: #initial. + ^desc +] + +{ #category : #examples } +StatefulProtocolDescription class >> example2 [ + "StatefulProtocolDescription example2 explore" + + ^self example compile +] + +{ #category : #examples } +StatefulProtocolDescription class >> example3 [ "Note: this example should pop up an error notifier during compilation" + + "StatefulProtocolDescription example3 compile" + + | desc | + desc := self new. + (desc newState: #initial -> (#echo: -> #initial)) add: $x -> (nil -> #statex). + (desc newState: #statex -> (#echox: -> #initial)) add: $y -> (nil -> #statexy). + (desc newState: #statexy -> (#echoxy: -> #initial)) add: $z -> (#echoxy: -> #statexyz). + desc initialState: #initial. + ^desc +] + +{ #category : #'instance creation' } +StatefulProtocolDescription class >> initialState: stateName [ + + ^self new initialState: stateName +] + +{ #category : #compiling } +StatefulProtocolDescription >> compile [ + "Compile my symbolic representation into a cyclic DAG and answer the root node" + + | edge | + self valuesDo: [:state | + state defaultTransition: (self resolve: state default). + state keysDo: [:key | + edge := state at: key. + state transitionAt: key put: (self resolve: edge)]]. + + ^self at: initialState +] + +{ #category : #'initialize-release' } +StatefulProtocolDescription >> initialState: stateName [ + + initialState := stateName +] + +{ #category : #'initialize-release' } +StatefulProtocolDescription >> newState: rule [ + + ^self newState: rule key default: rule value +] + +{ #category : #'initialize-release' } +StatefulProtocolDescription >> newState: stateName default: transition [ + + ^self at: stateName put: (ProtocolState name: stateName default: transition) +] + +{ #category : #printing } +StatefulProtocolDescription >> printElementsOn: aStream [ + + aStream nextPutAll: '(initial: ' , initialState printString , ' states:'. + self keysDo: [:key | aStream space. key printOn: aStream]. + aStream nextPut: $) +] + +{ #category : #compiling } +StatefulProtocolDescription >> resolve: edge [ + + | target action | + target := edge state. + action := edge action. + target := (self includesKey: target) + ifTrue: [self at: target] + ifFalse: [target isNil + ifTrue: [nil] + ifFalse: [self error: 'unknown target state ' , edge printString]]. + ^ProtocolStateTransition action: action state: target +] diff --git a/source/LayeredProtocol/StreamProtocolAdaptor.class.st b/source/LayeredProtocol/StreamProtocolAdaptor.class.st new file mode 100644 index 0000000..444cd71 --- /dev/null +++ b/source/LayeredProtocol/StreamProtocolAdaptor.class.st @@ -0,0 +1,180 @@ +Class { + #name : #StreamProtocolAdaptor, + #superclass : #ProtocolLayer, + #instVars : [ + 'upBlock', + 'downBlock', + 'flushBlock', + 'noteBlock', + 'cannedString' + ], + #category : 'LayeredProtocol-Extras' +} + +{ #category : #'instance creation' } +StreamProtocolAdaptor class >> example [ + "Send 42 down a stack and then reflect it back up." + "StreamProtocolAdaptor example" + + (StreamProtocolAdaptor new reflect asProtocolStack + push: StreamProtocolAdaptor new trace; + push: StreamProtocolAdaptor new trace; + push: (StreamProtocolAdaptor new trace + upBlock: [:stream | Transcript cr; show: 'ping ' , stream upToEnd printString]); + install; + run; + first) downcall: 42 +] + +{ #category : #'instance creation' } +StreamProtocolAdaptor class >> new [ + + ^super new initialize +] + +{ #category : #'instance creation' } +StreamProtocolAdaptor class >> upBlock: aBlock [ + + ^self new upBlock: aBlock +] + +{ #category : #accessing } +StreamProtocolAdaptor >> cannedString [ + "Answer the value of cannedString" + + ^ cannedString +] + +{ #category : #accessing } +StreamProtocolAdaptor >> cannedString: anObject [ + "Set the value of cannedString" + + cannedString := anObject +] + +{ #category : #control } +StreamProtocolAdaptor >> close [ +] + +{ #category : #accessing } +StreamProtocolAdaptor >> downBlock: anObject [ + "Set the receiver's instance variable downBlock to anObject." + + downBlock := anObject +] + +{ #category : #protocol } +StreamProtocolAdaptor >> downcall: arg [ + + self downcallAll: (ByteArray with: arg) +] + +{ #category : #protocol } +StreamProtocolAdaptor >> downcallAll: bytes [ + + downBlock value: bytes. + +] + +{ #category : #protocol } +StreamProtocolAdaptor >> flush [ + + flushBlock value +] + +{ #category : #accessing } +StreamProtocolAdaptor >> flushBlock: anObject [ + "Set the receiver's instance variable flushBlock to anObject." + + flushBlock := anObject +] + +{ #category : #initialization } +StreamProtocolAdaptor >> initialize [ + + self pass. + flushBlock := []. + noteBlock := [:s :a | ] +] + +{ #category : #control } +StreamProtocolAdaptor >> kill [ +] + +{ #category : #protocol } +StreamProtocolAdaptor >> note: aSymbol with: anObject [ + + noteBlock value: aSymbol value: anObject +] + +{ #category : #accessing } +StreamProtocolAdaptor >> noteBlock: anObject [ + "Set the receiver's instance variable noteBlock to anObject." + + noteBlock := anObject +] + +{ #category : #'canned protocols' } +StreamProtocolAdaptor >> pass [ + + self cannedString: 'pass'. + ^self + upBlock: [:chunk | up upcallAll: chunk]; + downBlock: [:chunk | down downcallAll: chunk] +] + +{ #category : #'canned protocols' } +StreamProtocolAdaptor >> reflect [ + + self cannedString: 'reflect'. + ^self + upBlock: [:chunk | down downcallAll: chunk]; + downBlock: [:chunk | up upcallAll: chunk; flush] + +] + +{ #category : #'canned protocols' } +StreamProtocolAdaptor >> reflectDown [ + + self cannedString: 'reflectDown'. + ^self + upBlock: [:chunk | down downcallAll: chunk]; + downBlock: [:chunk | down downcallAll: chunk] + +] + +{ #category : #'canned protocols' } +StreamProtocolAdaptor >> trace [ + + self cannedString: 'trace'. + ^self + upBlock: [:chunk | + Transcript cr; nextPutAll: 'up ' , chunk asString; endEntry. + self triggerEvent: #upcallAll. + up ifNotNil: [:localUp | localUp upcallAll: chunk]]; + downBlock: [:chunk | + Transcript cr; nextPutAll: 'down ' , chunk asString; endEntry. + self triggerEvent: #downcallAll. + down ifNotNil: [:localDown | localDown downcallAll: chunk]] +] + +{ #category : #accessing } +StreamProtocolAdaptor >> upBlock: anObject [ + "Set the receiver's instance variable upBlock to anObject." + + upBlock := anObject +] + +{ #category : #protocol } +StreamProtocolAdaptor >> upcall: arg [ + + self upcallAll: (ByteArray with: arg). + +] + +{ #category : #protocol } +StreamProtocolAdaptor >> upcallAll: bytes [ + + upBlock value: bytes. + +] diff --git a/source/LayeredProtocol/package.st b/source/LayeredProtocol/package.st new file mode 100644 index 0000000..6235aec --- /dev/null +++ b/source/LayeredProtocol/package.st @@ -0,0 +1 @@ +Package { #name : #LayeredProtocol } diff --git a/source/OpenPGP.package/.filetree b/source/OpenPGP.package/.filetree deleted file mode 100644 index 8998102..0000000 --- a/source/OpenPGP.package/.filetree +++ /dev/null @@ -1,4 +0,0 @@ -{ - "noMethodMetaData" : true, - "separateMethodMetaAndSource" : false, - "useCypressPropertiesFile" : true } diff --git a/source/OpenPGP.package/CAST5.class/README.md b/source/OpenPGP.package/CAST5.class/README.md deleted file mode 100644 index 5feb62e..0000000 --- a/source/OpenPGP.package/CAST5.class/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The CAST5 encryption algorithm. AFAIK, all key sizes specified in the standard are supported. See CAST5TestCase for test data. - -Instance Variables: -shortKey whether the key is short (< 48 bits) or long. Used to determine number of rounds. \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/class/initialize.st b/source/OpenPGP.package/CAST5.class/class/initialize.st deleted file mode 100644 index 19952eb..0000000 --- a/source/OpenPGP.package/CAST5.class/class/initialize.st +++ /dev/null @@ -1,268 +0,0 @@ -class initialization -initialize - "CAST5 initialize" - S1 := self sBoxFrom: ' - 30fb40d4 9fa0ff0b 6beccd2f 3f258c7a 1e213f2f 9c004dd3 6003e540 cf9fc949 - bfd4af27 88bbbdb5 e2034090 98d09675 6e63a0e0 15c361d2 c2e7661d 22d4ff8e - 28683b6f c07fd059 ff2379c8 775f50e2 43c340d3 df2f8656 887ca41a a2d2bd2d - a1c9e0d6 346c4819 61b76d87 22540f2f 2abe32e1 aa54166b 22568e3a a2d341d0 - 66db40c8 a784392f 004dff2f 2db9d2de 97943fac 4a97c1d8 527644b7 b5f437a7 - b82cbaef d751d159 6ff7f0ed 5a097a1f 827b68d0 90ecf52e 22b0c054 bc8e5935 - 4b6d2f7f 50bb64a2 d2664910 bee5812d b7332290 e93b159f b48ee411 4bff345d - fd45c240 ad31973f c4f6d02e 55fc8165 d5b1caad a1ac2dae a2d4b76d c19b0c50 - 882240f2 0c6e4f38 a4e4bfd7 4f5ba272 564c1d2f c59c5319 b949e354 b04669fe - b1b6ab8a c71358dd 6385c545 110f935d 57538ad5 6a390493 e63d37e0 2a54f6b3 - 3a787d5f 6276a0b5 19a6fcdf 7a42206a 29f9d4d5 f61b1891 bb72275e aa508167 - 38901091 c6b505eb 84c7cb8c 2ad75a0f 874a1427 a2d1936b 2ad286af aa56d291 - d7894360 425c750d 93b39e26 187184c9 6c00b32d 73e2bb14 a0bebc3c 54623779 - 64459eab 3f328b82 7718cf82 59a2cea6 04ee002e 89fe78e6 3fab0950 325ff6c2 - 81383f05 6963c5c8 76cb5ad6 d49974c9 ca180dcf 380782d5 c7fa5cf6 8ac31511 - 35e79e13 47da91d0 f40f9086 a7e2419e 31366241 051ef495 aa573b04 4a805d8d - 548300d0 00322a3c bf64cddf ba57a68e 75c6372b 50afd341 a7c13275 915a0bf5 - 6b54bfab 2b0b1426 ab4cc9d7 449ccd82 f7fbf265 ab85c5f3 1b55db94 aad4e324 - cfa4bd3f 2deaa3e2 9e204d02 c8bd25ac eadf55b3 d5bd9e98 e31231b2 2ad5ad6c - 954329de adbe4528 d8710f69 aa51c90f aa786bf6 22513f1e aa51a79b 2ad344cc - 7b5a41f0 d37cfbad 1b069505 41ece491 b4c332e6 032268d4 c9600acc ce387e6d - bf6bb16c 6a70fb78 0d03d9c9 d4df39de e01063da 4736f464 5ad328d8 b347cc96 - 75bb0fc3 98511bfb 4ffbcc35 b58bcf6a e11f0abc bfc5fe4a a70aec10 ac39570a - 3f04442f 6188b153 e0397a2e 5727cb79 9ceb418f 1cacd68d 2ad37c96 0175cb9d - c69dff09 c75b65f0 d9db40d8 ec0e7779 4744ead4 b11c3274 dd24cb9e 7e1c54bd - f01144f9 d2240eb1 9675b3fd a3ac3755 d47c27af 51c85f4d 56907596 a5bb15e6 - 580304f0 ca042cf1 011a37ea 8dbfaadb 35ba3e4a 3526ffa0 c37b4d09 bc306ed9 - 98a52666 5648f725 ff5e569d 0ced63d0 7c63b2cf 700b45e1 d5ea50f1 85a92872 - af1fbda7 d4234870 a7870bf3 2d3b4d79 42e04198 0cd0ede7 26470db8 f881814c - 474d6ad7 7c0c5e5c d1231959 381b7298 f5d2f4db ab838653 6e2f1e23 83719c9e - bd91e046 9a56456e dc39200c 20c8c571 962bda1c e1e696ff b141ab08 7cca89b9 - 1a69e783 02cc4843 a2f7c579 429ef47d 427b169c 5ac9f049 dd8f0f00 5c8165bf'. - S2 := self sBoxFrom: ' - 1f201094 ef0ba75b 69e3cf7e 393f4380 fe61cf7a eec5207a 55889c94 72fc0651 - ada7ef79 4e1d7235 d55a63ce de0436ba 99c430ef 5f0c0794 18dcdb7d a1d6eff3 - a0b52f7b 59e83605 ee15b094 e9ffd909 dc440086 ef944459 ba83ccb3 e0c3cdfb - d1da4181 3b092ab1 f997f1c1 a5e6cf7b 01420ddb e4e7ef5b 25a1ff41 e180f806 - 1fc41080 179bee7a d37ac6a9 fe5830a4 98de8b7f 77e83f4e 79929269 24fa9f7b - e113c85b acc40083 d7503525 f7ea615f 62143154 0d554b63 5d681121 c866c359 - 3d63cf73 cee234c0 d4d87e87 5c672b21 071f6181 39f7627f 361e3084 e4eb573b - 602f64a4 d63acd9c 1bbc4635 9e81032d 2701f50c 99847ab4 a0e3df79 ba6cf38c - 10843094 2537a95e f46f6ffe a1ff3b1f 208cfb6a 8f458c74 d9e0a227 4ec73a34 - fc884f69 3e4de8df ef0e0088 3559648d 8a45388c 1d804366 721d9bfd a58684bb - e8256333 844e8212 128d8098 fed33fb4 ce280ae1 27e19ba5 d5a6c252 e49754bd - c5d655dd eb667064 77840b4d a1b6a801 84db26a9 e0b56714 21f043b7 e5d05860 - 54f03084 066ff472 a31aa153 dadc4755 b5625dbf 68561be6 83ca6b94 2d6ed23b - eccf01db a6d3d0ba b6803d5c af77a709 33b4a34c 397bc8d6 5ee22b95 5f0e5304 - 81ed6f61 20e74364 b45e1378 de18639b 881ca122 b96726d1 8049a7e8 22b7da7b - 5e552d25 5272d237 79d2951c c60d894c 488cb402 1ba4fe5b a4b09f6b 1ca815cf - a20c3005 8871df63 b9de2fcb 0cc6c9e9 0beeff53 e3214517 b4542835 9f63293c - ee41e729 6e1d2d7c 50045286 1e6685f3 f33401c6 30a22c95 31a70850 60930f13 - 73f98417 a1269859 ec645c44 52c877a9 cdff33a6 a02b1741 7cbad9a2 2180036f - 50d99c08 cb3f4861 c26bd765 64a3f6ab 80342676 25a75e7b e4e6d1fc 20c710e6 - cdf0b680 17844d3b 31eef84d 7e0824e4 2ccb49eb 846a3bae 8ff77888 ee5d60f6 - 7af75673 2fdd5cdb a11631c1 30f66f43 b3faec54 157fd7fa ef8579cc d152de58 - db2ffd5e 8f32ce19 306af97a 02f03ef8 99319ad5 c242fa0f a7e3ebb0 c68e4906 - b8da230c 80823028 dcdef3c8 d35fb171 088a1bc8 bec0c560 61a3c9e8 bca8f54d - c72feffa 22822e99 82c570b4 d8d94e89 8b1c34bc 301e16e6 273be979 b0ffeaa6 - 61d9b8c6 00b24869 b7ffce3f 08dc283b 43daf65a f7e19798 7619b72f 8f1c9ba4 - dc8637a0 16a7d3b1 9fc393b7 a7136eeb c6bcc63e 1a513742 ef6828bc 520365d6 - 2d6a77ab 3527ed4b 821fd216 095c6e2e db92f2fb 5eea29cb 145892f5 91584f7f - 5483697b 2667a8cc 85196048 8c4bacea 833860d4 0d23e0f9 6c387e8a 0ae6d249 - b284600c d835731d dcb1c647 ac4c56ea 3ebd81b3 230eabb0 6438bc87 f0b5b1fa - 8f5ea2b3 fc184642 0a036b7a 4fb089bd 649da589 a345415e 5c038323 3e5d3bb9 - 43d79572 7e6dd07c 06dfdf1e 6c6cc4ef 7160a539 73bfbe70 83877605 4523ecf1'. - S3 := self sBoxFrom: ' - 8defc240 25fa5d9f eb903dbf e810c907 47607fff 369fe44b 8c1fc644 aececa90 - beb1f9bf eefbcaea e8cf1950 51df07ae 920e8806 f0ad0548 e13c8d83 927010d5 - 11107d9f 07647db9 b2e3e4d4 3d4f285e b9afa820 fade82e0 a067268b 8272792e - 553fb2c0 489ae22b d4ef9794 125e3fbc 21fffcee 825b1bfd 9255c5ed 1257a240 - 4e1a8302 bae07fff 528246e7 8e57140e 3373f7bf 8c9f8188 a6fc4ee8 c982b5a5 - a8c01db7 579fc264 67094f31 f2bd3f5f 40fff7c1 1fb78dfc 8e6bd2c1 437be59b - 99b03dbf b5dbc64b 638dc0e6 55819d99 a197c81c 4a012d6e c5884a28 ccc36f71 - b843c213 6c0743f1 8309893c 0feddd5f 2f7fe850 d7c07f7e 02507fbf 5afb9a04 - a747d2d0 1651192e af70bf3e 58c31380 5f98302e 727cc3c4 0a0fb402 0f7fef82 - 8c96fdad 5d2c2aae 8ee99a49 50da88b8 8427f4a0 1eac5790 796fb449 8252dc15 - efbd7d9b a672597d ada840d8 45f54504 fa5d7403 e83ec305 4f91751a 925669c2 - 23efe941 a903f12e 60270df2 0276e4b6 94fd6574 927985b2 8276dbcb 02778176 - f8af918d 4e48f79e 8f616ddf e29d840e 842f7d83 340ce5c8 96bbb682 93b4b148 - ef303cab 984faf28 779faf9b 92dc560d 224d1e20 8437aa88 7d29dc96 2756d3dc - 8b907cee b51fd240 e7c07ce3 e566b4a1 c3e9615e 3cf8209d 6094d1e3 cd9ca341 - 5c76460e 00ea983b d4d67881 fd47572c f76cedd9 bda8229c 127dadaa 438a074e - 1f97c090 081bdb8a 93a07ebe b938ca15 97b03cff 3dc2c0f8 8d1ab2ec 64380e51 - 68cc7bfb d90f2788 12490181 5de5ffd4 dd7ef86a 76a2e214 b9a40368 925d958f - 4b39fffa ba39aee9 a4ffd30b faf7933b 6d498623 193cbcfa 27627545 825cf47a - 61bd8ba0 d11e42d1 cead04f4 127ea392 10428db7 8272a972 9270c4a8 127de50b - 285ba1c8 3c62f44f 35c0eaa5 e805d231 428929fb b4fcdf82 4fb66a53 0e7dc15b - 1f081fab 108618ae fcfd086d f9ff2889 694bcc11 236a5cae 12deca4d 2c3f8cc5 - d2d02dfe f8ef5896 e4cf52da 95155b67 494a488c b9b6a80c 5c8f82bc 89d36b45 - 3a609437 ec00c9a9 44715253 0a874b49 d773bc40 7c34671c 02717ef6 4feb5536 - a2d02fff d2bf60c4 d43f03c0 50b4ef6d 07478cd1 006e1888 a2e53f55 b9e6d4bc - a2048016 97573833 d7207d67 de0f8f3d 72f87b33 abcc4f33 7688c55d 7b00a6b0 - 947b0001 570075d2 f9bb88f8 8942019e 4264a5ff 856302e0 72dbd92b ee971b69 - 6ea22fde 5f08ae2b af7a616d e5c98767 cf1febd2 61efc8c2 f1ac2571 cc8239c2 - 67214cb8 b1e583d1 b7dc3e62 7f10bdce f90a5c38 0ff0443d 606e6dc6 60543a49 - 5727c148 2be98a1d 8ab41738 20e1be24 af96da0f 68458425 99833be5 600d457d - 282f9350 8334b362 d91d1120 2b6d8da0 642b1e31 9c305a00 52bce688 1b03588a - f7baefd5 4142ed9c a4315c11 83323ec5 dfef4636 a133c501 e9d3531c ee353783'. - S4 := self sBoxFrom: ' - 9db30420 1fb6e9de a7be7bef d273a298 4a4f7bdb 64ad8c57 85510443 fa020ed1 - 7e287aff e60fb663 095f35a1 79ebf120 fd059d43 6497b7b1 f3641f63 241e4adf - 28147f5f 4fa2b8cd c9430040 0cc32220 fdd30b30 c0a5374f 1d2d00d9 24147b15 - ee4d111a 0fca5167 71ff904c 2d195ffe 1a05645f 0c13fefe 081b08ca 05170121 - 80530100 e83e5efe ac9af4f8 7fe72701 d2b8ee5f 06df4261 bb9e9b8a 7293ea25 - ce84ffdf f5718801 3dd64b04 a26f263b 7ed48400 547eebe6 446d4ca0 6cf3d6f5 - 2649abdf aea0c7f5 36338cc1 503f7e93 d3772061 11b638e1 72500e03 f80eb2bb - abe0502e ec8d77de 57971e81 e14f6746 c9335400 6920318f 081dbb99 ffc304a5 - 4d351805 7f3d5ce3 a6c866c6 5d5bcca9 daec6fea 9f926f91 9f46222f 3991467d - a5bf6d8e 1143c44f 43958302 d0214eeb 022083b8 3fb6180c 18f8931e 281658e6 - 26486e3e 8bd78a70 7477e4c1 b506e07c f32d0a25 79098b02 e4eabb81 28123b23 - 69dead38 1574ca16 df871b62 211c40b7 a51a9ef9 0014377b 041e8ac8 09114003 - bd59e4d2 e3d156d5 4fe876d5 2f91a340 557be8de 00eae4a7 0ce5c2ec 4db4bba6 - e756bdff dd3369ac ec17b035 06572327 99afc8b0 56c8c391 6b65811c 5e146119 - 6e85cb75 be07c002 c2325577 893ff4ec 5bbfc92d d0ec3b25 b7801ab7 8d6d3b24 - 20c763ef c366a5fc 9c382880 0ace3205 aac9548a eca1d7c7 041afa32 1d16625a - 6701902c 9b757a54 31d477f7 9126b031 36cc6fdb c70b8b46 d9e66a48 56e55a79 - 026a4ceb 52437eff 2f8f76b4 0df980a5 8674cde3 edda04eb 17a9be04 2c18f4df - b7747f9d ab2af7b4 efc34d20 2e096b7c 1741a254 e5b6a035 213d42f6 2c1c7c26 - 61c2f50f 6552daf9 d2c231f8 25130f69 d8167fa2 0418f2c8 001a96a6 0d1526ab - 63315c21 5e0a72ec 49bafefd 187908d9 8d0dbd86 311170a7 3e9b640c cc3e10d7 - d5cad3b6 0caec388 f73001e1 6c728aff 71eae2a1 1f9af36e cfcbd12f c1de8417 - ac07be6b cb44a1d8 8b9b0f56 013988c3 b1c52fca b4be31cd d8782806 12a3a4e2 - 6f7de532 58fd7eb6 d01ee900 24adffc2 f4990fc5 9711aac5 001d7b95 82e5e7d2 - 109873f6 00613096 c32d9521 ada121ff 29908415 7fbb977f af9eb3db 29c9ed2a - 5ce2a465 a730f32c d0aa3fe8 8a5cc091 d49e2ce7 0ce454a9 d60acd86 015f1919 - 77079103 dea03af6 78a8565e dee356df 21f05cbe 8b75e387 b3c50651 b8a5c3ef - d8eeb6d2 e523be77 c2154529 2f69efdf afe67afb f470c4b2 f3e0eb5b d6cc9876 - 39e4460c 1fda8538 1987832f ca007367 a99144f8 296b299e 492fc295 9266beab - b5676e69 9bd3ddda df7e052f db25701c 1b5e51ee f65324e6 6afce36c 0316cc04 - 8644213e b7dc59d0 7965291f ccd6fd43 41823979 932bcdf6 b657c34d 4edfd282 - 7ae5290c 3cb9536b 851e20fe 9833557e 13ecf0b0 d3ffb372 3f85c5c1 0aef7ed2'. - S5 := self sBoxFrom: ' - 7ec90c04 2c6e74b9 9b0e66df a6337911 b86a7fff 1dd358f5 44dd9d44 1731167f - 08fbf1fa e7f511cc d2051b00 735aba00 2ab722d8 386381cb acf6243a 69befd7a - e6a2e77f f0c720cd c4494816 ccf5c180 38851640 15b0a848 e68b18cb 4caadeff - 5f480a01 0412b2aa 259814fc 41d0efe2 4e40b48d 248eb6fb 8dba1cfe 41a99b02 - 1a550a04 ba8f65cb 7251f4e7 95a51725 c106ecd7 97a5980a c539b9aa 4d79fe6a - f2f3f763 68af8040 ed0c9e56 11b4958b e1eb5a88 8709e6b0 d7e07156 4e29fea7 - 6366e52d 02d1c000 c4ac8e05 9377f571 0c05372a 578535f2 2261be02 d642a0c9 - df13a280 74b55bd2 682199c0 d421e5ec 53fb3ce8 c8adedb3 28a87fc9 3d959981 - 5c1ff900 fe38d399 0c4eff0b 062407ea aa2f4fb1 4fb96976 90c79505 b0a8a774 - ef55a1ff e59ca2c2 a6b62d27 e66a4263 df65001f 0ec50966 dfdd55bc 29de0655 - 911e739a 17af8975 32c7911c 89f89468 0d01e980 524755f4 03b63cc9 0cc844b2 - bcf3f0aa 87ac36e9 e53a7426 01b3d82b 1a9e7449 64ee2d7e cddbb1da 01c94910 - b868bf80 0d26f3fd 9342ede7 04a5c284 636737b6 50f5b616 f24766e3 8eca36c1 - 136e05db fef18391 fb887a37 d6e7f7d4 c7fb7dc9 3063fcdf b6f589de ec2941da - 26e46695 b7566419 f654efc5 d08d58b7 48925401 c1bacb7f e5ff550f b6083049 - 5bb5d0e8 87d72e5a ab6a6ee1 223a66ce c62bf3cd 9e0885f9 68cb3e47 086c010f - a21de820 d18b69de f3f65777 fa02c3f6 407edac3 cbb3d550 1793084d b0d70eba - 0ab378d5 d951fb0c ded7da56 4124bbe4 94ca0b56 0f5755d1 e0e1e56e 6184b5be - 580a249f 94f74bc0 e327888e 9f7b5561 c3dc0280 05687715 646c6bd7 44904db3 - 66b4f0a3 c0f1648a 697ed5af 49e92ff6 309e374f 2cb6356a 85808573 4991f840 - 76f0ae02 083be84d 28421c9a 44489406 736e4cb8 c1092910 8bc95fc6 7d869cf4 - 134f616f 2e77118d b31b2be1 aa90b472 3ca5d717 7d161bba 9cad9010 af462ba2 - 9fe459d2 45d34559 d9f2da13 dbc65487 f3e4f94e 176d486f 097c13ea 631da5c7 - 445f7382 175683f4 cdc66a97 70be0288 b3cdcf72 6e5dd2f3 20936079 459b80a5 - be60e2db a9c23101 eba5315c 224e42f2 1c5c1572 f6721b2c 1ad2fff3 8c25404e - 324ed72f 4067b7fd 0523138e 5ca3bc78 dc0fd66e 75922283 784d6b17 58ebb16e - 44094f85 3f481d87 fcfeae7b 77b5ff76 8c2302bf aaf47556 5f46b02a 2b092801 - 3d38f5f7 0ca81f36 52af4a8a 66d5e7c0 df3b0874 95055110 1b5ad7a8 f61ed5ad - 6cf6e479 20758184 d0cefa65 88f7be58 4a046826 0ff6f8f3 a09c7f70 5346aba0 - 5ce96c28 e176eda3 6bac307f 376829d2 85360fa9 17e3fe2a 24b79767 f5a96b20 - d6cd2595 68ff1ebf 7555442c f19f06be f9e0659a eeb9491d 34010718 bb30cab8 - e822fe15 88570983 750e6249 da627e55 5e76ffa8 b1534546 6d47de08 efe9e7d4'. - S6 := self sBoxFrom: ' - f6fa8f9d 2cac6ce1 4ca34867 e2337f7c 95db08e7 016843b4 eced5cbc 325553ac - bf9f0960 dfa1e2ed 83f0579d 63ed86b9 1ab6a6b8 de5ebe39 f38ff732 8989b138 - 33f14961 c01937bd f506c6da e4625e7e a308ea99 4e23e33c 79cbd7cc 48a14367 - a3149619 fec94bd5 a114174a eaa01866 a084db2d 09a8486f a888614a 2900af98 - 01665991 e1992863 c8f30c60 2e78ef3c d0d51932 cf0fec14 f7ca07d2 d0a82072 - fd41197e 9305a6b0 e86be3da 74bed3cd 372da53c 4c7f4448 dab5d440 6dba0ec3 - 083919a7 9fbaeed9 49dbcfb0 4e670c53 5c3d9c01 64bdb941 2c0e636a ba7dd9cd - ea6f7388 e70bc762 35f29adb 5c4cdd8d f0d48d8c b88153e2 08a19866 1ae2eac8 - 284caf89 aa928223 9334be53 3b3a21bf 16434be3 9aea3906 efe8c36e f890cdd9 - 80226dae c340a4a3 df7e9c09 a694a807 5b7c5ecc 221db3a6 9a69a02f 68818a54 - ceb2296f 53c0843a fe893655 25bfe68a b4628abc cf222ebf 25ac6f48 a9a99387 - 53bddb65 e76ffbe7 e967fd78 0ba93563 8e342bc1 e8a11be9 4980740d c8087dfc - 8de4bf99 a11101a0 7fd37975 da5a26c0 e81f994f 9528cd89 fd339fed b87834bf - 5f04456d 22258698 c9c4c83b 2dc156be 4f628daa 57f55ec5 e2220abe d2916ebf - 4ec75b95 24f2c3c0 42d15d99 cd0d7fa0 7b6e27ff a8dc8af0 7345c106 f41e232f - 35162386 e6ea8926 3333b094 157ec6f2 372b74af 692573e4 e9a9d848 f3160289 - 3a62ef1d a787e238 f3a5f676 74364853 20951063 4576698d b6fad407 592af950 - 36f73523 4cfb6e87 7da4cec0 6c152daa cb0396a8 c50dfe5d fcd707ab 0921c42f - 89dff0bb 5fe2be78 448f4f33 754613c9 2b05d08d 48b9d585 dc049441 c8098f9b - 7dede786 c39a3373 42410005 6a091751 0ef3c8a6 890072d6 28207682 a9a9f7be - bf32679d d45b5b75 b353fd00 cbb0e358 830f220a 1f8fb214 d372cf08 cc3c4a13 - 8cf63166 061c87be 88c98f88 6062e397 47cf8e7a b6c85283 3cc2acfb 3fc06976 - 4e8f0252 64d8314d da3870e3 1e665459 c10908f0 513021a5 6c5b68b7 822f8aa0 - 3007cd3e 74719eef dc872681 073340d4 7e432fd9 0c5ec241 8809286c f592d891 - 08a930f6 957ef305 b7fbffbd c266e96f 6fe4ac98 b173ecc0 bc60b42a 953498da - fba1ae12 2d4bd736 0f25faab a4f3fceb e2969123 257f0c3d 9348af49 361400bc - e8816f4a 3814f200 a3f94043 9c7a54c2 bc704f57 da41e7f9 c25ad33a 54f4a084 - b17f5505 59357cbe edbd15c8 7f97c5ab ba5ac7b5 b6f6deaf 3a479c3a 5302da25 - 653d7e6a 54268d49 51a477ea 5017d55b d7d25d88 44136c76 0404a8c8 b8e5a121 - b81a928a 60ed5869 97c55b96 eaec991b 29935913 01fdb7f1 088e8dfa 9ab6f6f5 - 3b4cbf9f 4a5de3ab e6051d35 a0e1d855 d36b4cf1 f544edeb b0e93524 bebb8fbd - a2d762cf 49c92f54 38b5f331 7128a454 48392905 a65b1db8 851c97bd d675cf2f'. - S7 := self sBoxFrom: ' - 85e04019 332bf567 662dbfff cfc65693 2a8d7f6f ab9bc912 de6008a1 2028da1f - 0227bce7 4d642916 18fac300 50f18b82 2cb2cb11 b232e75c 4b3695f2 b28707de - a05fbcf6 cd4181e9 e150210c e24ef1bd b168c381 fde4e789 5c79b0d8 1e8bfd43 - 4d495001 38be4341 913cee1d 92a79c3f 089766be baeeadf4 1286becf b6eacb19 - 2660c200 7565bde4 64241f7a 8248dca9 c3b3ad66 28136086 0bd8dfa8 356d1cf2 - 107789be b3b2e9ce 0502aa8f 0bc0351e 166bf52a eb12ff82 e3486911 d34d7516 - 4e7b3aff 5f43671b 9cf6e037 4981ac83 334266ce 8c9341b7 d0d854c0 cb3a6c88 - 47bc2829 4725ba37 a66ad22b 7ad61f1e 0c5cbafa 4437f107 b6e79962 42d2d816 - 0a961288 e1a5c06e 13749e67 72fc081a b1d139f7 f9583745 cf19df58 bec3f756 - c06eba30 07211b24 45c28829 c95e317f bc8ec511 38bc46e9 c6e6fa14 bae8584a - ad4ebc46 468f508b 7829435f f124183b 821dba9f aff60ff4 ea2c4e6d 16e39264 - 92544a8b 009b4fc3 aba68ced 9ac96f78 06a5b79a b2856e6e 1aec3ca9 be838688 - 0e0804e9 55f1be56 e7e5363b b3a1f25d f7debb85 61fe033c 16746233 3c034c28 - da6d0c74 79aac56c 3ce4e1ad 51f0c802 98f8f35a 1626a49f eed82b29 1d382fe3 - 0c4fb99a bb325778 3ec6d97b 6e77a6a9 cb658b5c d45230c7 2bd1408b 60c03eb7 - b9068d78 a33754f4 f430c87d c8a71302 b96d8c32 ebd4e7be be8b9d2d 7979fb06 - e7225308 8b75cf77 11ef8da4 e083c858 8d6b786f 5a6317a6 fa5cf7a0 5dda0033 - f28ebfb0 f5b9c310 a0eac280 08b9767a a3d9d2b0 79d34217 021a718d 9ac6336a - 2711fd60 438050e3 069908a8 3d7fedc4 826d2bef 4eeb8476 488dcf25 36c9d566 - 28e74e41 c2610aca 3d49a9cf bae3b9df b65f8de6 92aeaf64 3ac7d5e6 9ea80509 - f22b017d a4173f70 dd1e16c3 15e0d7f9 50b1b887 2b9f4fd5 625aba82 6a017962 - 2ec01b9c 15488aa9 d716e740 40055a2c 93d29a22 e32dbf9a 058745b9 3453dc1e - d699296e 496cff6f 1c9f4986 dfe2ed07 b87242d1 19de7eae 053e561a 15ad6f8c - 66626c1c 7154c24c ea082b2a 93eb2939 17dcb0f0 58d4f2ae 9ea294fb 52cf564c - 9883fe66 2ec40581 763953c3 01d6692e d3a0c108 a1e7160e e4f2dfa6 693ed285 - 74904698 4c2b0edd 4f757656 5d393378 a132234f 3d321c5d c3f5e194 4b269301 - c79f022f 3c997e7e 5e4f9504 3ffafbbd 76f7ad0e 296693f4 3d1fce6f c61e45be - d3b5ab34 f72bf9b7 1b0434c0 4e72b567 5592a33d b5229301 cfd2a87f 60aeb767 - 1814386b 30bcc33d 38a0c07d fd1606f2 c363519b 589dd390 5479f8e6 1cb8d647 - 97fd61a9 ea7759f4 2d57539d 569a58cf e84e63ad 462e1b78 6580f87e f3817914 - 91da55f4 40a230f3 d1988f35 b6e318d2 3ffa50bc 3d40f021 c3c0bdae 4958c24c - 518f36b2 84b1d370 0fedce83 878ddada f2a279c7 94e01be8 90716f4b 954b8aa3'. - S8 := self sBoxFrom: ' - e216300d bbddfffc a7ebdabd 35648095 7789f8b7 e6c1121b 0e241600 052ce8b5 - 11a9cfb0 e5952f11 ece7990a 9386d174 2a42931c 76e38111 b12def3a 37ddddfc - de9adeb1 0a0cc32c be197029 84a00940 bb243a0f b4d137cf b44e79f0 049eedfd - 0b15a15d 480d3168 8bbbde5a 669ded42 c7ece831 3f8f95e7 72df191b 7580330d - 94074251 5c7dcdfa abbe6d63 aa402164 b301d40a 02e7d1ca 53571dae 7a3182a2 - 12a8ddec fdaa335d 176f43e8 71fb46d4 38129022 ce949ad4 b84769ad 965bd862 - 82f3d055 66fb9767 15b80b4e 1d5b47a0 4cfde06f c28ec4b8 57e8726e 647a78fc - 99865d44 608bd593 6c200e03 39dc5ff6 5d0b00a3 ae63aff2 7e8bd632 70108c0c - bbd35049 2998df04 980cf42a 9b6df491 9e7edd53 06918548 58cb7e07 3b74ef2e - 522fffb1 d24708cc 1c7e27cd a4eb215b 3cf1d2e2 19b47a38 424f7618 35856039 - 9d17dee7 27eb35e6 c9aff67b 36baf5b8 09c467cd c18910b1 e11dbf7b 06cd1af8 - 7170c608 2d5e3354 d4de495a 64c6d006 bcc0c62c 3dd00db3 708f8f34 77d51b42 - 264f620f 24b8d2bf 15c1b79e 46a52564 f8d7e54e 3e378160 7895cda5 859c15a5 - e6459788 c37bc75f db07ba0c 0676a3ab 7f229b1e 31842e7b 24259fd7 f8bef472 - 835ffcb8 6df4c1f2 96f5b195 fd0af0fc b0fe134c e2506d3d 4f9b12ea f215f225 - a223736f 9fb4c428 25d04979 34c713f8 c4618187 ea7a6e98 7cd16efc 1436876c - f1544107 bedeee14 56e9af27 a04aa441 3cf7c899 92ecbae6 dd67016d 151682eb - a842eedf fdba60b4 f1907b75 20e3030f 24d8c29e e139673b efa63fb8 71873054 - b6f2cf3b 9f326442 cb15a4cc b01a4504 f1e47d8d 844a1be5 bae7dfdc 42cbda70 - cd7dae0a 57e85b7a d53f5af6 20cf4d8c cea4d428 79d130a4 3486ebfb 33d3cddc - 77853b53 37effcb5 c5068778 e580b3e6 4e68b8f4 c5c8b37e 0d809ea2 398feb7c - 132a4f94 43b7950e 2fee7d1c 223613bd dd06caa2 37df932b c4248289 acf3ebc3 - 5715f6b7 ef3478dd f267616f c148cbe4 9052815e 5e410fab b48a2465 2eda7fa4 - e87b40e4 e98ea084 5889e9e1 efd390fc dd07d35b db485694 38d7e5b2 57720101 - 730edebc 5b643113 94917e4f 503c2fba 646f1282 7523d24a e0779695 f9c17a8f - 7a5b2121 d187b896 29263a4d ba510cdf 81f47c9f ad1163ed ea7b5965 1a00726e - 11403092 00da6d77 4a0cdd61 ad1f4603 605bdfb0 9eedc364 22ebe6a8 cee7d28a - a0e736a0 5564a6b9 10853209 c7eb8f37 2de705ca 8951570f df09822b bd691a6c - aa12e4f2 87451c0f e0f6a27a 3ada4819 4cf1764f 0d771c2b 67cdb156 350d8384 - 5938fa0f 42399ef3 36997b07 0e84093d 4aa93e61 8360d87b 1fa98b0c 1149382c - e97625a5 0614d1b7 0e25244b 0c768347 589e8d82 0d2059d1 a466bb1e f8da0a82 - 04f19130 ba6e4ec0 99265164 1ee7230d 50b2ad80 eaee6801 8db2a283 ea8bf59e'. - SBoxes := OrderedCollection new add: S1 ; add: S2 ; add: S3 ; add: S4 ; add: S5 ; add: S6 ; add: S7 ; add: S8 \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/class/maintenanceTest.st b/source/OpenPGP.package/CAST5.class/class/maintenanceTest.st deleted file mode 100644 index ea15435..0000000 --- a/source/OpenPGP.package/CAST5.class/class/maintenanceTest.st +++ /dev/null @@ -1,20 +0,0 @@ -class initialization -maintenanceTest - "Careful! on my 233 MHz PowerPC, this takes about 2.5 hours..." - "Time millisecondsToRun: [CAST5 maintenanceTest ifFalse: [self error: 'maintenance test failed!']]" - | a b cast mask64 al ar bl br | - a := 16r0123456712345678234567893456789A. - b := 16r0123456712345678234567893456789A. - cast := CAST5 new. - mask64 := (1 bitShift: 64) - 1. - 1000000 timesRepeat: [ - cast setKey: b. - al := cast encryptBlock: (a bitShift: -64). - ar := cast encryptBlock: (a bitAnd: mask64). - a := (al bitShift: 64) + ar. - cast setKey: a. - bl := cast encryptBlock: (b bitShift: -64). - br := cast encryptBlock: (b bitAnd: mask64). - b := (bl bitShift: 64) + br]. - ^a = 16rEEA9D0A249FD3BA6B3436FB89D6DCA92 - and: [b = 16rB2C95EB00C31AD7180AC05B8E83D696E] \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/class/maintenanceTest2.st b/source/OpenPGP.package/CAST5.class/class/maintenanceTest2.st deleted file mode 100644 index e1bd75e..0000000 --- a/source/OpenPGP.package/CAST5.class/class/maintenanceTest2.st +++ /dev/null @@ -1,20 +0,0 @@ -class initialization -maintenanceTest2 - "Careful! on my 233 MHz PowerPC, this takes a number of minutes..." - "MessageTally spyOn: [CAST5 maintenanceTest2 ifFalse: [self error: 'maintenance test failed!']]" - | a b cast mask64 al ar bl br | - a := 16r0123456712345678234567893456789A. - b := 16r0123456712345678234567893456789A. - cast := CAST5 new. - mask64 := (1 bitShift: 64) - 1. - 1000 timesRepeat: [ - cast setKey: b. - al := cast encryptBlock: (a bitShift: -64). - ar := cast encryptBlock: (a bitAnd: mask64). - a := (al bitShift: 64) + ar. - cast setKey: a. - bl := cast encryptBlock: (b bitShift: -64). - br := cast encryptBlock: (b bitAnd: mask64). - b := (bl bitShift: 64) + br]. - ^a = 16r23F73B14B02A2AD7DFB9F2C35644798D - and: [b = 16rE5BF37EFF14C456A40B21CE369370A9F] \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/class/sBoxFrom..st b/source/OpenPGP.package/CAST5.class/class/sBoxFrom..st deleted file mode 100644 index 46284a8..0000000 --- a/source/OpenPGP.package/CAST5.class/class/sBoxFrom..st +++ /dev/null @@ -1,13 +0,0 @@ -class initialization -sBoxFrom: aString - | str box value | - str := ReadStream on: aString. - box := Array new: 256. - 1 to: 256 do: [:i | - str skipSeparators. - value := (Integer - readFrom: (ReadStream on: (str next: 8) asUppercase) - base: 16). - box at: i put: (ThirtyTwoBitRegister new load: value)]. - str atEnd ifFalse: [self error: 'S-Box initialization data corrupt']. - ^box \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/instance/blockSize.st b/source/OpenPGP.package/CAST5.class/instance/blockSize.st deleted file mode 100644 index aec60aa..0000000 --- a/source/OpenPGP.package/CAST5.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -blockSize - ^8 \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/instance/decryptBlock..st b/source/OpenPGP.package/CAST5.class/instance/decryptBlock..st deleted file mode 100644 index ae82744..0000000 --- a/source/OpenPGP.package/CAST5.class/instance/decryptBlock..st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -decryptBlock: anInteger - ^self encrypt: anInteger forward: false \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/instance/encrypt.forward..st b/source/OpenPGP.package/CAST5.class/instance/encrypt.forward..st deleted file mode 100644 index e850562..0000000 --- a/source/OpenPGP.package/CAST5.class/instance/encrypt.forward..st +++ /dev/null @@ -1,36 +0,0 @@ -encryption/decryption -encrypt: anInteger forward: aBoolean - | rLast lLast mask32 km kr n t s1ia s2ib s3ic s4id maxRound round | - mask32 := 16rFFFFFFFF. - lLast := ThirtyTwoBitRegister new load: (anInteger bitShift: -32). - rLast := ThirtyTwoBitRegister new load: (anInteger bitAnd: mask32). - s1ia := ThirtyTwoBitRegister new. - s2ib := ThirtyTwoBitRegister new. - s3ic := ThirtyTwoBitRegister new. - s4id := ThirtyTwoBitRegister new. - maxRound := shortKey ifTrue: [12] ifFalse: [16]. - 1 to: maxRound do: [:i | - round := aBoolean ifTrue: [i] ifFalse: [maxRound+1-i]. - km := (k at: round) copy. - kr := k at: round+16. - n := round \\ 3. - n = 1 - ifTrue: [km += rLast] - ifFalse: [n = 2 - ifTrue: [km bitXor: rLast] - ifFalse: [km -= rLast]]. - km leftRotateBy: kr. - s1ia := (S1 at: km d0+1) copy. - s2ib := (S2 at: km d1+1). - s3ic := (S3 at: km d2+1). - s4id := (S4 at: km d3+1). - n = 1 - ifTrue: [(s1ia bitXor: s2ib) -= s3ic += s4id] - ifFalse: [n = 2 - ifTrue: [s1ia -= s2ib += s3ic bitXor: s4id] - ifFalse: [(s1ia += s2ib bitXor: s3ic) -= s4id]]. - t := rLast. - rLast := lLast. - rLast bitXor: s1ia. - lLast := t]. - ^lLast asInteger + (rLast asInteger bitShift: 32) \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/instance/encryptBlock..st b/source/OpenPGP.package/CAST5.class/instance/encryptBlock..st deleted file mode 100644 index 9f78fc4..0000000 --- a/source/OpenPGP.package/CAST5.class/instance/encryptBlock..st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -encryptBlock: anInteger - ^self encrypt: anInteger forward: true \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/instance/setKey..st b/source/OpenPGP.package/CAST5.class/instance/setKey..st deleted file mode 100644 index 52e8605..0000000 --- a/source/OpenPGP.package/CAST5.class/instance/setKey..st +++ /dev/null @@ -1,71 +0,0 @@ -initialize-release -setKey: anInteger - "anInteger is a CAST key with 128 bits, of which the LSBs may be 0 if a shorter key size is used. - CAST5 uses 12 rounds for key sizes up to and including 80 bits, and 16 rounds for larger keys. The key size is determined by examining the 48 LSBs of the keys; if they are 0, the key is assumed to be 80 bits or less." - | mask32 x0 x4 x8 xC z0 z4 z8 zC | - mask32 := (1 bitShift: 32) - 1. - shortKey := (anInteger bitAnd: (1 bitShift: 48)-1) = 0. - k := Array new: 32. - x0 := ThirtyTwoBitRegister new load: (anInteger bitShift: -96). - x4 := ThirtyTwoBitRegister new load: ((anInteger bitShift: -64) bitAnd: mask32). - x8 := ThirtyTwoBitRegister new load: ((anInteger bitShift: -32) bitAnd: mask32). - xC := ThirtyTwoBitRegister new load: (anInteger bitAnd: mask32). - 1 to: 32 by: 8 do: [:i | - z0 := x0 copy castXorFrom: S5 index: xC d1; castXorFrom: S6 index: xC d3; - castXorFrom: S7 index: xC d0; castXorFrom: S8 index: xC d2; castXorFrom: S7 index: x8 d0. - z4 := x8 copy castXorFrom: S5 index: z0 d0; castXorFrom: S6 index: z0 d2; - castXorFrom: S7 index: z0 d1; castXorFrom: S8 index: z0 d3; castXorFrom: S8 index: x8 d2. - z8 := xC copy castXorFrom: S5 index: z4 d3; castXorFrom: S6 index: z4 d2; - castXorFrom: S7 index: z4 d1; castXorFrom: S8 index: z4 d0; castXorFrom: S5 index: x8 d1. - zC := x4 copy castXorFrom: S5 index: z8 d2; castXorFrom: S6 index: z8 d1; - castXorFrom: S7 index: z8 d3; castXorFrom: S8 index: z8 d0; castXorFrom: S6 index: x8 d3. - - i \\ 16 = 1 - ifTrue: [ - k at: i put: ((S5 at: z8 d0+1) copy castXorFrom: S6 index: z8 d1; - castXorFrom: S7 index: z4 d3; castXorFrom: S8 index: z4 d2; castXorFrom: S5 index: z0 d2). - k at: i+1 put: ((S5 at: z8 d2+1) copy castXorFrom: S6 index: z8 d3; - castXorFrom: S7 index: z4 d1; castXorFrom: S8 index: z4 d0; castXorFrom: S6 index: z4 d2). - k at: i+2 put: ((S5 at: zC d0+1) copy castXorFrom: S6 index: zC d1; - castXorFrom: S7 index: z0 d3; castXorFrom: S8 index: z0 d2; castXorFrom: S7 index: z8 d1). - k at: i+3 put: ((S5 at: zC d2+1) copy castXorFrom: S6 index: zC d3; - castXorFrom: S7 index: z0 d1; castXorFrom: S8 index: z0 d0; castXorFrom: S8 index: zC d0)] - ifFalse: [ - k at: i put: ((S5 at: z0 d3+1) copy castXorFrom: S6 index: z0 d2; - castXorFrom: S7 index: zC d0; castXorFrom: S8 index: zC d1; castXorFrom: S5 index: z8 d1). - k at: i+1 put: ((S5 at: z0 d1+1) copy castXorFrom: S6 index: z0 d0; - castXorFrom: S7 index: zC d2; castXorFrom: S8 index: zC d3; castXorFrom: S6 index: zC d0). - k at: i+2 put: ((S5 at: z4 d3+1) copy castXorFrom: S6 index: z4 d2; - castXorFrom: S7 index: z8 d0; castXorFrom: S8 index: z8 d1; castXorFrom: S7 index: z0 d2). - k at: i+3 put: ((S5 at: z4 d1+1) copy castXorFrom: S6 index: z4 d0; - castXorFrom: S7 index: z8 d2; castXorFrom: S8 index: z8 d3; castXorFrom: S8 index: z4 d2)]. - - x0 := z8 copy castXorFrom: S5 index: z4 d1; castXorFrom: S6 index: z4 d3; - castXorFrom: S7 index: z4 d0; castXorFrom: S8 index: z4 d2; castXorFrom: S7 index: z0 d0. - x4 := z0 copy castXorFrom: S5 index: x0 d0; castXorFrom: S6 index: x0 d2; - castXorFrom: S7 index: x0 d1; castXorFrom: S8 index: x0 d3; castXorFrom: S8 index: z0 d2. - x8 := z4 copy castXorFrom: S5 index: x4 d3; castXorFrom: S6 index: x4 d2; - castXorFrom: S7 index: x4 d1; castXorFrom: S8 index: x4 d0; castXorFrom: S5 index: z0 d1. - xC := zC copy castXorFrom: S5 index: x8 d2; castXorFrom: S6 index: x8 d1; - castXorFrom: S7 index: x8 d3; castXorFrom: S8 index: x8 d0; castXorFrom: S6 index: z0 d3. - - i \\ 16 = 1 - ifTrue: [ - k at: i+4 put: ((S5 at: x0 d3+1) copy castXorFrom: S6 index: x0 d2; - castXorFrom: S7 index: xC d0; castXorFrom: S8 index: xC d1; castXorFrom: S5 index: x8 d0). - k at: i+5 put: ((S5 at: x0 d1+1) copy castXorFrom: S6 index: x0 d0; - castXorFrom: S7 index: xC d2; castXorFrom: S8 index: xC d3; castXorFrom: S6 index: xC d1). - k at: i+6 put: ((S5 at: x4 d3+1) copy castXorFrom: S6 index: x4 d2; - castXorFrom: S7 index: x8 d0; castXorFrom: S8 index: x8 d1; castXorFrom: S7 index: x0 d3). - k at: i+7 put: ((S5 at: x4 d1+1) copy castXorFrom: S6 index: x4 d0; - castXorFrom: S7 index: x8 d2; castXorFrom: S8 index: x8 d3; castXorFrom: S8 index: x4 d3)] - ifFalse: [ - k at: i+4 put: ((S5 at: x8 d0+1) copy castXorFrom: S6 index: x8 d1; - castXorFrom: S7 index: x4 d3; castXorFrom: S8 index: x4 d2; castXorFrom: S5 index: x0 d3). - k at: i+5 put: ((S5 at: x8 d2+1) copy castXorFrom: S6 index: x8 d3; - castXorFrom: S7 index: x4 d1; castXorFrom: S8 index: x4 d0; castXorFrom: S6 index: x4 d3). - k at: i+6 put: ((S5 at: xC d0+1) copy castXorFrom: S6 index: xC d1; - castXorFrom: S7 index: x0 d3; castXorFrom: S8 index: x0 d2; castXorFrom: S7 index: x8 d0). - k at: i+7 put: ((S5 at: xC d2+1) copy castXorFrom: S6 index: xC d3; - castXorFrom: S7 index: x0 d1; castXorFrom: S8 index: x0 d0; castXorFrom: S8 index: xC d1)]]. - 17 to: 32 do: [:i | k at: i put: ((k at: i) low bitAnd: 31)] \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5.class/methodProperties.json b/source/OpenPGP.package/CAST5.class/methodProperties.json deleted file mode 100644 index 91d23a4..0000000 --- a/source/OpenPGP.package/CAST5.class/methodProperties.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "class" : { - "initialize" : " 7/23/2018 10:01:09", - "maintenanceTest" : " 7/23/2018 10:01:09", - "maintenanceTest2" : " 7/23/2018 10:01:09", - "sBoxFrom:" : " 7/23/2018 10:01:09" }, - "instance" : { - "blockSize" : " 7/23/2018 10:01:09", - "decryptBlock:" : " 7/23/2018 10:01:09", - "encrypt:forward:" : " 7/23/2018 10:01:09", - "encryptBlock:" : " 7/23/2018 10:01:09", - "setKey:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/CAST5.class/properties.json b/source/OpenPGP.package/CAST5.class/properties.json deleted file mode 100644 index 84def56..0000000 --- a/source/OpenPGP.package/CAST5.class/properties.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - "EBitSelectionTable", - "S1", - "S2", - "S3", - "S4", - "S5", - "S6", - "S7", - "S8", - "SBoxes" ], - "commentStamp" : "hmm 3/26/2002 18:20", - "instvars" : [ - "shortKey" ], - "name" : "CAST5", - "pools" : [ - ], - "super" : "FeistelCipher", - "type" : "normal" } diff --git a/source/OpenPGP.package/CAST5TestCase.class/README.md b/source/OpenPGP.package/CAST5TestCase.class/README.md deleted file mode 100644 index 432018f..0000000 --- a/source/OpenPGP.package/CAST5TestCase.class/README.md +++ /dev/null @@ -1 +0,0 @@ -This test case checks that the 3 test key/plaintext pairs (for 40, 80 and 128 bit key length) given in the CAST5 spec are encoded and decoded correctly. \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5TestCase.class/instance/test128BitKey.st b/source/OpenPGP.package/CAST5TestCase.class/instance/test128BitKey.st deleted file mode 100644 index 58b5f8e..0000000 --- a/source/OpenPGP.package/CAST5TestCase.class/instance/test128BitKey.st +++ /dev/null @@ -1,8 +0,0 @@ -running -test128BitKey - | key plaintext ciphertext | - key := 16r0123456712345678234567893456789A. - plaintext := 16r0123456789ABCDEF. - ciphertext := 16r238B4FE5847E44B2. - self assert: ((CAST5 new setKey: key) encryptBlock: plaintext) = ciphertext. - self assert: ((CAST5 new setKey: key) decryptBlock: ciphertext) = plaintext \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5TestCase.class/instance/test40BitKey.st b/source/OpenPGP.package/CAST5TestCase.class/instance/test40BitKey.st deleted file mode 100644 index bbbd82d..0000000 --- a/source/OpenPGP.package/CAST5TestCase.class/instance/test40BitKey.st +++ /dev/null @@ -1,8 +0,0 @@ -running -test40BitKey - | key plaintext ciphertext | - key := 16r01234567120000000000000000000000. - plaintext := 16r0123456789ABCDEF. - ciphertext := 16r7AC816D16E9B302E. - self assert: ((CAST5 new setKey: key) encryptBlock: plaintext) = ciphertext. - self assert: ((CAST5 new setKey: key) decryptBlock: ciphertext) = plaintext \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5TestCase.class/instance/test80BitKey.st b/source/OpenPGP.package/CAST5TestCase.class/instance/test80BitKey.st deleted file mode 100644 index 051a391..0000000 --- a/source/OpenPGP.package/CAST5TestCase.class/instance/test80BitKey.st +++ /dev/null @@ -1,8 +0,0 @@ -running -test80BitKey - | key plaintext ciphertext | - key := 16r01234567123456782345000000000000. - plaintext := 16r0123456789ABCDEF. - ciphertext := 16rEB6A711A2C02271B. - self assert: ((CAST5 new setKey: key) encryptBlock: plaintext) = ciphertext. - self assert: ((CAST5 new setKey: key) decryptBlock: ciphertext) = plaintext \ No newline at end of file diff --git a/source/OpenPGP.package/CAST5TestCase.class/methodProperties.json b/source/OpenPGP.package/CAST5TestCase.class/methodProperties.json deleted file mode 100644 index f1dab00..0000000 --- a/source/OpenPGP.package/CAST5TestCase.class/methodProperties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "test128BitKey" : " 7/23/2018 10:01:09", - "test40BitKey" : " 7/23/2018 10:01:09", - "test80BitKey" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/CAST5TestCase.class/properties.json b/source/OpenPGP.package/CAST5TestCase.class/properties.json deleted file mode 100644 index ef3e431..0000000 --- a/source/OpenPGP.package/CAST5TestCase.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 18:19", - "instvars" : [ - ], - "name" : "CAST5TestCase", - "pools" : [ - ], - "super" : "TestCase", - "type" : "normal" } diff --git a/source/OpenPGP.package/CFBEncryption.class/README.md b/source/OpenPGP.package/CFBEncryption.class/README.md deleted file mode 100644 index 3b87bcd..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/README.md +++ /dev/null @@ -1,7 +0,0 @@ -This class implements cipher feedback encryption in concert with any block cipher. - -Instance Variables: -cipher used with the encryption -iv initialization vector, is updated for every encrypted byte. -encIV encrypted IV, used in the decrpytion step of the CFB -index index into encIV used in the decryption step \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/cipher.initialVector..st b/source/OpenPGP.package/CFBEncryption.class/instance/cipher.initialVector..st deleted file mode 100644 index 9f21055..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/cipher.initialVector..st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -cipher: aBlockCipher initialVector: aByteArray - self cipher: aBlockCipher initialVector: aByteArray shiftSize: 1 \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/cipher.initialVector.shiftSize..st b/source/OpenPGP.package/CFBEncryption.class/instance/cipher.initialVector.shiftSize..st deleted file mode 100644 index 98d5bba..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/cipher.initialVector.shiftSize..st +++ /dev/null @@ -1,6 +0,0 @@ -initialize-release -cipher: aBlockCipher initialVector: aByteArray shiftSize: anInteger - cipher := aBlockCipher. - iv := aByteArray copy. - shiftData := ByteArray new: anInteger. - shiftIndex := 0 \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/decrypt..st b/source/OpenPGP.package/CFBEncryption.class/instance/decrypt..st deleted file mode 100644 index 443e649..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/decrypt..st +++ /dev/null @@ -1,12 +0,0 @@ -encrypting -decrypt: aCharacterOrInteger - | encBlock out | - encBlock := cipher encryptBytes: iv. - shiftIndex := shiftIndex+1. - out := (encBlock at: shiftIndex) bitXor: aCharacterOrInteger asInteger. - shiftData at: shiftIndex put: aCharacterOrInteger asInteger. - shiftIndex = shiftData size ifTrue: [ - iv replaceFrom: 1 to: iv size-shiftIndex with: iv startingAt: shiftIndex+1. - iv replaceFrom: iv size-shiftIndex+1 to: iv size with: shiftData startingAt: 1. - shiftIndex := 0]. - ^out \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/decryptBytes..st b/source/OpenPGP.package/CFBEncryption.class/instance/decryptBytes..st deleted file mode 100644 index 5ce0023..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/decryptBytes..st +++ /dev/null @@ -1,3 +0,0 @@ -encrypting -decryptBytes: aByteArray - ^aByteArray collect: [:i | self decrypt: i] \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/encrypt..st b/source/OpenPGP.package/CFBEncryption.class/instance/encrypt..st deleted file mode 100644 index 7019852..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/encrypt..st +++ /dev/null @@ -1,8 +0,0 @@ -encrypting -encrypt: aCharacterOrInteger - | encBlock out | - encBlock := cipher encryptBytes: iv. - out := encBlock first bitXor: aCharacterOrInteger asInteger. - iv replaceFrom: 1 to: iv size-1 with: iv startingAt: 2. - iv at: iv size put: out. - ^out \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/encryptBytes..st b/source/OpenPGP.package/CFBEncryption.class/instance/encryptBytes..st deleted file mode 100644 index 3a490f4..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/encryptBytes..st +++ /dev/null @@ -1,3 +0,0 @@ -encrypting -encryptBytes: aByteArray - ^aByteArray collect: [:i | self encrypt: i] \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/instance/resyncWith..st b/source/OpenPGP.package/CFBEncryption.class/instance/resyncWith..st deleted file mode 100644 index fa1fd5c..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/instance/resyncWith..st +++ /dev/null @@ -1,5 +0,0 @@ -initialize-release -resyncWith: aByteArray - iv := aByteArray copy. - shiftData := ByteArray new: shiftData size. - shiftIndex := 0 \ No newline at end of file diff --git a/source/OpenPGP.package/CFBEncryption.class/methodProperties.json b/source/OpenPGP.package/CFBEncryption.class/methodProperties.json deleted file mode 100644 index 1dba0fe..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/methodProperties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "cipher:initialVector:" : " 7/23/2018 10:01:09", - "cipher:initialVector:shiftSize:" : " 7/23/2018 10:01:09", - "decrypt:" : " 7/23/2018 10:01:09", - "decryptBytes:" : " 7/23/2018 10:01:09", - "encrypt:" : " 7/23/2018 10:01:09", - "encryptBytes:" : " 7/23/2018 10:01:09", - "resyncWith:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/CFBEncryption.class/properties.json b/source/OpenPGP.package/CFBEncryption.class/properties.json deleted file mode 100644 index 3d37618..0000000 --- a/source/OpenPGP.package/CFBEncryption.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 18:24", - "instvars" : [ - "cipher", - "iv", - "shiftData", - "shiftIndex" ], - "name" : "CFBEncryption", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/DESForOpenPGP.class/README.md b/source/OpenPGP.package/DESForOpenPGP.class/README.md deleted file mode 100644 index 6d46974..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/README.md +++ /dev/null @@ -1 +0,0 @@ -This is the Digital Encryption Standard cipher. It's quite old now, uses only a relatively short key (56 bits), and is crackable using brute force with relatively moderate resources. For reasonable security, use either CAST5 or TripleDES. \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/class/blockSize.st b/source/OpenPGP.package/DESForOpenPGP.class/class/blockSize.st deleted file mode 100644 index 1d23ac1..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ 8 \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/class/initSBox.from..st b/source/OpenPGP.package/DESForOpenPGP.class/class/initSBox.from..st deleted file mode 100644 index d831915..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/class/initSBox.from..st +++ /dev/null @@ -1,12 +0,0 @@ -class initialization -initSBox: index from: anArray - "Initialization data is given in the same order order as in the spec, which is nonsense. - This method reorders it to avoid reordering in the encryption/decryption process." - "Validity test: - (DES new applyToSBoxes: 2r011101000101110101000111101000011100101101011101) - = 2r00110100111001011010010110101001" - | row col | - SBoxes at: index put: ((0 to: 63) collect: [:i | - row := i // 32 * 2 + (i \\ 2). - col := i // 2 \\ 16. - anArray at: row * 16 + col + 1]) \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/class/initialize.st b/source/OpenPGP.package/DESForOpenPGP.class/class/initialize.st deleted file mode 100644 index 274bd29..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/class/initialize.st +++ /dev/null @@ -1,99 +0,0 @@ -class initialization -initialize - "DES initialize" - DESBitPermutation initialize. - PC1 := DESBitPermutation fromDESBitIndexes: #( - 57 49 41 33 25 17 9 - 1 58 50 42 34 26 18 - 10 2 59 51 43 35 27 - 19 11 3 60 52 44 36 - 63 55 47 39 31 23 15 - 7 62 54 46 38 30 22 - 14 6 61 53 45 37 29 - 21 13 5 28 20 12 4) sourceWidth: 64. - PC2 := DESBitPermutation fromDESBitIndexes: #( - 14 17 11 24 1 5 - 3 28 15 6 21 10 - 23 19 12 4 26 8 - 16 7 27 20 13 2 - 41 52 31 37 47 55 - 30 40 51 45 33 48 - 44 49 39 56 34 53 - 46 42 50 36 29 32) sourceWidth: 56. - IP := DESBitPermutation fromDESBitIndexes: #( - 58 50 42 34 26 18 10 2 - 60 52 44 36 28 20 12 4 - 62 54 46 38 30 22 14 6 - 64 56 48 40 32 24 16 8 - 57 49 41 33 25 17 9 1 - 59 51 43 35 27 19 11 3 - 61 53 45 37 29 21 13 5 - 63 55 47 39 31 23 15 7) sourceWidth: 64. - IIP := DESBitPermutation fromDESBitIndexes: #( - 40 8 48 16 56 24 64 32 - 39 7 47 15 55 23 63 31 - 38 6 46 14 54 22 62 30 - 37 5 45 13 53 21 61 29 - 36 4 44 12 52 20 60 28 - 35 3 43 11 51 19 59 27 - 34 2 42 10 50 18 58 26 - 33 1 41 9 49 17 57 25) sourceWidth: 64. - EBitSelectionTable := DESBitPermutation fromDESBitIndexes: #( - 32 1 2 3 4 5 - 4 5 6 7 8 9 - 8 9 10 11 12 13 - 12 13 14 15 16 17 - 16 17 18 19 20 21 - 20 21 22 23 24 25 - 24 25 26 27 28 29 - 28 29 30 31 32 1) sourceWidth: 32. - P := DESBitPermutation fromDESBitIndexes: #( - 16 7 20 21 - 29 12 28 17 - 1 15 23 26 - 5 18 31 10 - 2 8 24 14 - 32 27 3 9 - 19 13 30 6 - 22 11 4 25) sourceWidth: 32. - SBoxes := Array new: 8. - self initSBox: 1 from: #( - 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7 - 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8 - 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0 - 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13). - self initSBox: 2 from: #( - 15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10 - 3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5 - 0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15 - 13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9). - self initSBox: 3 from: #( - 10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8 - 13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1 - 13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7 - 1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12). - self initSBox: 4 from: #( - 7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15 - 13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9 - 10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4 - 3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14). - self initSBox: 5 from: #( - 2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9 - 14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6 - 4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14 - 11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3). - self initSBox: 6 from: #( - 12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11 - 10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8 - 9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6 - 4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13). - self initSBox: 7 from: #( - 4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1 - 13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6 - 1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2 - 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12). - self initSBox: 8 from: #( - 13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7 - 1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2 - 7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8 - 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11) \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/class/keySize.st b/source/OpenPGP.package/DESForOpenPGP.class/class/keySize.st deleted file mode 100644 index f907f39..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/class/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ 8 \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/applyToSBoxes..st b/source/OpenPGP.package/DESForOpenPGP.class/instance/applyToSBoxes..st deleted file mode 100644 index 1cbb882..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/applyToSBoxes..st +++ /dev/null @@ -1,8 +0,0 @@ -encryption/decryption -applyToSBoxes: anInteger - | result bits | - result := 0. - 1 to: 8 do: [:i | - bits := (anInteger bitShift: i*6-48) bitAnd: 63. - result := (result bitShift: 4) + ((SBoxes at: i) at: bits+1)]. - ^result \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/blockSize.st b/source/OpenPGP.package/DESForOpenPGP.class/instance/blockSize.st deleted file mode 100644 index aec60aa..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -blockSize - ^8 \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/coreProcess.forward..st b/source/OpenPGP.package/DESForOpenPGP.class/instance/coreProcess.forward..st deleted file mode 100644 index 0f14065..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/coreProcess.forward..st +++ /dev/null @@ -1,14 +0,0 @@ -encryption/decryption -coreProcess: anInteger forward: aBoolean - | rLast lLast rCurrent rXored rSBoxed rPermuted | - lLast := anInteger bitShift: -32. - rLast := anInteger bitAnd: 16rFFFFFFFF. - 1 to: 16 do: [:i | - rCurrent := EBitSelectionTable permute: rLast. - rXored := rCurrent bitXor: (k at: (aBoolean ifTrue: [i] ifFalse: [17-i])). - rSBoxed := self applyToSBoxes: rXored. - rPermuted := P permute: rSBoxed. - rCurrent := rPermuted bitXor: lLast. - lLast := rLast. - rLast := rCurrent]. - ^lLast + (rLast bitShift: 32) \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/decryptBlock..st b/source/OpenPGP.package/DESForOpenPGP.class/instance/decryptBlock..st deleted file mode 100644 index 7eb952d..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/decryptBlock..st +++ /dev/null @@ -1,6 +0,0 @@ -encryption/decryption -decryptBlock: anInteger - | permuted encoded | - permuted := IP permute: anInteger. - encoded := self coreProcess: permuted forward: false. - ^IIP permute: encoded \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/encryptBlock..st b/source/OpenPGP.package/DESForOpenPGP.class/instance/encryptBlock..st deleted file mode 100644 index 0884a35..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/encryptBlock..st +++ /dev/null @@ -1,6 +0,0 @@ -encryption/decryption -encryptBlock: anInteger - | permuted encoded | - permuted := IP permute: anInteger. - encoded := self coreProcess: permuted forward: true. - ^IIP permute: encoded \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/keySize.st b/source/OpenPGP.package/DESForOpenPGP.class/instance/keySize.st deleted file mode 100644 index 0715b6e..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -keySize - ^8 \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/instance/setKey..st b/source/OpenPGP.package/DESForOpenPGP.class/instance/setKey..st deleted file mode 100644 index a970799..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/instance/setKey..st +++ /dev/null @@ -1,21 +0,0 @@ -initialize-release -setKey: anInteger - "anInteger is a 64-bit DES key" - "DES new setKey: 2" - | kCurrent mask28 rot l r | - mask28 := 16rFFFFFFF. - kCurrent := PC1 permute: anInteger. - l := kCurrent bitShift: -28. - r := kCurrent bitAnd: mask28. - k := Array new: 16. - 1 to: 16 do: [:i | - rot := #(1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1) at: i. - false - ifTrue: [ - l := (l bitShift: 0-rot) + (l bitShift: 28-rot) bitAnd: mask28. - r := (r bitShift: 0-rot) + (r bitShift: 28-rot) bitAnd: mask28] - ifFalse: [ - l := (l bitShift: rot) + (l bitShift: rot - 28) bitAnd: mask28. - r := (r bitShift: rot) + (r bitShift: rot - 28) bitAnd: mask28]. - kCurrent := (l bitShift: 28) + r. - k at: i put: (PC2 permute: kCurrent)] \ No newline at end of file diff --git a/source/OpenPGP.package/DESForOpenPGP.class/methodProperties.json b/source/OpenPGP.package/DESForOpenPGP.class/methodProperties.json deleted file mode 100644 index ace3dbb..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/methodProperties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "class" : { - "blockSize" : " 7/23/2018 10:01:09", - "initSBox:from:" : " 7/23/2018 10:01:09", - "initialize" : " 7/23/2018 10:01:09", - "keySize" : " 7/23/2018 10:01:09" }, - "instance" : { - "applyToSBoxes:" : " 7/23/2018 10:01:09", - "blockSize" : " 7/23/2018 10:01:09", - "coreProcess:forward:" : " 7/23/2018 10:01:09", - "decryptBlock:" : " 7/23/2018 10:01:09", - "encryptBlock:" : " 7/23/2018 10:01:09", - "keySize" : " 7/23/2018 10:01:09", - "setKey:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/DESForOpenPGP.class/properties.json b/source/OpenPGP.package/DESForOpenPGP.class/properties.json deleted file mode 100644 index 72316b3..0000000 --- a/source/OpenPGP.package/DESForOpenPGP.class/properties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - "EBitSelectionTable", - "IIP", - "IP", - "P", - "PC1", - "PC2", - "SBoxes" ], - "commentStamp" : "hmm 3/26/2002 19:15", - "instvars" : [ - ], - "name" : "DESForOpenPGP", - "pools" : [ - ], - "super" : "FeistelCipher", - "type" : "normal" } diff --git a/source/OpenPGP.package/DESTestCase.class/README.md b/source/OpenPGP.package/DESTestCase.class/README.md deleted file mode 100644 index 1ebd351..0000000 --- a/source/OpenPGP.package/DESTestCase.class/README.md +++ /dev/null @@ -1 +0,0 @@ -This class tests the DES algorithm using a test case defined by Ron Rivest in (http://theory.lcs.mit.edu/~rivest/destest.txt), which according to his analysis should uncover all possible single-point failures. \ No newline at end of file diff --git a/source/OpenPGP.package/DESTestCase.class/instance/testRivest.st b/source/OpenPGP.package/DESTestCase.class/instance/testRivest.st deleted file mode 100644 index cbb142b..0000000 --- a/source/OpenPGP.package/DESTestCase.class/instance/testRivest.st +++ /dev/null @@ -1,13 +0,0 @@ -running -testRivest - "Run the simple test given by Ron Rivest in http://theory.lcs.mit.edu/~rivest/destest.txt" - - | des x | - des := DESForOpenPGP new. - x := 16r9474B8E8C73BCA7D. - 1 to: 16 do: [:i | - des setKey: x. - x := i odd - ifTrue: [des encryptBlock: x] - ifFalse: [des decryptBlock: x]]. - self assert: x = 16r1B1A2DDB4C642438 \ No newline at end of file diff --git a/source/OpenPGP.package/DESTestCase.class/instance/testRivestWithBase.st b/source/OpenPGP.package/DESTestCase.class/instance/testRivestWithBase.st deleted file mode 100644 index 2228038..0000000 --- a/source/OpenPGP.package/DESTestCase.class/instance/testRivestWithBase.st +++ /dev/null @@ -1,13 +0,0 @@ -running -testRivestWithBase - "Run the simple test given by Ron Rivest in http://theory.lcs.mit.edu/~rivest/destest.txt" - - | des x | - des := DES new. - x := 16r9474B8E8C73BCA7D asByteArray. - 1 to: 16 do: [:i | - des key: x copy. - i odd - ifTrue: [des encryptBlock: x] - ifFalse: [des decryptBlock: x]]. - self assert: x = 16r1B1A2DDB4C642438 asByteArray \ No newline at end of file diff --git a/source/OpenPGP.package/DESTestCase.class/instance/testSSLeay.st b/source/OpenPGP.package/DESTestCase.class/instance/testSSLeay.st deleted file mode 100644 index b9550c0..0000000 --- a/source/OpenPGP.package/DESTestCase.class/instance/testSSLeay.st +++ /dev/null @@ -1,39 +0,0 @@ -running -testSSLeay - "Run 3DES tests from the SSLeay package. Test vectors copied from OpenPGP source" - | tripleDES | - #( - ( 16r010101010101010101010101010101010101010101010101 - 16r95F8A5E5DD31D900 - 16r8000000000000000) - ( 16r010101010101010101010101010101010101010101010101 - 16r9D64555A9A10B852 - 16r0000001000000000) - ( 16r3849674C2602319E3849674C2602319E3849674C2602319E - 16r51454B582DDF440A - 16r7178876E01F19B2A) - ( 16r04B915BA43FEB5B604B915BA43FEB5B604B915BA43FEB5B6 - 16r42FD443059577FA2 - 16rAF37FB421F8C4095) - ( 16r0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF - 16r736F6D6564617461 - 16r3D124FE2198BA318) - ( 16r0123456789ABCDEF55555555555555550123456789ABCDEF - 16r736F6D6564617461 - 16rFBABA1FF9D05E9B1) - ( 16r0123456789ABCDEF5555555555555555FEDCBA9876543210 - 16r736F6D6564617461 - 16r18D748E563620572) - ( 16r0352020767208217860287665908219864056ABDFEA93457 - 16r7371756967676C65 - 16rC07D2A0FA566FA30) - ( 16r010101010101010180010101010101010101010101010102 - 16r0000000000000000 - 16rE6E6DD5B7E722974) - ( 16r10461034899880209107D0158919010119079210981A0101 - 16r0000000000000000 - 16rE1EF62C332FE825B)) do: [:array | - tripleDES := TripleDESForOpenPGP new. - tripleDES setKey: array first. - self assert: (tripleDES encryptBlock: array second) = array third. - self assert: (tripleDES decryptBlock: array third) = array second] \ No newline at end of file diff --git a/source/OpenPGP.package/DESTestCase.class/instance/testSSLeayWithBase.st b/source/OpenPGP.package/DESTestCase.class/instance/testSSLeayWithBase.st deleted file mode 100644 index f359dbf..0000000 --- a/source/OpenPGP.package/DESTestCase.class/instance/testSSLeayWithBase.st +++ /dev/null @@ -1,39 +0,0 @@ -running -testSSLeayWithBase - "Run 3DES tests from the SSLeay package. Test vectors copied from OpenPGP source" - | tripleDES | - #( - ( 16r010101010101010101010101010101010101010101010101 - 16r95F8A5E5DD31D900 - 16r8000000000000000) - ( 16r010101010101010101010101010101010101010101010101 - 16r9D64555A9A10B852 - 16r0000001000000000) - ( 16r3849674C2602319E3849674C2602319E3849674C2602319E - 16r51454B582DDF440A - 16r7178876E01F19B2A) - ( 16r04B915BA43FEB5B604B915BA43FEB5B604B915BA43FEB5B6 - 16r42FD443059577FA2 - 16rAF37FB421F8C4095) - ( 16r0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF - 16r736F6D6564617461 - 16r3D124FE2198BA318) - ( 16r0123456789ABCDEF55555555555555550123456789ABCDEF - 16r736F6D6564617461 - 16rFBABA1FF9D05E9B1) - ( 16r0123456789ABCDEF5555555555555555FEDCBA9876543210 - 16r736F6D6564617461 - 16r18D748E563620572) - ( 16r0352020767208217860287665908219864056ABDFEA93457 - 16r7371756967676C65 - 16rC07D2A0FA566FA30) - ( 16r010101010101010180010101010101010101010101010102 - 16r0000000000000000 - 16rE6E6DD5B7E722974) - ( 16r10461034899880209107D0158919010119079210981A0101 - 16r0000000000000000 - 16rE1EF62C332FE825B)) do: [:array | - tripleDES := TripleDES new. - tripleDES setKey: array first. - self assert: (tripleDES encryptBlock: array second) = array third. - self assert: (tripleDES decryptBlock: array third) = array second] \ No newline at end of file diff --git a/source/OpenPGP.package/DESTestCase.class/methodProperties.json b/source/OpenPGP.package/DESTestCase.class/methodProperties.json deleted file mode 100644 index 7fc9dd8..0000000 --- a/source/OpenPGP.package/DESTestCase.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "testRivest" : " 7/23/2018 10:01:09", - "testRivestWithBase" : " 7/23/2018 10:01:09", - "testSSLeay" : " 7/23/2018 10:01:09", - "testSSLeayWithBase" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/DESTestCase.class/properties.json b/source/OpenPGP.package/DESTestCase.class/properties.json deleted file mode 100644 index 0f01162..0000000 --- a/source/OpenPGP.package/DESTestCase.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 19:18", - "instvars" : [ - ], - "name" : "DESTestCase", - "pools" : [ - ], - "super" : "TestCase", - "type" : "normal" } diff --git a/source/OpenPGP.package/FeistelCipher.class/README.md b/source/OpenPGP.package/FeistelCipher.class/README.md deleted file mode 100644 index 5ce2bc3..0000000 --- a/source/OpenPGP.package/FeistelCipher.class/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Subclasses implement so-called Feistel ciphers (DES, CAST5, Blowfish). Such ciphers apply a fixed number of transformations to their input data to encrypt. Decryption is achieved by applying the same transformations in reverse. - -Instance Variables: -k data for the different rounds, derived from the encryption key. \ No newline at end of file diff --git a/source/OpenPGP.package/FeistelCipher.class/methodProperties.json b/source/OpenPGP.package/FeistelCipher.class/methodProperties.json deleted file mode 100644 index 0e4a662..0000000 --- a/source/OpenPGP.package/FeistelCipher.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - } } diff --git a/source/OpenPGP.package/FeistelCipher.class/properties.json b/source/OpenPGP.package/FeistelCipher.class/properties.json deleted file mode 100644 index 4c63808..0000000 --- a/source/OpenPGP.package/FeistelCipher.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 19:13", - "instvars" : [ - "k" ], - "name" : "FeistelCipher", - "pools" : [ - ], - "super" : "BlockCipher", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGP.class/README.md b/source/OpenPGP.package/OpenPGP.class/README.md deleted file mode 100644 index 7744345..0000000 --- a/source/OpenPGP.package/OpenPGP.class/README.md +++ /dev/null @@ -1 +0,0 @@ -This class serves as a central interface to the OpenPGP implementation classes. Clients should not reference those classes directly, but they may use all non-private methods on the class side. \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGP.class/class/initialize.st b/source/OpenPGP.package/OpenPGP.class/class/initialize.st deleted file mode 100644 index cc136b5..0000000 --- a/source/OpenPGP.package/OpenPGP.class/class/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -class initialization -initialize - "OpenPGP initialize" - DefaultPrivateKeyFile := '/home/hmm/.gnupg/secring.gpg'. - DefaultPublicKeyFile := '/home/hmm/.gnupg/pubring.gpg' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGP.class/instance/decryptFile..st b/source/OpenPGP.package/OpenPGP.class/instance/decryptFile..st deleted file mode 100644 index 7e76bef..0000000 --- a/source/OpenPGP.package/OpenPGP.class/instance/decryptFile..st +++ /dev/null @@ -1,5 +0,0 @@ -decryption -decryptFile: aFilename - | str | - str := FileStream readOnlyFileNamed: aFilename. - [self handleStream: str visitor: OpenPGPDecryption new] ensure: [str close] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGP.class/instance/handleStream.visitor..st b/source/OpenPGP.package/OpenPGP.class/instance/handleStream.visitor..st deleted file mode 100644 index 9df2b64..0000000 --- a/source/OpenPGP.package/OpenPGP.class/instance/handleStream.visitor..st +++ /dev/null @@ -1,9 +0,0 @@ -private -handleStream: aStream visitor: aVisitor - | str packet | - aVisitor config: self. - str := OpenPGPStream onStream: aStream. - [str atEnd] whileFalse: [ - packet := str nextPacket. - packet acceptVisitor: aVisitor]. - aVisitor finish \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGP.class/instance/privateKeys.st b/source/OpenPGP.package/OpenPGP.class/instance/privateKeys.st deleted file mode 100644 index 7e2ff26..0000000 --- a/source/OpenPGP.package/OpenPGP.class/instance/privateKeys.st +++ /dev/null @@ -1,4 +0,0 @@ -private -privateKeys - privateKeys == nil ifTrue: [privateKeys := self readKeyring: DefaultPrivateKeyFile]. - ^privateKeys \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGP.class/instance/publicKeys.st b/source/OpenPGP.package/OpenPGP.class/instance/publicKeys.st deleted file mode 100644 index a04aa77..0000000 --- a/source/OpenPGP.package/OpenPGP.class/instance/publicKeys.st +++ /dev/null @@ -1,4 +0,0 @@ -private -publicKeys - publicKeys == nil ifTrue: [publicKeys := self readKeyring: DefaultPublicKeyFile]. - ^publicKeys \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGP.class/instance/readKeyring..st b/source/OpenPGP.package/OpenPGP.class/instance/readKeyring..st deleted file mode 100644 index 1f71438..0000000 --- a/source/OpenPGP.package/OpenPGP.class/instance/readKeyring..st +++ /dev/null @@ -1,5 +0,0 @@ -private -readKeyring: aFilename - | in | - in := OpenPGPStream onStream: (FileStream readOnlyFileNamed: aFilename). - ^[OpenPGPKeyring new readFrom: in] ensure: [in close] diff --git a/source/OpenPGP.package/OpenPGP.class/methodProperties.json b/source/OpenPGP.package/OpenPGP.class/methodProperties.json deleted file mode 100644 index a1ee613..0000000 --- a/source/OpenPGP.package/OpenPGP.class/methodProperties.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "class" : { - "initialize" : " 7/23/2018 10:01:09" }, - "instance" : { - "decryptFile:" : " 7/23/2018 10:01:09", - "handleStream:visitor:" : " 7/23/2018 10:01:09", - "privateKeys" : " 7/23/2018 10:01:09", - "publicKeys" : " 7/23/2018 10:01:09", - "readKeyring:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGP.class/properties.json b/source/OpenPGP.package/OpenPGP.class/properties.json deleted file mode 100644 index 703f016..0000000 --- a/source/OpenPGP.package/OpenPGP.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - "DefaultPrivateKeyFile", - "DefaultPublicKeyFile" ], - "commentStamp" : "hmm 3/30/2002 14:32", - "instvars" : [ - "publicKeys", - "privateKeys", - "options" ], - "name" : "OpenPGP", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/README.md b/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 20e29d9..0000000 --- a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleCompressedDataPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/instance/uncompressedData.st b/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/instance/uncompressedData.st deleted file mode 100644 index 646aa2f..0000000 --- a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/instance/uncompressedData.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -uncompressedData - data first = 1 ifFalse: [self error: 'only inflate supported']. - ^(InflateStream on: data from: 2 to: data size) upToEnd \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/methodProperties.json deleted file mode 100644 index 4539971..0000000 --- a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/methodProperties.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "uncompressedData" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/properties.json b/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/properties.json deleted file mode 100644 index 0e1b669..0000000 --- a/source/OpenPGP.package/OpenPGPCompressedDataPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPCompressedDataPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPDSAData.class/README.md b/source/OpenPGP.package/OpenPGPDSAData.class/README.md deleted file mode 100644 index 1dfd3ad..0000000 --- a/source/OpenPGP.package/OpenPGPDSAData.class/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This class stores algorithm-specific data for DSA signature keys in OpenPGP. -Its MPIs are p, q, g, and y. \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDSAData.class/instance/numMPIs.st b/source/OpenPGP.package/OpenPGPDSAData.class/instance/numMPIs.st deleted file mode 100644 index 454cac7..0000000 --- a/source/OpenPGP.package/OpenPGPDSAData.class/instance/numMPIs.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -numMPIs - ^4 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDSAData.class/methodProperties.json b/source/OpenPGP.package/OpenPGPDSAData.class/methodProperties.json deleted file mode 100644 index 7252f3d..0000000 --- a/source/OpenPGP.package/OpenPGPDSAData.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "numMPIs" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPDSAData.class/properties.json b/source/OpenPGP.package/OpenPGPDSAData.class/properties.json deleted file mode 100644 index b144ccc..0000000 --- a/source/OpenPGP.package/OpenPGPDSAData.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/25/2002 21:34", - "instvars" : [ - ], - "name" : "OpenPGPDSAData", - "pools" : [ - ], - "super" : "OpenPGPPublicKeyAlgorithmData", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/README.md b/source/OpenPGP.package/OpenPGPDecryption.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/instance/cipher.st b/source/OpenPGP.package/OpenPGPDecryption.class/instance/cipher.st deleted file mode 100644 index 204d764..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/instance/cipher.st +++ /dev/null @@ -1,9 +0,0 @@ -accessing -cipher - | pw | - cipher == nil ifFalse: [^cipher]. - symmetricKeyPacket == nil ifFalse: [ - pw := FillInTheBlank requestPassword: 'Passphrase for symmetric cipher?'. - pw = '' ifFalse: [ - ^cipher := symmetricKeyPacket cipherWithPassphrase: pw]]. - self halt \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleCompressedDataPacket..st b/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleCompressedDataPacket..st deleted file mode 100644 index 31418dc..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleCompressedDataPacket..st +++ /dev/null @@ -1,5 +0,0 @@ -visitor -handleCompressedDataPacket: anOpenPGPPacket - | data | - data := anOpenPGPPacket uncompressedData. - config handleStream: (ReadStream on: data) visitor: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleLiteralDataPacket..st b/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleLiteralDataPacket..st deleted file mode 100644 index 796ac37..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleLiteralDataPacket..st +++ /dev/null @@ -1,5 +0,0 @@ -visitor -handleLiteralDataPacket: anOpenPGPPacket - | str | - str := ReadStream on: anOpenPGPPacket data. - self halt \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleSymmetricKeyEncryptedSessionKeyPacket..st b/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleSymmetricKeyEncryptedSessionKeyPacket..st deleted file mode 100644 index 9ea26f7..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleSymmetricKeyEncryptedSessionKeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleSymmetricKeyEncryptedSessionKeyPacket: anOpenPGPPacket - symmetricKeyPacket := anOpenPGPPacket \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleSymmetricallyEncryptedDataPacket..st b/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleSymmetricallyEncryptedDataPacket..st deleted file mode 100644 index c6c1c2f..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/instance/handleSymmetricallyEncryptedDataPacket..st +++ /dev/null @@ -1,8 +0,0 @@ -visitor -handleSymmetricallyEncryptedDataPacket: anOpenPGPPacket - | data | - [anOpenPGPPacket verifyWithCipher: self cipher] whileFalse: [ - (self confirm: 'Possibly invalid passprase. Do you want to retry?') ifFalse: [^self]. - cipher := nil]. - data := (anOpenPGPPacket decryptWithCipher: self cipher). - config handleStream: (ReadStream on: data) visitor: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/instance/verifyWithCipher..st b/source/OpenPGP.package/OpenPGPDecryption.class/instance/verifyWithCipher..st deleted file mode 100644 index 78aa098..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/instance/verifyWithCipher..st +++ /dev/null @@ -1,3 +0,0 @@ -missing -verifyWithCipher: anObject - self error: #notYetImplemented \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/methodProperties.json b/source/OpenPGP.package/OpenPGPDecryption.class/methodProperties.json deleted file mode 100644 index 49bf3cc..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/methodProperties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "cipher" : " 7/23/2018 10:01:09", - "handleCompressedDataPacket:" : " 7/23/2018 10:01:09", - "handleLiteralDataPacket:" : " 7/23/2018 10:01:09", - "handleSymmetricKeyEncryptedSessionKeyPacket:" : " 7/23/2018 10:01:09", - "handleSymmetricallyEncryptedDataPacket:" : " 7/23/2018 10:01:09", - "verifyWithCipher:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPDecryption.class/properties.json b/source/OpenPGP.package/OpenPGPDecryption.class/properties.json deleted file mode 100644 index 70bd943..0000000 --- a/source/OpenPGP.package/OpenPGPDecryption.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "symmetricKeyPacket", - "publicKeyPacket", - "cipher" ], - "name" : "OpenPGPDecryption", - "pools" : [ - ], - "super" : "OpenPGPVisitor", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPElgamalData.class/README.md b/source/OpenPGP.package/OpenPGPElgamalData.class/README.md deleted file mode 100644 index 255d913..0000000 --- a/source/OpenPGP.package/OpenPGPElgamalData.class/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This class stores algorithm-specific data for Elgamal encryption keys in OpenPGP. -Its MPIs are g**k mod p and m * y**k mod p \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPElgamalData.class/instance/numMPIs.st b/source/OpenPGP.package/OpenPGPElgamalData.class/instance/numMPIs.st deleted file mode 100644 index b88ced6..0000000 --- a/source/OpenPGP.package/OpenPGPElgamalData.class/instance/numMPIs.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -numMPIs - ^3 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPElgamalData.class/methodProperties.json b/source/OpenPGP.package/OpenPGPElgamalData.class/methodProperties.json deleted file mode 100644 index 7252f3d..0000000 --- a/source/OpenPGP.package/OpenPGPElgamalData.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "numMPIs" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPElgamalData.class/properties.json b/source/OpenPGP.package/OpenPGPElgamalData.class/properties.json deleted file mode 100644 index 18b626c..0000000 --- a/source/OpenPGP.package/OpenPGPElgamalData.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/25/2002 21:37", - "instvars" : [ - ], - "name" : "OpenPGPElgamalData", - "pools" : [ - ], - "super" : "OpenPGPPublicKeyAlgorithmData", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/README.md b/source/OpenPGP.package/OpenPGPKeyring.class/README.md deleted file mode 100644 index 9ab4f9a..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Istances of this class store PGP keyrings. - -Instance Variables: -entries OpenPGPKeyringEntry> entries keyed by key ID (16-byte hex string) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/instance/entries.st b/source/OpenPGP.package/OpenPGPKeyring.class/instance/entries.st deleted file mode 100644 index 7240a10..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/instance/entries.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -entries - ^entries \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/instance/keysWithID..st b/source/OpenPGP.package/OpenPGPKeyring.class/instance/keysWithID..st deleted file mode 100644 index 2bd463c..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/instance/keysWithID..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keysWithID: aKeyID - ^entries select: [:each | each packets first keyID = aKeyID] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/instance/keysWithUserIDMatching..st b/source/OpenPGP.package/OpenPGPKeyring.class/instance/keysWithUserIDMatching..st deleted file mode 100644 index ce77c1d..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/instance/keysWithUserIDMatching..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keysWithUserIDMatching: aString - ^entries select: [:each | (each packets - detect: [:pack | pack isUserIDPacket and: [aString match: pack data asString]] - ifNone: []) notNil] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/instance/readFrom..st b/source/OpenPGP.package/OpenPGPKeyring.class/instance/readFrom..st deleted file mode 100644 index d841a3c..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/instance/readFrom..st +++ /dev/null @@ -1,10 +0,0 @@ -reading -readFrom: aStream - | packet entry | - entries := OrderedCollection new. - [aStream atEnd] whileFalse: [ - packet := aStream nextPacket. - packet isKeyPacket - ifTrue: [packet owner: self. entries add: (entry := packet)] - ifFalse: [(entry add: packet) ifFalse: [self halt]]]. - entries := entries asSortedCollection: [:a :b | a userIDString < b userIDString] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/methodProperties.json b/source/OpenPGP.package/OpenPGPKeyring.class/methodProperties.json deleted file mode 100644 index 078c57c..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "entries" : " 7/23/2018 10:01:09", - "keysWithID:" : " 7/23/2018 10:01:09", - "keysWithUserIDMatching:" : " 7/23/2018 10:01:09", - "readFrom:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPKeyring.class/properties.json b/source/OpenPGP.package/OpenPGPKeyring.class/properties.json deleted file mode 100644 index e323187..0000000 --- a/source/OpenPGP.package/OpenPGPKeyring.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 19:19", - "instvars" : [ - "entries" ], - "name" : "OpenPGPKeyring", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/README.md b/source/OpenPGP.package/OpenPGPKeyringEntry.class/README.md deleted file mode 100644 index 54c93ef..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Instances of this class represent keyring entries. Their first packet is always a public or secret key packet, and the following packets are additional data (IDs, subkeys) and signatures for that key. - -Instance Variables: -packets packets comprising this key \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/class/new.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/class/new.st deleted file mode 100644 index 4e996cc..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^super new initialize \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/class/preferredKeys.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/class/preferredKeys.st deleted file mode 100644 index 9a903ba..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/class/preferredKeys.st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -preferredKeys - PreferredKeys isNil ifTrue: [PreferredKeys := Set new]. - ^PreferredKeys \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/add..st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/add..st deleted file mode 100644 index a115808..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/add..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -add: aPacket - packets add: aPacket \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/detectPacket.return..st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/detectPacket.return..st deleted file mode 100644 index 6435178..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/detectPacket.return..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -detectPacket: detectBlock return: valueBlock - ^self - detectPacket: detectBlock - return: valueBlock - ifNone: [] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/detectPacket.return.ifNone..st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/detectPacket.return.ifNone..st deleted file mode 100644 index e72aa03..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/detectPacket.return.ifNone..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -detectPacket: detectBlock return: valueBlock ifNone: noneBlock - packets do: [:each | - (detectBlock value: each) ifTrue: [^valueBlock value: each]]. - ^noneBlock value \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/initialize.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/initialize.st deleted file mode 100644 index a2d9280..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/initialize.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -initialize - packets := OrderedCollection new \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyID.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyID.st deleted file mode 100644 index 25eb99b..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyID.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keyID - ^packets first keyID \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyID8Hex.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyID8Hex.st deleted file mode 100644 index 126b991..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyID8Hex.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keyID8Hex - ^packets first keyID8Hex \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyIDHex.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyIDHex.st deleted file mode 100644 index 9e929d7..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/keyIDHex.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keyIDHex - ^packets first keyIDHex \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/packets.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/packets.st deleted file mode 100644 index ab27bd9..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/packets.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -packets - ^packets \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/photoID.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/photoID.st deleted file mode 100644 index 881c7ca..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/photoID.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -photoID - ^self - detectPacket: [:p | p isPhotoIDPacket] - return: [:p | p image] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/preferred..st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/preferred..st deleted file mode 100644 index 5c8845b..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/preferred..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -preferred: aBoolean - aBoolean - ifTrue: [self class preferredKeys add: self keyID] - ifFalse: [self class preferredKeys remove: self keyID ifAbsent: []] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/preferred.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/preferred.st deleted file mode 100644 index 2b2fef1..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/preferred.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -preferred - "This is stored in a class variable for the time being" - ^self class preferredKeys includes: self keyID \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/printOn..st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/printOn..st deleted file mode 100644 index de7f251..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/printOn..st +++ /dev/null @@ -1,12 +0,0 @@ -printing -printOn: aStream - | key | - super printOn: aStream. - packets isEmpty ifTrue: [^self]. - key := packets first keyID printStringRadix: 16. - key size < 8 ifTrue: [key := (String new: 8-key size withAll: $0), key]. - aStream nextPutAll: ', keyID='. - aStream nextPutAll: key. - aStream nextPutAll: ', created='. - packets first printCreationDateAndTimeOn: aStream. - packets do: [:each | each isUserIDPacket ifTrue: [aStream space; print: each dataAsString]] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/trust.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/trust.st deleted file mode 100644 index 473e6da..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/trust.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -trust - ^'?' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/type.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/type.st deleted file mode 100644 index 4480499..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/type.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -type - ^packets first version printString \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/userID.st b/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/userID.st deleted file mode 100644 index ab0b929..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/instance/userID.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -userID - ^self - detectPacket: [:p | p isUserIDPacket] - return: [:p | p dataAsString] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/methodProperties.json b/source/OpenPGP.package/OpenPGPKeyringEntry.class/methodProperties.json deleted file mode 100644 index f185ef0..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/methodProperties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "class" : { - "new" : " 7/23/2018 10:01:09", - "preferredKeys" : " 7/23/2018 10:01:09" }, - "instance" : { - "add:" : " 7/23/2018 10:01:09", - "detectPacket:return:" : " 7/23/2018 10:01:09", - "detectPacket:return:ifNone:" : " 7/23/2018 10:01:09", - "initialize" : " 7/23/2018 10:01:09", - "keyID" : " 7/23/2018 10:01:09", - "keyID8Hex" : " 7/23/2018 10:01:09", - "keyIDHex" : " 7/23/2018 10:01:09", - "packets" : " 7/23/2018 10:01:09", - "photoID" : " 7/23/2018 10:01:09", - "preferred" : " 7/23/2018 10:01:09", - "preferred:" : " 7/23/2018 10:01:09", - "printOn:" : " 7/23/2018 10:01:09", - "trust" : " 7/23/2018 10:01:09", - "type" : " 7/23/2018 10:01:09", - "userID" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPKeyringEntry.class/properties.json b/source/OpenPGP.package/OpenPGPKeyringEntry.class/properties.json deleted file mode 100644 index c5dbf46..0000000 --- a/source/OpenPGP.package/OpenPGPKeyringEntry.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - "PreferredKeys" ], - "commentStamp" : "hmm 3/26/2002 19:19", - "instvars" : [ - "packets" ], - "name" : "OpenPGPKeyringEntry", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/README.md b/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/instance/acceptVisitor..st deleted file mode 100644 index bdb2539..0000000 --- a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleLiteralDataPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/methodProperties.json deleted file mode 100644 index 04157f6..0000000 --- a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/properties.json b/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/properties.json deleted file mode 100644 index 47e55f8..0000000 --- a/source/OpenPGP.package/OpenPGPLiteralDataPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPLiteralDataPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPMarkerPacket.class/README.md b/source/OpenPGP.package/OpenPGPMarkerPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPMarkerPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPMarkerPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 3aecf46..0000000 --- a/source/OpenPGP.package/OpenPGPMarkerPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleMarkerPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPMarkerPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPMarkerPacket.class/methodProperties.json deleted file mode 100644 index 04157f6..0000000 --- a/source/OpenPGP.package/OpenPGPMarkerPacket.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPMarkerPacket.class/properties.json b/source/OpenPGP.package/OpenPGPMarkerPacket.class/properties.json deleted file mode 100644 index feadeef..0000000 --- a/source/OpenPGP.package/OpenPGPMarkerPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPMarkerPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/README.md b/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/instance/acceptVisitor..st deleted file mode 100644 index 4a36328..0000000 --- a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleOpenPassSignaturePacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/methodProperties.json deleted file mode 100644 index 04157f6..0000000 --- a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/properties.json b/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/properties.json deleted file mode 100644 index dfd957b..0000000 --- a/source/OpenPGP.package/OpenPGPOnePassSignaturePacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPOnePassSignaturePacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPPacket.class/README.md b/source/OpenPGP.package/OpenPGPPacket.class/README.md deleted file mode 100644 index 074a9fa..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/README.md +++ /dev/null @@ -1,7 +0,0 @@ -This class is used to represent OpenPGP packets. There are no subclasses; all type-specific behavior is implemented by the interpretedData inst var. This makes it easier to parse and write OpenPGP files, even if they contain unknown packet types. - -Instance Variables: -header the first byte of the packet -dataSize size of the data, or nil if the packet has undetermined size -data raw data contents of packet -trust contents of associated trust packed \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/class/initialize.st b/source/OpenPGP.package/OpenPGPPacket.class/class/initialize.st deleted file mode 100644 index 2c2a38b..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/class/initialize.st +++ /dev/null @@ -1,21 +0,0 @@ -class initialization -initialize - "OpenPGPPacket initialize" - TagTypes := Array new: 64 withAll: 'user defined'. - #( 0 'Reserved' - 1 'Public-Key Encrypted Session Key' - 2 'Signature' - 3 'Symmetric-Key Encrypted Session Key' - 4 'One-Pass Signature' - 5 'Secret Key' - 6 'Public Key' - 7 'Secret Subkey' - 8 'Compressed Data' - 9 'Symmetrically Encrypted Data' - 10 'Marker' - 11 'Literal Data' - 12 'Trust' - 13 'User ID' - 14 'Public Subkey' - 17 'Photo ID') pairsDo: [:index :string | - TagTypes at: index+1 put: string] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/class/packetClassForTag..st b/source/OpenPGP.package/OpenPGPPacket.class/class/packetClassForTag..st deleted file mode 100644 index f24c124..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/class/packetClassForTag..st +++ /dev/null @@ -1,19 +0,0 @@ -accessing -packetClassForTag: anInteger - anInteger = 0 ifTrue: [self error: 'invalid packet tag value']. - anInteger = 1 ifTrue: [^OpenPGPPublicKeyEncryptedSessionKeyPacket]. - anInteger = 2 ifTrue: [^OpenPGPSignaturePacket]. - anInteger = 3 ifTrue: [^OpenPGPSymmetricKeyEncryptedSessionKeyPacket]. - anInteger = 4 ifTrue: [^OpenPGPOnePassSignaturePacket]. - anInteger = 5 ifTrue: [^OpenPGPSecretKeyPacket]. - anInteger = 6 ifTrue: [^OpenPGPPublicKeyPacket]. - anInteger = 7 ifTrue: [^OpenPGPSecretSubkeyPacket]. - anInteger = 8 ifTrue: [^OpenPGPCompressedDataPacket]. - anInteger = 9 ifTrue: [^OpenPGPSymmetricallyEncryptedDataPacket]. - anInteger = 10 ifTrue: [^OpenPGPMarkerPacket]. - anInteger = 11 ifTrue: [^OpenPGPLiteralDataPacket]. - anInteger = 12 ifTrue: [^OpenPGPTrustPacket]. - anInteger = 13 ifTrue: [^OpenPGPUserIDPacket]. - anInteger = 14 ifTrue: [^OpenPGPPublicSubkeyPacket]. - anInteger = 17 ifTrue: [^OpenPGPPhotoIDPacket]. - ^self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/class/readFrom..st b/source/OpenPGP.package/OpenPGPPacket.class/class/readFrom..st deleted file mode 100644 index 3ce22a7..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/class/readFrom..st +++ /dev/null @@ -1,25 +0,0 @@ -instance creation -readFrom: aStream - | oldFormat lengthType header tag data dataSize | - header := aStream next. - header < 128 ifTrue: [self errorInvalidHeader]. - oldFormat := (header bitAnd: 64) = 0. - oldFormat - ifTrue: [ - tag := (header bitShift: -2) bitAnd: 15. - lengthType := header bitAnd: 3. - lengthType = 3 - ifTrue: [ - data := aStream upToEnd] - ifFalse: [ - dataSize := aStream nextNumber: (1 bitShift: lengthType). - data := aStream next: dataSize]] - ifFalse: [ - tag := header bitAnd: 63. - [dataSize := aStream nextNewFormatPacketLength. - data := data isNil - ifTrue: [aStream next: dataSize abs] - ifFalse: [data, (aStream next: dataSize abs)]. - dataSize < 0] whileTrue: []. - dataSize := data size]. - ^(self packetClassForTag: tag) new header: header data: data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/class/symmetricKeyAlgorithmFor..st b/source/OpenPGP.package/OpenPGPPacket.class/class/symmetricKeyAlgorithmFor..st deleted file mode 100644 index 4402546..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/class/symmetricKeyAlgorithmFor..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -symmetricKeyAlgorithmFor: anInteger - anInteger = 2 ifTrue: [^TripleDESForOpenPGP new]. - anInteger = 3 ifTrue: [^CAST5 new]. - self error: 'symmetric key algorithm ', anInteger printString, ' not yet available' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/acceptVisitor..st deleted file mode 100644 index c34e720..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handlePacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/add..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/add..st deleted file mode 100644 index 265ad7d..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/add..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -add: aPacket - ownedPackets isNil ifFalse: [ - (self ownedPackets last add: aPacket) - ifTrue: [^true]]. - (aPacket canBeAddedTo: self) ifFalse: [^false]. - ownedPackets := ownedPackets isNil - ifTrue: [Array with: aPacket] - ifFalse: [ownedPackets copyWith: aPacket]. - aPacket owner: self. - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/canBeAddedTo..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/canBeAddedTo..st deleted file mode 100644 index 86d93dc..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/canBeAddedTo..st +++ /dev/null @@ -1,3 +0,0 @@ -testing -canBeAddedTo: aPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/computeInterpretedData.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/computeInterpretedData.st deleted file mode 100644 index 8989b45..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/computeInterpretedData.st +++ /dev/null @@ -1,14 +0,0 @@ -accessing -computeInterpretedData - | class | - self tag = 13 ifTrue: [ - ^data asString]. - self tag = 2 ifTrue: [ - data first = 3 ifTrue: [ - class := OpenPGPSignatureV3Data]. - data first = 4 ifTrue: [ - class := OpenPGPSignatureV4Data]]. - self tag = 3 ifTrue: [ - class := OpenPGPSymmetricKeyEncryptedSessionKeyPacket]. - class == nil ifTrue: [self error: 'No reader class for this packet type/version yet']. - ^class new readFrom: (OpenPGPStream on: data) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/data.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/data.st deleted file mode 100644 index af67cea..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/data.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -data - ^data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/dataAsString.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/dataAsString.st deleted file mode 100644 index b50f5b9..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/dataAsString.st +++ /dev/null @@ -1,5 +0,0 @@ -printing -dataAsString - "^(data withEncoding: #UTF8) readStream upToEnd" - "^(MultiByteBinaryOrTextStream on: data encoding: 'utf-8') halt upToEnd" - ^data asString \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/dataSize.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/dataSize.st deleted file mode 100644 index e9d039f..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/dataSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -dataSize - ^data size \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/detectPacket.return..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/detectPacket.return..st deleted file mode 100644 index 6435178..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/detectPacket.return..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -detectPacket: detectBlock return: valueBlock - ^self - detectPacket: detectBlock - return: valueBlock - ifNone: [] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/detectPacket.return.ifNone..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/detectPacket.return.ifNone..st deleted file mode 100644 index 86a0326..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/detectPacket.return.ifNone..st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -detectPacket: detectBlock return: valueBlock ifNone: noneBlock - ownedPackets isNil ifFalse: [ - self ownedPackets do: [:each | - (detectBlock value: each) ifTrue: [^valueBlock value: each]. - each detectPacket: detectBlock return: valueBlock ifNone: []]]. - ^noneBlock value \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/header.data..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/header.data..st deleted file mode 100644 index fd45138..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/header.data..st +++ /dev/null @@ -1,5 +0,0 @@ -initialize-release -header: headerInteger data: dataBytes - header := headerInteger. - data := dataBytes. - "self parseData: (OpenPGPStream on: data)" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/header.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/header.st deleted file mode 100644 index 43ee7cd..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/header.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -header - ^header \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isKeyPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isKeyPacket.st deleted file mode 100644 index 89a62c7..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isKeyPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isOldFormat.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isOldFormat.st deleted file mode 100644 index 3be042a..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isOldFormat.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isOldFormat - ^(header bitAnd: 64) = 0 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isPhotoIDPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isPhotoIDPacket.st deleted file mode 100644 index f8c4ade..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isPhotoIDPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isPhotoIDPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isPrivateKeyPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isPrivateKeyPacket.st deleted file mode 100644 index f9b2acd..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isPrivateKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isPrivateKeyPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isPublicKeyPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isPublicKeyPacket.st deleted file mode 100644 index 84b2a9f..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isPublicKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isPublicKeyPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isSignaturePacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isSignaturePacket.st deleted file mode 100644 index 965be06..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isSignaturePacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isSignaturePacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isSubkeyPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isSubkeyPacket.st deleted file mode 100644 index 89acee5..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isSubkeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isSubkeyPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isSymmetricKeyEncryptedSessionKeyPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isSymmetricKeyEncryptedSessionKeyPacket.st deleted file mode 100644 index edd5606..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isSymmetricKeyEncryptedSessionKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isSymmetricKeyEncryptedSessionKeyPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isTrustPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isTrustPacket.st deleted file mode 100644 index 01f8478..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isTrustPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isTrustPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/isUserIDPacket.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/isUserIDPacket.st deleted file mode 100644 index 48a995e..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/isUserIDPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isUserIDPacket - ^false \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/oldFormat.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/oldFormat.st deleted file mode 100644 index 9da42aa..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/oldFormat.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -oldFormat - ^(header bitAnd: 64) = 0 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/ownedPackets.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/ownedPackets.st deleted file mode 100644 index ba6cebb..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/ownedPackets.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -ownedPackets - ^ownedPackets ifNil: [#()] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/owner..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/owner..st deleted file mode 100644 index 38ec807..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/owner..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -owner: aPacketOrKeyring - owner := aPacketOrKeyring \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/owner.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/owner.st deleted file mode 100644 index e608e1a..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/owner.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -owner - ^owner \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/parseData..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/parseData..st deleted file mode 100644 index f314484..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/parseData..st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -parseData: aStream - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/parseData.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/parseData.st deleted file mode 100644 index c62a64e..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/parseData.st +++ /dev/null @@ -1,3 +0,0 @@ -initialize-release -parseData - self parseData: (OpenPGPStream on: data) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/printDataOn..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/printDataOn..st deleted file mode 100644 index a32fbdc..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/printDataOn..st +++ /dev/null @@ -1,4 +0,0 @@ -printing -printDataOn: aStream - aStream nextPutAll: ', data='. - aStream print: self data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/printOn..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/printOn..st deleted file mode 100644 index d80e2ff..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/printOn..st +++ /dev/null @@ -1,18 +0,0 @@ -printing -printOn: aStream - aStream nextPutAll: 'OpenPGP '. - aStream nextPutAll: (TagTypes at: self tag+1); nextPutAll: ', tag='. - aStream print: self tag. - "aStream nextPutAll: ', format='. - aStream nextPutAll: (self isOldFormat ifTrue: ['old'] ifFalse: ['new'])." - self version isNil ifFalse: [ - aStream nextPutAll: ', version='. - self version printOn: aStream. - ]. - aStream nextPutAll: ', size='. - aStream print: self dataSize. - self isKeyPacket ifTrue: [ - aStream nextPutAll: ', created='. - self printCreationDateAndTimeOn: aStream]. - self printDataOn: aStream. - aStream cr \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/saveOn..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/saveOn..st deleted file mode 100644 index 419ad6a..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/saveOn..st +++ /dev/null @@ -1,22 +0,0 @@ -printing -saveOn: aStream - | oldFormat lengthType dataSize | - aStream nextPut: header. - oldFormat := (header bitAnd: 64) = 0. - oldFormat - ifTrue: [ - lengthType := header bitAnd: 3. - lengthType = 3 - ifTrue: [ - aStream nextPutAll: data] - ifFalse: [ - aStream nextNumber: (1 bitShift: lengthType) put: data size. - aStream nextPutAll: data]] - ifFalse: [ - [self halt. - dataSize := aStream nextNewFormatPacketLength. - data := data isNil - ifTrue: [aStream next: dataSize abs] - ifFalse: [data, (aStream next: dataSize abs)]. - dataSize < 0] whileTrue: []. - dataSize := data size]. \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/tag.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/tag.st deleted file mode 100644 index 49e0243..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/tag.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tag - ^self isOldFormat - ifTrue: [(header bitShift: -2) bitAnd: 15] - ifFalse: [header bitAnd: 63] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/trust..st b/source/OpenPGP.package/OpenPGPPacket.class/instance/trust..st deleted file mode 100644 index c1370a1..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/trust..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -trust: anInteger - trust := anInteger \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/trust.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/trust.st deleted file mode 100644 index 87c7366..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/trust.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -trust - ^trust \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/instance/version.st b/source/OpenPGP.package/OpenPGPPacket.class/instance/version.st deleted file mode 100644 index 8c7d2cc..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/instance/version.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -version - "subclasses can reimplement this" - ^nil \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPPacket.class/methodProperties.json deleted file mode 100644 index e25ed17..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/methodProperties.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "class" : { - "initialize" : " 7/23/2018 10:01:09", - "packetClassForTag:" : " 7/23/2018 10:01:09", - "readFrom:" : " 7/23/2018 10:01:09", - "symmetricKeyAlgorithmFor:" : " 7/23/2018 10:01:09" }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "add:" : " 7/23/2018 10:01:09", - "canBeAddedTo:" : " 7/23/2018 10:01:09", - "computeInterpretedData" : " 7/23/2018 10:01:09", - "data" : " 7/23/2018 10:01:09", - "dataAsString" : " 7/23/2018 10:01:09", - "dataSize" : " 7/23/2018 10:01:09", - "detectPacket:return:" : " 7/23/2018 10:01:09", - "detectPacket:return:ifNone:" : " 7/23/2018 10:01:09", - "header" : " 7/23/2018 10:01:09", - "header:data:" : " 7/23/2018 10:01:09", - "isKeyPacket" : " 7/23/2018 10:01:09", - "isOldFormat" : " 7/23/2018 10:01:09", - "isPhotoIDPacket" : " 7/23/2018 10:01:09", - "isPrivateKeyPacket" : " 7/23/2018 10:01:09", - "isPublicKeyPacket" : " 7/23/2018 10:01:09", - "isSignaturePacket" : " 7/23/2018 10:01:09", - "isSubkeyPacket" : " 7/23/2018 10:01:09", - "isSymmetricKeyEncryptedSessionKeyPacket" : " 7/23/2018 10:01:09", - "isTrustPacket" : " 7/23/2018 10:01:09", - "isUserIDPacket" : " 7/23/2018 10:01:09", - "oldFormat" : " 7/23/2018 10:01:09", - "ownedPackets" : " 7/23/2018 10:01:09", - "owner" : " 7/23/2018 10:01:09", - "owner:" : " 7/23/2018 10:01:09", - "parseData" : " 7/23/2018 10:01:09", - "parseData:" : " 7/23/2018 10:01:09", - "printDataOn:" : " 7/23/2018 10:01:09", - "printOn:" : " 7/23/2018 10:01:09", - "saveOn:" : " 7/23/2018 10:01:09", - "tag" : " 7/23/2018 10:01:09", - "trust" : " 7/23/2018 10:01:09", - "trust:" : " 7/23/2018 10:01:09", - "version" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPPacket.class/properties.json b/source/OpenPGP.package/OpenPGPPacket.class/properties.json deleted file mode 100644 index 075af54..0000000 --- a/source/OpenPGP.package/OpenPGPPacket.class/properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - "TagTypes" ], - "commentStamp" : "hmm 4/6/2002 12:34", - "instvars" : [ - "header", - "version", - "data", - "trust", - "owner", - "ownedPackets" ], - "name" : "OpenPGPPacket", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/README.md b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 80d3845..0000000 --- a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handlePhotoIDPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/canBeAddedTo..st b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/canBeAddedTo..st deleted file mode 100644 index 5b0e6c0..0000000 --- a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/canBeAddedTo..st +++ /dev/null @@ -1,3 +0,0 @@ -testing -canBeAddedTo: aPacket - ^aPacket isPublicKeyPacket \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/image.st b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/image.st deleted file mode 100644 index 8afe43b..0000000 --- a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/image.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -image - "Must use RWBinaryOrTextStream because the XBM reader wants to switch the stream to ascii :-(" - ^ImageReadWriter formFromStream: (RWBinaryOrTextStream with: (data copyFrom: 23 to: data size)) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/isPhotoIDPacket.st b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/isPhotoIDPacket.st deleted file mode 100644 index 5b1fa71..0000000 --- a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/instance/isPhotoIDPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isPhotoIDPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/methodProperties.json deleted file mode 100644 index 86f136e..0000000 --- a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "canBeAddedTo:" : " 7/23/2018 10:01:09", - "image" : " 7/23/2018 10:01:09", - "isPhotoIDPacket" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/properties.json b/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/properties.json deleted file mode 100644 index cbbe6cc..0000000 --- a/source/OpenPGP.package/OpenPGPPhotoIDPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPPhotoIDPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/README.md b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/README.md deleted file mode 100644 index eb64fe3..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Instances of this class hold parameter data for public key algorithms. Since the algorithms known to OpenPGP all use a number of large integers (MPIs in OpenPGP parlance) an instance variable for these is defined in this class. At the moment, subclasses only differ by the number of MPIs stored. - -Instance Variables: -mpis MPIs for this algorithm \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/class/forPGPAlgorithmID..st b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/class/forPGPAlgorithmID..st deleted file mode 100644 index 5815bd6..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/class/forPGPAlgorithmID..st +++ /dev/null @@ -1,7 +0,0 @@ -instance creation -forPGPAlgorithmID: anInteger - (anInteger between: 1 and: 3) ifTrue: [^OpenPGPRSAData new]. - anInteger = 16 ifTrue: [^OpenPGPElgamalData new]. - anInteger = 17 ifTrue: [^OpenPGPDSAData new]. - anInteger = 20 ifTrue: [^OpenPGPElgamalData new]. - self error: 'PGP algorithm ', anInteger printString, ' is not yet supported' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/mpis.st b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/mpis.st deleted file mode 100644 index 7d41777..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/mpis.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -mpis - ^mpis \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/numMPIs.st b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/numMPIs.st deleted file mode 100644 index 45c5fd0..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/numMPIs.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -numMPIs - self subclassResponsibility \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/publicKey.st b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/publicKey.st deleted file mode 100644 index a3b79d6..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/publicKey.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -publicKey - self subclassResponsibility \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/readFrom..st b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/readFrom..st deleted file mode 100644 index 2d4b790..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/instance/readFrom..st +++ /dev/null @@ -1,3 +0,0 @@ -reading -readFrom: aStream - mpis := (1 to: self numMPIs) collect: [:i | aStream nextMPI] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/methodProperties.json b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/methodProperties.json deleted file mode 100644 index 9e61dcc..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - "forPGPAlgorithmID:" : " 7/23/2018 10:01:09" }, - "instance" : { - "mpis" : " 7/23/2018 10:01:09", - "numMPIs" : " 7/23/2018 10:01:09", - "publicKey" : " 7/23/2018 10:01:09", - "readFrom:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/properties.json b/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/properties.json deleted file mode 100644 index a2c1dde..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyAlgorithmData.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/25/2002 21:32", - "instvars" : [ - "mpis" ], - "name" : "OpenPGPPublicKeyAlgorithmData", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/README.md b/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/instance/acceptVisitor..st deleted file mode 100644 index b613379..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handlePublicKeyEncryptedSessionKeyPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/methodProperties.json deleted file mode 100644 index 04157f6..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/properties.json b/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/properties.json deleted file mode 100644 index f07f5e8..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyEncryptedSessionKeyPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPPublicKeyEncryptedSessionKeyPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/README.md b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/README.md deleted file mode 100644 index ec4f62c..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/README.md +++ /dev/null @@ -1,7 +0,0 @@ -This class holds data describing a public key. Subclasses exist for OpenPGP V3 and V4 formats. - -Instance Variables: -creationTime number of seconds since 1.1.1970 GMT (presumably) -publicKeyAlgorithm number of public key algorithm. See RFC2440 for possible values. -algorithmSpecificData data specifying the key in the chosen public key algorithm -fingerprint hash of the key's data, used to verify the authenticity of a key via phone etc. \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/acceptVisitor..st deleted file mode 100644 index a59bc45..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handlePublicKeyPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/algorithmSpecificData.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/algorithmSpecificData.st deleted file mode 100644 index 15bf3aa..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/algorithmSpecificData.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -algorithmSpecificData - algorithmSpecificData isNil ifTrue: [self parseData]. - ^algorithmSpecificData \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/computeFingerprint.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/computeFingerprint.st deleted file mode 100644 index ddcdcd3..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/computeFingerprint.st +++ /dev/null @@ -1,29 +0,0 @@ -private -computeFingerprint - | str bits len hash result | - version <= 3 ifTrue: [ - str := ReadWriteStream on: (ByteArray new: 300). - self mpis do: [:each | - bits := each highBit. - str nextNumber: bits+7//8 put: each]. - str reset. - hash := MD5 hashStream: str. - result := 0. - hash do: [:each | result := (result bitShift: 8) + each]. - ^result]. - version = 4 ifTrue: [ - str := ReadWriteStream on: (ByteArray new: 300). - str - nextPut: 16r99; - nextNumber: 2 put: 0; - nextPut: 4; - nextNumber: 4 put: creationTime; - nextPut: publicKeyAlgorithm. - self mpis do: [:each | - str nextNumber: 2 put: (bits := each highBit). - str nextNumber: bits+7//8 put: each]. - len := str position-3. - str position: 1. - str nextNumber: 2 put: len. - str reset. - ^SecureHashAlgorithm new hashStream: str] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationDateAndTime.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationDateAndTime.st deleted file mode 100644 index 782ecd8..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationDateAndTime.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -creationDateAndTime - | t | - t := self creationTime + 2177452800. - "^Array with: (Date fromSeconds: t) with: (Time fromSeconds: t\\86400)" - ^DateAndTime fromSeconds: t \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationDateAndTimeFormatted.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationDateAndTimeFormatted.st deleted file mode 100644 index 5654908..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationDateAndTimeFormatted.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -creationDateAndTimeFormatted - | str | - str := WriteStream on: String new. - self printCreationDateAndTimeOn: str. - ^str contents \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationTime.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationTime.st deleted file mode 100644 index a6d5ce2..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/creationTime.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -creationTime - creationTime isNil ifTrue: [self parseData]. - ^creationTime \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/fingerprint.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/fingerprint.st deleted file mode 100644 index 469b06e..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/fingerprint.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -fingerprint - fingerprint = nil ifTrue: [fingerprint := self computeFingerprint]. - ^fingerprint \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/fingerprintHex.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/fingerprintHex.st deleted file mode 100644 index 6ed3b4b..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/fingerprintHex.st +++ /dev/null @@ -1,15 +0,0 @@ -accessing -fingerprintHex - "Return a string with this key's fingerprint. - Version 3 has 16 8-bit hex values; version 4 has 10 16-bit hex values" - | str fp dig n | - str := WriteStream on: String new. - fp := self fingerprint. - n := self version = 3 ifTrue: [16] ifFalse: [20]. - n to: 1 by: -1 do: [:i | - dig := fp digitAt: i. - str nextPut: (Character digitValue: dig // 16). - str nextPut: (Character digitValue: dig \\ 16). - (n = 16 or: [i odd]) ifTrue: [str space. - i = (n/2+1) ifTrue: [str space]]]. - ^str contents \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/isKeyPacket.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/isKeyPacket.st deleted file mode 100644 index 8b3a357..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/isKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isKeyPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/isPublicKeyPacket.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/isPublicKeyPacket.st deleted file mode 100644 index 7d3de8d..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/isPublicKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isPublicKeyPacket - ^self isPrivateKeyPacket not \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID.st deleted file mode 100644 index f10ec79..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keyID - ^(self version <= 3 - ifTrue: [self mpis first] - ifFalse: [self fingerprint]) bitAnd: 16rFFFFFFFF \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID8.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID8.st deleted file mode 100644 index 9be1e7a..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID8.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keyID8 - ^(self version <= 3 - ifTrue: [self mpis first] - ifFalse: [self fingerprint]) bitAnd: 16rFFFFFFFFFFFFFFFF \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID8Hex.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID8Hex.st deleted file mode 100644 index 6e2c45c..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyID8Hex.st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -keyID8Hex - "Return a string with this key's 8-byte ID as hex values" - | str id dig | - str := WriteStream on: String new. - id := self keyID8. - 8 to: 1 by: -1 do: [:i | - dig := id digitAt: i. - str nextPut: (Character digitValue: dig // 16). - str nextPut: (Character digitValue: dig \\ 16). - i = 5 ifTrue: [str space]]. - ^str contents \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyIDHex.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyIDHex.st deleted file mode 100644 index aae2d6d..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/keyIDHex.st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -keyIDHex - "Return a string with this key's ID as hex values" - | str id dig | - str := WriteStream on: String new. - id := self keyID. - 4 to: 1 by: -1 do: [:i | - dig := id digitAt: i. - str nextPut: (Character digitValue: dig // 16). - str nextPut: (Character digitValue: dig \\ 16)]. - ^str contents \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/mpis.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/mpis.st deleted file mode 100644 index 18042e5..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/mpis.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -mpis - ^self algorithmSpecificData mpis \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/parseData..st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/parseData..st deleted file mode 100644 index 364c126..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/parseData..st +++ /dev/null @@ -1,11 +0,0 @@ -reading -parseData: aStream - version := aStream next. - creationTime := aStream nextNumber: 4. - version <= 3 ifTrue: [ - validDays := aStream nextNumber: 2. - publicKeyAlgorithm := aStream next. - algorithmSpecificData := (OpenPGPPublicKeyAlgorithmData forPGPAlgorithmID: publicKeyAlgorithm) readFrom: aStream]. - version = 4 ifTrue: [ - publicKeyAlgorithm := aStream next. - algorithmSpecificData := (OpenPGPPublicKeyAlgorithmData forPGPAlgorithmID: publicKeyAlgorithm) readFrom: aStream] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/photo.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/photo.st deleted file mode 100644 index bc8d280..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/photo.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -photo - photo notNil ifTrue: [^photo]. - ^self - detectPacket: [:p | p isPhotoIDPacket] - return: [:p | photo := p image] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/photoID.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/photoID.st deleted file mode 100644 index 12b4534..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/photoID.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -photoID - ^self ownedPackets detect: [:p | p isPhotoIDPacket] ifNone: [] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/preferred.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/preferred.st deleted file mode 100644 index 5ba0fc4..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/preferred.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -preferred - ^'?' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/printCreationDateAndTimeOn..st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/printCreationDateAndTimeOn..st deleted file mode 100644 index 6635006..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/printCreationDateAndTimeOn..st +++ /dev/null @@ -1,7 +0,0 @@ -printing -printCreationDateAndTimeOn: aStream - | t | - t := self creationDateAndTime. - t asDate printOn: aStream format: #(1 2 3 $. 1 1 2). - aStream space. - t asTime print24: true on: aStream \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/printDataOn..st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/printDataOn..st deleted file mode 100644 index a2834b3..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/printDataOn..st +++ /dev/null @@ -1,7 +0,0 @@ -printing -printDataOn: aStream - aStream nextPutAll: ', id='. - aStream nextPutAll: self keyIDHex. - aStream nextPutAll: ', fingerprint= '. - aStream nextPutAll: self fingerprintHex. - self userIDs first printDataOn: aStream \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/publicKey.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/publicKey.st deleted file mode 100644 index 4b3bcdc..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/publicKey.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -publicKey - ^algorithmSpecificData publicKey \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/trust.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/trust.st deleted file mode 100644 index 473e6da..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/trust.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -trust - ^'?' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/type.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/type.st deleted file mode 100644 index 7b18f7c..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/type.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -type - ^'type' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/userIDString.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/userIDString.st deleted file mode 100644 index 5d6879c..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/userIDString.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -userIDString - userIDString isNil ifTrue: [userIDString := self userIDs first dataAsString]. - ^userIDString \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/userIDs.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/userIDs.st deleted file mode 100644 index 8ae1a23..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/userIDs.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -userIDs - ^self ownedPackets select: [:each | each isUserIDPacket] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/version.st b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/version.st deleted file mode 100644 index dbcb093..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/instance/version.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -version - version isNil ifTrue: [self parseData]. - ^version \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/methodProperties.json deleted file mode 100644 index a27ff1b..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/methodProperties.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "algorithmSpecificData" : " 7/23/2018 10:01:09", - "computeFingerprint" : " 7/23/2018 10:01:09", - "creationDateAndTime" : " 7/23/2018 10:01:09", - "creationDateAndTimeFormatted" : " 7/23/2018 10:01:09", - "creationTime" : " 7/23/2018 10:01:09", - "fingerprint" : " 7/23/2018 10:01:09", - "fingerprintHex" : " 7/23/2018 10:01:09", - "isKeyPacket" : " 7/23/2018 10:01:09", - "isPublicKeyPacket" : " 7/23/2018 10:01:09", - "keyID" : " 7/23/2018 10:01:09", - "keyID8" : " 7/23/2018 10:01:09", - "keyID8Hex" : " 7/23/2018 10:01:09", - "keyIDHex" : " 7/23/2018 10:01:09", - "mpis" : " 7/23/2018 10:01:09", - "parseData:" : " 7/23/2018 10:01:09", - "photo" : " 7/23/2018 10:01:09", - "photoID" : " 7/23/2018 10:01:09", - "preferred" : " 7/23/2018 10:01:09", - "printCreationDateAndTimeOn:" : " 7/23/2018 10:01:09", - "printDataOn:" : " 7/23/2018 10:01:09", - "publicKey" : " 7/23/2018 10:01:09", - "trust" : " 7/23/2018 10:01:09", - "type" : " 7/23/2018 10:01:09", - "userIDString" : " 7/23/2018 10:01:09", - "userIDs" : " 7/23/2018 10:01:09", - "version" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/properties.json b/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/properties.json deleted file mode 100644 index 9c5afb8..0000000 --- a/source/OpenPGP.package/OpenPGPPublicKeyPacket.class/properties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/25/2002 22:22", - "instvars" : [ - "creationTime", - "validDays", - "publicKeyAlgorithm", - "algorithmSpecificData", - "fingerprint", - "userIDString", - "photo" ], - "name" : "OpenPGPPublicKeyPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/README.md b/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/acceptVisitor..st deleted file mode 100644 index bdf9a83..0000000 --- a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handlePublicSubkeyPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/canBeAddedTo..st b/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/canBeAddedTo..st deleted file mode 100644 index 5b0e6c0..0000000 --- a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/canBeAddedTo..st +++ /dev/null @@ -1,3 +0,0 @@ -testing -canBeAddedTo: aPacket - ^aPacket isPublicKeyPacket \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/isSubkeyPacket.st b/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/isSubkeyPacket.st deleted file mode 100644 index ec9c6a3..0000000 --- a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/instance/isSubkeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isSubkeyPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/methodProperties.json deleted file mode 100644 index 9bffcce..0000000 --- a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/methodProperties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "canBeAddedTo:" : " 7/23/2018 10:01:09", - "isSubkeyPacket" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/properties.json b/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/properties.json deleted file mode 100644 index 2d39078..0000000 --- a/source/OpenPGP.package/OpenPGPPublicSubkeyPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPPublicSubkeyPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPRSAData.class/README.md b/source/OpenPGP.package/OpenPGPRSAData.class/README.md deleted file mode 100644 index 60b3ef9..0000000 --- a/source/OpenPGP.package/OpenPGPRSAData.class/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This class stores algorithm-specific data for RSA encryption keys in OpenPGP. -Its single MPI is m**e mod n. \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPRSAData.class/instance/numMPIs.st b/source/OpenPGP.package/OpenPGPRSAData.class/instance/numMPIs.st deleted file mode 100644 index 479b415..0000000 --- a/source/OpenPGP.package/OpenPGPRSAData.class/instance/numMPIs.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -numMPIs - ^2 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPRSAData.class/methodProperties.json b/source/OpenPGP.package/OpenPGPRSAData.class/methodProperties.json deleted file mode 100644 index 7252f3d..0000000 --- a/source/OpenPGP.package/OpenPGPRSAData.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "numMPIs" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPRSAData.class/properties.json b/source/OpenPGP.package/OpenPGPRSAData.class/properties.json deleted file mode 100644 index 42ff3a3..0000000 --- a/source/OpenPGP.package/OpenPGPRSAData.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/25/2002 21:37", - "instvars" : [ - ], - "name" : "OpenPGPRSAData", - "pools" : [ - ], - "super" : "OpenPGPPublicKeyAlgorithmData", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/README.md b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/README.md deleted file mode 100644 index ba7ac01..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/README.md +++ /dev/null @@ -1,7 +0,0 @@ -A S2KSpecifier encodes how cleartext passphrases are converted into encryption keys. See RFC2440 for more info. - -Instance Variables: -type 0, 1, or 3. Only 3 is currently supported (iterated and salted s2k) -hashAlgorithm for the hashing algorithm. Only 2 is currently supported (SHA) -salt 8 bytes for 'salting' the hashing machinery so that the same passphrase will not yield the same hash. -count number of bytes of repeated passphrase data to process \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/count.st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/count.st deleted file mode 100644 index 0df471e..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/count.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -count - ^count \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/hashAlgorithm.st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/hashAlgorithm.st deleted file mode 100644 index 097217a..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/hashAlgorithm.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashAlgorithm - ^hashAlgorithm \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/hashBytes.st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/hashBytes.st deleted file mode 100644 index fb84e60..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/hashBytes.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashBytes - ^20 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/readFrom..st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/readFrom..st deleted file mode 100644 index 9608992..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/readFrom..st +++ /dev/null @@ -1,9 +0,0 @@ -reading -readFrom: aStream - type := aStream next. - (#(0 1 3) includes: type) ifFalse: [self error: 'Unknown string-to-key specifier']. - hashAlgorithm := aStream next. - (type bitAnd: 1) = 1 ifTrue: [salt := aStream next: 8]. - (type bitAnd: 2) = 2 ifTrue: [ - count := aStream next. - count := count \\ 16 + 16 bitShift: count // 16 + 6] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/salt.st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/salt.st deleted file mode 100644 index 0778daa..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/salt.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -salt - ^salt \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/stringToKey.numBytes..st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/stringToKey.numBytes..st deleted file mode 100644 index aa94e37..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/stringToKey.numBytes..st +++ /dev/null @@ -1,16 +0,0 @@ -accessing -stringToKey: aString numBytes: numBytes - | b i hash | - b := 0. - i := 0. - hash := 0. - [b < numBytes] whileTrue: [ - hash := (hash bitShift: self hashBytes * 8) + (self stringToKey: aString preload: i). - b := b + self hashBytes. - i := i + 1]. - b > numBytes ifTrue: [hash := hash bitShift: (numBytes - b) * 8]. - "1 to: hash digitLength // 2 do: [:j | - t := hash digitAt: j. - hash digitAt: j put: (hash digitAt: hash digitLength+1-j). - hash digitAt: hash digitLength+1-j put: t]." - ^hash \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/stringToKey.preload..st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/stringToKey.preload..st deleted file mode 100644 index 4552e1b..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/stringToKey.preload..st +++ /dev/null @@ -1,22 +0,0 @@ -accessing -stringToKey: aString preload: num - | message i | - (type = 3 and: [hashAlgorithm = 2]) ifFalse: [ - self error: 'Only SHA-1 supported at the moment']. - message := ByteArray new: (count max: aString size + salt size) + num. - i := 1 + num. - [i <= message size] whileTrue: [ - message - replaceFrom: i - to: (i + salt size-1 min: message size) - with: salt - startingAt: 1. - i := i + salt size. - i <= message size ifTrue: [ - message - replaceFrom: i - to: (i + aString size-1 min: message size) - with: aString - startingAt: 1. - i := i + aString size]]. - ^SecureHashAlgorithm new hashMessage: message \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/type.st b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/type.st deleted file mode 100644 index 9be52a3..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/instance/type.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -type - ^type \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/methodProperties.json b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/methodProperties.json deleted file mode 100644 index 86fb8cd..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/methodProperties.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "count" : " 7/23/2018 10:01:09", - "hashAlgorithm" : " 7/23/2018 10:01:09", - "hashBytes" : " 7/23/2018 10:01:09", - "readFrom:" : " 7/23/2018 10:01:09", - "salt" : " 7/23/2018 10:01:09", - "stringToKey:numBytes:" : " 7/23/2018 10:01:09", - "stringToKey:preload:" : " 7/23/2018 10:01:09", - "type" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/properties.json b/source/OpenPGP.package/OpenPGPS2KSpecifier.class/properties.json deleted file mode 100644 index 3bba9c3..0000000 --- a/source/OpenPGP.package/OpenPGPS2KSpecifier.class/properties.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/25/2002 22:27", - "instvars" : [ - "type", - "hashAlgorithm", - "salt", - "count" ], - "name" : "OpenPGPS2KSpecifier", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/README.md b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/README.md deleted file mode 100644 index d07e378..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/README.md +++ /dev/null @@ -1,10 +0,0 @@ -Data stored in a secret key OpenPGP packet. - -Instance Variables: -publicKeyData public key data for this private key -stringToKeyUsage specifies how the passphrase protecting the secret key is used -stringToKeySpecifier further specifying string to key conversion -encryptionAlgorithm specifying the encryption algorithm used to protect the key -initialVector initial data for the encryption -mpis algorithm-specific secret key data -checksum checksum to verify that the user gave the correct passphrase diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 4c4f107..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleSecretKeyPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/decryptMPIsUsing..st b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/decryptMPIsUsing..st deleted file mode 100644 index 8ac04c2..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/decryptMPIsUsing..st +++ /dev/null @@ -1,15 +0,0 @@ -private -decryptMPIsUsing: passphrase - "Decrypt the secret key data to use in signing and decryption of encrypted messages. - Returns an Array of LargePositiveIntegers" - | k cast5 cfb bytes sum str | - encryptionAlgorithm = 3 ifFalse: [self error: 'Only CAST5 supported at the moment']. - k := stringToKeySpecifier stringToKey: passphrase numBytes: 16. - cast5 := CAST5 new setKey: k. - cfb := CFBEncryption new cipher: cast5 initialVector: initialVector. - bytes := cfb decryptBytes: mpis. - sum := (bytes unsignedShortAt: bytes size -1 bigEndian: true). - bytes := bytes copyFrom: 1 to: bytes size-2. - bytes sum = sum ifFalse: [^nil]. - str := OpenPGPStream on: (ReadStream on: bytes). - ^str mpisUpToEnd \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/decryptedSecretKeys.st b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/decryptedSecretKeys.st deleted file mode 100644 index cacedf0..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/decryptedSecretKeys.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -decryptedSecretKeys - ^self decryptMPIsUsing: (FillInTheBlank requestPassword: 'Enter your passphrase') \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/isPrivateKeyPacket.st b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/isPrivateKeyPacket.st deleted file mode 100644 index 36f3755..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/isPrivateKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isPrivateKeyPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/parseData..st b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/parseData..st deleted file mode 100644 index 2e901fb..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/parseData..st +++ /dev/null @@ -1,10 +0,0 @@ -reading -parseData: aStream - super parseData: aStream. - stringToKeyUsage := aStream next. - stringToKeyUsage = 255 ifTrue: [ - encryptionAlgorithm := aStream next. - stringToKeySpecifier := aStream nextS2KSpecifier]. - stringToKeyUsage = 0 ifFalse: [ - initialVector := aStream next: 8]. - self readMPIsFrom: aStream \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/readMPIsFrom..st b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/readMPIsFrom..st deleted file mode 100644 index bb681df..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/instance/readMPIsFrom..st +++ /dev/null @@ -1,3 +0,0 @@ -reading -readMPIsFrom: aStream - mpis := ByteArray withAll: aStream upToEnd \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/methodProperties.json deleted file mode 100644 index ecfa878..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/methodProperties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "decryptMPIsUsing:" : " 7/23/2018 10:01:09", - "decryptedSecretKeys" : " 7/23/2018 10:01:09", - "isPrivateKeyPacket" : " 7/23/2018 10:01:09", - "parseData:" : " 7/23/2018 10:01:09", - "readMPIsFrom:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/properties.json b/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/properties.json deleted file mode 100644 index e99433f..0000000 --- a/source/OpenPGP.package/OpenPGPSecretKeyPacket.class/properties.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 17:45", - "instvars" : [ - "stringToKeyUsage", - "stringToKeySpecifier", - "encryptionAlgorithm", - "initialVector", - "mpis", - "checksum" ], - "name" : "OpenPGPSecretKeyPacket", - "pools" : [ - ], - "super" : "OpenPGPPublicKeyPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/README.md b/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 36f7bb4..0000000 --- a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleSecretSubkeyPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/methodProperties.json deleted file mode 100644 index 04157f6..0000000 --- a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/properties.json b/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/properties.json deleted file mode 100644 index 88ca549..0000000 --- a/source/OpenPGP.package/OpenPGPSecretSubkeyPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPSecretSubkeyPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/README.md b/source/OpenPGP.package/OpenPGPSignatureData.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putKeyPacket.onHashStream..st b/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putKeyPacket.onHashStream..st deleted file mode 100644 index 562c913..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putKeyPacket.onHashStream..st +++ /dev/null @@ -1,6 +0,0 @@ -verifying -putKeyPacket: aPacket onHashStream: aStream - aStream - nextPut: 16r99; - nextNumber: 2 put: aPacket dataSize; - nextPutAll: aPacket data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putSignatureDataOnHashStream..st b/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putSignatureDataOnHashStream..st deleted file mode 100644 index 2af9b69..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putSignatureDataOnHashStream..st +++ /dev/null @@ -1,3 +0,0 @@ -verifying -putSignatureDataOnHashStream: aStream - self subclassResponsibility \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putUserIdPacket.onHashStream..st b/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putUserIdPacket.onHashStream..st deleted file mode 100644 index 5d814b6..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/putUserIdPacket.onHashStream..st +++ /dev/null @@ -1,6 +0,0 @@ -verifying -putUserIdPacket: aPacket onHashStream: aStream - aStream - nextPut: 16rB4; - nextNumber: 4 put: aPacket dataSize; - nextPutAll: aPacket data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/signatureType.st b/source/OpenPGP.package/OpenPGPSignatureData.class/instance/signatureType.st deleted file mode 100644 index 4ef0c6e..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/signatureType.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -signatureType - ^signatureType \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/verifyKey.userId..st b/source/OpenPGP.package/OpenPGPSignatureData.class/instance/verifyKey.userId..st deleted file mode 100644 index 6fcd3c0..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/instance/verifyKey.userId..st +++ /dev/null @@ -1,17 +0,0 @@ -verifying -verifyKey: keyPacket userId: userIdPacket - "compute a hash from the given key and userId according to my hash function. - This method is ugly, but not much more than RFC2440 from which it was created." - | message hash | - hashAlgorithm = 2 ifFalse: [self error: 'Only SHA-1 is supported']. - publicKeyAlgorithm = 17 ifFalse: [self error: 'Only DSA signatures are supported']. - message := ReadWriteStream on: ByteArray new. - self putKeyPacket: keyPacket onHashStream: message. - self putUserIdPacket: userIdPacket onHashStream: message. - self putSignatureDataOnHashStream: message. - message reset. - hash := SecureHashAlgorithm new hashStream: message. - ^DigitalSignatureAlgorithm new - verifySignature: mpis - ofMessageHash: hash - publicKey: keyPacket mpis \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSignatureData.class/methodProperties.json deleted file mode 100644 index 59da43b..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/methodProperties.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "putKeyPacket:onHashStream:" : " 7/23/2018 10:01:09", - "putSignatureDataOnHashStream:" : " 7/23/2018 10:01:09", - "putUserIdPacket:onHashStream:" : " 7/23/2018 10:01:09", - "signatureType" : " 7/23/2018 10:01:09", - "verifyKey:userId:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSignatureData.class/properties.json b/source/OpenPGP.package/OpenPGPSignatureData.class/properties.json deleted file mode 100644 index 632bde5..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureData.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "signatureType", - "publicKeyAlgorithm", - "hashAlgorithm", - "msbOfHash", - "mpis" ], - "name" : "OpenPGPSignatureData", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/README.md b/source/OpenPGP.package/OpenPGPSignaturePacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/acceptVisitor..st deleted file mode 100644 index ab2d6f9..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleSignaturePacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/canBeAddedTo..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/canBeAddedTo..st deleted file mode 100644 index a543373..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/canBeAddedTo..st +++ /dev/null @@ -1,3 +0,0 @@ -testing -canBeAddedTo: aPacket - ^aPacket isUserIDPacket or: [aPacket isPhotoIDPacket or: [aPacket isPublicKeyPacket or: [aPacket isSubkeyPacket]]] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/creationTime.st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/creationTime.st deleted file mode 100644 index a6d5ce2..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/creationTime.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -creationTime - creationTime isNil ifTrue: [self parseData]. - ^creationTime \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/isSignaturePacket.st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/isSignaturePacket.st deleted file mode 100644 index 4645854..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/isSignaturePacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isSignaturePacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/parseData..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/parseData..st deleted file mode 100644 index b5f10d1..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/parseData..st +++ /dev/null @@ -1,27 +0,0 @@ -initialize-release -parseData: aStream - version := aStream next. - version <= 3 ifTrue: [ - aStream next = 5 ifFalse: [self error: 'This number must be 5. See RFC 2440']. - signatureType := aStream next. - creationTime := aStream nextNumber: 4. - signer := aStream next: 8. - publicKeyAlgorithm := aStream next. - hashAlgorithm := aStream next. - msbOfHash := aStream nextNumber: 2. - mpis := aStream mpisUpToEnd]. - version = 4 ifTrue: [ - signatureType := aStream next. - publicKeyAlgorithm := aStream next. - hashAlgorithm := aStream next. - hashedSubpacketData := aStream nextSubpacketData. - unhashedSubpacketData := aStream nextSubpacketData. - msbOfHash := aStream nextNumber: 2. - mpis := aStream mpisUpToEnd. - self subpackets: hashedSubpacketData do: [:subdata | - subdata first = 2 ifTrue: [ - creationTime := (OpenPGPStream on: subdata) - next: 1; nextNumber: 4]]. - self subpackets: unhashedSubpacketData do: [:subdata | - subdata first = 16 ifTrue: [ - signer := subdata copyFrom: 2 to: subdata size]]] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putKeyPacket.onHashStream..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putKeyPacket.onHashStream..st deleted file mode 100644 index 562c913..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putKeyPacket.onHashStream..st +++ /dev/null @@ -1,6 +0,0 @@ -verifying -putKeyPacket: aPacket onHashStream: aStream - aStream - nextPut: 16r99; - nextNumber: 2 put: aPacket dataSize; - nextPutAll: aPacket data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putSignatureDataOnHashStream..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putSignatureDataOnHashStream..st deleted file mode 100644 index 0277aad..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putSignatureDataOnHashStream..st +++ /dev/null @@ -1,19 +0,0 @@ -verifying -putSignatureDataOnHashStream: aStream - version = 3 ifTrue: [ - aStream - nextPut: signatureType; - nextNumber: 4 put: creationTime]. - version = 4 ifTrue: [ - aStream - nextPut: 4; - nextPut: signatureType; - nextPut: publicKeyAlgorithm; - nextPut: hashAlgorithm. - aStream - nextNumber: 2 put: hashedSubpacketData size; - nextPutAll: hashedSubpacketData. - aStream - nextPut: 4; - nextPut: 16rFF; - nextNumber: 4 put: hashedSubpacketData size + 6] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putUserIdPacket.onHashStream..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putUserIdPacket.onHashStream..st deleted file mode 100644 index 5d814b6..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/putUserIdPacket.onHashStream..st +++ /dev/null @@ -1,6 +0,0 @@ -verifying -putUserIdPacket: aPacket onHashStream: aStream - aStream - nextPut: 16rB4; - nextNumber: 4 put: aPacket dataSize; - nextPutAll: aPacket data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/signer.st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/signer.st deleted file mode 100644 index 093fe43..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/signer.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -signer - signer = nil ifTrue: [self parseData]. - ^signer \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/subpackets.do..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/subpackets.do..st deleted file mode 100644 index ea8a7a7..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/subpackets.do..st +++ /dev/null @@ -1,7 +0,0 @@ -private -subpackets: aByteArray do: aBlock - | str len | - str := OpenPGPStream on: aByteArray. - [str atEnd] whileFalse: [ - len := str nextNewFormatPacketLength. - aBlock value: (str next: len)] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/verifyKey.userId..st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/verifyKey.userId..st deleted file mode 100644 index 6fcd3c0..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/verifyKey.userId..st +++ /dev/null @@ -1,17 +0,0 @@ -verifying -verifyKey: keyPacket userId: userIdPacket - "compute a hash from the given key and userId according to my hash function. - This method is ugly, but not much more than RFC2440 from which it was created." - | message hash | - hashAlgorithm = 2 ifFalse: [self error: 'Only SHA-1 is supported']. - publicKeyAlgorithm = 17 ifFalse: [self error: 'Only DSA signatures are supported']. - message := ReadWriteStream on: ByteArray new. - self putKeyPacket: keyPacket onHashStream: message. - self putUserIdPacket: userIdPacket onHashStream: message. - self putSignatureDataOnHashStream: message. - message reset. - hash := SecureHashAlgorithm new hashStream: message. - ^DigitalSignatureAlgorithm new - verifySignature: mpis - ofMessageHash: hash - publicKey: keyPacket mpis \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/version.st b/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/version.st deleted file mode 100644 index dbcb093..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/instance/version.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -version - version isNil ifTrue: [self parseData]. - ^version \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSignaturePacket.class/methodProperties.json deleted file mode 100644 index be61e92..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/methodProperties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "canBeAddedTo:" : " 7/23/2018 10:01:09", - "creationTime" : " 7/23/2018 10:01:09", - "isSignaturePacket" : " 7/23/2018 10:01:09", - "parseData:" : " 7/23/2018 10:01:09", - "putKeyPacket:onHashStream:" : " 7/23/2018 10:01:09", - "putSignatureDataOnHashStream:" : " 7/23/2018 10:01:09", - "putUserIdPacket:onHashStream:" : " 7/23/2018 10:01:09", - "signer" : " 7/23/2018 10:01:09", - "subpackets:do:" : " 7/23/2018 10:01:09", - "verifyKey:userId:" : " 7/23/2018 10:01:09", - "version" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSignaturePacket.class/properties.json b/source/OpenPGP.package/OpenPGPSignaturePacket.class/properties.json deleted file mode 100644 index e27b91a..0000000 --- a/source/OpenPGP.package/OpenPGPSignaturePacket.class/properties.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "signatureType", - "publicKeyAlgorithm", - "hashAlgorithm", - "msbOfHash", - "mpis", - "creationTime", - "signer", - "hashedSubpacketData", - "unhashedSubpacketData" ], - "name" : "OpenPGPSignaturePacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/README.md b/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/methodProperties.json deleted file mode 100644 index 0e4a662..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/methodProperties.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "class" : { - }, - "instance" : { - } } diff --git a/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/properties.json b/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/properties.json deleted file mode 100644 index 315ec0f..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureSubpacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "data" ], - "name" : "OpenPGPSignatureSubpacket", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/README.md b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/creationTime.st b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/creationTime.st deleted file mode 100644 index e9603ab..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/creationTime.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -creationTime - ^creationTime \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/putSignatureDataOnHashStream..st b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/putSignatureDataOnHashStream..st deleted file mode 100644 index 7941d9b..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/putSignatureDataOnHashStream..st +++ /dev/null @@ -1,5 +0,0 @@ -verifying -putSignatureDataOnHashStream: aStream - aStream - nextPut: signatureType; - nextNumber: 4 put: creationTime \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/putUserIdPacket.onHashStream..st b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/putUserIdPacket.onHashStream..st deleted file mode 100644 index e94de0f..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/putUserIdPacket.onHashStream..st +++ /dev/null @@ -1,4 +0,0 @@ -verifying -putUserIdPacket: aPacket onHashStream: aStream - aStream - nextPutAll: aPacket data \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/readFrom..st b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/readFrom..st deleted file mode 100644 index 9ee6dfe..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/readFrom..st +++ /dev/null @@ -1,11 +0,0 @@ -reading -readFrom: aStream - aStream next = 3 ifFalse: [self error: 'version number mismatch']. - aStream next = 5 ifFalse: [self error: 'This number must be 5. See RFC 2440']. - signatureType := aStream next. - creationTime := aStream nextNumber: 4. - signer := aStream next: 8. - publicKeyAlgorithm := aStream next. - hashAlgorithm := aStream next. - msbOfHash := aStream nextNumber: 2. - mpis := aStream mpisUpToEnd \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/signer.st b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/signer.st deleted file mode 100644 index 8596bad..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/instance/signer.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -signer - ^signer \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/methodProperties.json deleted file mode 100644 index 82ecbd3..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/methodProperties.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "creationTime" : " 7/23/2018 10:01:09", - "putSignatureDataOnHashStream:" : " 7/23/2018 10:01:09", - "putUserIdPacket:onHashStream:" : " 7/23/2018 10:01:09", - "readFrom:" : " 7/23/2018 10:01:09", - "signer" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/properties.json b/source/OpenPGP.package/OpenPGPSignatureV3Data.class/properties.json deleted file mode 100644 index ae305c5..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV3Data.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "creationTime", - "signer" ], - "name" : "OpenPGPSignatureV3Data", - "pools" : [ - ], - "super" : "OpenPGPSignatureData", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/README.md b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/creationTime.st b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/creationTime.st deleted file mode 100644 index 95b3f5f..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/creationTime.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -creationTime - self subpackets: hashedSubpacketData do: [:data | - data first = 2 ifTrue: [^data unsignedLongAt: 2 bigEndian: true]]. - ^nil \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/putSignatureDataOnHashStream..st b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/putSignatureDataOnHashStream..st deleted file mode 100644 index 16e1907..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/putSignatureDataOnHashStream..st +++ /dev/null @@ -1,14 +0,0 @@ -verifying -putSignatureDataOnHashStream: aStream - aStream - nextPut: 4; - nextPut: signatureType; - nextPut: publicKeyAlgorithm; - nextPut: hashAlgorithm. - aStream - nextNumber: 2 put: hashedSubpacketData size; - nextPutAll: hashedSubpacketData. - aStream - nextPut: 4; - nextPut: 16rFF; - nextNumber: 4 put: hashedSubpacketData size + 6 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/readFrom..st b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/readFrom..st deleted file mode 100644 index c7a2f08..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/readFrom..st +++ /dev/null @@ -1,10 +0,0 @@ -reading -readFrom: aStream - aStream next = 4 ifFalse: [self error: 'version type mismatch']. - signatureType := aStream next. - publicKeyAlgorithm := aStream next. - hashAlgorithm := aStream next. - hashedSubpacketData := aStream nextSubpacketData. - unhashedSubpacketData := aStream nextSubpacketData. - msbOfHash := aStream nextNumber: 2. - mpis := aStream mpisUpToEnd \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/subpackets.do..st b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/subpackets.do..st deleted file mode 100644 index bf48c0d..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/instance/subpackets.do..st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -subpackets: aByteArray do: aBlock - | str len | - str := OpenPGPStream on: (ReadStream on: aByteArray). - [str atEnd] whileFalse: [ - len := str nextNewFormatPacketLength. - aBlock value: (str next: len)] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/methodProperties.json deleted file mode 100644 index 75878f6..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "creationTime" : " 7/23/2018 10:01:09", - "putSignatureDataOnHashStream:" : " 7/23/2018 10:01:09", - "readFrom:" : " 7/23/2018 10:01:09", - "subpackets:do:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/properties.json b/source/OpenPGP.package/OpenPGPSignatureV4Data.class/properties.json deleted file mode 100644 index 7b49d30..0000000 --- a/source/OpenPGP.package/OpenPGPSignatureV4Data.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "hashedSubpacketData", - "unhashedSubpacketData" ], - "name" : "OpenPGPSignatureV4Data", - "pools" : [ - ], - "super" : "OpenPGPSignatureData", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPStream.class/README.md b/source/OpenPGP.package/OpenPGPStream.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPStream.class/class/on..st b/source/OpenPGP.package/OpenPGPStream.class/class/on..st deleted file mode 100644 index c87dda2..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/class/on..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -on: aCollection - ^self onStream: (ReadStream on: aCollection) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/class/onStream..st b/source/OpenPGP.package/OpenPGPStream.class/class/onStream..st deleted file mode 100644 index 52117b8..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/class/onStream..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -onStream: aStream - ^self basicNew on: aStream \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/class/parsePackets..st b/source/OpenPGP.package/OpenPGPStream.class/class/parsePackets..st deleted file mode 100644 index d1e3a6b..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/class/parsePackets..st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -parsePackets: aStream - ^[(self onStream: aStream) nextPacketsUpToEnd] ensure: [aStream close] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/atEnd.st b/source/OpenPGP.package/OpenPGPStream.class/instance/atEnd.st deleted file mode 100644 index 4b641a9..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/atEnd.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -atEnd - ^stream atEnd \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/binary.st b/source/OpenPGP.package/OpenPGPStream.class/instance/binary.st deleted file mode 100644 index 699ffca..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/binary.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -binary - stream binary \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/close.st b/source/OpenPGP.package/OpenPGPStream.class/instance/close.st deleted file mode 100644 index 4dcc3f4..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/close.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -close - stream close \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/mpisUpToEnd.st b/source/OpenPGP.package/OpenPGPStream.class/instance/mpisUpToEnd.st deleted file mode 100644 index e7082da..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/mpisUpToEnd.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -mpisUpToEnd - | mpis | - mpis := #(). - [self atEnd] whileFalse: [mpis := mpis copyWith: self nextMPI]. - ^mpis \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/next..st b/source/OpenPGP.package/OpenPGPStream.class/instance/next..st deleted file mode 100644 index b03f018..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/next..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -next: aNumber - ^stream next: aNumber \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/next.st b/source/OpenPGP.package/OpenPGPStream.class/instance/next.st deleted file mode 100644 index 99d7cf5..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/next.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -next - ^stream next \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextMPI.st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextMPI.st deleted file mode 100644 index aa7b6c5..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextMPI.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -nextMPI - | bits | - bits := stream next * 256 + stream next. - ^self nextNumber: bits+7//8 \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextNewFormatPacketLength.st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextNewFormatPacketLength.st deleted file mode 100644 index 7c8ba26..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextNewFormatPacketLength.st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -nextNewFormatPacketLength - | len | - len := stream next. - len > 191 ifTrue: [ - len := len < 224 - ifTrue: [len - 192 * 256 + stream next + 192] - ifFalse: [ - len = 255 - ifTrue: [stream nextNumber: 4] - ifFalse: [(1 bitShift: (len \\ 32)) negated]]]. - ^len \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextNumber..st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextNumber..st deleted file mode 100644 index a2f6771..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextNumber..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -nextNumber: anInteger - | result | - anInteger <= 4 ifTrue: [ - result := 0. - anInteger timesRepeat: [result := result * 256 + stream next]. - ^result]. - result := Integer new: anInteger neg: false. - anInteger to: 1 by: -1 do: [:i | - result digitAt: i put: stream next]. - ^result normalize \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextPacket.st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextPacket.st deleted file mode 100644 index c07e18b..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -nextPacket - ^OpenPGPPacket readFrom: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextPacketsUpToEnd.st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextPacketsUpToEnd.st deleted file mode 100644 index c5f7dd8..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextPacketsUpToEnd.st +++ /dev/null @@ -1,7 +0,0 @@ -accessing -nextPacketsUpToEnd - | result | - result := OrderedCollection new. - [self atEnd] whileFalse: [ - result add: self nextPacket]. - ^result \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextS2KSpecifier.st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextS2KSpecifier.st deleted file mode 100644 index 8b990c7..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextS2KSpecifier.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -nextS2KSpecifier - ^OpenPGPS2KSpecifier new readFrom: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/nextSubpacketData.st b/source/OpenPGP.package/OpenPGPStream.class/instance/nextSubpacketData.st deleted file mode 100644 index 8c1d5f8..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/nextSubpacketData.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -nextSubpacketData - | len | - len := self nextNumber: 2. - ^stream next: len \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/instance/on..st b/source/OpenPGP.package/OpenPGPStream.class/instance/on..st deleted file mode 100644 index 54cc2b3..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/instance/on..st +++ /dev/null @@ -1,4 +0,0 @@ -private -on: aStream - stream := aStream. - stream binary \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPStream.class/methodProperties.json b/source/OpenPGP.package/OpenPGPStream.class/methodProperties.json deleted file mode 100644 index f7c0684..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/methodProperties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "class" : { - "on:" : " 7/23/2018 10:01:09", - "onStream:" : " 7/23/2018 10:01:09", - "parsePackets:" : " 7/23/2018 10:01:09" }, - "instance" : { - "atEnd" : " 7/23/2018 10:01:09", - "binary" : " 7/23/2018 10:01:09", - "close" : " 7/23/2018 10:01:09", - "mpisUpToEnd" : " 7/23/2018 10:01:09", - "next" : " 7/23/2018 10:01:09", - "next:" : " 7/23/2018 10:01:09", - "nextMPI" : " 7/23/2018 10:01:09", - "nextNewFormatPacketLength" : " 7/23/2018 10:01:09", - "nextNumber:" : " 7/23/2018 10:01:09", - "nextPacket" : " 7/23/2018 10:01:09", - "nextPacketsUpToEnd" : " 7/23/2018 10:01:09", - "nextS2KSpecifier" : " 7/23/2018 10:01:09", - "nextSubpacketData" : " 7/23/2018 10:01:09", - "on:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPStream.class/properties.json b/source/OpenPGP.package/OpenPGPStream.class/properties.json deleted file mode 100644 index 49087e9..0000000 --- a/source/OpenPGP.package/OpenPGPStream.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "stream" ], - "name" : "OpenPGPStream", - "pools" : [ - ], - "super" : "Stream", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/README.md b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 3a3dd48..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleSymmetricKeyEncryptedSessionKeyPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/cipherWithPassphrase..st b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/cipherWithPassphrase..st deleted file mode 100644 index 5b10b9c..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/cipherWithPassphrase..st +++ /dev/null @@ -1,6 +0,0 @@ -as yet unclassified -cipherWithPassphrase: aString - | cipher | - cipher := OpenPGPPacket symmetricKeyAlgorithmFor: algorithm. - cipher setKey: (s2kSpecifier stringToKey: aString numBytes: cipher keySize). - ^cipher \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/isSymmetricKeyEncryptedSessionKeyPacket.st b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/isSymmetricKeyEncryptedSessionKeyPacket.st deleted file mode 100644 index 92488ae..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/isSymmetricKeyEncryptedSessionKeyPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isSymmetricKeyEncryptedSessionKeyPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/parseData..st b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/parseData..st deleted file mode 100644 index f6be4a1..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/instance/parseData..st +++ /dev/null @@ -1,6 +0,0 @@ -reading -parseData: aStream - aStream next = 4 ifFalse: [self error: 'Version must be 4']. - algorithm := aStream next. - s2kSpecifier := aStream nextS2KSpecifier. - aStream atEnd ifFalse: [sessionKey := aStream upToEnd] \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/methodProperties.json deleted file mode 100644 index 6ef71f2..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "cipherWithPassphrase:" : " 7/23/2018 10:01:09", - "isSymmetricKeyEncryptedSessionKeyPacket" : " 7/23/2018 10:01:09", - "parseData:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/properties.json b/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/properties.json deleted file mode 100644 index dc9288a..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "algorithm", - "s2kSpecifier", - "sessionKey" ], - "name" : "OpenPGPSymmetricKeyEncryptedSessionKeyPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/README.md b/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/acceptVisitor..st deleted file mode 100644 index 228a93e..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleSymmetricallyEncryptedDataPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/decryptWithCipher..st b/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/decryptWithCipher..st deleted file mode 100644 index 668b02e..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/decryptWithCipher..st +++ /dev/null @@ -1,11 +0,0 @@ -accessing -decryptWithCipher: cipher - "Return decrypted data" - | c s | - s := cipher blockSize. - c := CFBEncryption new - cipher: cipher - initialVector: (ByteArray new: s) - shiftSize: s. - c resyncWith: (data copyFrom: 3 to: s+2). - ^c decryptBytes: (data copyFrom: s+3 to: data size) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/verifyWithCipher..st b/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/verifyWithCipher..st deleted file mode 100644 index 7d2d5c7..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/instance/verifyWithCipher..st +++ /dev/null @@ -1,11 +0,0 @@ -testing -verifyWithCipher: cipher - "Test whether the given block cipher (with initialized key) is correct for decrypting our data" - | c check s | - s := cipher blockSize. - c := CFBEncryption new - cipher: cipher - initialVector: (ByteArray new: s) - shiftSize: s. - check := c decryptBytes: (data copyFrom: 1 to: s+2). - ^(check copyFrom: s-1 to: s) = (check copyFrom: s+1 to: s+2) \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/methodProperties.json deleted file mode 100644 index 96e4483..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/methodProperties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "decryptWithCipher:" : " 7/23/2018 10:01:09", - "verifyWithCipher:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/properties.json b/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/properties.json deleted file mode 100644 index 168965a..0000000 --- a/source/OpenPGP.package/OpenPGPSymmetricallyEncryptedDataPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPSymmetricallyEncryptedDataPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPTrustPacket.class/README.md b/source/OpenPGP.package/OpenPGPTrustPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/acceptVisitor..st deleted file mode 100644 index d6c7e98..0000000 --- a/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleTrustPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/canBeAddedTo..st b/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/canBeAddedTo..st deleted file mode 100644 index 08e6329..0000000 --- a/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/canBeAddedTo..st +++ /dev/null @@ -1,3 +0,0 @@ -testing -canBeAddedTo: aPacket - ^aPacket isSignaturePacket \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/isTrustPacket.st b/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/isTrustPacket.st deleted file mode 100644 index f387d3d..0000000 --- a/source/OpenPGP.package/OpenPGPTrustPacket.class/instance/isTrustPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isTrustPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPTrustPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPTrustPacket.class/methodProperties.json deleted file mode 100644 index dec23f8..0000000 --- a/source/OpenPGP.package/OpenPGPTrustPacket.class/methodProperties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "canBeAddedTo:" : " 7/23/2018 10:01:09", - "isTrustPacket" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPTrustPacket.class/properties.json b/source/OpenPGP.package/OpenPGPTrustPacket.class/properties.json deleted file mode 100644 index 9bc2fb6..0000000 --- a/source/OpenPGP.package/OpenPGPTrustPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPTrustPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/README.md b/source/OpenPGP.package/OpenPGPUserIDPacket.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/acceptVisitor..st b/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/acceptVisitor..st deleted file mode 100644 index cc5b80d..0000000 --- a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/acceptVisitor..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -acceptVisitor: aVisitor - ^aVisitor handleUserIDPacket: self \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/canBeAddedTo..st b/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/canBeAddedTo..st deleted file mode 100644 index 5b0e6c0..0000000 --- a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/canBeAddedTo..st +++ /dev/null @@ -1,3 +0,0 @@ -testing -canBeAddedTo: aPacket - ^aPacket isPublicKeyPacket \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/isUserIDPacket.st b/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/isUserIDPacket.st deleted file mode 100644 index c744056..0000000 --- a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/isUserIDPacket.st +++ /dev/null @@ -1,3 +0,0 @@ -testing -isUserIDPacket - ^true \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/printDataOn..st b/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/printDataOn..st deleted file mode 100644 index 082ea27..0000000 --- a/source/OpenPGP.package/OpenPGPUserIDPacket.class/instance/printDataOn..st +++ /dev/null @@ -1,4 +0,0 @@ -printing -printDataOn: aStream - aStream nextPutAll: ', uid='. - aStream nextPutAll: self dataAsString \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/methodProperties.json b/source/OpenPGP.package/OpenPGPUserIDPacket.class/methodProperties.json deleted file mode 100644 index 77163f6..0000000 --- a/source/OpenPGP.package/OpenPGPUserIDPacket.class/methodProperties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "acceptVisitor:" : " 7/23/2018 10:01:09", - "canBeAddedTo:" : " 7/23/2018 10:01:09", - "isUserIDPacket" : " 7/23/2018 10:01:09", - "printDataOn:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPUserIDPacket.class/properties.json b/source/OpenPGP.package/OpenPGPUserIDPacket.class/properties.json deleted file mode 100644 index 38dc220..0000000 --- a/source/OpenPGP.package/OpenPGPUserIDPacket.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Packets", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - ], - "name" : "OpenPGPUserIDPacket", - "pools" : [ - ], - "super" : "OpenPGPPacket", - "type" : "normal" } diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/README.md b/source/OpenPGP.package/OpenPGPVisitor.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/class/new.st b/source/OpenPGP.package/OpenPGPVisitor.class/class/new.st deleted file mode 100644 index 0fb0f76..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -as yet unclassified -new - ^super new initialize \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/config..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/config..st deleted file mode 100644 index bec40df..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/config..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -config: anOpenPGP - config := anOpenPGP \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/finish.st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/finish.st deleted file mode 100644 index a85eabc..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/finish.st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -finish - "perform any necessary cleanup" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleCompressedDataPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleCompressedDataPacket..st deleted file mode 100644 index 360fd6f..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleCompressedDataPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleCompressedDataPacket: anOpenPGPCompressedDataPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleLiteralDataPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleLiteralDataPacket..st deleted file mode 100644 index e06fb89..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleLiteralDataPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleLiteralDataPacket: anOpenPGPLiteralDataPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleMarkerPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleMarkerPacket..st deleted file mode 100644 index 1e3a182..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleMarkerPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleMarkerPacket: anOpenPGPMarkerPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleOnePassSignaturePacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleOnePassSignaturePacket..st deleted file mode 100644 index 3f1b16b..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleOnePassSignaturePacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleOnePassSignaturePacket: anOpenPGPOnePassSignaturePacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleOpenPassSignaturePacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleOpenPassSignaturePacket..st deleted file mode 100644 index cf4396e..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleOpenPassSignaturePacket..st +++ /dev/null @@ -1,3 +0,0 @@ -not yet implemented -handleOpenPassSignaturePacket: anObject - self error: #notYetImplemented \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePacket..st deleted file mode 100644 index 99e29e1..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handlePacket: anOpenPGPPacket - self error: 'unknown packet type encountered' \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePhotoIDPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePhotoIDPacket..st deleted file mode 100644 index eae9048..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePhotoIDPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handlePhotoIDPacket: anOpenPGPPhotoIDPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicKeyEncryptedSessionKeyPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicKeyEncryptedSessionKeyPacket..st deleted file mode 100644 index c5132d5..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicKeyEncryptedSessionKeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handlePublicKeyEncryptedSessionKeyPacket: anOpenPGPPublicKeyEncryptedSessionKeyPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicKeyPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicKeyPacket..st deleted file mode 100644 index 7b1fca6..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicKeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handlePublicKeyPacket: anOpenPGPPublicKeyPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicSubkeyPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicSubkeyPacket..st deleted file mode 100644 index 60d9198..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handlePublicSubkeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handlePublicSubkeyPacket: anOpenPGPPublicSubkeyPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSecretKeyPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSecretKeyPacket..st deleted file mode 100644 index ce9f9da..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSecretKeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleSecretKeyPacket: anOpenPGPSecretKeyPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSecretSubkeyPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSecretSubkeyPacket..st deleted file mode 100644 index f7e5fbc..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSecretSubkeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleSecretSubkeyPacket: anOpenPGPSecretSubkeyPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSignaturePacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSignaturePacket..st deleted file mode 100644 index 6b69cf7..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSignaturePacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleSignaturePacket: anOpenPGPSignaturePacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSymmetricKeyEncryptedSessionKeyPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSymmetricKeyEncryptedSessionKeyPacket..st deleted file mode 100644 index c25d477..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSymmetricKeyEncryptedSessionKeyPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleSymmetricKeyEncryptedSessionKeyPacket: anOpenPGPSymmetricKeyEncryptedSessionKeyPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSymmetricallyEncryptedDataPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSymmetricallyEncryptedDataPacket..st deleted file mode 100644 index bcd9705..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleSymmetricallyEncryptedDataPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleSymmetricallyEncryptedDataPacket: anOpenPGPSymmetricallyEncryptedDataPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleTrustPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleTrustPacket..st deleted file mode 100644 index 2da7921..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleTrustPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleTrustPacket: anOpenPGPTrustPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleUserIDPacket..st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleUserIDPacket..st deleted file mode 100644 index 0a38e65..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/handleUserIDPacket..st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -handleUserIDPacket: anOpenPGPUserIDPacket - "do nothing" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/instance/initialize.st b/source/OpenPGP.package/OpenPGPVisitor.class/instance/initialize.st deleted file mode 100644 index 58d2859..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/instance/initialize.st +++ /dev/null @@ -1,3 +0,0 @@ -visitor -initialize - "perform any necessary initialization" \ No newline at end of file diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/methodProperties.json b/source/OpenPGP.package/OpenPGPVisitor.class/methodProperties.json deleted file mode 100644 index 6e7179d..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/methodProperties.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "class" : { - "new" : " 7/23/2018 10:01:09" }, - "instance" : { - "config:" : " 7/23/2018 10:01:09", - "finish" : " 7/23/2018 10:01:09", - "handleCompressedDataPacket:" : " 7/23/2018 10:01:09", - "handleLiteralDataPacket:" : " 7/23/2018 10:01:09", - "handleMarkerPacket:" : " 7/23/2018 10:01:09", - "handleOnePassSignaturePacket:" : " 7/23/2018 10:01:09", - "handleOpenPassSignaturePacket:" : " 7/23/2018 10:01:09", - "handlePacket:" : " 7/23/2018 10:01:09", - "handlePhotoIDPacket:" : " 7/23/2018 10:01:09", - "handlePublicKeyEncryptedSessionKeyPacket:" : " 7/23/2018 10:01:09", - "handlePublicKeyPacket:" : " 7/23/2018 10:01:09", - "handlePublicSubkeyPacket:" : " 7/23/2018 10:01:09", - "handleSecretKeyPacket:" : " 7/23/2018 10:01:09", - "handleSecretSubkeyPacket:" : " 7/23/2018 10:01:09", - "handleSignaturePacket:" : " 7/23/2018 10:01:09", - "handleSymmetricKeyEncryptedSessionKeyPacket:" : " 7/23/2018 10:01:09", - "handleSymmetricallyEncryptedDataPacket:" : " 7/23/2018 10:01:09", - "handleTrustPacket:" : " 7/23/2018 10:01:09", - "handleUserIDPacket:" : " 7/23/2018 10:01:09", - "initialize" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/OpenPGPVisitor.class/properties.json b/source/OpenPGP.package/OpenPGPVisitor.class/properties.json deleted file mode 100644 index 07ca2ea..0000000 --- a/source/OpenPGP.package/OpenPGPVisitor.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "category" : "OpenPGP-Core", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "", - "instvars" : [ - "config" ], - "name" : "OpenPGPVisitor", - "pools" : [ - ], - "super" : "Object", - "type" : "normal" } diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/^minus.equals.st b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/^minus.equals.st deleted file mode 100644 index 1efb98c..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/^minus.equals.st +++ /dev/null @@ -1,10 +0,0 @@ -*openPGP-accumulator ops --= aThirtyTwoBitRegister - "Replace my contents with the difference of the given register and my current contents." - - | carry | - low := low - aThirtyTwoBitRegister low. - low < 0 - ifTrue: [low := low + 65536. carry := 1] - ifFalse: [carry := 0]. - hi := (hi - aThirtyTwoBitRegister hi - carry+ 65536) bitAnd: 16rFFFF \ No newline at end of file diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/castXorFrom.index..st b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/castXorFrom.index..st deleted file mode 100644 index 85c20df..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/castXorFrom.index..st +++ /dev/null @@ -1,3 +0,0 @@ -*openPGP-accessing -castXorFrom: anSBox index: anInteger - self bitXor: (anSBox at: anInteger+1) \ No newline at end of file diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d0.st b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d0.st deleted file mode 100644 index 50d43a0..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d0.st +++ /dev/null @@ -1,3 +0,0 @@ -*openPGP-accessing -d0 - ^ hi bitShift: -8 \ No newline at end of file diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d1.st b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d1.st deleted file mode 100644 index 2155e44..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d1.st +++ /dev/null @@ -1,3 +0,0 @@ -*openPGP-accessing -d1 - ^ hi bitAnd: 16rFF \ No newline at end of file diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d2.st b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d2.st deleted file mode 100644 index 4aaac57..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d2.st +++ /dev/null @@ -1,3 +0,0 @@ -*openPGP-accessing -d2 - ^ low bitShift: -8 \ No newline at end of file diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d3.st b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d3.st deleted file mode 100644 index 6b6dc19..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/instance/d3.st +++ /dev/null @@ -1,3 +0,0 @@ -*openPGP-accessing -d3 - ^ low bitAnd: 16rFF \ No newline at end of file diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/methodProperties.json b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/methodProperties.json deleted file mode 100644 index d3d1396..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/methodProperties.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "class" : { - }, - "instance" : { - "-=" : " 7/23/2018 10:01:09", - "castXorFrom:index:" : " 7/23/2018 10:01:09", - "d0" : " 7/23/2018 10:01:09", - "d1" : " 7/23/2018 10:01:09", - "d2" : " 7/23/2018 10:01:09", - "d3" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/properties.json b/source/OpenPGP.package/ThirtyTwoBitRegister.extension/properties.json deleted file mode 100644 index ac423a9..0000000 --- a/source/OpenPGP.package/ThirtyTwoBitRegister.extension/properties.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - "name" : "ThirtyTwoBitRegister" } diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/README.md b/source/OpenPGP.package/TripleDESForOpenPGP.class/README.md deleted file mode 100644 index d8d3c46..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/README.md +++ /dev/null @@ -1 +0,0 @@ -TripleDES uses its 168-bit key to set up 3 DES instances which are used in a cascade to encrypt and decrypt data. It has reasonable cryptoanalytic strength. \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/class/blockSize.st b/source/OpenPGP.package/TripleDESForOpenPGP.class/class/blockSize.st deleted file mode 100644 index 1d23ac1..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/class/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -blockSize - ^ 8 \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/class/keySize.st b/source/OpenPGP.package/TripleDESForOpenPGP.class/class/keySize.st deleted file mode 100644 index 75df6c3..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/class/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -keySize - ^ 8*3 \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/class/new.st b/source/OpenPGP.package/TripleDESForOpenPGP.class/class/new.st deleted file mode 100644 index 777662d..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/class/new.st +++ /dev/null @@ -1,3 +0,0 @@ -instance creation -new - ^ super new initialize \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/blockSize.st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/blockSize.st deleted file mode 100644 index aec60aa..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/blockSize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -blockSize - ^8 \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/decryptBlock..st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/decryptBlock..st deleted file mode 100644 index 42b09b3..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/decryptBlock..st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -decryptBlock: anInteger - ^des1 decryptBlock: (des2 encryptBlock: (des3 decryptBlock: anInteger)) \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/encryptBlock..st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/encryptBlock..st deleted file mode 100644 index ba4f29f..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/encryptBlock..st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -encryptBlock: anInteger - ^des3 encryptBlock: (des2 decryptBlock: (des1 encryptBlock: anInteger)) \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/initialize.st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/initialize.st deleted file mode 100644 index 57457ad..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/initialize.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -initialize - des1 _ DESForOpenPGP new. - des2 _ DESForOpenPGP new. - des3 _ DESForOpenPGP new \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/key..st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/key..st deleted file mode 100644 index 396b3a4..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/key..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -key: aByteArray - des1 key: (aByteArray copyFrom: 1 to: 8). - des2 key: (aByteArray copyFrom: 9 to: 16). - des3 key: (aByteArray copyFrom: 17 to: 24) \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/keySize.st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/keySize.st deleted file mode 100644 index 72478b1..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/keySize.st +++ /dev/null @@ -1,3 +0,0 @@ -encryption/decryption -keySize - ^24 \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/setKey..st b/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/setKey..st deleted file mode 100644 index f5abb0e..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/instance/setKey..st +++ /dev/null @@ -1,7 +0,0 @@ -initialize-release -setKey: aNumber - | mask64 | - mask64 := 16rFFFFFFFFFFFFFFFF. - des1 := DESForOpenPGP new setKey: ((aNumber bitShift: -128) bitAnd: mask64). - des2 := DESForOpenPGP new setKey: ((aNumber bitShift: -64) bitAnd: mask64). - des3 := DESForOpenPGP new setKey: (aNumber bitAnd: mask64) \ No newline at end of file diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/methodProperties.json b/source/OpenPGP.package/TripleDESForOpenPGP.class/methodProperties.json deleted file mode 100644 index da21dc3..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/methodProperties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "class" : { - "blockSize" : " 7/23/2018 10:01:09", - "keySize" : " 7/23/2018 10:01:09", - "new" : " 7/23/2018 10:01:09" }, - "instance" : { - "blockSize" : " 7/23/2018 10:01:09", - "decryptBlock:" : " 7/23/2018 10:01:09", - "encryptBlock:" : " 7/23/2018 10:01:09", - "initialize" : " 7/23/2018 10:01:09", - "key:" : " 7/23/2018 10:01:09", - "keySize" : " 7/23/2018 10:01:09", - "setKey:" : " 7/23/2018 10:01:09" } } diff --git a/source/OpenPGP.package/TripleDESForOpenPGP.class/properties.json b/source/OpenPGP.package/TripleDESForOpenPGP.class/properties.json deleted file mode 100644 index 05463b1..0000000 --- a/source/OpenPGP.package/TripleDESForOpenPGP.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "category" : "OpenPGP-Algorithms", - "classinstvars" : [ - ], - "classvars" : [ - ], - "commentStamp" : "hmm 3/26/2002 19:16", - "instvars" : [ - "des1", - "des2", - "des3" ], - "name" : "TripleDESForOpenPGP", - "pools" : [ - ], - "super" : "BlockCipher", - "type" : "normal" } diff --git a/source/OpenPGP.package/monticello.meta/categories.st b/source/OpenPGP.package/monticello.meta/categories.st deleted file mode 100644 index d318e28..0000000 --- a/source/OpenPGP.package/monticello.meta/categories.st +++ /dev/null @@ -1,4 +0,0 @@ -SystemOrganization addCategory: #OpenPGP! -SystemOrganization addCategory: 'OpenPGP-Algorithms'! -SystemOrganization addCategory: 'OpenPGP-Core'! -SystemOrganization addCategory: 'OpenPGP-Packets'! diff --git a/source/OpenPGP.package/monticello.meta/initializers.st b/source/OpenPGP.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/OpenPGP.package/monticello.meta/package b/source/OpenPGP.package/monticello.meta/package deleted file mode 100644 index 67942c3..0000000 --- a/source/OpenPGP.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'OpenPGP') \ No newline at end of file diff --git a/source/OpenPGP.package/monticello.meta/version b/source/OpenPGP.package/monticello.meta/version deleted file mode 100644 index 82ff906..0000000 --- a/source/OpenPGP.package/monticello.meta/version +++ /dev/null @@ -1 +0,0 @@ -(name 'OpenPGP-NorbertHartl.2' message 'Saving once for package declaration' id '2b48bd6c-2ee4-4457-8fff-b39d83bfdb79' date '23 July 2018' time '10:30:47.035781 am' author 'NorbertHartl' ancestors ((name 'OpenPGP-cypress.1' message 'fabricated from a Cypress format repository' id 'fa619b5f-ad9e-4dd3-8b25-2fe8a1887cb0' date '23 July 2018' time '10:01:09.933416 am' author '' ancestors () stepChildren ())) stepChildren ()) \ No newline at end of file diff --git a/source/OpenPGP.package/properties.json b/source/OpenPGP.package/properties.json deleted file mode 100644 index f037444..0000000 --- a/source/OpenPGP.package/properties.json +++ /dev/null @@ -1,2 +0,0 @@ -{ - } diff --git a/source/OpenPGP/CAST5.class.st b/source/OpenPGP/CAST5.class.st new file mode 100644 index 0000000..57d6278 --- /dev/null +++ b/source/OpenPGP/CAST5.class.st @@ -0,0 +1,481 @@ +" +The CAST5 encryption algorithm. AFAIK, all key sizes specified in the standard are supported. See CAST5TestCase for test data. + +Instance Variables: +shortKey whether the key is short (< 48 bits) or long. Used to determine number of rounds. +" +Class { + #name : #CAST5, + #superclass : #FeistelCipher, + #instVars : [ + 'shortKey' + ], + #classVars : [ + 'EBitSelectionTable', + 'S1', + 'S2', + 'S3', + 'S4', + 'S5', + 'S6', + 'S7', + 'S8', + 'SBoxes' + ], + #category : 'OpenPGP-Algorithms' +} + +{ #category : #'class initialization' } +CAST5 class >> initialize [ + "CAST5 initialize" + S1 := self sBoxFrom: ' + 30fb40d4 9fa0ff0b 6beccd2f 3f258c7a 1e213f2f 9c004dd3 6003e540 cf9fc949 + bfd4af27 88bbbdb5 e2034090 98d09675 6e63a0e0 15c361d2 c2e7661d 22d4ff8e + 28683b6f c07fd059 ff2379c8 775f50e2 43c340d3 df2f8656 887ca41a a2d2bd2d + a1c9e0d6 346c4819 61b76d87 22540f2f 2abe32e1 aa54166b 22568e3a a2d341d0 + 66db40c8 a784392f 004dff2f 2db9d2de 97943fac 4a97c1d8 527644b7 b5f437a7 + b82cbaef d751d159 6ff7f0ed 5a097a1f 827b68d0 90ecf52e 22b0c054 bc8e5935 + 4b6d2f7f 50bb64a2 d2664910 bee5812d b7332290 e93b159f b48ee411 4bff345d + fd45c240 ad31973f c4f6d02e 55fc8165 d5b1caad a1ac2dae a2d4b76d c19b0c50 + 882240f2 0c6e4f38 a4e4bfd7 4f5ba272 564c1d2f c59c5319 b949e354 b04669fe + b1b6ab8a c71358dd 6385c545 110f935d 57538ad5 6a390493 e63d37e0 2a54f6b3 + 3a787d5f 6276a0b5 19a6fcdf 7a42206a 29f9d4d5 f61b1891 bb72275e aa508167 + 38901091 c6b505eb 84c7cb8c 2ad75a0f 874a1427 a2d1936b 2ad286af aa56d291 + d7894360 425c750d 93b39e26 187184c9 6c00b32d 73e2bb14 a0bebc3c 54623779 + 64459eab 3f328b82 7718cf82 59a2cea6 04ee002e 89fe78e6 3fab0950 325ff6c2 + 81383f05 6963c5c8 76cb5ad6 d49974c9 ca180dcf 380782d5 c7fa5cf6 8ac31511 + 35e79e13 47da91d0 f40f9086 a7e2419e 31366241 051ef495 aa573b04 4a805d8d + 548300d0 00322a3c bf64cddf ba57a68e 75c6372b 50afd341 a7c13275 915a0bf5 + 6b54bfab 2b0b1426 ab4cc9d7 449ccd82 f7fbf265 ab85c5f3 1b55db94 aad4e324 + cfa4bd3f 2deaa3e2 9e204d02 c8bd25ac eadf55b3 d5bd9e98 e31231b2 2ad5ad6c + 954329de adbe4528 d8710f69 aa51c90f aa786bf6 22513f1e aa51a79b 2ad344cc + 7b5a41f0 d37cfbad 1b069505 41ece491 b4c332e6 032268d4 c9600acc ce387e6d + bf6bb16c 6a70fb78 0d03d9c9 d4df39de e01063da 4736f464 5ad328d8 b347cc96 + 75bb0fc3 98511bfb 4ffbcc35 b58bcf6a e11f0abc bfc5fe4a a70aec10 ac39570a + 3f04442f 6188b153 e0397a2e 5727cb79 9ceb418f 1cacd68d 2ad37c96 0175cb9d + c69dff09 c75b65f0 d9db40d8 ec0e7779 4744ead4 b11c3274 dd24cb9e 7e1c54bd + f01144f9 d2240eb1 9675b3fd a3ac3755 d47c27af 51c85f4d 56907596 a5bb15e6 + 580304f0 ca042cf1 011a37ea 8dbfaadb 35ba3e4a 3526ffa0 c37b4d09 bc306ed9 + 98a52666 5648f725 ff5e569d 0ced63d0 7c63b2cf 700b45e1 d5ea50f1 85a92872 + af1fbda7 d4234870 a7870bf3 2d3b4d79 42e04198 0cd0ede7 26470db8 f881814c + 474d6ad7 7c0c5e5c d1231959 381b7298 f5d2f4db ab838653 6e2f1e23 83719c9e + bd91e046 9a56456e dc39200c 20c8c571 962bda1c e1e696ff b141ab08 7cca89b9 + 1a69e783 02cc4843 a2f7c579 429ef47d 427b169c 5ac9f049 dd8f0f00 5c8165bf'. + S2 := self sBoxFrom: ' + 1f201094 ef0ba75b 69e3cf7e 393f4380 fe61cf7a eec5207a 55889c94 72fc0651 + ada7ef79 4e1d7235 d55a63ce de0436ba 99c430ef 5f0c0794 18dcdb7d a1d6eff3 + a0b52f7b 59e83605 ee15b094 e9ffd909 dc440086 ef944459 ba83ccb3 e0c3cdfb + d1da4181 3b092ab1 f997f1c1 a5e6cf7b 01420ddb e4e7ef5b 25a1ff41 e180f806 + 1fc41080 179bee7a d37ac6a9 fe5830a4 98de8b7f 77e83f4e 79929269 24fa9f7b + e113c85b acc40083 d7503525 f7ea615f 62143154 0d554b63 5d681121 c866c359 + 3d63cf73 cee234c0 d4d87e87 5c672b21 071f6181 39f7627f 361e3084 e4eb573b + 602f64a4 d63acd9c 1bbc4635 9e81032d 2701f50c 99847ab4 a0e3df79 ba6cf38c + 10843094 2537a95e f46f6ffe a1ff3b1f 208cfb6a 8f458c74 d9e0a227 4ec73a34 + fc884f69 3e4de8df ef0e0088 3559648d 8a45388c 1d804366 721d9bfd a58684bb + e8256333 844e8212 128d8098 fed33fb4 ce280ae1 27e19ba5 d5a6c252 e49754bd + c5d655dd eb667064 77840b4d a1b6a801 84db26a9 e0b56714 21f043b7 e5d05860 + 54f03084 066ff472 a31aa153 dadc4755 b5625dbf 68561be6 83ca6b94 2d6ed23b + eccf01db a6d3d0ba b6803d5c af77a709 33b4a34c 397bc8d6 5ee22b95 5f0e5304 + 81ed6f61 20e74364 b45e1378 de18639b 881ca122 b96726d1 8049a7e8 22b7da7b + 5e552d25 5272d237 79d2951c c60d894c 488cb402 1ba4fe5b a4b09f6b 1ca815cf + a20c3005 8871df63 b9de2fcb 0cc6c9e9 0beeff53 e3214517 b4542835 9f63293c + ee41e729 6e1d2d7c 50045286 1e6685f3 f33401c6 30a22c95 31a70850 60930f13 + 73f98417 a1269859 ec645c44 52c877a9 cdff33a6 a02b1741 7cbad9a2 2180036f + 50d99c08 cb3f4861 c26bd765 64a3f6ab 80342676 25a75e7b e4e6d1fc 20c710e6 + cdf0b680 17844d3b 31eef84d 7e0824e4 2ccb49eb 846a3bae 8ff77888 ee5d60f6 + 7af75673 2fdd5cdb a11631c1 30f66f43 b3faec54 157fd7fa ef8579cc d152de58 + db2ffd5e 8f32ce19 306af97a 02f03ef8 99319ad5 c242fa0f a7e3ebb0 c68e4906 + b8da230c 80823028 dcdef3c8 d35fb171 088a1bc8 bec0c560 61a3c9e8 bca8f54d + c72feffa 22822e99 82c570b4 d8d94e89 8b1c34bc 301e16e6 273be979 b0ffeaa6 + 61d9b8c6 00b24869 b7ffce3f 08dc283b 43daf65a f7e19798 7619b72f 8f1c9ba4 + dc8637a0 16a7d3b1 9fc393b7 a7136eeb c6bcc63e 1a513742 ef6828bc 520365d6 + 2d6a77ab 3527ed4b 821fd216 095c6e2e db92f2fb 5eea29cb 145892f5 91584f7f + 5483697b 2667a8cc 85196048 8c4bacea 833860d4 0d23e0f9 6c387e8a 0ae6d249 + b284600c d835731d dcb1c647 ac4c56ea 3ebd81b3 230eabb0 6438bc87 f0b5b1fa + 8f5ea2b3 fc184642 0a036b7a 4fb089bd 649da589 a345415e 5c038323 3e5d3bb9 + 43d79572 7e6dd07c 06dfdf1e 6c6cc4ef 7160a539 73bfbe70 83877605 4523ecf1'. + S3 := self sBoxFrom: ' + 8defc240 25fa5d9f eb903dbf e810c907 47607fff 369fe44b 8c1fc644 aececa90 + beb1f9bf eefbcaea e8cf1950 51df07ae 920e8806 f0ad0548 e13c8d83 927010d5 + 11107d9f 07647db9 b2e3e4d4 3d4f285e b9afa820 fade82e0 a067268b 8272792e + 553fb2c0 489ae22b d4ef9794 125e3fbc 21fffcee 825b1bfd 9255c5ed 1257a240 + 4e1a8302 bae07fff 528246e7 8e57140e 3373f7bf 8c9f8188 a6fc4ee8 c982b5a5 + a8c01db7 579fc264 67094f31 f2bd3f5f 40fff7c1 1fb78dfc 8e6bd2c1 437be59b + 99b03dbf b5dbc64b 638dc0e6 55819d99 a197c81c 4a012d6e c5884a28 ccc36f71 + b843c213 6c0743f1 8309893c 0feddd5f 2f7fe850 d7c07f7e 02507fbf 5afb9a04 + a747d2d0 1651192e af70bf3e 58c31380 5f98302e 727cc3c4 0a0fb402 0f7fef82 + 8c96fdad 5d2c2aae 8ee99a49 50da88b8 8427f4a0 1eac5790 796fb449 8252dc15 + efbd7d9b a672597d ada840d8 45f54504 fa5d7403 e83ec305 4f91751a 925669c2 + 23efe941 a903f12e 60270df2 0276e4b6 94fd6574 927985b2 8276dbcb 02778176 + f8af918d 4e48f79e 8f616ddf e29d840e 842f7d83 340ce5c8 96bbb682 93b4b148 + ef303cab 984faf28 779faf9b 92dc560d 224d1e20 8437aa88 7d29dc96 2756d3dc + 8b907cee b51fd240 e7c07ce3 e566b4a1 c3e9615e 3cf8209d 6094d1e3 cd9ca341 + 5c76460e 00ea983b d4d67881 fd47572c f76cedd9 bda8229c 127dadaa 438a074e + 1f97c090 081bdb8a 93a07ebe b938ca15 97b03cff 3dc2c0f8 8d1ab2ec 64380e51 + 68cc7bfb d90f2788 12490181 5de5ffd4 dd7ef86a 76a2e214 b9a40368 925d958f + 4b39fffa ba39aee9 a4ffd30b faf7933b 6d498623 193cbcfa 27627545 825cf47a + 61bd8ba0 d11e42d1 cead04f4 127ea392 10428db7 8272a972 9270c4a8 127de50b + 285ba1c8 3c62f44f 35c0eaa5 e805d231 428929fb b4fcdf82 4fb66a53 0e7dc15b + 1f081fab 108618ae fcfd086d f9ff2889 694bcc11 236a5cae 12deca4d 2c3f8cc5 + d2d02dfe f8ef5896 e4cf52da 95155b67 494a488c b9b6a80c 5c8f82bc 89d36b45 + 3a609437 ec00c9a9 44715253 0a874b49 d773bc40 7c34671c 02717ef6 4feb5536 + a2d02fff d2bf60c4 d43f03c0 50b4ef6d 07478cd1 006e1888 a2e53f55 b9e6d4bc + a2048016 97573833 d7207d67 de0f8f3d 72f87b33 abcc4f33 7688c55d 7b00a6b0 + 947b0001 570075d2 f9bb88f8 8942019e 4264a5ff 856302e0 72dbd92b ee971b69 + 6ea22fde 5f08ae2b af7a616d e5c98767 cf1febd2 61efc8c2 f1ac2571 cc8239c2 + 67214cb8 b1e583d1 b7dc3e62 7f10bdce f90a5c38 0ff0443d 606e6dc6 60543a49 + 5727c148 2be98a1d 8ab41738 20e1be24 af96da0f 68458425 99833be5 600d457d + 282f9350 8334b362 d91d1120 2b6d8da0 642b1e31 9c305a00 52bce688 1b03588a + f7baefd5 4142ed9c a4315c11 83323ec5 dfef4636 a133c501 e9d3531c ee353783'. + S4 := self sBoxFrom: ' + 9db30420 1fb6e9de a7be7bef d273a298 4a4f7bdb 64ad8c57 85510443 fa020ed1 + 7e287aff e60fb663 095f35a1 79ebf120 fd059d43 6497b7b1 f3641f63 241e4adf + 28147f5f 4fa2b8cd c9430040 0cc32220 fdd30b30 c0a5374f 1d2d00d9 24147b15 + ee4d111a 0fca5167 71ff904c 2d195ffe 1a05645f 0c13fefe 081b08ca 05170121 + 80530100 e83e5efe ac9af4f8 7fe72701 d2b8ee5f 06df4261 bb9e9b8a 7293ea25 + ce84ffdf f5718801 3dd64b04 a26f263b 7ed48400 547eebe6 446d4ca0 6cf3d6f5 + 2649abdf aea0c7f5 36338cc1 503f7e93 d3772061 11b638e1 72500e03 f80eb2bb + abe0502e ec8d77de 57971e81 e14f6746 c9335400 6920318f 081dbb99 ffc304a5 + 4d351805 7f3d5ce3 a6c866c6 5d5bcca9 daec6fea 9f926f91 9f46222f 3991467d + a5bf6d8e 1143c44f 43958302 d0214eeb 022083b8 3fb6180c 18f8931e 281658e6 + 26486e3e 8bd78a70 7477e4c1 b506e07c f32d0a25 79098b02 e4eabb81 28123b23 + 69dead38 1574ca16 df871b62 211c40b7 a51a9ef9 0014377b 041e8ac8 09114003 + bd59e4d2 e3d156d5 4fe876d5 2f91a340 557be8de 00eae4a7 0ce5c2ec 4db4bba6 + e756bdff dd3369ac ec17b035 06572327 99afc8b0 56c8c391 6b65811c 5e146119 + 6e85cb75 be07c002 c2325577 893ff4ec 5bbfc92d d0ec3b25 b7801ab7 8d6d3b24 + 20c763ef c366a5fc 9c382880 0ace3205 aac9548a eca1d7c7 041afa32 1d16625a + 6701902c 9b757a54 31d477f7 9126b031 36cc6fdb c70b8b46 d9e66a48 56e55a79 + 026a4ceb 52437eff 2f8f76b4 0df980a5 8674cde3 edda04eb 17a9be04 2c18f4df + b7747f9d ab2af7b4 efc34d20 2e096b7c 1741a254 e5b6a035 213d42f6 2c1c7c26 + 61c2f50f 6552daf9 d2c231f8 25130f69 d8167fa2 0418f2c8 001a96a6 0d1526ab + 63315c21 5e0a72ec 49bafefd 187908d9 8d0dbd86 311170a7 3e9b640c cc3e10d7 + d5cad3b6 0caec388 f73001e1 6c728aff 71eae2a1 1f9af36e cfcbd12f c1de8417 + ac07be6b cb44a1d8 8b9b0f56 013988c3 b1c52fca b4be31cd d8782806 12a3a4e2 + 6f7de532 58fd7eb6 d01ee900 24adffc2 f4990fc5 9711aac5 001d7b95 82e5e7d2 + 109873f6 00613096 c32d9521 ada121ff 29908415 7fbb977f af9eb3db 29c9ed2a + 5ce2a465 a730f32c d0aa3fe8 8a5cc091 d49e2ce7 0ce454a9 d60acd86 015f1919 + 77079103 dea03af6 78a8565e dee356df 21f05cbe 8b75e387 b3c50651 b8a5c3ef + d8eeb6d2 e523be77 c2154529 2f69efdf afe67afb f470c4b2 f3e0eb5b d6cc9876 + 39e4460c 1fda8538 1987832f ca007367 a99144f8 296b299e 492fc295 9266beab + b5676e69 9bd3ddda df7e052f db25701c 1b5e51ee f65324e6 6afce36c 0316cc04 + 8644213e b7dc59d0 7965291f ccd6fd43 41823979 932bcdf6 b657c34d 4edfd282 + 7ae5290c 3cb9536b 851e20fe 9833557e 13ecf0b0 d3ffb372 3f85c5c1 0aef7ed2'. + S5 := self sBoxFrom: ' + 7ec90c04 2c6e74b9 9b0e66df a6337911 b86a7fff 1dd358f5 44dd9d44 1731167f + 08fbf1fa e7f511cc d2051b00 735aba00 2ab722d8 386381cb acf6243a 69befd7a + e6a2e77f f0c720cd c4494816 ccf5c180 38851640 15b0a848 e68b18cb 4caadeff + 5f480a01 0412b2aa 259814fc 41d0efe2 4e40b48d 248eb6fb 8dba1cfe 41a99b02 + 1a550a04 ba8f65cb 7251f4e7 95a51725 c106ecd7 97a5980a c539b9aa 4d79fe6a + f2f3f763 68af8040 ed0c9e56 11b4958b e1eb5a88 8709e6b0 d7e07156 4e29fea7 + 6366e52d 02d1c000 c4ac8e05 9377f571 0c05372a 578535f2 2261be02 d642a0c9 + df13a280 74b55bd2 682199c0 d421e5ec 53fb3ce8 c8adedb3 28a87fc9 3d959981 + 5c1ff900 fe38d399 0c4eff0b 062407ea aa2f4fb1 4fb96976 90c79505 b0a8a774 + ef55a1ff e59ca2c2 a6b62d27 e66a4263 df65001f 0ec50966 dfdd55bc 29de0655 + 911e739a 17af8975 32c7911c 89f89468 0d01e980 524755f4 03b63cc9 0cc844b2 + bcf3f0aa 87ac36e9 e53a7426 01b3d82b 1a9e7449 64ee2d7e cddbb1da 01c94910 + b868bf80 0d26f3fd 9342ede7 04a5c284 636737b6 50f5b616 f24766e3 8eca36c1 + 136e05db fef18391 fb887a37 d6e7f7d4 c7fb7dc9 3063fcdf b6f589de ec2941da + 26e46695 b7566419 f654efc5 d08d58b7 48925401 c1bacb7f e5ff550f b6083049 + 5bb5d0e8 87d72e5a ab6a6ee1 223a66ce c62bf3cd 9e0885f9 68cb3e47 086c010f + a21de820 d18b69de f3f65777 fa02c3f6 407edac3 cbb3d550 1793084d b0d70eba + 0ab378d5 d951fb0c ded7da56 4124bbe4 94ca0b56 0f5755d1 e0e1e56e 6184b5be + 580a249f 94f74bc0 e327888e 9f7b5561 c3dc0280 05687715 646c6bd7 44904db3 + 66b4f0a3 c0f1648a 697ed5af 49e92ff6 309e374f 2cb6356a 85808573 4991f840 + 76f0ae02 083be84d 28421c9a 44489406 736e4cb8 c1092910 8bc95fc6 7d869cf4 + 134f616f 2e77118d b31b2be1 aa90b472 3ca5d717 7d161bba 9cad9010 af462ba2 + 9fe459d2 45d34559 d9f2da13 dbc65487 f3e4f94e 176d486f 097c13ea 631da5c7 + 445f7382 175683f4 cdc66a97 70be0288 b3cdcf72 6e5dd2f3 20936079 459b80a5 + be60e2db a9c23101 eba5315c 224e42f2 1c5c1572 f6721b2c 1ad2fff3 8c25404e + 324ed72f 4067b7fd 0523138e 5ca3bc78 dc0fd66e 75922283 784d6b17 58ebb16e + 44094f85 3f481d87 fcfeae7b 77b5ff76 8c2302bf aaf47556 5f46b02a 2b092801 + 3d38f5f7 0ca81f36 52af4a8a 66d5e7c0 df3b0874 95055110 1b5ad7a8 f61ed5ad + 6cf6e479 20758184 d0cefa65 88f7be58 4a046826 0ff6f8f3 a09c7f70 5346aba0 + 5ce96c28 e176eda3 6bac307f 376829d2 85360fa9 17e3fe2a 24b79767 f5a96b20 + d6cd2595 68ff1ebf 7555442c f19f06be f9e0659a eeb9491d 34010718 bb30cab8 + e822fe15 88570983 750e6249 da627e55 5e76ffa8 b1534546 6d47de08 efe9e7d4'. + S6 := self sBoxFrom: ' + f6fa8f9d 2cac6ce1 4ca34867 e2337f7c 95db08e7 016843b4 eced5cbc 325553ac + bf9f0960 dfa1e2ed 83f0579d 63ed86b9 1ab6a6b8 de5ebe39 f38ff732 8989b138 + 33f14961 c01937bd f506c6da e4625e7e a308ea99 4e23e33c 79cbd7cc 48a14367 + a3149619 fec94bd5 a114174a eaa01866 a084db2d 09a8486f a888614a 2900af98 + 01665991 e1992863 c8f30c60 2e78ef3c d0d51932 cf0fec14 f7ca07d2 d0a82072 + fd41197e 9305a6b0 e86be3da 74bed3cd 372da53c 4c7f4448 dab5d440 6dba0ec3 + 083919a7 9fbaeed9 49dbcfb0 4e670c53 5c3d9c01 64bdb941 2c0e636a ba7dd9cd + ea6f7388 e70bc762 35f29adb 5c4cdd8d f0d48d8c b88153e2 08a19866 1ae2eac8 + 284caf89 aa928223 9334be53 3b3a21bf 16434be3 9aea3906 efe8c36e f890cdd9 + 80226dae c340a4a3 df7e9c09 a694a807 5b7c5ecc 221db3a6 9a69a02f 68818a54 + ceb2296f 53c0843a fe893655 25bfe68a b4628abc cf222ebf 25ac6f48 a9a99387 + 53bddb65 e76ffbe7 e967fd78 0ba93563 8e342bc1 e8a11be9 4980740d c8087dfc + 8de4bf99 a11101a0 7fd37975 da5a26c0 e81f994f 9528cd89 fd339fed b87834bf + 5f04456d 22258698 c9c4c83b 2dc156be 4f628daa 57f55ec5 e2220abe d2916ebf + 4ec75b95 24f2c3c0 42d15d99 cd0d7fa0 7b6e27ff a8dc8af0 7345c106 f41e232f + 35162386 e6ea8926 3333b094 157ec6f2 372b74af 692573e4 e9a9d848 f3160289 + 3a62ef1d a787e238 f3a5f676 74364853 20951063 4576698d b6fad407 592af950 + 36f73523 4cfb6e87 7da4cec0 6c152daa cb0396a8 c50dfe5d fcd707ab 0921c42f + 89dff0bb 5fe2be78 448f4f33 754613c9 2b05d08d 48b9d585 dc049441 c8098f9b + 7dede786 c39a3373 42410005 6a091751 0ef3c8a6 890072d6 28207682 a9a9f7be + bf32679d d45b5b75 b353fd00 cbb0e358 830f220a 1f8fb214 d372cf08 cc3c4a13 + 8cf63166 061c87be 88c98f88 6062e397 47cf8e7a b6c85283 3cc2acfb 3fc06976 + 4e8f0252 64d8314d da3870e3 1e665459 c10908f0 513021a5 6c5b68b7 822f8aa0 + 3007cd3e 74719eef dc872681 073340d4 7e432fd9 0c5ec241 8809286c f592d891 + 08a930f6 957ef305 b7fbffbd c266e96f 6fe4ac98 b173ecc0 bc60b42a 953498da + fba1ae12 2d4bd736 0f25faab a4f3fceb e2969123 257f0c3d 9348af49 361400bc + e8816f4a 3814f200 a3f94043 9c7a54c2 bc704f57 da41e7f9 c25ad33a 54f4a084 + b17f5505 59357cbe edbd15c8 7f97c5ab ba5ac7b5 b6f6deaf 3a479c3a 5302da25 + 653d7e6a 54268d49 51a477ea 5017d55b d7d25d88 44136c76 0404a8c8 b8e5a121 + b81a928a 60ed5869 97c55b96 eaec991b 29935913 01fdb7f1 088e8dfa 9ab6f6f5 + 3b4cbf9f 4a5de3ab e6051d35 a0e1d855 d36b4cf1 f544edeb b0e93524 bebb8fbd + a2d762cf 49c92f54 38b5f331 7128a454 48392905 a65b1db8 851c97bd d675cf2f'. + S7 := self sBoxFrom: ' + 85e04019 332bf567 662dbfff cfc65693 2a8d7f6f ab9bc912 de6008a1 2028da1f + 0227bce7 4d642916 18fac300 50f18b82 2cb2cb11 b232e75c 4b3695f2 b28707de + a05fbcf6 cd4181e9 e150210c e24ef1bd b168c381 fde4e789 5c79b0d8 1e8bfd43 + 4d495001 38be4341 913cee1d 92a79c3f 089766be baeeadf4 1286becf b6eacb19 + 2660c200 7565bde4 64241f7a 8248dca9 c3b3ad66 28136086 0bd8dfa8 356d1cf2 + 107789be b3b2e9ce 0502aa8f 0bc0351e 166bf52a eb12ff82 e3486911 d34d7516 + 4e7b3aff 5f43671b 9cf6e037 4981ac83 334266ce 8c9341b7 d0d854c0 cb3a6c88 + 47bc2829 4725ba37 a66ad22b 7ad61f1e 0c5cbafa 4437f107 b6e79962 42d2d816 + 0a961288 e1a5c06e 13749e67 72fc081a b1d139f7 f9583745 cf19df58 bec3f756 + c06eba30 07211b24 45c28829 c95e317f bc8ec511 38bc46e9 c6e6fa14 bae8584a + ad4ebc46 468f508b 7829435f f124183b 821dba9f aff60ff4 ea2c4e6d 16e39264 + 92544a8b 009b4fc3 aba68ced 9ac96f78 06a5b79a b2856e6e 1aec3ca9 be838688 + 0e0804e9 55f1be56 e7e5363b b3a1f25d f7debb85 61fe033c 16746233 3c034c28 + da6d0c74 79aac56c 3ce4e1ad 51f0c802 98f8f35a 1626a49f eed82b29 1d382fe3 + 0c4fb99a bb325778 3ec6d97b 6e77a6a9 cb658b5c d45230c7 2bd1408b 60c03eb7 + b9068d78 a33754f4 f430c87d c8a71302 b96d8c32 ebd4e7be be8b9d2d 7979fb06 + e7225308 8b75cf77 11ef8da4 e083c858 8d6b786f 5a6317a6 fa5cf7a0 5dda0033 + f28ebfb0 f5b9c310 a0eac280 08b9767a a3d9d2b0 79d34217 021a718d 9ac6336a + 2711fd60 438050e3 069908a8 3d7fedc4 826d2bef 4eeb8476 488dcf25 36c9d566 + 28e74e41 c2610aca 3d49a9cf bae3b9df b65f8de6 92aeaf64 3ac7d5e6 9ea80509 + f22b017d a4173f70 dd1e16c3 15e0d7f9 50b1b887 2b9f4fd5 625aba82 6a017962 + 2ec01b9c 15488aa9 d716e740 40055a2c 93d29a22 e32dbf9a 058745b9 3453dc1e + d699296e 496cff6f 1c9f4986 dfe2ed07 b87242d1 19de7eae 053e561a 15ad6f8c + 66626c1c 7154c24c ea082b2a 93eb2939 17dcb0f0 58d4f2ae 9ea294fb 52cf564c + 9883fe66 2ec40581 763953c3 01d6692e d3a0c108 a1e7160e e4f2dfa6 693ed285 + 74904698 4c2b0edd 4f757656 5d393378 a132234f 3d321c5d c3f5e194 4b269301 + c79f022f 3c997e7e 5e4f9504 3ffafbbd 76f7ad0e 296693f4 3d1fce6f c61e45be + d3b5ab34 f72bf9b7 1b0434c0 4e72b567 5592a33d b5229301 cfd2a87f 60aeb767 + 1814386b 30bcc33d 38a0c07d fd1606f2 c363519b 589dd390 5479f8e6 1cb8d647 + 97fd61a9 ea7759f4 2d57539d 569a58cf e84e63ad 462e1b78 6580f87e f3817914 + 91da55f4 40a230f3 d1988f35 b6e318d2 3ffa50bc 3d40f021 c3c0bdae 4958c24c + 518f36b2 84b1d370 0fedce83 878ddada f2a279c7 94e01be8 90716f4b 954b8aa3'. + S8 := self sBoxFrom: ' + e216300d bbddfffc a7ebdabd 35648095 7789f8b7 e6c1121b 0e241600 052ce8b5 + 11a9cfb0 e5952f11 ece7990a 9386d174 2a42931c 76e38111 b12def3a 37ddddfc + de9adeb1 0a0cc32c be197029 84a00940 bb243a0f b4d137cf b44e79f0 049eedfd + 0b15a15d 480d3168 8bbbde5a 669ded42 c7ece831 3f8f95e7 72df191b 7580330d + 94074251 5c7dcdfa abbe6d63 aa402164 b301d40a 02e7d1ca 53571dae 7a3182a2 + 12a8ddec fdaa335d 176f43e8 71fb46d4 38129022 ce949ad4 b84769ad 965bd862 + 82f3d055 66fb9767 15b80b4e 1d5b47a0 4cfde06f c28ec4b8 57e8726e 647a78fc + 99865d44 608bd593 6c200e03 39dc5ff6 5d0b00a3 ae63aff2 7e8bd632 70108c0c + bbd35049 2998df04 980cf42a 9b6df491 9e7edd53 06918548 58cb7e07 3b74ef2e + 522fffb1 d24708cc 1c7e27cd a4eb215b 3cf1d2e2 19b47a38 424f7618 35856039 + 9d17dee7 27eb35e6 c9aff67b 36baf5b8 09c467cd c18910b1 e11dbf7b 06cd1af8 + 7170c608 2d5e3354 d4de495a 64c6d006 bcc0c62c 3dd00db3 708f8f34 77d51b42 + 264f620f 24b8d2bf 15c1b79e 46a52564 f8d7e54e 3e378160 7895cda5 859c15a5 + e6459788 c37bc75f db07ba0c 0676a3ab 7f229b1e 31842e7b 24259fd7 f8bef472 + 835ffcb8 6df4c1f2 96f5b195 fd0af0fc b0fe134c e2506d3d 4f9b12ea f215f225 + a223736f 9fb4c428 25d04979 34c713f8 c4618187 ea7a6e98 7cd16efc 1436876c + f1544107 bedeee14 56e9af27 a04aa441 3cf7c899 92ecbae6 dd67016d 151682eb + a842eedf fdba60b4 f1907b75 20e3030f 24d8c29e e139673b efa63fb8 71873054 + b6f2cf3b 9f326442 cb15a4cc b01a4504 f1e47d8d 844a1be5 bae7dfdc 42cbda70 + cd7dae0a 57e85b7a d53f5af6 20cf4d8c cea4d428 79d130a4 3486ebfb 33d3cddc + 77853b53 37effcb5 c5068778 e580b3e6 4e68b8f4 c5c8b37e 0d809ea2 398feb7c + 132a4f94 43b7950e 2fee7d1c 223613bd dd06caa2 37df932b c4248289 acf3ebc3 + 5715f6b7 ef3478dd f267616f c148cbe4 9052815e 5e410fab b48a2465 2eda7fa4 + e87b40e4 e98ea084 5889e9e1 efd390fc dd07d35b db485694 38d7e5b2 57720101 + 730edebc 5b643113 94917e4f 503c2fba 646f1282 7523d24a e0779695 f9c17a8f + 7a5b2121 d187b896 29263a4d ba510cdf 81f47c9f ad1163ed ea7b5965 1a00726e + 11403092 00da6d77 4a0cdd61 ad1f4603 605bdfb0 9eedc364 22ebe6a8 cee7d28a + a0e736a0 5564a6b9 10853209 c7eb8f37 2de705ca 8951570f df09822b bd691a6c + aa12e4f2 87451c0f e0f6a27a 3ada4819 4cf1764f 0d771c2b 67cdb156 350d8384 + 5938fa0f 42399ef3 36997b07 0e84093d 4aa93e61 8360d87b 1fa98b0c 1149382c + e97625a5 0614d1b7 0e25244b 0c768347 589e8d82 0d2059d1 a466bb1e f8da0a82 + 04f19130 ba6e4ec0 99265164 1ee7230d 50b2ad80 eaee6801 8db2a283 ea8bf59e'. + SBoxes := OrderedCollection new add: S1 ; add: S2 ; add: S3 ; add: S4 ; add: S5 ; add: S6 ; add: S7 ; add: S8 +] + +{ #category : #'class initialization' } +CAST5 class >> maintenanceTest [ + "Careful! on my 233 MHz PowerPC, this takes about 2.5 hours..." + "Time millisecondsToRun: [CAST5 maintenanceTest ifFalse: [self error: 'maintenance test failed!']]" + | a b cast mask64 al ar bl br | + a := 16r0123456712345678234567893456789A. + b := 16r0123456712345678234567893456789A. + cast := CAST5 new. + mask64 := (1 bitShift: 64) - 1. + 1000000 timesRepeat: [ + cast setKey: b. + al := cast encryptBlock: (a bitShift: -64). + ar := cast encryptBlock: (a bitAnd: mask64). + a := (al bitShift: 64) + ar. + cast setKey: a. + bl := cast encryptBlock: (b bitShift: -64). + br := cast encryptBlock: (b bitAnd: mask64). + b := (bl bitShift: 64) + br]. + ^a = 16rEEA9D0A249FD3BA6B3436FB89D6DCA92 + and: [b = 16rB2C95EB00C31AD7180AC05B8E83D696E] +] + +{ #category : #'class initialization' } +CAST5 class >> maintenanceTest2 [ + "Careful! on my 233 MHz PowerPC, this takes a number of minutes..." + "MessageTally spyOn: [CAST5 maintenanceTest2 ifFalse: [self error: 'maintenance test failed!']]" + | a b cast mask64 al ar bl br | + a := 16r0123456712345678234567893456789A. + b := 16r0123456712345678234567893456789A. + cast := CAST5 new. + mask64 := (1 bitShift: 64) - 1. + 1000 timesRepeat: [ + cast setKey: b. + al := cast encryptBlock: (a bitShift: -64). + ar := cast encryptBlock: (a bitAnd: mask64). + a := (al bitShift: 64) + ar. + cast setKey: a. + bl := cast encryptBlock: (b bitShift: -64). + br := cast encryptBlock: (b bitAnd: mask64). + b := (bl bitShift: 64) + br]. + ^a = 16r23F73B14B02A2AD7DFB9F2C35644798D + and: [b = 16rE5BF37EFF14C456A40B21CE369370A9F] +] + +{ #category : #'class initialization' } +CAST5 class >> sBoxFrom: aString [ + | str box value | + str := ReadStream on: aString. + box := Array new: 256. + 1 to: 256 do: [:i | + str skipSeparators. + value := (Integer + readFrom: (ReadStream on: (str next: 8) asUppercase) + base: 16). + box at: i put: (ThirtyTwoBitRegister new load: value)]. + str atEnd ifFalse: [self error: 'S-Box initialization data corrupt']. + ^box +] + +{ #category : #'encryption/decryption' } +CAST5 >> blockSize [ + ^8 +] + +{ #category : #'encryption/decryption' } +CAST5 >> decryptBlock: anInteger [ + ^self encrypt: anInteger forward: false +] + +{ #category : #'encryption/decryption' } +CAST5 >> encrypt: anInteger forward: aBoolean [ + | rLast lLast mask32 km kr n t s1ia s2ib s3ic s4id maxRound round | + mask32 := 16rFFFFFFFF. + lLast := ThirtyTwoBitRegister new load: (anInteger bitShift: -32). + rLast := ThirtyTwoBitRegister new load: (anInteger bitAnd: mask32). + s1ia := ThirtyTwoBitRegister new. + s2ib := ThirtyTwoBitRegister new. + s3ic := ThirtyTwoBitRegister new. + s4id := ThirtyTwoBitRegister new. + maxRound := shortKey ifTrue: [12] ifFalse: [16]. + 1 to: maxRound do: [:i | + round := aBoolean ifTrue: [i] ifFalse: [maxRound+1-i]. + km := (k at: round) copy. + kr := k at: round+16. + n := round \\ 3. + n = 1 + ifTrue: [km += rLast] + ifFalse: [n = 2 + ifTrue: [km bitXor: rLast] + ifFalse: [km -= rLast]]. + km leftRotateBy: kr. + s1ia := (S1 at: km d0+1) copy. + s2ib := (S2 at: km d1+1). + s3ic := (S3 at: km d2+1). + s4id := (S4 at: km d3+1). + n = 1 + ifTrue: [(s1ia bitXor: s2ib) -= s3ic += s4id] + ifFalse: [n = 2 + ifTrue: [s1ia -= s2ib += s3ic bitXor: s4id] + ifFalse: [(s1ia += s2ib bitXor: s3ic) -= s4id]]. + t := rLast. + rLast := lLast. + rLast bitXor: s1ia. + lLast := t]. + ^lLast asInteger + (rLast asInteger bitShift: 32) +] + +{ #category : #'encryption/decryption' } +CAST5 >> encryptBlock: anInteger [ + ^self encrypt: anInteger forward: true +] + +{ #category : #'initialize-release' } +CAST5 >> setKey: anInteger [ + "anInteger is a CAST key with 128 bits, of which the LSBs may be 0 if a shorter key size is used. + CAST5 uses 12 rounds for key sizes up to and including 80 bits, and 16 rounds for larger keys. The key size is determined by examining the 48 LSBs of the keys; if they are 0, the key is assumed to be 80 bits or less." + | mask32 x0 x4 x8 xC z0 z4 z8 zC | + mask32 := (1 bitShift: 32) - 1. + shortKey := (anInteger bitAnd: (1 bitShift: 48)-1) = 0. + k := Array new: 32. + x0 := ThirtyTwoBitRegister new load: (anInteger bitShift: -96). + x4 := ThirtyTwoBitRegister new load: ((anInteger bitShift: -64) bitAnd: mask32). + x8 := ThirtyTwoBitRegister new load: ((anInteger bitShift: -32) bitAnd: mask32). + xC := ThirtyTwoBitRegister new load: (anInteger bitAnd: mask32). + 1 to: 32 by: 8 do: [:i | + z0 := x0 copy castXorFrom: S5 index: xC d1; castXorFrom: S6 index: xC d3; + castXorFrom: S7 index: xC d0; castXorFrom: S8 index: xC d2; castXorFrom: S7 index: x8 d0. + z4 := x8 copy castXorFrom: S5 index: z0 d0; castXorFrom: S6 index: z0 d2; + castXorFrom: S7 index: z0 d1; castXorFrom: S8 index: z0 d3; castXorFrom: S8 index: x8 d2. + z8 := xC copy castXorFrom: S5 index: z4 d3; castXorFrom: S6 index: z4 d2; + castXorFrom: S7 index: z4 d1; castXorFrom: S8 index: z4 d0; castXorFrom: S5 index: x8 d1. + zC := x4 copy castXorFrom: S5 index: z8 d2; castXorFrom: S6 index: z8 d1; + castXorFrom: S7 index: z8 d3; castXorFrom: S8 index: z8 d0; castXorFrom: S6 index: x8 d3. + + i \\ 16 = 1 + ifTrue: [ + k at: i put: ((S5 at: z8 d0+1) copy castXorFrom: S6 index: z8 d1; + castXorFrom: S7 index: z4 d3; castXorFrom: S8 index: z4 d2; castXorFrom: S5 index: z0 d2). + k at: i+1 put: ((S5 at: z8 d2+1) copy castXorFrom: S6 index: z8 d3; + castXorFrom: S7 index: z4 d1; castXorFrom: S8 index: z4 d0; castXorFrom: S6 index: z4 d2). + k at: i+2 put: ((S5 at: zC d0+1) copy castXorFrom: S6 index: zC d1; + castXorFrom: S7 index: z0 d3; castXorFrom: S8 index: z0 d2; castXorFrom: S7 index: z8 d1). + k at: i+3 put: ((S5 at: zC d2+1) copy castXorFrom: S6 index: zC d3; + castXorFrom: S7 index: z0 d1; castXorFrom: S8 index: z0 d0; castXorFrom: S8 index: zC d0)] + ifFalse: [ + k at: i put: ((S5 at: z0 d3+1) copy castXorFrom: S6 index: z0 d2; + castXorFrom: S7 index: zC d0; castXorFrom: S8 index: zC d1; castXorFrom: S5 index: z8 d1). + k at: i+1 put: ((S5 at: z0 d1+1) copy castXorFrom: S6 index: z0 d0; + castXorFrom: S7 index: zC d2; castXorFrom: S8 index: zC d3; castXorFrom: S6 index: zC d0). + k at: i+2 put: ((S5 at: z4 d3+1) copy castXorFrom: S6 index: z4 d2; + castXorFrom: S7 index: z8 d0; castXorFrom: S8 index: z8 d1; castXorFrom: S7 index: z0 d2). + k at: i+3 put: ((S5 at: z4 d1+1) copy castXorFrom: S6 index: z4 d0; + castXorFrom: S7 index: z8 d2; castXorFrom: S8 index: z8 d3; castXorFrom: S8 index: z4 d2)]. + + x0 := z8 copy castXorFrom: S5 index: z4 d1; castXorFrom: S6 index: z4 d3; + castXorFrom: S7 index: z4 d0; castXorFrom: S8 index: z4 d2; castXorFrom: S7 index: z0 d0. + x4 := z0 copy castXorFrom: S5 index: x0 d0; castXorFrom: S6 index: x0 d2; + castXorFrom: S7 index: x0 d1; castXorFrom: S8 index: x0 d3; castXorFrom: S8 index: z0 d2. + x8 := z4 copy castXorFrom: S5 index: x4 d3; castXorFrom: S6 index: x4 d2; + castXorFrom: S7 index: x4 d1; castXorFrom: S8 index: x4 d0; castXorFrom: S5 index: z0 d1. + xC := zC copy castXorFrom: S5 index: x8 d2; castXorFrom: S6 index: x8 d1; + castXorFrom: S7 index: x8 d3; castXorFrom: S8 index: x8 d0; castXorFrom: S6 index: z0 d3. + + i \\ 16 = 1 + ifTrue: [ + k at: i+4 put: ((S5 at: x0 d3+1) copy castXorFrom: S6 index: x0 d2; + castXorFrom: S7 index: xC d0; castXorFrom: S8 index: xC d1; castXorFrom: S5 index: x8 d0). + k at: i+5 put: ((S5 at: x0 d1+1) copy castXorFrom: S6 index: x0 d0; + castXorFrom: S7 index: xC d2; castXorFrom: S8 index: xC d3; castXorFrom: S6 index: xC d1). + k at: i+6 put: ((S5 at: x4 d3+1) copy castXorFrom: S6 index: x4 d2; + castXorFrom: S7 index: x8 d0; castXorFrom: S8 index: x8 d1; castXorFrom: S7 index: x0 d3). + k at: i+7 put: ((S5 at: x4 d1+1) copy castXorFrom: S6 index: x4 d0; + castXorFrom: S7 index: x8 d2; castXorFrom: S8 index: x8 d3; castXorFrom: S8 index: x4 d3)] + ifFalse: [ + k at: i+4 put: ((S5 at: x8 d0+1) copy castXorFrom: S6 index: x8 d1; + castXorFrom: S7 index: x4 d3; castXorFrom: S8 index: x4 d2; castXorFrom: S5 index: x0 d3). + k at: i+5 put: ((S5 at: x8 d2+1) copy castXorFrom: S6 index: x8 d3; + castXorFrom: S7 index: x4 d1; castXorFrom: S8 index: x4 d0; castXorFrom: S6 index: x4 d3). + k at: i+6 put: ((S5 at: xC d0+1) copy castXorFrom: S6 index: xC d1; + castXorFrom: S7 index: x0 d3; castXorFrom: S8 index: x0 d2; castXorFrom: S7 index: x8 d0). + k at: i+7 put: ((S5 at: xC d2+1) copy castXorFrom: S6 index: xC d3; + castXorFrom: S7 index: x0 d1; castXorFrom: S8 index: x0 d0; castXorFrom: S8 index: xC d1)]]. + 17 to: 32 do: [:i | k at: i put: ((k at: i) low bitAnd: 31)] +] diff --git a/source/OpenPGP/CAST5TestCase.class.st b/source/OpenPGP/CAST5TestCase.class.st new file mode 100644 index 0000000..2367565 --- /dev/null +++ b/source/OpenPGP/CAST5TestCase.class.st @@ -0,0 +1,38 @@ +" +This test case checks that the 3 test key/plaintext pairs (for 40, 80 and 128 bit key length) given in the CAST5 spec are encoded and decoded correctly. +" +Class { + #name : #CAST5TestCase, + #superclass : #TestCase, + #category : 'OpenPGP-Algorithms' +} + +{ #category : #running } +CAST5TestCase >> test128BitKey [ + | key plaintext ciphertext | + key := 16r0123456712345678234567893456789A. + plaintext := 16r0123456789ABCDEF. + ciphertext := 16r238B4FE5847E44B2. + self assert: ((CAST5 new setKey: key) encryptBlock: plaintext) = ciphertext. + self assert: ((CAST5 new setKey: key) decryptBlock: ciphertext) = plaintext +] + +{ #category : #running } +CAST5TestCase >> test40BitKey [ + | key plaintext ciphertext | + key := 16r01234567120000000000000000000000. + plaintext := 16r0123456789ABCDEF. + ciphertext := 16r7AC816D16E9B302E. + self assert: ((CAST5 new setKey: key) encryptBlock: plaintext) = ciphertext. + self assert: ((CAST5 new setKey: key) decryptBlock: ciphertext) = plaintext +] + +{ #category : #running } +CAST5TestCase >> test80BitKey [ + | key plaintext ciphertext | + key := 16r01234567123456782345000000000000. + plaintext := 16r0123456789ABCDEF. + ciphertext := 16rEB6A711A2C02271B. + self assert: ((CAST5 new setKey: key) encryptBlock: plaintext) = ciphertext. + self assert: ((CAST5 new setKey: key) decryptBlock: ciphertext) = plaintext +] diff --git a/source/OpenPGP/CFBEncryption.class.st b/source/OpenPGP/CFBEncryption.class.st new file mode 100644 index 0000000..590e1cf --- /dev/null +++ b/source/OpenPGP/CFBEncryption.class.st @@ -0,0 +1,74 @@ +" +This class implements cipher feedback encryption in concert with any block cipher. + +Instance Variables: +cipher used with the encryption +iv initialization vector, is updated for every encrypted byte. +encIV encrypted IV, used in the decrpytion step of the CFB +index index into encIV used in the decryption step +" +Class { + #name : #CFBEncryption, + #superclass : #Object, + #instVars : [ + 'cipher', + 'iv', + 'shiftData', + 'shiftIndex' + ], + #category : 'OpenPGP-Algorithms' +} + +{ #category : #'initialize-release' } +CFBEncryption >> cipher: aBlockCipher initialVector: aByteArray [ + self cipher: aBlockCipher initialVector: aByteArray shiftSize: 1 +] + +{ #category : #'initialize-release' } +CFBEncryption >> cipher: aBlockCipher initialVector: aByteArray shiftSize: anInteger [ + cipher := aBlockCipher. + iv := aByteArray copy. + shiftData := ByteArray new: anInteger. + shiftIndex := 0 +] + +{ #category : #encrypting } +CFBEncryption >> decrypt: aCharacterOrInteger [ + | encBlock out | + encBlock := cipher encryptBytes: iv. + shiftIndex := shiftIndex+1. + out := (encBlock at: shiftIndex) bitXor: aCharacterOrInteger asInteger. + shiftData at: shiftIndex put: aCharacterOrInteger asInteger. + shiftIndex = shiftData size ifTrue: [ + iv replaceFrom: 1 to: iv size-shiftIndex with: iv startingAt: shiftIndex+1. + iv replaceFrom: iv size-shiftIndex+1 to: iv size with: shiftData startingAt: 1. + shiftIndex := 0]. + ^out +] + +{ #category : #encrypting } +CFBEncryption >> decryptBytes: aByteArray [ + ^aByteArray collect: [:i | self decrypt: i] +] + +{ #category : #encrypting } +CFBEncryption >> encrypt: aCharacterOrInteger [ + | encBlock out | + encBlock := cipher encryptBytes: iv. + out := encBlock first bitXor: aCharacterOrInteger asInteger. + iv replaceFrom: 1 to: iv size-1 with: iv startingAt: 2. + iv at: iv size put: out. + ^out +] + +{ #category : #encrypting } +CFBEncryption >> encryptBytes: aByteArray [ + ^aByteArray collect: [:i | self encrypt: i] +] + +{ #category : #'initialize-release' } +CFBEncryption >> resyncWith: aByteArray [ + iv := aByteArray copy. + shiftData := ByteArray new: shiftData size. + shiftIndex := 0 +] diff --git a/source/OpenPGP/DESForOpenPGP.class.st b/source/OpenPGP/DESForOpenPGP.class.st new file mode 100644 index 0000000..56b0126 --- /dev/null +++ b/source/OpenPGP/DESForOpenPGP.class.st @@ -0,0 +1,217 @@ +" +This is the Digital Encryption Standard cipher. It's quite old now, uses only a relatively short key (56 bits), and is crackable using brute force with relatively moderate resources. For reasonable security, use either CAST5 or TripleDES. +" +Class { + #name : #DESForOpenPGP, + #superclass : #FeistelCipher, + #classVars : [ + 'EBitSelectionTable', + 'IIP', + 'IP', + 'P', + 'PC1', + 'PC2', + 'SBoxes' + ], + #category : 'OpenPGP-Algorithms' +} + +{ #category : #accessing } +DESForOpenPGP class >> blockSize [ + ^ 8 +] + +{ #category : #'class initialization' } +DESForOpenPGP class >> initSBox: index from: anArray [ + "Initialization data is given in the same order order as in the spec, which is nonsense. + This method reorders it to avoid reordering in the encryption/decryption process." + "Validity test: + (DES new applyToSBoxes: 2r011101000101110101000111101000011100101101011101) + = 2r00110100111001011010010110101001" + | row col | + SBoxes at: index put: ((0 to: 63) collect: [:i | + row := i // 32 * 2 + (i \\ 2). + col := i // 2 \\ 16. + anArray at: row * 16 + col + 1]) +] + +{ #category : #'class initialization' } +DESForOpenPGP class >> initialize [ + "DES initialize" + DESBitPermutation initialize. + PC1 := DESBitPermutation fromDESBitIndexes: #( + 57 49 41 33 25 17 9 + 1 58 50 42 34 26 18 + 10 2 59 51 43 35 27 + 19 11 3 60 52 44 36 + 63 55 47 39 31 23 15 + 7 62 54 46 38 30 22 + 14 6 61 53 45 37 29 + 21 13 5 28 20 12 4) sourceWidth: 64. + PC2 := DESBitPermutation fromDESBitIndexes: #( + 14 17 11 24 1 5 + 3 28 15 6 21 10 + 23 19 12 4 26 8 + 16 7 27 20 13 2 + 41 52 31 37 47 55 + 30 40 51 45 33 48 + 44 49 39 56 34 53 + 46 42 50 36 29 32) sourceWidth: 56. + IP := DESBitPermutation fromDESBitIndexes: #( + 58 50 42 34 26 18 10 2 + 60 52 44 36 28 20 12 4 + 62 54 46 38 30 22 14 6 + 64 56 48 40 32 24 16 8 + 57 49 41 33 25 17 9 1 + 59 51 43 35 27 19 11 3 + 61 53 45 37 29 21 13 5 + 63 55 47 39 31 23 15 7) sourceWidth: 64. + IIP := DESBitPermutation fromDESBitIndexes: #( + 40 8 48 16 56 24 64 32 + 39 7 47 15 55 23 63 31 + 38 6 46 14 54 22 62 30 + 37 5 45 13 53 21 61 29 + 36 4 44 12 52 20 60 28 + 35 3 43 11 51 19 59 27 + 34 2 42 10 50 18 58 26 + 33 1 41 9 49 17 57 25) sourceWidth: 64. + EBitSelectionTable := DESBitPermutation fromDESBitIndexes: #( + 32 1 2 3 4 5 + 4 5 6 7 8 9 + 8 9 10 11 12 13 + 12 13 14 15 16 17 + 16 17 18 19 20 21 + 20 21 22 23 24 25 + 24 25 26 27 28 29 + 28 29 30 31 32 1) sourceWidth: 32. + P := DESBitPermutation fromDESBitIndexes: #( + 16 7 20 21 + 29 12 28 17 + 1 15 23 26 + 5 18 31 10 + 2 8 24 14 + 32 27 3 9 + 19 13 30 6 + 22 11 4 25) sourceWidth: 32. + SBoxes := Array new: 8. + self initSBox: 1 from: #( + 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7 + 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8 + 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0 + 15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13). + self initSBox: 2 from: #( + 15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10 + 3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5 + 0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15 + 13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9). + self initSBox: 3 from: #( + 10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8 + 13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1 + 13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7 + 1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12). + self initSBox: 4 from: #( + 7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15 + 13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9 + 10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4 + 3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14). + self initSBox: 5 from: #( + 2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9 + 14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6 + 4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14 + 11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3). + self initSBox: 6 from: #( + 12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11 + 10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8 + 9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6 + 4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13). + self initSBox: 7 from: #( + 4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1 + 13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6 + 1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2 + 6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12). + self initSBox: 8 from: #( + 13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7 + 1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2 + 7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8 + 2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11) +] + +{ #category : #accessing } +DESForOpenPGP class >> keySize [ + ^ 8 +] + +{ #category : #'encryption/decryption' } +DESForOpenPGP >> applyToSBoxes: anInteger [ + | result bits | + result := 0. + 1 to: 8 do: [:i | + bits := (anInteger bitShift: i*6-48) bitAnd: 63. + result := (result bitShift: 4) + ((SBoxes at: i) at: bits+1)]. + ^result +] + +{ #category : #'encryption/decryption' } +DESForOpenPGP >> blockSize [ + ^8 +] + +{ #category : #'encryption/decryption' } +DESForOpenPGP >> coreProcess: anInteger forward: aBoolean [ + | rLast lLast rCurrent rXored rSBoxed rPermuted | + lLast := anInteger bitShift: -32. + rLast := anInteger bitAnd: 16rFFFFFFFF. + 1 to: 16 do: [:i | + rCurrent := EBitSelectionTable permute: rLast. + rXored := rCurrent bitXor: (k at: (aBoolean ifTrue: [i] ifFalse: [17-i])). + rSBoxed := self applyToSBoxes: rXored. + rPermuted := P permute: rSBoxed. + rCurrent := rPermuted bitXor: lLast. + lLast := rLast. + rLast := rCurrent]. + ^lLast + (rLast bitShift: 32) +] + +{ #category : #'encryption/decryption' } +DESForOpenPGP >> decryptBlock: anInteger [ + | permuted encoded | + permuted := IP permute: anInteger. + encoded := self coreProcess: permuted forward: false. + ^IIP permute: encoded +] + +{ #category : #'encryption/decryption' } +DESForOpenPGP >> encryptBlock: anInteger [ + | permuted encoded | + permuted := IP permute: anInteger. + encoded := self coreProcess: permuted forward: true. + ^IIP permute: encoded +] + +{ #category : #'encryption/decryption' } +DESForOpenPGP >> keySize [ + ^8 +] + +{ #category : #'initialize-release' } +DESForOpenPGP >> setKey: anInteger [ + "anInteger is a 64-bit DES key" + "DES new setKey: 2" + | kCurrent mask28 rot l r | + mask28 := 16rFFFFFFF. + kCurrent := PC1 permute: anInteger. + l := kCurrent bitShift: -28. + r := kCurrent bitAnd: mask28. + k := Array new: 16. + 1 to: 16 do: [:i | + rot := #(1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1) at: i. + false + ifTrue: [ + l := (l bitShift: 0-rot) + (l bitShift: 28-rot) bitAnd: mask28. + r := (r bitShift: 0-rot) + (r bitShift: 28-rot) bitAnd: mask28] + ifFalse: [ + l := (l bitShift: rot) + (l bitShift: rot - 28) bitAnd: mask28. + r := (r bitShift: rot) + (r bitShift: rot - 28) bitAnd: mask28]. + kCurrent := (l bitShift: 28) + r. + k at: i put: (PC2 permute: kCurrent)] +] diff --git a/source/OpenPGP/DESTestCase.class.st b/source/OpenPGP/DESTestCase.class.st new file mode 100644 index 0000000..51f7d15 --- /dev/null +++ b/source/OpenPGP/DESTestCase.class.st @@ -0,0 +1,126 @@ +" +This class tests the DES algorithm using a test case defined by Ron Rivest in (http://theory.lcs.mit.edu/~rivest/destest.txt), which according to his analysis should uncover all possible single-point failures. +" +Class { + #name : #DESTestCase, + #superclass : #TestCase, + #category : 'OpenPGP-Algorithms' +} + +{ #category : #testing } +DESTestCase >> expectedFailures [ + "deactivating just. Not sure someone uses this code" + ^ #( testSSLeay testSSLeayWithBase ) +] + +{ #category : #running } +DESTestCase >> testRivest [ + "Run the simple test given by Ron Rivest in http://theory.lcs.mit.edu/~rivest/destest.txt" + + | des x | + des := DESForOpenPGP new. + x := 16r9474B8E8C73BCA7D. + 1 to: 16 do: [:i | + des setKey: x. + x := i odd + ifTrue: [des encryptBlock: x] + ifFalse: [des decryptBlock: x]]. + self assert: x = 16r1B1A2DDB4C642438 +] + +{ #category : #running } +DESTestCase >> testRivestWithBase [ + "Run the simple test given by Ron Rivest in http://theory.lcs.mit.edu/~rivest/destest.txt" + + | des x | + des := DES new. + x := 16r9474B8E8C73BCA7D asByteArray. + 1 to: 16 do: [:i | + des key: x copy. + i odd + ifTrue: [des encryptBlock: x] + ifFalse: [des decryptBlock: x]]. + self assert: x = 16r1B1A2DDB4C642438 asByteArray +] + +{ #category : #running } +DESTestCase >> testSSLeay [ + "Run 3DES tests from the SSLeay package. Test vectors copied from OpenPGP source" + | tripleDES | + #( + ( 16r010101010101010101010101010101010101010101010101 + 16r95F8A5E5DD31D900 + 16r8000000000000000) + ( 16r010101010101010101010101010101010101010101010101 + 16r9D64555A9A10B852 + 16r0000001000000000) + ( 16r3849674C2602319E3849674C2602319E3849674C2602319E + 16r51454B582DDF440A + 16r7178876E01F19B2A) + ( 16r04B915BA43FEB5B604B915BA43FEB5B604B915BA43FEB5B6 + 16r42FD443059577FA2 + 16rAF37FB421F8C4095) + ( 16r0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF + 16r736F6D6564617461 + 16r3D124FE2198BA318) + ( 16r0123456789ABCDEF55555555555555550123456789ABCDEF + 16r736F6D6564617461 + 16rFBABA1FF9D05E9B1) + ( 16r0123456789ABCDEF5555555555555555FEDCBA9876543210 + 16r736F6D6564617461 + 16r18D748E563620572) + ( 16r0352020767208217860287665908219864056ABDFEA93457 + 16r7371756967676C65 + 16rC07D2A0FA566FA30) + ( 16r010101010101010180010101010101010101010101010102 + 16r0000000000000000 + 16rE6E6DD5B7E722974) + ( 16r10461034899880209107D0158919010119079210981A0101 + 16r0000000000000000 + 16rE1EF62C332FE825B)) do: [:array | + tripleDES := TripleDESForOpenPGP new. + tripleDES setKey: array first. + self assert: (tripleDES encryptBlock: array second) = array third. + self assert: (tripleDES decryptBlock: array third) = array second] +] + +{ #category : #running } +DESTestCase >> testSSLeayWithBase [ + "Run 3DES tests from the SSLeay package. Test vectors copied from OpenPGP source" + | tripleDES | + #( + ( 16r010101010101010101010101010101010101010101010101 + 16r95F8A5E5DD31D900 + 16r8000000000000000) + ( 16r010101010101010101010101010101010101010101010101 + 16r9D64555A9A10B852 + 16r0000001000000000) + ( 16r3849674C2602319E3849674C2602319E3849674C2602319E + 16r51454B582DDF440A + 16r7178876E01F19B2A) + ( 16r04B915BA43FEB5B604B915BA43FEB5B604B915BA43FEB5B6 + 16r42FD443059577FA2 + 16rAF37FB421F8C4095) + ( 16r0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF + 16r736F6D6564617461 + 16r3D124FE2198BA318) + ( 16r0123456789ABCDEF55555555555555550123456789ABCDEF + 16r736F6D6564617461 + 16rFBABA1FF9D05E9B1) + ( 16r0123456789ABCDEF5555555555555555FEDCBA9876543210 + 16r736F6D6564617461 + 16r18D748E563620572) + ( 16r0352020767208217860287665908219864056ABDFEA93457 + 16r7371756967676C65 + 16rC07D2A0FA566FA30) + ( 16r010101010101010180010101010101010101010101010102 + 16r0000000000000000 + 16rE6E6DD5B7E722974) + ( 16r10461034899880209107D0158919010119079210981A0101 + 16r0000000000000000 + 16rE1EF62C332FE825B)) do: [:array | + tripleDES := TripleDES new. + tripleDES setKey: array first. + self assert: (tripleDES encryptBlock: array second) = array third. + self assert: (tripleDES decryptBlock: array third) = array second] +] diff --git a/source/OpenPGP/FeistelCipher.class.st b/source/OpenPGP/FeistelCipher.class.st new file mode 100644 index 0000000..7cc23d6 --- /dev/null +++ b/source/OpenPGP/FeistelCipher.class.st @@ -0,0 +1,14 @@ +" +Subclasses implement so-called Feistel ciphers (DES, CAST5, Blowfish). Such ciphers apply a fixed number of transformations to their input data to encrypt. Decryption is achieved by applying the same transformations in reverse. + +Instance Variables: +k data for the different rounds, derived from the encryption key. +" +Class { + #name : #FeistelCipher, + #superclass : #BlockCipher, + #instVars : [ + 'k' + ], + #category : 'OpenPGP-Algorithms' +} diff --git a/source/OpenPGP/OpenPGP.class.st b/source/OpenPGP/OpenPGP.class.st new file mode 100644 index 0000000..d05b78a --- /dev/null +++ b/source/OpenPGP/OpenPGP.class.st @@ -0,0 +1,62 @@ +" +This class serves as a central interface to the OpenPGP implementation classes. Clients should not reference those classes directly, but they may use all non-private methods on the class side. +" +Class { + #name : #OpenPGP, + #superclass : #Object, + #instVars : [ + 'publicKeys', + 'privateKeys', + 'options' + ], + #classVars : [ + 'DefaultPrivateKeyFile', + 'DefaultPublicKeyFile' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #'class initialization' } +OpenPGP class >> initialize [ + "OpenPGP initialize" + DefaultPrivateKeyFile := '/home/hmm/.gnupg/secring.gpg'. + DefaultPublicKeyFile := '/home/hmm/.gnupg/pubring.gpg' +] + +{ #category : #decryption } +OpenPGP >> decryptFile: aFilename [ + | str | + str := FileStream readOnlyFileNamed: aFilename. + [self handleStream: str visitor: OpenPGPDecryption new] ensure: [str close] +] + +{ #category : #private } +OpenPGP >> handleStream: aStream visitor: aVisitor [ + | str packet | + aVisitor config: self. + str := OpenPGPStream onStream: aStream. + [str atEnd] whileFalse: [ + packet := str nextPacket. + packet acceptVisitor: aVisitor]. + aVisitor finish +] + +{ #category : #private } +OpenPGP >> privateKeys [ + privateKeys == nil ifTrue: [privateKeys := self readKeyring: DefaultPrivateKeyFile]. + ^privateKeys +] + +{ #category : #private } +OpenPGP >> publicKeys [ + publicKeys == nil ifTrue: [publicKeys := self readKeyring: DefaultPublicKeyFile]. + ^publicKeys +] + +{ #category : #private } +OpenPGP >> readKeyring: aFilename [ + | in | + in := OpenPGPStream onStream: (FileStream readOnlyFileNamed: aFilename). + ^[OpenPGPKeyring new readFrom: in] ensure: [in close] + +] diff --git a/source/OpenPGP/OpenPGPCompressedDataPacket.class.st b/source/OpenPGP/OpenPGPCompressedDataPacket.class.st new file mode 100644 index 0000000..0909013 --- /dev/null +++ b/source/OpenPGP/OpenPGPCompressedDataPacket.class.st @@ -0,0 +1,16 @@ +Class { + #name : #OpenPGPCompressedDataPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPCompressedDataPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleCompressedDataPacket: self +] + +{ #category : #accessing } +OpenPGPCompressedDataPacket >> uncompressedData [ + data first = 1 ifFalse: [self error: 'only inflate supported']. + ^(InflateStream on: data from: 2 to: data size) upToEnd +] diff --git a/source/OpenPGP/OpenPGPDSAData.class.st b/source/OpenPGP/OpenPGPDSAData.class.st new file mode 100644 index 0000000..1a6b040 --- /dev/null +++ b/source/OpenPGP/OpenPGPDSAData.class.st @@ -0,0 +1,14 @@ +" +This class stores algorithm-specific data for DSA signature keys in OpenPGP. +Its MPIs are p, q, g, and y. +" +Class { + #name : #OpenPGPDSAData, + #superclass : #OpenPGPPublicKeyAlgorithmData, + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPDSAData >> numMPIs [ + ^4 +] diff --git a/source/OpenPGP/OpenPGPDecryption.class.st b/source/OpenPGP/OpenPGPDecryption.class.st new file mode 100644 index 0000000..c476e47 --- /dev/null +++ b/source/OpenPGP/OpenPGPDecryption.class.st @@ -0,0 +1,55 @@ +Class { + #name : #OpenPGPDecryption, + #superclass : #OpenPGPVisitor, + #instVars : [ + 'symmetricKeyPacket', + 'publicKeyPacket', + 'cipher' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPDecryption >> cipher [ + | pw | + cipher == nil ifFalse: [^cipher]. + symmetricKeyPacket == nil ifFalse: [ + pw := FillInTheBlank requestPassword: 'Passphrase for symmetric cipher?'. + pw = '' ifFalse: [ + ^cipher := symmetricKeyPacket cipherWithPassphrase: pw]]. + self halt +] + +{ #category : #visitor } +OpenPGPDecryption >> handleCompressedDataPacket: anOpenPGPPacket [ + | data | + data := anOpenPGPPacket uncompressedData. + config handleStream: (ReadStream on: data) visitor: self +] + +{ #category : #visitor } +OpenPGPDecryption >> handleLiteralDataPacket: anOpenPGPPacket [ + | str | + str := ReadStream on: anOpenPGPPacket data. + self halt +] + +{ #category : #visitor } +OpenPGPDecryption >> handleSymmetricKeyEncryptedSessionKeyPacket: anOpenPGPPacket [ + symmetricKeyPacket := anOpenPGPPacket +] + +{ #category : #visitor } +OpenPGPDecryption >> handleSymmetricallyEncryptedDataPacket: anOpenPGPPacket [ + | data | + [anOpenPGPPacket verifyWithCipher: self cipher] whileFalse: [ + (self confirm: 'Possibly invalid passprase. Do you want to retry?') ifFalse: [^self]. + cipher := nil]. + data := (anOpenPGPPacket decryptWithCipher: self cipher). + config handleStream: (ReadStream on: data) visitor: self +] + +{ #category : #missing } +OpenPGPDecryption >> verifyWithCipher: anObject [ + self error: #notYetImplemented +] diff --git a/source/OpenPGP/OpenPGPElgamalData.class.st b/source/OpenPGP/OpenPGPElgamalData.class.st new file mode 100644 index 0000000..fde1893 --- /dev/null +++ b/source/OpenPGP/OpenPGPElgamalData.class.st @@ -0,0 +1,14 @@ +" +This class stores algorithm-specific data for Elgamal encryption keys in OpenPGP. +Its MPIs are g**k mod p and m * y**k mod p +" +Class { + #name : #OpenPGPElgamalData, + #superclass : #OpenPGPPublicKeyAlgorithmData, + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPElgamalData >> numMPIs [ + ^3 +] diff --git a/source/OpenPGP/OpenPGPKeyring.class.st b/source/OpenPGP/OpenPGPKeyring.class.st new file mode 100644 index 0000000..38164ec --- /dev/null +++ b/source/OpenPGP/OpenPGPKeyring.class.st @@ -0,0 +1,43 @@ +" +Istances of this class store PGP keyrings. + +Instance Variables: +entries OpenPGPKeyringEntry> entries keyed by key ID (16-byte hex string) +" +Class { + #name : #OpenPGPKeyring, + #superclass : #Object, + #instVars : [ + 'entries' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPKeyring >> entries [ + ^entries +] + +{ #category : #accessing } +OpenPGPKeyring >> keysWithID: aKeyID [ + ^entries select: [:each | each packets first keyID = aKeyID] +] + +{ #category : #accessing } +OpenPGPKeyring >> keysWithUserIDMatching: aString [ + ^entries select: [:each | (each packets + detect: [:pack | pack isUserIDPacket and: [aString match: pack data asString]] + ifNone: []) notNil] +] + +{ #category : #reading } +OpenPGPKeyring >> readFrom: aStream [ + | packet entry | + entries := OrderedCollection new. + [aStream atEnd] whileFalse: [ + packet := aStream nextPacket. + packet isKeyPacket + ifTrue: [packet owner: self. entries add: (entry := packet)] + ifFalse: [(entry add: packet) ifFalse: [self halt]]]. + entries := entries asSortedCollection: [:a :b | a userIDString < b userIDString] +] diff --git a/source/OpenPGP/OpenPGPKeyringEntry.class.st b/source/OpenPGP/OpenPGPKeyringEntry.class.st new file mode 100644 index 0000000..8bb34ee --- /dev/null +++ b/source/OpenPGP/OpenPGPKeyringEntry.class.st @@ -0,0 +1,124 @@ +" +Instances of this class represent keyring entries. Their first packet is always a public or secret key packet, and the following packets are additional data (IDs, subkeys) and signatures for that key. + +Instance Variables: +packets packets comprising this key +" +Class { + #name : #OpenPGPKeyringEntry, + #superclass : #Object, + #instVars : [ + 'packets' + ], + #classVars : [ + 'PreferredKeys' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #'instance creation' } +OpenPGPKeyringEntry class >> new [ + ^super new initialize +] + +{ #category : #'instance creation' } +OpenPGPKeyringEntry class >> preferredKeys [ + PreferredKeys isNil ifTrue: [PreferredKeys := Set new]. + ^PreferredKeys +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> add: aPacket [ + packets add: aPacket +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> detectPacket: detectBlock return: valueBlock [ + ^self + detectPacket: detectBlock + return: valueBlock + ifNone: [] +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> detectPacket: detectBlock return: valueBlock ifNone: noneBlock [ + packets do: [:each | + (detectBlock value: each) ifTrue: [^valueBlock value: each]]. + ^noneBlock value +] + +{ #category : #'initialize-release' } +OpenPGPKeyringEntry >> initialize [ + packets := OrderedCollection new +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> keyID [ + ^packets first keyID +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> keyID8Hex [ + ^packets first keyID8Hex +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> keyIDHex [ + ^packets first keyIDHex +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> packets [ + ^packets +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> photoID [ + ^self + detectPacket: [:p | p isPhotoIDPacket] + return: [:p | p image] +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> preferred [ + "This is stored in a class variable for the time being" + ^self class preferredKeys includes: self keyID +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> preferred: aBoolean [ + aBoolean + ifTrue: [self class preferredKeys add: self keyID] + ifFalse: [self class preferredKeys remove: self keyID ifAbsent: []] +] + +{ #category : #printing } +OpenPGPKeyringEntry >> printOn: aStream [ + | key | + super printOn: aStream. + packets isEmpty ifTrue: [^self]. + key := packets first keyID printStringRadix: 16. + key size < 8 ifTrue: [key := (String new: 8-key size withAll: $0), key]. + aStream nextPutAll: ', keyID='. + aStream nextPutAll: key. + aStream nextPutAll: ', created='. + packets first printCreationDateAndTimeOn: aStream. + packets do: [:each | each isUserIDPacket ifTrue: [aStream space; print: each dataAsString]] +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> trust [ + ^'?' +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> type [ + ^packets first version printString +] + +{ #category : #accessing } +OpenPGPKeyringEntry >> userID [ + ^self + detectPacket: [:p | p isUserIDPacket] + return: [:p | p dataAsString] +] diff --git a/source/OpenPGP/OpenPGPLiteralDataPacket.class.st b/source/OpenPGP/OpenPGPLiteralDataPacket.class.st new file mode 100644 index 0000000..efd73e8 --- /dev/null +++ b/source/OpenPGP/OpenPGPLiteralDataPacket.class.st @@ -0,0 +1,10 @@ +Class { + #name : #OpenPGPLiteralDataPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPLiteralDataPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleLiteralDataPacket: self +] diff --git a/source/OpenPGP/OpenPGPMarkerPacket.class.st b/source/OpenPGP/OpenPGPMarkerPacket.class.st new file mode 100644 index 0000000..c0a2199 --- /dev/null +++ b/source/OpenPGP/OpenPGPMarkerPacket.class.st @@ -0,0 +1,10 @@ +Class { + #name : #OpenPGPMarkerPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPMarkerPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleMarkerPacket: self +] diff --git a/source/OpenPGP/OpenPGPOnePassSignaturePacket.class.st b/source/OpenPGP/OpenPGPOnePassSignaturePacket.class.st new file mode 100644 index 0000000..337ddbc --- /dev/null +++ b/source/OpenPGP/OpenPGPOnePassSignaturePacket.class.st @@ -0,0 +1,10 @@ +Class { + #name : #OpenPGPOnePassSignaturePacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPOnePassSignaturePacket >> acceptVisitor: aVisitor [ + ^aVisitor handleOpenPassSignaturePacket: self +] diff --git a/source/OpenPGP/OpenPGPPacket.class.st b/source/OpenPGP/OpenPGPPacket.class.st new file mode 100644 index 0000000..08a27cb --- /dev/null +++ b/source/OpenPGP/OpenPGPPacket.class.st @@ -0,0 +1,341 @@ +" +This class is used to represent OpenPGP packets. There are no subclasses; all type-specific behavior is implemented by the interpretedData inst var. This makes it easier to parse and write OpenPGP files, even if they contain unknown packet types. + +Instance Variables: +header the first byte of the packet +dataSize size of the data, or nil if the packet has undetermined size +data raw data contents of packet +trust contents of associated trust packed +" +Class { + #name : #OpenPGPPacket, + #superclass : #Object, + #instVars : [ + 'header', + 'version', + 'data', + 'trust', + 'owner', + 'ownedPackets' + ], + #classVars : [ + 'TagTypes' + ], + #category : 'OpenPGP-Packets' +} + +{ #category : #'class initialization' } +OpenPGPPacket class >> initialize [ + "OpenPGPPacket initialize" + TagTypes := Array new: 64 withAll: 'user defined'. + #( 0 'Reserved' + 1 'Public-Key Encrypted Session Key' + 2 'Signature' + 3 'Symmetric-Key Encrypted Session Key' + 4 'One-Pass Signature' + 5 'Secret Key' + 6 'Public Key' + 7 'Secret Subkey' + 8 'Compressed Data' + 9 'Symmetrically Encrypted Data' + 10 'Marker' + 11 'Literal Data' + 12 'Trust' + 13 'User ID' + 14 'Public Subkey' + 17 'Photo ID') pairsDo: [:index :string | + TagTypes at: index+1 put: string] +] + +{ #category : #accessing } +OpenPGPPacket class >> packetClassForTag: anInteger [ + anInteger = 0 ifTrue: [self error: 'invalid packet tag value']. + anInteger = 1 ifTrue: [^OpenPGPPublicKeyEncryptedSessionKeyPacket]. + anInteger = 2 ifTrue: [^OpenPGPSignaturePacket]. + anInteger = 3 ifTrue: [^OpenPGPSymmetricKeyEncryptedSessionKeyPacket]. + anInteger = 4 ifTrue: [^OpenPGPOnePassSignaturePacket]. + anInteger = 5 ifTrue: [^OpenPGPSecretKeyPacket]. + anInteger = 6 ifTrue: [^OpenPGPPublicKeyPacket]. + anInteger = 7 ifTrue: [^OpenPGPSecretSubkeyPacket]. + anInteger = 8 ifTrue: [^OpenPGPCompressedDataPacket]. + anInteger = 9 ifTrue: [^OpenPGPSymmetricallyEncryptedDataPacket]. + anInteger = 10 ifTrue: [^OpenPGPMarkerPacket]. + anInteger = 11 ifTrue: [^OpenPGPLiteralDataPacket]. + anInteger = 12 ifTrue: [^OpenPGPTrustPacket]. + anInteger = 13 ifTrue: [^OpenPGPUserIDPacket]. + anInteger = 14 ifTrue: [^OpenPGPPublicSubkeyPacket]. + anInteger = 17 ifTrue: [^OpenPGPPhotoIDPacket]. + ^self +] + +{ #category : #'instance creation' } +OpenPGPPacket class >> readFrom: aStream [ + | oldFormat lengthType header tag data dataSize | + header := aStream next. + header < 128 ifTrue: [self errorInvalidHeader]. + oldFormat := (header bitAnd: 64) = 0. + oldFormat + ifTrue: [ + tag := (header bitShift: -2) bitAnd: 15. + lengthType := header bitAnd: 3. + lengthType = 3 + ifTrue: [ + data := aStream upToEnd] + ifFalse: [ + dataSize := aStream nextNumber: (1 bitShift: lengthType). + data := aStream next: dataSize]] + ifFalse: [ + tag := header bitAnd: 63. + [dataSize := aStream nextNewFormatPacketLength. + data := data isNil + ifTrue: [aStream next: dataSize abs] + ifFalse: [data, (aStream next: dataSize abs)]. + dataSize < 0] whileTrue: []. + dataSize := data size]. + ^(self packetClassForTag: tag) new header: header data: data +] + +{ #category : #accessing } +OpenPGPPacket class >> symmetricKeyAlgorithmFor: anInteger [ + anInteger = 2 ifTrue: [^TripleDESForOpenPGP new]. + anInteger = 3 ifTrue: [^CAST5 new]. + self error: 'symmetric key algorithm ', anInteger printString, ' not yet available' +] + +{ #category : #visitor } +OpenPGPPacket >> acceptVisitor: aVisitor [ + ^aVisitor handlePacket: self +] + +{ #category : #accessing } +OpenPGPPacket >> add: aPacket [ + ownedPackets isNil ifFalse: [ + (self ownedPackets last add: aPacket) + ifTrue: [^true]]. + (aPacket canBeAddedTo: self) ifFalse: [^false]. + ownedPackets := ownedPackets isNil + ifTrue: [Array with: aPacket] + ifFalse: [ownedPackets copyWith: aPacket]. + aPacket owner: self. + ^true +] + +{ #category : #testing } +OpenPGPPacket >> canBeAddedTo: aPacket [ + ^false +] + +{ #category : #accessing } +OpenPGPPacket >> computeInterpretedData [ + | class | + self tag = 13 ifTrue: [ + ^data asString]. + self tag = 2 ifTrue: [ + data first = 3 ifTrue: [ + class := OpenPGPSignatureV3Data]. + data first = 4 ifTrue: [ + class := OpenPGPSignatureV4Data]]. + self tag = 3 ifTrue: [ + class := OpenPGPSymmetricKeyEncryptedSessionKeyPacket]. + class == nil ifTrue: [self error: 'No reader class for this packet type/version yet']. + ^class new readFrom: (OpenPGPStream on: data) +] + +{ #category : #accessing } +OpenPGPPacket >> data [ + ^data +] + +{ #category : #printing } +OpenPGPPacket >> dataAsString [ + "^(data withEncoding: #UTF8) readStream upToEnd" + "^(MultiByteBinaryOrTextStream on: data encoding: 'utf-8') halt upToEnd" + ^data asString +] + +{ #category : #accessing } +OpenPGPPacket >> dataSize [ + ^data size +] + +{ #category : #accessing } +OpenPGPPacket >> detectPacket: detectBlock return: valueBlock [ + ^self + detectPacket: detectBlock + return: valueBlock + ifNone: [] +] + +{ #category : #accessing } +OpenPGPPacket >> detectPacket: detectBlock return: valueBlock ifNone: noneBlock [ + ownedPackets isNil ifFalse: [ + self ownedPackets do: [:each | + (detectBlock value: each) ifTrue: [^valueBlock value: each]. + each detectPacket: detectBlock return: valueBlock ifNone: []]]. + ^noneBlock value +] + +{ #category : #accessing } +OpenPGPPacket >> header [ + ^header +] + +{ #category : #'initialize-release' } +OpenPGPPacket >> header: headerInteger data: dataBytes [ + header := headerInteger. + data := dataBytes. + "self parseData: (OpenPGPStream on: data)" +] + +{ #category : #testing } +OpenPGPPacket >> isKeyPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isOldFormat [ + ^(header bitAnd: 64) = 0 +] + +{ #category : #testing } +OpenPGPPacket >> isPhotoIDPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isPrivateKeyPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isPublicKeyPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isSignaturePacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isSubkeyPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isSymmetricKeyEncryptedSessionKeyPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isTrustPacket [ + ^false +] + +{ #category : #testing } +OpenPGPPacket >> isUserIDPacket [ + ^false +] + +{ #category : #accessing } +OpenPGPPacket >> oldFormat [ + ^(header bitAnd: 64) = 0 +] + +{ #category : #accessing } +OpenPGPPacket >> ownedPackets [ + ^ownedPackets ifNil: [#()] +] + +{ #category : #accessing } +OpenPGPPacket >> owner [ + ^owner +] + +{ #category : #accessing } +OpenPGPPacket >> owner: aPacketOrKeyring [ + owner := aPacketOrKeyring +] + +{ #category : #'initialize-release' } +OpenPGPPacket >> parseData [ + self parseData: (OpenPGPStream on: data) +] + +{ #category : #'initialize-release' } +OpenPGPPacket >> parseData: aStream [ + "do nothing" +] + +{ #category : #printing } +OpenPGPPacket >> printDataOn: aStream [ + aStream nextPutAll: ', data='. + aStream print: self data +] + +{ #category : #printing } +OpenPGPPacket >> printOn: aStream [ + aStream nextPutAll: 'OpenPGP '. + aStream nextPutAll: (TagTypes at: self tag+1); nextPutAll: ', tag='. + aStream print: self tag. + "aStream nextPutAll: ', format='. + aStream nextPutAll: (self isOldFormat ifTrue: ['old'] ifFalse: ['new'])." + self version isNil ifFalse: [ + aStream nextPutAll: ', version='. + self version printOn: aStream. + ]. + aStream nextPutAll: ', size='. + aStream print: self dataSize. + self isKeyPacket ifTrue: [ + aStream nextPutAll: ', created='. + self printCreationDateAndTimeOn: aStream]. + self printDataOn: aStream. + aStream cr +] + +{ #category : #printing } +OpenPGPPacket >> saveOn: aStream [ + | oldFormat lengthType dataSize | + aStream nextPut: header. + oldFormat := (header bitAnd: 64) = 0. + oldFormat + ifTrue: [ + lengthType := header bitAnd: 3. + lengthType = 3 + ifTrue: [ + aStream nextPutAll: data] + ifFalse: [ + aStream nextNumber: (1 bitShift: lengthType) put: data size. + aStream nextPutAll: data]] + ifFalse: [ + [self halt. + dataSize := aStream nextNewFormatPacketLength. + data := data isNil + ifTrue: [aStream next: dataSize abs] + ifFalse: [data, (aStream next: dataSize abs)]. + dataSize < 0] whileTrue: []. + dataSize := data size]. +] + +{ #category : #accessing } +OpenPGPPacket >> tag [ + ^self isOldFormat + ifTrue: [(header bitShift: -2) bitAnd: 15] + ifFalse: [header bitAnd: 63] +] + +{ #category : #accessing } +OpenPGPPacket >> trust [ + ^trust +] + +{ #category : #accessing } +OpenPGPPacket >> trust: anInteger [ + trust := anInteger +] + +{ #category : #accessing } +OpenPGPPacket >> version [ + "subclasses can reimplement this" + ^nil +] diff --git a/source/OpenPGP/OpenPGPPhotoIDPacket.class.st b/source/OpenPGP/OpenPGPPhotoIDPacket.class.st new file mode 100644 index 0000000..9f5df66 --- /dev/null +++ b/source/OpenPGP/OpenPGPPhotoIDPacket.class.st @@ -0,0 +1,26 @@ +Class { + #name : #OpenPGPPhotoIDPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPPhotoIDPacket >> acceptVisitor: aVisitor [ + ^aVisitor handlePhotoIDPacket: self +] + +{ #category : #testing } +OpenPGPPhotoIDPacket >> canBeAddedTo: aPacket [ + ^aPacket isPublicKeyPacket +] + +{ #category : #accessing } +OpenPGPPhotoIDPacket >> image [ + "Must use RWBinaryOrTextStream because the XBM reader wants to switch the stream to ascii :-(" + ^ImageReadWriter formFromStream: (RWBinaryOrTextStream with: (data copyFrom: 23 to: data size)) +] + +{ #category : #testing } +OpenPGPPhotoIDPacket >> isPhotoIDPacket [ + ^true +] diff --git a/source/OpenPGP/OpenPGPPublicKeyAlgorithmData.class.st b/source/OpenPGP/OpenPGPPublicKeyAlgorithmData.class.st new file mode 100644 index 0000000..ad69761 --- /dev/null +++ b/source/OpenPGP/OpenPGPPublicKeyAlgorithmData.class.st @@ -0,0 +1,43 @@ +" +Instances of this class hold parameter data for public key algorithms. Since the algorithms known to OpenPGP all use a number of large integers (MPIs in OpenPGP parlance) an instance variable for these is defined in this class. At the moment, subclasses only differ by the number of MPIs stored. + +Instance Variables: +mpis MPIs for this algorithm +" +Class { + #name : #OpenPGPPublicKeyAlgorithmData, + #superclass : #Object, + #instVars : [ + 'mpis' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #'instance creation' } +OpenPGPPublicKeyAlgorithmData class >> forPGPAlgorithmID: anInteger [ + (anInteger between: 1 and: 3) ifTrue: [^OpenPGPRSAData new]. + anInteger = 16 ifTrue: [^OpenPGPElgamalData new]. + anInteger = 17 ifTrue: [^OpenPGPDSAData new]. + anInteger = 20 ifTrue: [^OpenPGPElgamalData new]. + self error: 'PGP algorithm ', anInteger printString, ' is not yet supported' +] + +{ #category : #accessing } +OpenPGPPublicKeyAlgorithmData >> mpis [ + ^mpis +] + +{ #category : #accessing } +OpenPGPPublicKeyAlgorithmData >> numMPIs [ + self subclassResponsibility +] + +{ #category : #accessing } +OpenPGPPublicKeyAlgorithmData >> publicKey [ + self subclassResponsibility +] + +{ #category : #reading } +OpenPGPPublicKeyAlgorithmData >> readFrom: aStream [ + mpis := (1 to: self numMPIs) collect: [:i | aStream nextMPI] +] diff --git a/source/OpenPGP/OpenPGPPublicKeyEncryptedSessionKeyPacket.class.st b/source/OpenPGP/OpenPGPPublicKeyEncryptedSessionKeyPacket.class.st new file mode 100644 index 0000000..08e0231 --- /dev/null +++ b/source/OpenPGP/OpenPGPPublicKeyEncryptedSessionKeyPacket.class.st @@ -0,0 +1,10 @@ +Class { + #name : #OpenPGPPublicKeyEncryptedSessionKeyPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPPublicKeyEncryptedSessionKeyPacket >> acceptVisitor: aVisitor [ + ^aVisitor handlePublicKeyEncryptedSessionKeyPacket: self +] diff --git a/source/OpenPGP/OpenPGPPublicKeyPacket.class.st b/source/OpenPGP/OpenPGPPublicKeyPacket.class.st new file mode 100644 index 0000000..dc5e4eb --- /dev/null +++ b/source/OpenPGP/OpenPGPPublicKeyPacket.class.st @@ -0,0 +1,247 @@ +" +This class holds data describing a public key. Subclasses exist for OpenPGP V3 and V4 formats. + +Instance Variables: +creationTime number of seconds since 1.1.1970 GMT (presumably) +publicKeyAlgorithm number of public key algorithm. See RFC2440 for possible values. +algorithmSpecificData data specifying the key in the chosen public key algorithm +fingerprint hash of the key's data, used to verify the authenticity of a key via phone etc. +" +Class { + #name : #OpenPGPPublicKeyPacket, + #superclass : #OpenPGPPacket, + #instVars : [ + 'creationTime', + 'validDays', + 'publicKeyAlgorithm', + 'algorithmSpecificData', + 'fingerprint', + 'userIDString', + 'photo' + ], + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPPublicKeyPacket >> acceptVisitor: aVisitor [ + ^aVisitor handlePublicKeyPacket: self +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> algorithmSpecificData [ + algorithmSpecificData isNil ifTrue: [self parseData]. + ^algorithmSpecificData +] + +{ #category : #private } +OpenPGPPublicKeyPacket >> computeFingerprint [ + | str bits len hash result | + version <= 3 ifTrue: [ + str := ReadWriteStream on: (ByteArray new: 300). + self mpis do: [:each | + bits := each highBit. + str nextNumber: bits+7//8 put: each]. + str reset. + hash := MD5 hashStream: str. + result := 0. + hash do: [:each | result := (result bitShift: 8) + each]. + ^result]. + version = 4 ifTrue: [ + str := ReadWriteStream on: (ByteArray new: 300). + str + nextPut: 16r99; + nextNumber: 2 put: 0; + nextPut: 4; + nextNumber: 4 put: creationTime; + nextPut: publicKeyAlgorithm. + self mpis do: [:each | + str nextNumber: 2 put: (bits := each highBit). + str nextNumber: bits+7//8 put: each]. + len := str position-3. + str position: 1. + str nextNumber: 2 put: len. + str reset. + ^SecureHashAlgorithm new hashStream: str] +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> creationDateAndTime [ + | t | + t := self creationTime + 2177452800. + "^Array with: (Date fromSeconds: t) with: (Time fromSeconds: t\\86400)" + ^DateAndTime fromSeconds: t +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> creationDateAndTimeFormatted [ + | str | + str := WriteStream on: String new. + self printCreationDateAndTimeOn: str. + ^str contents +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> creationTime [ + creationTime isNil ifTrue: [self parseData]. + ^creationTime +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> fingerprint [ + fingerprint = nil ifTrue: [fingerprint := self computeFingerprint]. + ^fingerprint +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> fingerprintHex [ + "Return a string with this key's fingerprint. + Version 3 has 16 8-bit hex values; version 4 has 10 16-bit hex values" + | str fp dig n | + str := WriteStream on: String new. + fp := self fingerprint. + n := self version = 3 ifTrue: [16] ifFalse: [20]. + n to: 1 by: -1 do: [:i | + dig := fp digitAt: i. + str nextPut: (Character digitValue: dig // 16). + str nextPut: (Character digitValue: dig \\ 16). + (n = 16 or: [i odd]) ifTrue: [str space. + i = (n/2+1) ifTrue: [str space]]]. + ^str contents +] + +{ #category : #testing } +OpenPGPPublicKeyPacket >> isKeyPacket [ + ^true +] + +{ #category : #testing } +OpenPGPPublicKeyPacket >> isPublicKeyPacket [ + ^self isPrivateKeyPacket not +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> keyID [ + ^(self version <= 3 + ifTrue: [self mpis first] + ifFalse: [self fingerprint]) bitAnd: 16rFFFFFFFF +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> keyID8 [ + ^(self version <= 3 + ifTrue: [self mpis first] + ifFalse: [self fingerprint]) bitAnd: 16rFFFFFFFFFFFFFFFF +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> keyID8Hex [ + "Return a string with this key's 8-byte ID as hex values" + | str id dig | + str := WriteStream on: String new. + id := self keyID8. + 8 to: 1 by: -1 do: [:i | + dig := id digitAt: i. + str nextPut: (Character digitValue: dig // 16). + str nextPut: (Character digitValue: dig \\ 16). + i = 5 ifTrue: [str space]]. + ^str contents +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> keyIDHex [ + "Return a string with this key's ID as hex values" + | str id dig | + str := WriteStream on: String new. + id := self keyID. + 4 to: 1 by: -1 do: [:i | + dig := id digitAt: i. + str nextPut: (Character digitValue: dig // 16). + str nextPut: (Character digitValue: dig \\ 16)]. + ^str contents +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> mpis [ + ^self algorithmSpecificData mpis +] + +{ #category : #reading } +OpenPGPPublicKeyPacket >> parseData: aStream [ + version := aStream next. + creationTime := aStream nextNumber: 4. + version <= 3 ifTrue: [ + validDays := aStream nextNumber: 2. + publicKeyAlgorithm := aStream next. + algorithmSpecificData := (OpenPGPPublicKeyAlgorithmData forPGPAlgorithmID: publicKeyAlgorithm) readFrom: aStream]. + version = 4 ifTrue: [ + publicKeyAlgorithm := aStream next. + algorithmSpecificData := (OpenPGPPublicKeyAlgorithmData forPGPAlgorithmID: publicKeyAlgorithm) readFrom: aStream] +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> photo [ + photo notNil ifTrue: [^photo]. + ^self + detectPacket: [:p | p isPhotoIDPacket] + return: [:p | photo := p image] +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> photoID [ + ^self ownedPackets detect: [:p | p isPhotoIDPacket] ifNone: [] +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> preferred [ + ^'?' +] + +{ #category : #printing } +OpenPGPPublicKeyPacket >> printCreationDateAndTimeOn: aStream [ + | t | + t := self creationDateAndTime. + t asDate printOn: aStream format: #(1 2 3 $. 1 1 2). + aStream space. + t asTime print24: true on: aStream +] + +{ #category : #printing } +OpenPGPPublicKeyPacket >> printDataOn: aStream [ + aStream nextPutAll: ', id='. + aStream nextPutAll: self keyIDHex. + aStream nextPutAll: ', fingerprint= '. + aStream nextPutAll: self fingerprintHex. + self userIDs first printDataOn: aStream +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> publicKey [ + ^algorithmSpecificData publicKey +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> trust [ + ^'?' +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> type [ + ^'type' +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> userIDString [ + userIDString isNil ifTrue: [userIDString := self userIDs first dataAsString]. + ^userIDString +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> userIDs [ + ^self ownedPackets select: [:each | each isUserIDPacket] +] + +{ #category : #accessing } +OpenPGPPublicKeyPacket >> version [ + version isNil ifTrue: [self parseData]. + ^version +] diff --git a/source/OpenPGP/OpenPGPPublicSubkeyPacket.class.st b/source/OpenPGP/OpenPGPPublicSubkeyPacket.class.st new file mode 100644 index 0000000..5f93931 --- /dev/null +++ b/source/OpenPGP/OpenPGPPublicSubkeyPacket.class.st @@ -0,0 +1,20 @@ +Class { + #name : #OpenPGPPublicSubkeyPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPPublicSubkeyPacket >> acceptVisitor: aVisitor [ + ^aVisitor handlePublicSubkeyPacket: self +] + +{ #category : #testing } +OpenPGPPublicSubkeyPacket >> canBeAddedTo: aPacket [ + ^aPacket isPublicKeyPacket +] + +{ #category : #testing } +OpenPGPPublicSubkeyPacket >> isSubkeyPacket [ + ^true +] diff --git a/source/OpenPGP/OpenPGPRSAData.class.st b/source/OpenPGP/OpenPGPRSAData.class.st new file mode 100644 index 0000000..e0668f6 --- /dev/null +++ b/source/OpenPGP/OpenPGPRSAData.class.st @@ -0,0 +1,14 @@ +" +This class stores algorithm-specific data for RSA encryption keys in OpenPGP. +Its single MPI is m**e mod n. +" +Class { + #name : #OpenPGPRSAData, + #superclass : #OpenPGPPublicKeyAlgorithmData, + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPRSAData >> numMPIs [ + ^2 +] diff --git a/source/OpenPGP/OpenPGPS2KSpecifier.class.st b/source/OpenPGP/OpenPGPS2KSpecifier.class.st new file mode 100644 index 0000000..ae57835 --- /dev/null +++ b/source/OpenPGP/OpenPGPS2KSpecifier.class.st @@ -0,0 +1,98 @@ +" +A S2KSpecifier encodes how cleartext passphrases are converted into encryption keys. See RFC2440 for more info. + +Instance Variables: +type 0, 1, or 3. Only 3 is currently supported (iterated and salted s2k) +hashAlgorithm for the hashing algorithm. Only 2 is currently supported (SHA) +salt 8 bytes for 'salting' the hashing machinery so that the same passphrase will not yield the same hash. +count number of bytes of repeated passphrase data to process +" +Class { + #name : #OpenPGPS2KSpecifier, + #superclass : #Object, + #instVars : [ + 'type', + 'hashAlgorithm', + 'salt', + 'count' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPS2KSpecifier >> count [ + ^count +] + +{ #category : #accessing } +OpenPGPS2KSpecifier >> hashAlgorithm [ + ^hashAlgorithm +] + +{ #category : #accessing } +OpenPGPS2KSpecifier >> hashBytes [ + ^20 +] + +{ #category : #reading } +OpenPGPS2KSpecifier >> readFrom: aStream [ + type := aStream next. + (#(0 1 3) includes: type) ifFalse: [self error: 'Unknown string-to-key specifier']. + hashAlgorithm := aStream next. + (type bitAnd: 1) = 1 ifTrue: [salt := aStream next: 8]. + (type bitAnd: 2) = 2 ifTrue: [ + count := aStream next. + count := count \\ 16 + 16 bitShift: count // 16 + 6] +] + +{ #category : #accessing } +OpenPGPS2KSpecifier >> salt [ + ^salt +] + +{ #category : #accessing } +OpenPGPS2KSpecifier >> stringToKey: aString numBytes: numBytes [ + | b i hash | + b := 0. + i := 0. + hash := 0. + [b < numBytes] whileTrue: [ + hash := (hash bitShift: self hashBytes * 8) + (self stringToKey: aString preload: i). + b := b + self hashBytes. + i := i + 1]. + b > numBytes ifTrue: [hash := hash bitShift: (numBytes - b) * 8]. + "1 to: hash digitLength // 2 do: [:j | + t := hash digitAt: j. + hash digitAt: j put: (hash digitAt: hash digitLength+1-j). + hash digitAt: hash digitLength+1-j put: t]." + ^hash +] + +{ #category : #accessing } +OpenPGPS2KSpecifier >> stringToKey: aString preload: num [ + | message i | + (type = 3 and: [hashAlgorithm = 2]) ifFalse: [ + self error: 'Only SHA-1 supported at the moment']. + message := ByteArray new: (count max: aString size + salt size) + num. + i := 1 + num. + [i <= message size] whileTrue: [ + message + replaceFrom: i + to: (i + salt size-1 min: message size) + with: salt + startingAt: 1. + i := i + salt size. + i <= message size ifTrue: [ + message + replaceFrom: i + to: (i + aString size-1 min: message size) + with: aString + startingAt: 1. + i := i + aString size]]. + ^SecureHashAlgorithm new hashMessage: message +] + +{ #category : #accessing } +OpenPGPS2KSpecifier >> type [ + ^type +] diff --git a/source/OpenPGP/OpenPGPSecretKeyPacket.class.st b/source/OpenPGP/OpenPGPSecretKeyPacket.class.st new file mode 100644 index 0000000..41482d6 --- /dev/null +++ b/source/OpenPGP/OpenPGPSecretKeyPacket.class.st @@ -0,0 +1,75 @@ +" +Data stored in a secret key OpenPGP packet. + +Instance Variables: +publicKeyData public key data for this private key +stringToKeyUsage specifies how the passphrase protecting the secret key is used +stringToKeySpecifier further specifying string to key conversion +encryptionAlgorithm specifying the encryption algorithm used to protect the key +initialVector initial data for the encryption +mpis algorithm-specific secret key data +checksum checksum to verify that the user gave the correct passphrase + +" +Class { + #name : #OpenPGPSecretKeyPacket, + #superclass : #OpenPGPPublicKeyPacket, + #instVars : [ + 'stringToKeyUsage', + 'stringToKeySpecifier', + 'encryptionAlgorithm', + 'initialVector', + 'mpis', + 'checksum' + ], + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPSecretKeyPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleSecretKeyPacket: self +] + +{ #category : #private } +OpenPGPSecretKeyPacket >> decryptMPIsUsing: passphrase [ + "Decrypt the secret key data to use in signing and decryption of encrypted messages. + Returns an Array of LargePositiveIntegers" + | k cast5 cfb bytes sum str | + encryptionAlgorithm = 3 ifFalse: [self error: 'Only CAST5 supported at the moment']. + k := stringToKeySpecifier stringToKey: passphrase numBytes: 16. + cast5 := CAST5 new setKey: k. + cfb := CFBEncryption new cipher: cast5 initialVector: initialVector. + bytes := cfb decryptBytes: mpis. + sum := (bytes unsignedShortAt: bytes size -1 bigEndian: true). + bytes := bytes copyFrom: 1 to: bytes size-2. + bytes sum = sum ifFalse: [^nil]. + str := OpenPGPStream on: (ReadStream on: bytes). + ^str mpisUpToEnd +] + +{ #category : #accessing } +OpenPGPSecretKeyPacket >> decryptedSecretKeys [ + ^self decryptMPIsUsing: (FillInTheBlank requestPassword: 'Enter your passphrase') +] + +{ #category : #testing } +OpenPGPSecretKeyPacket >> isPrivateKeyPacket [ + ^true +] + +{ #category : #reading } +OpenPGPSecretKeyPacket >> parseData: aStream [ + super parseData: aStream. + stringToKeyUsage := aStream next. + stringToKeyUsage = 255 ifTrue: [ + encryptionAlgorithm := aStream next. + stringToKeySpecifier := aStream nextS2KSpecifier]. + stringToKeyUsage = 0 ifFalse: [ + initialVector := aStream next: 8]. + self readMPIsFrom: aStream +] + +{ #category : #reading } +OpenPGPSecretKeyPacket >> readMPIsFrom: aStream [ + mpis := ByteArray withAll: aStream upToEnd +] diff --git a/source/OpenPGP/OpenPGPSecretSubkeyPacket.class.st b/source/OpenPGP/OpenPGPSecretSubkeyPacket.class.st new file mode 100644 index 0000000..ac3efed --- /dev/null +++ b/source/OpenPGP/OpenPGPSecretSubkeyPacket.class.st @@ -0,0 +1,10 @@ +Class { + #name : #OpenPGPSecretSubkeyPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPSecretSubkeyPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleSecretSubkeyPacket: self +] diff --git a/source/OpenPGP/OpenPGPSignatureData.class.st b/source/OpenPGP/OpenPGPSignatureData.class.st new file mode 100644 index 0000000..a3e0f93 --- /dev/null +++ b/source/OpenPGP/OpenPGPSignatureData.class.st @@ -0,0 +1,57 @@ +Class { + #name : #OpenPGPSignatureData, + #superclass : #Object, + #instVars : [ + 'signatureType', + 'publicKeyAlgorithm', + 'hashAlgorithm', + 'msbOfHash', + 'mpis' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #verifying } +OpenPGPSignatureData >> putKeyPacket: aPacket onHashStream: aStream [ + aStream + nextPut: 16r99; + nextNumber: 2 put: aPacket dataSize; + nextPutAll: aPacket data +] + +{ #category : #verifying } +OpenPGPSignatureData >> putSignatureDataOnHashStream: aStream [ + self subclassResponsibility +] + +{ #category : #verifying } +OpenPGPSignatureData >> putUserIdPacket: aPacket onHashStream: aStream [ + aStream + nextPut: 16rB4; + nextNumber: 4 put: aPacket dataSize; + nextPutAll: aPacket data +] + +{ #category : #accessing } +OpenPGPSignatureData >> signatureType [ + ^signatureType +] + +{ #category : #verifying } +OpenPGPSignatureData >> verifyKey: keyPacket userId: userIdPacket [ + "compute a hash from the given key and userId according to my hash function. + This method is ugly, but not much more than RFC2440 from which it was created." + | message hash | + hashAlgorithm = 2 ifFalse: [self error: 'Only SHA-1 is supported']. + publicKeyAlgorithm = 17 ifFalse: [self error: 'Only DSA signatures are supported']. + message := ReadWriteStream on: ByteArray new. + self putKeyPacket: keyPacket onHashStream: message. + self putUserIdPacket: userIdPacket onHashStream: message. + self putSignatureDataOnHashStream: message. + message reset. + hash := SecureHashAlgorithm new hashStream: message. + ^DigitalSignatureAlgorithm new + verifySignature: mpis + ofMessageHash: hash + publicKey: keyPacket mpis +] diff --git a/source/OpenPGP/OpenPGPSignaturePacket.class.st b/source/OpenPGP/OpenPGPSignaturePacket.class.st new file mode 100644 index 0000000..1f132be --- /dev/null +++ b/source/OpenPGP/OpenPGPSignaturePacket.class.st @@ -0,0 +1,143 @@ +Class { + #name : #OpenPGPSignaturePacket, + #superclass : #OpenPGPPacket, + #instVars : [ + 'signatureType', + 'publicKeyAlgorithm', + 'hashAlgorithm', + 'msbOfHash', + 'mpis', + 'creationTime', + 'signer', + 'hashedSubpacketData', + 'unhashedSubpacketData' + ], + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPSignaturePacket >> acceptVisitor: aVisitor [ + ^aVisitor handleSignaturePacket: self +] + +{ #category : #testing } +OpenPGPSignaturePacket >> canBeAddedTo: aPacket [ + ^aPacket isUserIDPacket or: [aPacket isPhotoIDPacket or: [aPacket isPublicKeyPacket or: [aPacket isSubkeyPacket]]] +] + +{ #category : #accessing } +OpenPGPSignaturePacket >> creationTime [ + creationTime isNil ifTrue: [self parseData]. + ^creationTime +] + +{ #category : #testing } +OpenPGPSignaturePacket >> isSignaturePacket [ + ^true +] + +{ #category : #'initialize-release' } +OpenPGPSignaturePacket >> parseData: aStream [ + version := aStream next. + version <= 3 ifTrue: [ + aStream next = 5 ifFalse: [self error: 'This number must be 5. See RFC 2440']. + signatureType := aStream next. + creationTime := aStream nextNumber: 4. + signer := aStream next: 8. + publicKeyAlgorithm := aStream next. + hashAlgorithm := aStream next. + msbOfHash := aStream nextNumber: 2. + mpis := aStream mpisUpToEnd]. + version = 4 ifTrue: [ + signatureType := aStream next. + publicKeyAlgorithm := aStream next. + hashAlgorithm := aStream next. + hashedSubpacketData := aStream nextSubpacketData. + unhashedSubpacketData := aStream nextSubpacketData. + msbOfHash := aStream nextNumber: 2. + mpis := aStream mpisUpToEnd. + self subpackets: hashedSubpacketData do: [:subdata | + subdata first = 2 ifTrue: [ + creationTime := (OpenPGPStream on: subdata) + next: 1; nextNumber: 4]]. + self subpackets: unhashedSubpacketData do: [:subdata | + subdata first = 16 ifTrue: [ + signer := subdata copyFrom: 2 to: subdata size]]] +] + +{ #category : #verifying } +OpenPGPSignaturePacket >> putKeyPacket: aPacket onHashStream: aStream [ + aStream + nextPut: 16r99; + nextNumber: 2 put: aPacket dataSize; + nextPutAll: aPacket data +] + +{ #category : #verifying } +OpenPGPSignaturePacket >> putSignatureDataOnHashStream: aStream [ + version = 3 ifTrue: [ + aStream + nextPut: signatureType; + nextNumber: 4 put: creationTime]. + version = 4 ifTrue: [ + aStream + nextPut: 4; + nextPut: signatureType; + nextPut: publicKeyAlgorithm; + nextPut: hashAlgorithm. + aStream + nextNumber: 2 put: hashedSubpacketData size; + nextPutAll: hashedSubpacketData. + aStream + nextPut: 4; + nextPut: 16rFF; + nextNumber: 4 put: hashedSubpacketData size + 6] +] + +{ #category : #verifying } +OpenPGPSignaturePacket >> putUserIdPacket: aPacket onHashStream: aStream [ + aStream + nextPut: 16rB4; + nextNumber: 4 put: aPacket dataSize; + nextPutAll: aPacket data +] + +{ #category : #'initialize-release' } +OpenPGPSignaturePacket >> signer [ + signer = nil ifTrue: [self parseData]. + ^signer +] + +{ #category : #private } +OpenPGPSignaturePacket >> subpackets: aByteArray do: aBlock [ + | str len | + str := OpenPGPStream on: aByteArray. + [str atEnd] whileFalse: [ + len := str nextNewFormatPacketLength. + aBlock value: (str next: len)] +] + +{ #category : #verifying } +OpenPGPSignaturePacket >> verifyKey: keyPacket userId: userIdPacket [ + "compute a hash from the given key and userId according to my hash function. + This method is ugly, but not much more than RFC2440 from which it was created." + | message hash | + hashAlgorithm = 2 ifFalse: [self error: 'Only SHA-1 is supported']. + publicKeyAlgorithm = 17 ifFalse: [self error: 'Only DSA signatures are supported']. + message := ReadWriteStream on: ByteArray new. + self putKeyPacket: keyPacket onHashStream: message. + self putUserIdPacket: userIdPacket onHashStream: message. + self putSignatureDataOnHashStream: message. + message reset. + hash := SecureHashAlgorithm new hashStream: message. + ^DigitalSignatureAlgorithm new + verifySignature: mpis + ofMessageHash: hash + publicKey: keyPacket mpis +] + +{ #category : #accessing } +OpenPGPSignaturePacket >> version [ + version isNil ifTrue: [self parseData]. + ^version +] diff --git a/source/OpenPGP/OpenPGPSignatureSubpacket.class.st b/source/OpenPGP/OpenPGPSignatureSubpacket.class.st new file mode 100644 index 0000000..3ee6c50 --- /dev/null +++ b/source/OpenPGP/OpenPGPSignatureSubpacket.class.st @@ -0,0 +1,8 @@ +Class { + #name : #OpenPGPSignatureSubpacket, + #superclass : #Object, + #instVars : [ + 'data' + ], + #category : 'OpenPGP-Core' +} diff --git a/source/OpenPGP/OpenPGPSignatureV3Data.class.st b/source/OpenPGP/OpenPGPSignatureV3Data.class.st new file mode 100644 index 0000000..4c5e6c0 --- /dev/null +++ b/source/OpenPGP/OpenPGPSignatureV3Data.class.st @@ -0,0 +1,45 @@ +Class { + #name : #OpenPGPSignatureV3Data, + #superclass : #OpenPGPSignatureData, + #instVars : [ + 'creationTime', + 'signer' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPSignatureV3Data >> creationTime [ + ^creationTime +] + +{ #category : #verifying } +OpenPGPSignatureV3Data >> putSignatureDataOnHashStream: aStream [ + aStream + nextPut: signatureType; + nextNumber: 4 put: creationTime +] + +{ #category : #verifying } +OpenPGPSignatureV3Data >> putUserIdPacket: aPacket onHashStream: aStream [ + aStream + nextPutAll: aPacket data +] + +{ #category : #reading } +OpenPGPSignatureV3Data >> readFrom: aStream [ + aStream next = 3 ifFalse: [self error: 'version number mismatch']. + aStream next = 5 ifFalse: [self error: 'This number must be 5. See RFC 2440']. + signatureType := aStream next. + creationTime := aStream nextNumber: 4. + signer := aStream next: 8. + publicKeyAlgorithm := aStream next. + hashAlgorithm := aStream next. + msbOfHash := aStream nextNumber: 2. + mpis := aStream mpisUpToEnd +] + +{ #category : #accessing } +OpenPGPSignatureV3Data >> signer [ + ^signer +] diff --git a/source/OpenPGP/OpenPGPSignatureV4Data.class.st b/source/OpenPGP/OpenPGPSignatureV4Data.class.st new file mode 100644 index 0000000..151e757 --- /dev/null +++ b/source/OpenPGP/OpenPGPSignatureV4Data.class.st @@ -0,0 +1,53 @@ +Class { + #name : #OpenPGPSignatureV4Data, + #superclass : #OpenPGPSignatureData, + #instVars : [ + 'hashedSubpacketData', + 'unhashedSubpacketData' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #accessing } +OpenPGPSignatureV4Data >> creationTime [ + self subpackets: hashedSubpacketData do: [:data | + data first = 2 ifTrue: [^data unsignedLongAt: 2 bigEndian: true]]. + ^nil +] + +{ #category : #verifying } +OpenPGPSignatureV4Data >> putSignatureDataOnHashStream: aStream [ + aStream + nextPut: 4; + nextPut: signatureType; + nextPut: publicKeyAlgorithm; + nextPut: hashAlgorithm. + aStream + nextNumber: 2 put: hashedSubpacketData size; + nextPutAll: hashedSubpacketData. + aStream + nextPut: 4; + nextPut: 16rFF; + nextNumber: 4 put: hashedSubpacketData size + 6 +] + +{ #category : #reading } +OpenPGPSignatureV4Data >> readFrom: aStream [ + aStream next = 4 ifFalse: [self error: 'version type mismatch']. + signatureType := aStream next. + publicKeyAlgorithm := aStream next. + hashAlgorithm := aStream next. + hashedSubpacketData := aStream nextSubpacketData. + unhashedSubpacketData := aStream nextSubpacketData. + msbOfHash := aStream nextNumber: 2. + mpis := aStream mpisUpToEnd +] + +{ #category : #accessing } +OpenPGPSignatureV4Data >> subpackets: aByteArray do: aBlock [ + | str len | + str := OpenPGPStream on: (ReadStream on: aByteArray). + [str atEnd] whileFalse: [ + len := str nextNewFormatPacketLength. + aBlock value: (str next: len)] +] diff --git a/source/OpenPGP/OpenPGPStream.class.st b/source/OpenPGP/OpenPGPStream.class.st new file mode 100644 index 0000000..96bdb92 --- /dev/null +++ b/source/OpenPGP/OpenPGPStream.class.st @@ -0,0 +1,122 @@ +Class { + #name : #OpenPGPStream, + #superclass : #Stream, + #instVars : [ + 'stream' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #'instance creation' } +OpenPGPStream class >> on: aCollection [ + ^self onStream: (ReadStream on: aCollection) +] + +{ #category : #'instance creation' } +OpenPGPStream class >> onStream: aStream [ + ^self basicNew on: aStream +] + +{ #category : #'instance creation' } +OpenPGPStream class >> parsePackets: aStream [ + ^[(self onStream: aStream) nextPacketsUpToEnd] ensure: [aStream close] +] + +{ #category : #accessing } +OpenPGPStream >> atEnd [ + ^stream atEnd +] + +{ #category : #accessing } +OpenPGPStream >> binary [ + stream binary +] + +{ #category : #accessing } +OpenPGPStream >> close [ + stream close +] + +{ #category : #accessing } +OpenPGPStream >> mpisUpToEnd [ + | mpis | + mpis := #(). + [self atEnd] whileFalse: [mpis := mpis copyWith: self nextMPI]. + ^mpis +] + +{ #category : #accessing } +OpenPGPStream >> next [ + ^stream next +] + +{ #category : #accessing } +OpenPGPStream >> next: aNumber [ + ^stream next: aNumber +] + +{ #category : #accessing } +OpenPGPStream >> nextMPI [ + | bits | + bits := stream next * 256 + stream next. + ^self nextNumber: bits+7//8 +] + +{ #category : #accessing } +OpenPGPStream >> nextNewFormatPacketLength [ + | len | + len := stream next. + len > 191 ifTrue: [ + len := len < 224 + ifTrue: [len - 192 * 256 + stream next + 192] + ifFalse: [ + len = 255 + ifTrue: [stream nextNumber: 4] + ifFalse: [(1 bitShift: (len \\ 32)) negated]]]. + ^len +] + +{ #category : #accessing } +OpenPGPStream >> nextNumber: anInteger [ + | result | + anInteger <= 4 ifTrue: [ + result := 0. + anInteger timesRepeat: [result := result * 256 + stream next]. + ^result]. + result := Integer new: anInteger neg: false. + anInteger to: 1 by: -1 do: [:i | + result digitAt: i put: stream next]. + ^result normalize +] + +{ #category : #accessing } +OpenPGPStream >> nextPacket [ + ^OpenPGPPacket readFrom: self +] + +{ #category : #accessing } +OpenPGPStream >> nextPacketsUpToEnd [ + | result | + result := OrderedCollection new. + [self atEnd] whileFalse: [ + result add: self nextPacket]. + ^result +] + +{ #category : #accessing } +OpenPGPStream >> nextS2KSpecifier [ + ^OpenPGPS2KSpecifier new readFrom: self +] + +{ #category : #accessing } +OpenPGPStream >> nextSubpacketData [ + | len | + len := self nextNumber: 2. + ^stream next: len +] + +{ #category : #private } +OpenPGPStream >> on: aStream [ + stream := aStream. + stream binary +] diff --git a/source/OpenPGP/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class.st b/source/OpenPGP/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class.st new file mode 100644 index 0000000..682d086 --- /dev/null +++ b/source/OpenPGP/OpenPGPSymmetricKeyEncryptedSessionKeyPacket.class.st @@ -0,0 +1,36 @@ +Class { + #name : #OpenPGPSymmetricKeyEncryptedSessionKeyPacket, + #superclass : #OpenPGPPacket, + #instVars : [ + 'algorithm', + 's2kSpecifier', + 'sessionKey' + ], + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPSymmetricKeyEncryptedSessionKeyPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleSymmetricKeyEncryptedSessionKeyPacket: self +] + +{ #category : #'as yet unclassified' } +OpenPGPSymmetricKeyEncryptedSessionKeyPacket >> cipherWithPassphrase: aString [ + | cipher | + cipher := OpenPGPPacket symmetricKeyAlgorithmFor: algorithm. + cipher setKey: (s2kSpecifier stringToKey: aString numBytes: cipher keySize). + ^cipher +] + +{ #category : #testing } +OpenPGPSymmetricKeyEncryptedSessionKeyPacket >> isSymmetricKeyEncryptedSessionKeyPacket [ + ^true +] + +{ #category : #reading } +OpenPGPSymmetricKeyEncryptedSessionKeyPacket >> parseData: aStream [ + aStream next = 4 ifFalse: [self error: 'Version must be 4']. + algorithm := aStream next. + s2kSpecifier := aStream nextS2KSpecifier. + aStream atEnd ifFalse: [sessionKey := aStream upToEnd] +] diff --git a/source/OpenPGP/OpenPGPSymmetricallyEncryptedDataPacket.class.st b/source/OpenPGP/OpenPGPSymmetricallyEncryptedDataPacket.class.st new file mode 100644 index 0000000..64f3d5c --- /dev/null +++ b/source/OpenPGP/OpenPGPSymmetricallyEncryptedDataPacket.class.st @@ -0,0 +1,36 @@ +Class { + #name : #OpenPGPSymmetricallyEncryptedDataPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPSymmetricallyEncryptedDataPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleSymmetricallyEncryptedDataPacket: self +] + +{ #category : #accessing } +OpenPGPSymmetricallyEncryptedDataPacket >> decryptWithCipher: cipher [ + "Return decrypted data" + | c s | + s := cipher blockSize. + c := CFBEncryption new + cipher: cipher + initialVector: (ByteArray new: s) + shiftSize: s. + c resyncWith: (data copyFrom: 3 to: s+2). + ^c decryptBytes: (data copyFrom: s+3 to: data size) +] + +{ #category : #testing } +OpenPGPSymmetricallyEncryptedDataPacket >> verifyWithCipher: cipher [ + "Test whether the given block cipher (with initialized key) is correct for decrypting our data" + | c check s | + s := cipher blockSize. + c := CFBEncryption new + cipher: cipher + initialVector: (ByteArray new: s) + shiftSize: s. + check := c decryptBytes: (data copyFrom: 1 to: s+2). + ^(check copyFrom: s-1 to: s) = (check copyFrom: s+1 to: s+2) +] diff --git a/source/OpenPGP/OpenPGPTrustPacket.class.st b/source/OpenPGP/OpenPGPTrustPacket.class.st new file mode 100644 index 0000000..38fc438 --- /dev/null +++ b/source/OpenPGP/OpenPGPTrustPacket.class.st @@ -0,0 +1,20 @@ +Class { + #name : #OpenPGPTrustPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPTrustPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleTrustPacket: self +] + +{ #category : #testing } +OpenPGPTrustPacket >> canBeAddedTo: aPacket [ + ^aPacket isSignaturePacket +] + +{ #category : #testing } +OpenPGPTrustPacket >> isTrustPacket [ + ^true +] diff --git a/source/OpenPGP/OpenPGPUserIDPacket.class.st b/source/OpenPGP/OpenPGPUserIDPacket.class.st new file mode 100644 index 0000000..419b6e6 --- /dev/null +++ b/source/OpenPGP/OpenPGPUserIDPacket.class.st @@ -0,0 +1,26 @@ +Class { + #name : #OpenPGPUserIDPacket, + #superclass : #OpenPGPPacket, + #category : 'OpenPGP-Packets' +} + +{ #category : #visitor } +OpenPGPUserIDPacket >> acceptVisitor: aVisitor [ + ^aVisitor handleUserIDPacket: self +] + +{ #category : #testing } +OpenPGPUserIDPacket >> canBeAddedTo: aPacket [ + ^aPacket isPublicKeyPacket +] + +{ #category : #testing } +OpenPGPUserIDPacket >> isUserIDPacket [ + ^true +] + +{ #category : #printing } +OpenPGPUserIDPacket >> printDataOn: aStream [ + aStream nextPutAll: ', uid='. + aStream nextPutAll: self dataAsString +] diff --git a/source/OpenPGP/OpenPGPVisitor.class.st b/source/OpenPGP/OpenPGPVisitor.class.st new file mode 100644 index 0000000..4b9821a --- /dev/null +++ b/source/OpenPGP/OpenPGPVisitor.class.st @@ -0,0 +1,113 @@ +Class { + #name : #OpenPGPVisitor, + #superclass : #Object, + #instVars : [ + 'config' + ], + #category : 'OpenPGP-Core' +} + +{ #category : #'as yet unclassified' } +OpenPGPVisitor class >> new [ + ^super new initialize +] + +{ #category : #visitor } +OpenPGPVisitor >> config: anOpenPGP [ + config := anOpenPGP +] + +{ #category : #visitor } +OpenPGPVisitor >> finish [ + "perform any necessary cleanup" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleCompressedDataPacket: anOpenPGPCompressedDataPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleLiteralDataPacket: anOpenPGPLiteralDataPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleMarkerPacket: anOpenPGPMarkerPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleOnePassSignaturePacket: anOpenPGPOnePassSignaturePacket [ + "do nothing" +] + +{ #category : #'not yet implemented' } +OpenPGPVisitor >> handleOpenPassSignaturePacket: anObject [ + self error: #notYetImplemented +] + +{ #category : #visitor } +OpenPGPVisitor >> handlePacket: anOpenPGPPacket [ + self error: 'unknown packet type encountered' +] + +{ #category : #visitor } +OpenPGPVisitor >> handlePhotoIDPacket: anOpenPGPPhotoIDPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handlePublicKeyEncryptedSessionKeyPacket: anOpenPGPPublicKeyEncryptedSessionKeyPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handlePublicKeyPacket: anOpenPGPPublicKeyPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handlePublicSubkeyPacket: anOpenPGPPublicSubkeyPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleSecretKeyPacket: anOpenPGPSecretKeyPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleSecretSubkeyPacket: anOpenPGPSecretSubkeyPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleSignaturePacket: anOpenPGPSignaturePacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleSymmetricKeyEncryptedSessionKeyPacket: anOpenPGPSymmetricKeyEncryptedSessionKeyPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleSymmetricallyEncryptedDataPacket: anOpenPGPSymmetricallyEncryptedDataPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleTrustPacket: anOpenPGPTrustPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> handleUserIDPacket: anOpenPGPUserIDPacket [ + "do nothing" +] + +{ #category : #visitor } +OpenPGPVisitor >> initialize [ + "perform any necessary initialization" +] diff --git a/source/OpenPGP/ThirtyTwoBitRegister.extension.st b/source/OpenPGP/ThirtyTwoBitRegister.extension.st new file mode 100644 index 0000000..b3f3be2 --- /dev/null +++ b/source/OpenPGP/ThirtyTwoBitRegister.extension.st @@ -0,0 +1,38 @@ +Extension { #name : #ThirtyTwoBitRegister } + +{ #category : #'*openPGP-accumulator ops' } +ThirtyTwoBitRegister >> -= aThirtyTwoBitRegister [ + "Replace my contents with the difference of the given register and my current contents." + + | carry | + low := low - aThirtyTwoBitRegister low. + low < 0 + ifTrue: [low := low + 65536. carry := 1] + ifFalse: [carry := 0]. + hi := (hi - aThirtyTwoBitRegister hi - carry+ 65536) bitAnd: 16rFFFF +] + +{ #category : #'*openPGP-accessing' } +ThirtyTwoBitRegister >> castXorFrom: anSBox index: anInteger [ + self bitXor: (anSBox at: anInteger+1) +] + +{ #category : #'*openPGP-accessing' } +ThirtyTwoBitRegister >> d0 [ + ^ hi bitShift: -8 +] + +{ #category : #'*openPGP-accessing' } +ThirtyTwoBitRegister >> d1 [ + ^ hi bitAnd: 16rFF +] + +{ #category : #'*openPGP-accessing' } +ThirtyTwoBitRegister >> d2 [ + ^ low bitShift: -8 +] + +{ #category : #'*openPGP-accessing' } +ThirtyTwoBitRegister >> d3 [ + ^ low bitAnd: 16rFF +] diff --git a/source/OpenPGP/TripleDESForOpenPGP.class.st b/source/OpenPGP/TripleDESForOpenPGP.class.st new file mode 100644 index 0000000..bdf304f --- /dev/null +++ b/source/OpenPGP/TripleDESForOpenPGP.class.st @@ -0,0 +1,71 @@ +" +TripleDES uses its 168-bit key to set up 3 DES instances which are used in a cascade to encrypt and decrypt data. It has reasonable cryptoanalytic strength. +" +Class { + #name : #TripleDESForOpenPGP, + #superclass : #BlockCipher, + #instVars : [ + 'des1', + 'des2', + 'des3' + ], + #category : 'OpenPGP-Algorithms' +} + +{ #category : #accessing } +TripleDESForOpenPGP class >> blockSize [ + ^ 8 +] + +{ #category : #accessing } +TripleDESForOpenPGP class >> keySize [ + ^ 8*3 +] + +{ #category : #'instance creation' } +TripleDESForOpenPGP class >> new [ + ^ super new initialize +] + +{ #category : #'encryption/decryption' } +TripleDESForOpenPGP >> blockSize [ + ^8 +] + +{ #category : #'encryption/decryption' } +TripleDESForOpenPGP >> decryptBlock: anInteger [ + ^des1 decryptBlock: (des2 encryptBlock: (des3 decryptBlock: anInteger)) +] + +{ #category : #'encryption/decryption' } +TripleDESForOpenPGP >> encryptBlock: anInteger [ + ^des3 encryptBlock: (des2 decryptBlock: (des1 encryptBlock: anInteger)) +] + +{ #category : #accessing } +TripleDESForOpenPGP >> initialize [ + des1 _ DESForOpenPGP new. + des2 _ DESForOpenPGP new. + des3 _ DESForOpenPGP new +] + +{ #category : #accessing } +TripleDESForOpenPGP >> key: aByteArray [ + des1 key: (aByteArray copyFrom: 1 to: 8). + des2 key: (aByteArray copyFrom: 9 to: 16). + des3 key: (aByteArray copyFrom: 17 to: 24) +] + +{ #category : #'encryption/decryption' } +TripleDESForOpenPGP >> keySize [ + ^24 +] + +{ #category : #'initialize-release' } +TripleDESForOpenPGP >> setKey: aNumber [ + | mask64 | + mask64 := 16rFFFFFFFFFFFFFFFF. + des1 := DESForOpenPGP new setKey: ((aNumber bitShift: -128) bitAnd: mask64). + des2 := DESForOpenPGP new setKey: ((aNumber bitShift: -64) bitAnd: mask64). + des3 := DESForOpenPGP new setKey: (aNumber bitAnd: mask64) +] diff --git a/source/OpenPGP/package.st b/source/OpenPGP/package.st new file mode 100644 index 0000000..4c8becf --- /dev/null +++ b/source/OpenPGP/package.st @@ -0,0 +1 @@ +Package { #name : #OpenPGP } diff --git a/source/PBKDF2-Tests.package/.filetree b/source/PBKDF2-Tests.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/PBKDF2-Tests.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/README.md b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/assertDerivedKey.iterations.equals..st b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/assertDerivedKey.iterations.equals..st deleted file mode 100644 index 1dc67f3..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/assertDerivedKey.iterations.equals..st +++ /dev/null @@ -1,11 +0,0 @@ -as yet unclassified -assertDerivedKey: pbkdf2 iterations: iterations equals: aString - | expected | - expected := ByteArray fromHexString: aString. - self - assert: - (pbkdf2 - iterations: iterations; - length: expected size; - deriveKey) - equals: expected \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_0x1234567878563412.st b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_0x1234567878563412.st deleted file mode 100644 index 86f6117..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_0x1234567878563412.st +++ /dev/null @@ -1,13 +0,0 @@ -as yet unclassified -testRfc3962_0x1234567878563412 - | pbkdf2 | - pbkdf2 := PBKDF2 new - hashFunction: SHA1; - password: 'password'; - salt: 16r1234567878563412; - yourself. - self - assertDerivedKey: pbkdf2 iterations: 5 equals: 'd1 da a7 86 15 f2 87 e6 a1 c8 b1 20 d7 06 2a 49'; - assertDerivedKey: pbkdf2 - iterations: 5 - equals: 'd1 da a7 86 15 f2 87 e6 a1 c8 b1 20 d7 06 2a 49 3f 98 d2 03 e6 be 49 a6 ad f4 fa 57 4b 6e 64 ee' \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_64X.st b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_64X.st deleted file mode 100644 index 574aa18..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_64X.st +++ /dev/null @@ -1,13 +0,0 @@ -as yet unclassified -testRfc3962_64X - | pbkdf2 | - pbkdf2 := PBKDF2 new - hashFunction: SHA1; - password: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; - salt: 'pass phrase equals block size'; - yourself. - self - assertDerivedKey: pbkdf2 iterations: 1200 equals: '13 9c 30 c0 96 6b c3 2b a5 5f db f2 12 53 0a c9'; - assertDerivedKey: pbkdf2 - iterations: 1200 - equals: '13 9c 30 c0 96 6b c3 2b a5 5f db f2 12 53 0a c9 c5 ec 59 f1 a4 52 f5 cc 9a d9 40 fe a0 59 8e d1' \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_65X.st b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_65X.st deleted file mode 100644 index f33657e..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_65X.st +++ /dev/null @@ -1,13 +0,0 @@ -as yet unclassified -testRfc3962_65X - | pbkdf2 | - pbkdf2 := PBKDF2 new - hashFunction: SHA1; - password: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; - salt: 'pass phrase exceeds block size'; - yourself. - self - assertDerivedKey: pbkdf2 iterations: 1200 equals: '9c ca d6 d4 68 77 0c d5 1b 10 e6 a6 87 21 be 61'; - assertDerivedKey: pbkdf2 - iterations: 1200 - equals: '9c ca d6 d4 68 77 0c d5 1b 10 e6 a6 87 21 be 61 1a 8b 4d 28 26 01 db 3b 36 be 92 46 91 5e c8 2a' \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_AthenaMitEduRaeburn.st b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_AthenaMitEduRaeburn.st deleted file mode 100644 index 276b2cd..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_AthenaMitEduRaeburn.st +++ /dev/null @@ -1,23 +0,0 @@ -as yet unclassified -testRfc3962_AthenaMitEduRaeburn - | pbkdf2 | - pbkdf2 := PBKDF2 new - hashFunction: SHA1; - password: 'password'; - salt: 'ATHENA.MIT.EDUraeburn'; - yourself. - self - assertDerivedKey: pbkdf2 iterations: 1 equals: 'cd ed b5 28 1b b2 f8 01 56 5a 11 22 b2 56 35 15'; - assertDerivedKey: pbkdf2 - iterations: 1 - equals: 'cd ed b5 28 1b b2 f8 01 56 5a 11 22 b2 56 35 15 0a d1 f7 a0 4b b9 f3 a3 33 ec c0 e2 e1 f7 08 37'. - self - assertDerivedKey: pbkdf2 iterations: 2 equals: '01 db ee 7f 4a 9e 24 3e 98 8b 62 c7 3c da 93 5d'; - assertDerivedKey: pbkdf2 - iterations: 2 - equals: '01 db ee 7f 4a 9e 24 3e 98 8b 62 c7 3c da 93 5d a0 53 78 b9 32 44 ec 8f 48 a9 9e 61 ad 79 9d 86'. - self - assertDerivedKey: pbkdf2 iterations: 1200 equals: '5c 08 eb 61 fd f7 1e 4e 4e c3 cf 6b a1 f5 51 2b'; - assertDerivedKey: pbkdf2 - iterations: 1200 - equals: '5c 08 eb 61 fd f7 1e 4e 4e c3 cf 6b a1 f5 51 2b a7 e5 2d db c5 e5 14 2f 70 8a 31 e2 e6 2b 1e 13' \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_ExampleCOMpianist.st b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_ExampleCOMpianist.st deleted file mode 100644 index 1a05515..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/instance/testRfc3962_ExampleCOMpianist.st +++ /dev/null @@ -1,13 +0,0 @@ -as yet unclassified -testRfc3962_ExampleCOMpianist - | pbkdf2 | - pbkdf2 := PBKDF2 new - hashFunction: SHA1; - password: 16rf09d849e; - salt: 'EXAMPLE.COMpianist'; - yourself. - self - assertDerivedKey: pbkdf2 iterations: 50 equals: '6b 9c f2 6d 45 45 5a 43 a5 b8 bb 27 6a 40 3b 39'; - assertDerivedKey: pbkdf2 - iterations: 50 - equals: ' 6b 9c f2 6d 45 45 5a 43 a5 b8 bb 27 6a 40 3b 39 e7 fe 37 a0 c4 1e 02 c2 81 ff 30 69 e1 e9 4f 52' \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/properties.json b/source/PBKDF2-Tests.package/PBKDF2TestCase.class/properties.json deleted file mode 100644 index 54c8610..0000000 --- a/source/PBKDF2-Tests.package/PBKDF2TestCase.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "PBKDF2-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "PBKDF2TestCase", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/monticello.meta/categories.st b/source/PBKDF2-Tests.package/monticello.meta/categories.st deleted file mode 100644 index 650bfa5..0000000 --- a/source/PBKDF2-Tests.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #'PBKDF2-Tests'! diff --git a/source/PBKDF2-Tests.package/monticello.meta/initializers.st b/source/PBKDF2-Tests.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/PBKDF2-Tests.package/monticello.meta/package b/source/PBKDF2-Tests.package/monticello.meta/package deleted file mode 100644 index 892aca6..0000000 --- a/source/PBKDF2-Tests.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'PBKDF2-Tests') \ No newline at end of file diff --git a/source/PBKDF2-Tests.package/properties.json b/source/PBKDF2-Tests.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/PBKDF2-Tests.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/PBKDF2-Tests/PBKDF2TestCase.class.st b/source/PBKDF2-Tests/PBKDF2TestCase.class.st new file mode 100644 index 0000000..49637f3 --- /dev/null +++ b/source/PBKDF2-Tests/PBKDF2TestCase.class.st @@ -0,0 +1,108 @@ +Class { + #name : #PBKDF2TestCase, + #superclass : #TestCase, + #category : #'PBKDF2-Tests' +} + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> assertDerivedKey: pbkdf2 iterations: iterations equals: aString [ + | expected | + expected := ByteArray fromHexString: (self trim: aString). + self + assert: + (pbkdf2 + iterations: iterations; + length: expected size; + deriveKey) + equals: expected +] + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> testRfc3962_0x1234567878563412 [ + | pbkdf2 | + pbkdf2 := PBKDF2 new + hashFunction: SHA1; + password: 'password'; + salt: 16r1234567878563412; + yourself. + self + assertDerivedKey: pbkdf2 iterations: 5 equals: 'd1 da a7 86 15 f2 87 e6 a1 c8 b1 20 d7 06 2a 49'; + assertDerivedKey: pbkdf2 + iterations: 5 + equals: 'd1 da a7 86 15 f2 87 e6 a1 c8 b1 20 d7 06 2a 49 3f 98 d2 03 e6 be 49 a6 ad f4 fa 57 4b 6e 64 ee' +] + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> testRfc3962_64X [ + | pbkdf2 | + pbkdf2 := PBKDF2 new + hashFunction: SHA1; + password: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; + salt: 'pass phrase equals block size'; + yourself. + self + assertDerivedKey: pbkdf2 iterations: 1200 equals: '13 9c 30 c0 96 6b c3 2b a5 5f db f2 12 53 0a c9'; + assertDerivedKey: pbkdf2 + iterations: 1200 + equals: '13 9c 30 c0 96 6b c3 2b a5 5f db f2 12 53 0a c9 c5 ec 59 f1 a4 52 f5 cc 9a d9 40 fe a0 59 8e d1' +] + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> testRfc3962_65X [ + | pbkdf2 | + pbkdf2 := PBKDF2 new + hashFunction: SHA1; + password: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; + salt: 'pass phrase exceeds block size'; + yourself. + self + assertDerivedKey: pbkdf2 iterations: 1200 equals: '9c ca d6 d4 68 77 0c d5 1b 10 e6 a6 87 21 be 61'; + assertDerivedKey: pbkdf2 + iterations: 1200 + equals: '9c ca d6 d4 68 77 0c d5 1b 10 e6 a6 87 21 be 61 1a 8b 4d 28 26 01 db 3b 36 be 92 46 91 5e c8 2a' +] + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> testRfc3962_AthenaMitEduRaeburn [ + | pbkdf2 | + pbkdf2 := PBKDF2 new + hashFunction: SHA1; + password: 'password'; + salt: 'ATHENA.MIT.EDUraeburn'; + yourself. + self + assertDerivedKey: pbkdf2 iterations: 1 equals: 'cd ed b5 28 1b b2 f8 01 56 5a 11 22 b2 56 35 15'; + assertDerivedKey: pbkdf2 + iterations: 1 + equals: 'cd ed b5 28 1b b2 f8 01 56 5a 11 22 b2 56 35 15 0a d1 f7 a0 4b b9 f3 a3 33 ec c0 e2 e1 f7 08 37'. + self + assertDerivedKey: pbkdf2 iterations: 2 equals: '01 db ee 7f 4a 9e 24 3e 98 8b 62 c7 3c da 93 5d'; + assertDerivedKey: pbkdf2 + iterations: 2 + equals: '01 db ee 7f 4a 9e 24 3e 98 8b 62 c7 3c da 93 5d a0 53 78 b9 32 44 ec 8f 48 a9 9e 61 ad 79 9d 86'. + self + assertDerivedKey: pbkdf2 iterations: 1200 equals: '5c 08 eb 61 fd f7 1e 4e 4e c3 cf 6b a1 f5 51 2b'; + assertDerivedKey: pbkdf2 + iterations: 1200 + equals: '5c 08 eb 61 fd f7 1e 4e 4e c3 cf 6b a1 f5 51 2b a7 e5 2d db c5 e5 14 2f 70 8a 31 e2 e6 2b 1e 13' +] + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> testRfc3962_ExampleCOMpianist [ + | pbkdf2 | + pbkdf2 := PBKDF2 new + hashFunction: SHA1; + password: 16rf09d849e; + salt: 'EXAMPLE.COMpianist'; + yourself. + self + assertDerivedKey: pbkdf2 iterations: 50 equals: '6b 9c f2 6d 45 45 5a 43 a5 b8 bb 27 6a 40 3b 39'; + assertDerivedKey: pbkdf2 + iterations: 50 + equals: ' 6b 9c f2 6d 45 45 5a 43 a5 b8 bb 27 6a 40 3b 39 e7 fe 37 a0 c4 1e 02 c2 81 ff 30 69 e1 e9 4f 52' +] + +{ #category : #'as yet unclassified' } +PBKDF2TestCase >> trim: aString [ + ^ aString copyWithout: Character space +] diff --git a/source/PBKDF2-Tests/package.st b/source/PBKDF2-Tests/package.st new file mode 100644 index 0000000..fa6cad1 --- /dev/null +++ b/source/PBKDF2-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'PBKDF2-Tests' } diff --git a/source/PBKDF2.package/.filetree b/source/PBKDF2.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/PBKDF2.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/README.md b/source/PBKDF2.package/PBKDF2.class/README.md deleted file mode 100644 index 56f8199..0000000 --- a/source/PBKDF2.package/PBKDF2.class/README.md +++ /dev/null @@ -1,20 +0,0 @@ -PBKDF2 implementation based on RFC 2898 (http://tools.ietf.org/html/rfc2898). - -Usage (Detailed Form): - -derivedKey := PBKDF2 new - hashFunction: SHA1; - password: 'password'; - salt: 'salt'; - iterations: 4096; - length: 256; - deriveKey. - -You can also use some convenience class methods. E.g.: - derivedKey := PBKDF2 derivedKeySHA1Password: password salt: salt. - -Defaults: - prf: HMAC-SHA-1 - iterations: 1000 - length: 16 Bytes - diff --git a/source/PBKDF2.package/PBKDF2.class/class/derivedKeyHashFunction.password.salt..st b/source/PBKDF2.package/PBKDF2.class/class/derivedKeyHashFunction.password.salt..st deleted file mode 100644 index e16910b..0000000 --- a/source/PBKDF2.package/PBKDF2.class/class/derivedKeyHashFunction.password.salt..st +++ /dev/null @@ -1,7 +0,0 @@ -instance creation -derivedKeyHashFunction: hashClass password: password salt: salt - ^ PBKDF2 new - hashFunction: hashClass; - password: password; - salt: salt; - deriveKey \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/class/derivedKeyHashFunction.password.salt.iterations.length..st b/source/PBKDF2.package/PBKDF2.class/class/derivedKeyHashFunction.password.salt.iterations.length..st deleted file mode 100644 index 3954e6f..0000000 --- a/source/PBKDF2.package/PBKDF2.class/class/derivedKeyHashFunction.password.salt.iterations.length..st +++ /dev/null @@ -1,9 +0,0 @@ -instance creation -derivedKeyHashFunction: hashClass password: password salt: salt iterations: iterations length: length - ^ PBKDF2 new - hashFunction: hashClass; - password: password; - salt: salt; - iterations: iterations; - length: length; - deriveKey \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/class/derivedKeyPseudoRandomFunction.password.salt.iterations.length..st b/source/PBKDF2.package/PBKDF2.class/class/derivedKeyPseudoRandomFunction.password.salt.iterations.length..st deleted file mode 100644 index 0c898f1..0000000 --- a/source/PBKDF2.package/PBKDF2.class/class/derivedKeyPseudoRandomFunction.password.salt.iterations.length..st +++ /dev/null @@ -1,9 +0,0 @@ -instance creation -derivedKeyPseudoRandomFunction: prf password: password salt: salt iterations: iterations length: length - ^ PBKDF2 new - prf: prf; - password: password; - salt: salt; - iterations: iterations; - length: length; - deriveKey \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/class/derivedKeySHA1Password.salt..st b/source/PBKDF2.package/PBKDF2.class/class/derivedKeySHA1Password.salt..st deleted file mode 100644 index 60fe314..0000000 --- a/source/PBKDF2.package/PBKDF2.class/class/derivedKeySHA1Password.salt..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -derivedKeySHA1Password: password salt: salt - ^ PBKDF2 new - password: password; - salt: salt; - deriveKey \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/c..st b/source/PBKDF2.package/PBKDF2.class/instance/c..st deleted file mode 100644 index 467da5e..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/c..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -c: anInteger - c := anInteger \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/deriveBlock..st b/source/PBKDF2.package/PBKDF2.class/instance/deriveBlock..st deleted file mode 100644 index 943ae27..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/deriveBlock..st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -deriveBlock: i - | u un | - un := prf - key: p; - digestMessage: s , (i asByteArrayOfSize: 4). - u := un. - c - 1 - timesRepeat: [ - un := prf digestMessage: un. - u := u bitXor: un ]. - ^ u \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/deriveKey.st b/source/PBKDF2.package/PBKDF2.class/instance/deriveKey.st deleted file mode 100644 index 2d584ed..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/deriveKey.st +++ /dev/null @@ -1,12 +0,0 @@ -accessing -deriveKey - | l | - dkLen > (((2 raisedTo: 32) - 1) * hLen) - ifTrue: [ self error: 'derived key too long' ]. "If dkLen > (2^32 - 1) * hLen, output 'derived key too long' and - stop." - l := (dkLen / hLen) ceiling. "Let l be the number of hLen-octet blocks in the derived key, - rounding up" "r := dkLen - ((l - 1) * hLen)." "and let r be the number of octets in the last - block:" - ^ (ByteArray streamContents: [ :dkStream | 1 to: l do: [ :i | dkStream nextPutAll: (self deriveBlock: i) ] ]) contents - copyFrom: 1 - to: dkLen \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/dkLen..st b/source/PBKDF2.package/PBKDF2.class/instance/dkLen..st deleted file mode 100644 index 106bd38..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/dkLen..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -dkLen: anInteger - dkLen := anInteger \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/hashFunction..st b/source/PBKDF2.package/PBKDF2.class/instance/hashFunction..st deleted file mode 100644 index 19e46fd..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/hashFunction..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -hashFunction: anHashFunction - self prf: anHashFunction new hmac \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/initialize.st b/source/PBKDF2.package/PBKDF2.class/instance/initialize.st deleted file mode 100644 index 5ae5fe0..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/initialize.st +++ /dev/null @@ -1,6 +0,0 @@ -initialization -initialize - self - hashFunction: SHA1; - iterations: 1000; - length: 16 \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/iterations..st b/source/PBKDF2.package/PBKDF2.class/instance/iterations..st deleted file mode 100644 index 8275113..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/iterations..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -iterations: anInteger - self c: anInteger \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/length..st b/source/PBKDF2.package/PBKDF2.class/instance/length..st deleted file mode 100644 index 226cdef..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/length..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -length: anInteger - self dkLen: anInteger \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/p..st b/source/PBKDF2.package/PBKDF2.class/instance/p..st deleted file mode 100644 index fb38713..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/p..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -p: aByteArray - p := aByteArray \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/password..st b/source/PBKDF2.package/PBKDF2.class/instance/password..st deleted file mode 100644 index 01fb354..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/password..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -password: aString - self p: aString asByteArray \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/prf..st b/source/PBKDF2.package/PBKDF2.class/instance/prf..st deleted file mode 100644 index 4d443e1..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/prf..st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -prf: aPseudoRandomFunction - prf := aPseudoRandomFunction. - hLen := self prfHLen: aPseudoRandomFunction \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/prfHLen..st b/source/PBKDF2.package/PBKDF2.class/instance/prfHLen..st deleted file mode 100644 index 96ef88f..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/prfHLen..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -prfHLen: aPseudoRandomFunction - ^ aPseudoRandomFunction digestSize \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/prfKey.message..st b/source/PBKDF2.package/PBKDF2.class/instance/prfKey.message..st deleted file mode 100644 index c68100c..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/prfKey.message..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -prfKey: k message: m - ^ prf - key: k; - digestMessage: m \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/s..st b/source/PBKDF2.package/PBKDF2.class/instance/s..st deleted file mode 100644 index 109da6e..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/s..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -s: aByteArray - s := aByteArray \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/instance/salt..st b/source/PBKDF2.package/PBKDF2.class/instance/salt..st deleted file mode 100644 index bc51a79..0000000 --- a/source/PBKDF2.package/PBKDF2.class/instance/salt..st +++ /dev/null @@ -1,3 +0,0 @@ -accessing -salt: aString - self s: aString asByteArray \ No newline at end of file diff --git a/source/PBKDF2.package/PBKDF2.class/properties.json b/source/PBKDF2.package/PBKDF2.class/properties.json deleted file mode 100644 index ac9430c..0000000 --- a/source/PBKDF2.package/PBKDF2.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "commentStamp" : "UdoSchneider 7/9/2014 13:59", - "super" : "Object", - "category" : "PBKDF2", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "prf", - "hLen", - "p", - "s", - "c", - "dkLen" - ], - "name" : "PBKDF2", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PBKDF2.package/monticello.meta/categories.st b/source/PBKDF2.package/monticello.meta/categories.st deleted file mode 100644 index e61ab02..0000000 --- a/source/PBKDF2.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #PBKDF2! diff --git a/source/PBKDF2.package/monticello.meta/initializers.st b/source/PBKDF2.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/PBKDF2.package/monticello.meta/package b/source/PBKDF2.package/monticello.meta/package deleted file mode 100644 index e6212bd..0000000 --- a/source/PBKDF2.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'PBKDF2') \ No newline at end of file diff --git a/source/PBKDF2.package/properties.json b/source/PBKDF2.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/PBKDF2.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/PBKDF2/PBKDF2.class.st b/source/PBKDF2/PBKDF2.class.st new file mode 100644 index 0000000..6526a7a --- /dev/null +++ b/source/PBKDF2/PBKDF2.class.st @@ -0,0 +1,174 @@ +" +PBKDF2 implementation based on RFC 2898 (http://tools.ietf.org/html/rfc2898). + +Usage (Detailed Form): + +derivedKey := PBKDF2 new + hashFunction: SHA1; + password: 'password'; + salt: 'salt'; + iterations: 4096; + length: 256; + deriveKey. + +You can also use some convenience class methods. E.g.: + derivedKey := PBKDF2 derivedKeySHA1Password: password salt: salt. + +Defaults: + prf: HMAC-SHA-1 + iterations: 1000 + length: 16 Bytes + + +" +Class { + #name : #PBKDF2, + #superclass : #Object, + #instVars : [ + 'prf', + 'hLen', + 'p', + 's', + 'c', + 'dkLen' + ], + #category : 'PBKDF2' +} + +{ #category : #'instance creation' } +PBKDF2 class >> derivedKeyHashFunction: hashClass password: password salt: salt [ + ^ PBKDF2 new + hashFunction: hashClass; + password: password; + salt: salt; + deriveKey +] + +{ #category : #'instance creation' } +PBKDF2 class >> derivedKeyHashFunction: hashClass password: password salt: salt iterations: iterations length: length [ + ^ PBKDF2 new + hashFunction: hashClass; + password: password; + salt: salt; + iterations: iterations; + length: length; + deriveKey +] + +{ #category : #'instance creation' } +PBKDF2 class >> derivedKeyPseudoRandomFunction: prf password: password salt: salt iterations: iterations length: length [ + ^ PBKDF2 new + prf: prf; + password: password; + salt: salt; + iterations: iterations; + length: length; + deriveKey +] + +{ #category : #'instance creation' } +PBKDF2 class >> derivedKeySHA1Password: password salt: salt [ + ^ PBKDF2 new + password: password; + salt: salt; + deriveKey +] + +{ #category : #accessing } +PBKDF2 >> c: anInteger [ + c := anInteger +] + +{ #category : #accessing } +PBKDF2 >> deriveBlock: i [ + | u un | + un := prf + key: p; + digestMessage: s , (i asByteArrayOfSize: 4). + u := un. + c - 1 + timesRepeat: [ + un := prf digestMessage: un. + u := u bitXor: un ]. + ^ u +] + +{ #category : #accessing } +PBKDF2 >> deriveKey [ + | l | + dkLen > (((2 raisedTo: 32) - 1) * hLen) + ifTrue: [ self error: 'derived key too long' ]. "If dkLen > (2^32 - 1) * hLen, output 'derived key too long' and + stop." + l := (dkLen / hLen) ceiling. "Let l be the number of hLen-octet blocks in the derived key, + rounding up" "r := dkLen - ((l - 1) * hLen)." "and let r be the number of octets in the last + block:" + ^ (ByteArray streamContents: [ :dkStream | 1 to: l do: [ :i | dkStream nextPutAll: (self deriveBlock: i) ] ]) contents + copyFrom: 1 + to: dkLen +] + +{ #category : #accessing } +PBKDF2 >> dkLen: anInteger [ + dkLen := anInteger +] + +{ #category : #accessing } +PBKDF2 >> hashFunction: anHashFunction [ + self prf: anHashFunction new hmac +] + +{ #category : #initialization } +PBKDF2 >> initialize [ + self + hashFunction: SHA1; + iterations: 1000; + length: 16 +] + +{ #category : #accessing } +PBKDF2 >> iterations: anInteger [ + self c: anInteger +] + +{ #category : #accessing } +PBKDF2 >> length: anInteger [ + self dkLen: anInteger +] + +{ #category : #accessing } +PBKDF2 >> p: aByteArray [ + p := aByteArray +] + +{ #category : #accessing } +PBKDF2 >> password: aString [ + self p: aString asByteArray +] + +{ #category : #accessing } +PBKDF2 >> prf: aPseudoRandomFunction [ + prf := aPseudoRandomFunction. + hLen := self prfHLen: aPseudoRandomFunction +] + +{ #category : #accessing } +PBKDF2 >> prfHLen: aPseudoRandomFunction [ + ^ aPseudoRandomFunction digestSize +] + +{ #category : #accessing } +PBKDF2 >> prfKey: k message: m [ + ^ prf + key: k; + digestMessage: m +] + +{ #category : #accessing } +PBKDF2 >> s: aByteArray [ + s := aByteArray +] + +{ #category : #accessing } +PBKDF2 >> salt: aString [ + self s: aString asByteArray +] diff --git a/source/PBKDF2/package.st b/source/PBKDF2/package.st new file mode 100644 index 0000000..852959b --- /dev/null +++ b/source/PBKDF2/package.st @@ -0,0 +1 @@ +Package { #name : #PBKDF2 } diff --git a/source/PKCS12-Tests.package/.filetree b/source/PKCS12-Tests.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/PKCS12-Tests.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/README.md b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test1.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test1.st deleted file mode 100644 index d778eb6..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test1.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test1 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: 'smeg' - salt: #(10 88 207 100 83 13 130 63) - iterations: 1 - size: 8) hex. - self assert: key = '79993dfe048d3b76' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test10.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test10.st deleted file mode 100644 index 07eb393..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test10.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test10 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: 'queeg' - salt: #(22 130 192 252 91 63 126 197) - iterations: 1000 - size: 24) hex. - self assert: key = '483dd6e919d7de2e8e648ba8f862f3fbfbdc2bcb2c02957f' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test2.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test2.st deleted file mode 100644 index 26893f9..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test2.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test2 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: 'smeg' - salt: #(100 43 153 171 68 251 75 31) - iterations: 1 - size: 8) hex. - self assert: key = 'c0a38d64a79bea1d' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test3.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test3.st deleted file mode 100644 index 9f7362e..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test3.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test3 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: 'queeg' - salt: #(5 222 201 89 172 255 114 247) - iterations: 1000 - size: 8) hex. - self assert: key = '11dedad7758d4860' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test4.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test4.st deleted file mode 100644 index 751e891..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test4.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test4 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: 'queeg' - salt: #(22 130 192 252 91 63 126 197) - iterations: 1000 - size: 8) hex. - self assert: key = '9d461d1b00355c50' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test5.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test5.st deleted file mode 100644 index 2f345df..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test5.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test5 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 3 - fromPassword: 'smeg' - salt: #(61 131 192 228 84 106 193 64) - iterations: 1 - size: 20) hex. - self assert: key = '8d967d88f6caa9d714800ab3d48051d63f73a312' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test6.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test6.st deleted file mode 100644 index 9749248..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test6.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test6 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 3 - fromPassword: 'queeg' - salt: #(38 50 22 252 194 250 179 28) - iterations: 1000 - size: 20) hex. - self assert: key = '5ec4c7a80df652294c3925b6489a7ab857c83476' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test7.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test7.st deleted file mode 100644 index e80acc7..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test7.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test7 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: 'smeg' - salt: #(10 88 207 100 83 13 130 63) - iterations: 1 - size: 24) hex. - self assert: key = '8aaae6297b6cb04642ab5b077851284eb7128f1a2a7fbca3' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test8.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test8.st deleted file mode 100644 index 92d0b54..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test8.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test8 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: 'smeg' - salt: #(100 43 153 171 68 251 75 31) - iterations: 1 - size: 24) hex. - self assert: key = 'f3a95fec48d7711e985cfe67908c5ab79fa3d7c5caa5d966' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test9.st b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test9.st deleted file mode 100644 index 5cf35a4..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/instance/test9.st +++ /dev/null @@ -1,11 +0,0 @@ -testing -test9 - - | key | - key := (Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: 'queeg' - salt: #(5 222 201 89 172 255 114 247) - iterations: 1000 - size: 24) hex. - self assert: key = 'ed2034e36328830ff09df1e1a07dd357185dac0d4f9eb3d4' diff --git a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/properties.json b/source/PKCS12-Tests.package/CryptoPKCS12Test.class/properties.json deleted file mode 100644 index 8dc730e..0000000 --- a/source/PKCS12-Tests.package/CryptoPKCS12Test.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "PKCS12-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoPKCS12Test", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12-Tests.package/monticello.meta/categories.st b/source/PKCS12-Tests.package/monticello.meta/categories.st deleted file mode 100644 index 82b39a1..0000000 --- a/source/PKCS12-Tests.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #'PKCS12-Tests'! diff --git a/source/PKCS12-Tests.package/monticello.meta/initializers.st b/source/PKCS12-Tests.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12-Tests.package/monticello.meta/package b/source/PKCS12-Tests.package/monticello.meta/package deleted file mode 100644 index 4c12fe1..0000000 --- a/source/PKCS12-Tests.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'PKCS12-Tests') \ No newline at end of file diff --git a/source/PKCS12-Tests.package/properties.json b/source/PKCS12-Tests.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/PKCS12-Tests.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/PKCS12-Tests/CryptoPKCS12Test.class.st b/source/PKCS12-Tests/CryptoPKCS12Test.class.st new file mode 100644 index 0000000..e7ba2b5 --- /dev/null +++ b/source/PKCS12-Tests/CryptoPKCS12Test.class.st @@ -0,0 +1,145 @@ +Class { + #name : #CryptoPKCS12Test, + #superclass : #TestCase, + #category : 'PKCS12-Tests' +} + +{ #category : #testing } +CryptoPKCS12Test >> test1 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: 'smeg' + salt: #(10 88 207 100 83 13 130 63) + iterations: 1 + size: 8) hex. + self assert: key = '79993dfe048d3b76' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test10 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: 'queeg' + salt: #(22 130 192 252 91 63 126 197) + iterations: 1000 + size: 24) hex. + self assert: key = '483dd6e919d7de2e8e648ba8f862f3fbfbdc2bcb2c02957f' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test2 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: 'smeg' + salt: #(100 43 153 171 68 251 75 31) + iterations: 1 + size: 8) hex. + self assert: key = 'c0a38d64a79bea1d' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test3 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: 'queeg' + salt: #(5 222 201 89 172 255 114 247) + iterations: 1000 + size: 8) hex. + self assert: key = '11dedad7758d4860' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test4 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: 'queeg' + salt: #(22 130 192 252 91 63 126 197) + iterations: 1000 + size: 8) hex. + self assert: key = '9d461d1b00355c50' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test5 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 3 + fromPassword: 'smeg' + salt: #(61 131 192 228 84 106 193 64) + iterations: 1 + size: 20) hex. + self assert: key = '8d967d88f6caa9d714800ab3d48051d63f73a312' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test6 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 3 + fromPassword: 'queeg' + salt: #(38 50 22 252 194 250 179 28) + iterations: 1000 + size: 20) hex. + self assert: key = '5ec4c7a80df652294c3925b6489a7ab857c83476' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test7 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: 'smeg' + salt: #(10 88 207 100 83 13 130 63) + iterations: 1 + size: 24) hex. + self assert: key = '8aaae6297b6cb04642ab5b077851284eb7128f1a2a7fbca3' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test8 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: 'smeg' + salt: #(100 43 153 171 68 251 75 31) + iterations: 1 + size: 24) hex. + self assert: key = 'f3a95fec48d7711e985cfe67908c5ab79fa3d7c5caa5d966' + +] + +{ #category : #testing } +CryptoPKCS12Test >> test9 [ + + | key | + key := (Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: 'queeg' + salt: #(5 222 201 89 172 255 114 247) + iterations: 1000 + size: 24) hex. + self assert: key = 'ed2034e36328830ff09df1e1a07dd357185dac0d4f9eb3d4' + +] diff --git a/source/PKCS12-Tests/package.st b/source/PKCS12-Tests/package.st new file mode 100644 index 0000000..8defd0b --- /dev/null +++ b/source/PKCS12-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'PKCS12-Tests' } diff --git a/source/PKCS12.package/.filetree b/source/PKCS12.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/PKCS12.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CRLBag.class/README.md b/source/PKCS12.package/Pkcs12CRLBag.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlId..st b/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlId..st deleted file mode 100644 index 6ce131b..0000000 --- a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlId..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -crlId: anObject - "Set the value of crlId" - - crlId := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlId.st b/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlId.st deleted file mode 100644 index 834191a..0000000 --- a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlId.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -crlId - "Answer the value of crlId" - - ^ crlId \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlValue..st b/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlValue..st deleted file mode 100644 index 2ce322f..0000000 --- a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -crlValue: anObject - "Set the value of crlValue" - - crlValue := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlValue.st b/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlValue.st deleted file mode 100644 index e839b50..0000000 --- a/source/PKCS12.package/Pkcs12CRLBag.class/instance/crlValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -crlValue - "Answer the value of crlValue" - - ^ crlValue \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CRLBag.class/properties.json b/source/PKCS12.package/Pkcs12CRLBag.class/properties.json deleted file mode 100644 index 6a92f3b..0000000 --- a/source/PKCS12.package/Pkcs12CRLBag.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "crlId", - "crlValue" - ], - "name" : "Pkcs12CRLBag", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CertBag.class/README.md b/source/PKCS12.package/Pkcs12CertBag.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12CertBag.class/instance/certId..st b/source/PKCS12.package/Pkcs12CertBag.class/instance/certId..st deleted file mode 100644 index 2dec674..0000000 --- a/source/PKCS12.package/Pkcs12CertBag.class/instance/certId..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certId: anObject - "Set the value of certId" - - certId := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CertBag.class/instance/certId.st b/source/PKCS12.package/Pkcs12CertBag.class/instance/certId.st deleted file mode 100644 index 4190c53..0000000 --- a/source/PKCS12.package/Pkcs12CertBag.class/instance/certId.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certId - "Answer the value of certId" - - ^ certId \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CertBag.class/instance/certValue..st b/source/PKCS12.package/Pkcs12CertBag.class/instance/certValue..st deleted file mode 100644 index f0f6601..0000000 --- a/source/PKCS12.package/Pkcs12CertBag.class/instance/certValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certValue: anObject - "Set the value of certValue" - - certValue := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CertBag.class/instance/certValue.st b/source/PKCS12.package/Pkcs12CertBag.class/instance/certValue.st deleted file mode 100644 index a67e757..0000000 --- a/source/PKCS12.package/Pkcs12CertBag.class/instance/certValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certValue - "Answer the value of certValue" - - ^ certValue \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12CertBag.class/properties.json b/source/PKCS12.package/Pkcs12CertBag.class/properties.json deleted file mode 100644 index b697e2b..0000000 --- a/source/PKCS12.package/Pkcs12CertBag.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "certId", - "certValue" - ], - "name" : "Pkcs12CertBag", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/README.md b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/copyResult.toBufferOfSize..st b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/copyResult.toBufferOfSize..st deleted file mode 100644 index b7bcedf..0000000 --- a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/copyResult.toBufferOfSize..st +++ /dev/null @@ -1,7 +0,0 @@ -private -copyResult: result toBufferOfSize: bufferSize - - | buffer | - buffer := ByteArray new: bufferSize. - 0 to: bufferSize-1 do: [:i | buffer at: i + 1 put: (result at: (i \\ result size + 1))]. - ^ buffer diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/derivedKeyWithId.fromDoubleBytePassword.salt.iterations.size..st b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/derivedKeyWithId.fromDoubleBytePassword.salt.iterations.size..st deleted file mode 100644 index c477ba2..0000000 --- a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/derivedKeyWithId.fromDoubleBytePassword.salt.iterations.size..st +++ /dev/null @@ -1,28 +0,0 @@ -as yet unclassified -derivedKeyWithId: id fromDoubleBytePassword: passIn salt: saltIn iterations: iterate size: size - - | password salt diversifier initial final digest v u pLen sLen c k buffer ij | - v := 64. - u := 20. - diversifier := ByteArray new: v withAll: id. - pLen := v * (passIn size + v - 1 // v). - sLen := v * (saltIn size + v - 1 // v). - k := (passIn size + v - 1 // v) + (saltIn size + v - 1 // v). - - password := self passwordBufferFromPassword: passIn length: pLen. - salt := self saltBufferFromSalt: saltIn length: sLen. - initial := salt, password. - c := size + u - 1 // u. - final := ByteArray new. - 1 to: c do: [:idx | - digest := diversifier, initial. - iterate timesRepeat: [digest := SHA1 hashMessage: digest]. - final := final, digest. - buffer := self copyResult: digest toBufferOfSize: v. - 0 to: k - 1 do: [:j | - ij := initial copyFrom: v*j + 1 to: v*(j+1). - ij := (ij asInteger + buffer asInteger + 1) asByteArray. - ij size > v ifTrue: [ij := ij copyFrom: 2 to: v+1]. - ij size < v ifTrue: [ij := ij, (ByteArray new: v - ij size withAll: 0)]. - initial replaceFrom: v*j + 1 to: v*(j+1) with: ij]]. - ^ final copyFrom: 1 to: size. \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/derivedKeyWithId.fromPassword.salt.iterations.size..st b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/derivedKeyWithId.fromPassword.salt.iterations.size..st deleted file mode 100644 index 9d7eb9b..0000000 --- a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/derivedKeyWithId.fromPassword.salt.iterations.size..st +++ /dev/null @@ -1,14 +0,0 @@ -as yet unclassified -derivedKeyWithId: id fromPassword: passIn salt: saltIn iterations: iterate size: size - - | stream password | - stream := WriteStream on: ByteArray new. - passIn do: [:e | stream nextPut: 0; nextPut: e asciiValue]. - password := stream nextPut: 0; nextPut: 0; contents. - - ^ self - derivedKeyWithId: id - fromDoubleBytePassword: password - salt: saltIn - iterations: iterate - size: size \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/passwordBufferFromPassword.length..st b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/passwordBufferFromPassword.length..st deleted file mode 100644 index 8031c04..0000000 --- a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/passwordBufferFromPassword.length..st +++ /dev/null @@ -1,7 +0,0 @@ -private -passwordBufferFromPassword: pass length: pLen - - | password | - password := ByteArray new: pLen. - 0 to: pLen-1 do: [:i | password at: i + 1 put: (pass at: (i \\ pass size + 1))]. - ^ password \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/saltBufferFromSalt.length..st b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/saltBufferFromSalt.length..st deleted file mode 100644 index 9abaf01..0000000 --- a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/instance/saltBufferFromSalt.length..st +++ /dev/null @@ -1,7 +0,0 @@ -private -saltBufferFromSalt: saltIn length: sLen - - | salt | - salt := ByteArray new: sLen. - 0 to: sLen-1 do: [:i | salt at: i + 1 put: (saltIn at: (i \\ saltIn size + 1))]. - ^ salt diff --git a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/properties.json b/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/properties.json deleted file mode 100644 index fce1a0d..0000000 --- a/source/PKCS12.package/Pkcs12KeyDerivationFunction.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "Pkcs12KeyDerivationFunction", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/README.md b/source/PKCS12.package/Pkcs12MacData.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12MacData.class/instance/iterations..st b/source/PKCS12.package/Pkcs12MacData.class/instance/iterations..st deleted file mode 100644 index 64da139..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/instance/iterations..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -iterations: anObject - "Set the value of iterations" - - iterations := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/instance/iterations.st b/source/PKCS12.package/Pkcs12MacData.class/instance/iterations.st deleted file mode 100644 index be2742c..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/instance/iterations.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -iterations - "Answer the value of iterations" - - ^ iterations \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/instance/mac..st b/source/PKCS12.package/Pkcs12MacData.class/instance/mac..st deleted file mode 100644 index 350ab13..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/instance/mac..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mac: anObject - "Set the value of mac" - - mac := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/instance/mac.st b/source/PKCS12.package/Pkcs12MacData.class/instance/mac.st deleted file mode 100644 index 7e82e0b..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/instance/mac.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -mac - "Answer the value of mac" - - ^ mac \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/instance/macSalt..st b/source/PKCS12.package/Pkcs12MacData.class/instance/macSalt..st deleted file mode 100644 index a85f9a5..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/instance/macSalt..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -macSalt: anObject - "Set the value of macSalt" - - macSalt := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/instance/macSalt.st b/source/PKCS12.package/Pkcs12MacData.class/instance/macSalt.st deleted file mode 100644 index 316e1a2..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/instance/macSalt.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -macSalt - "Answer the value of macSalt" - - ^ macSalt \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12MacData.class/properties.json b/source/PKCS12.package/Pkcs12MacData.class/properties.json deleted file mode 100644 index c2d67a4..0000000 --- a/source/PKCS12.package/Pkcs12MacData.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "mac", - "macSalt", - "iterations" - ], - "name" : "Pkcs12MacData", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PFX.class/README.md b/source/PKCS12.package/Pkcs12PFX.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12PFX.class/class/initialize.st b/source/PKCS12.package/Pkcs12PFX.class/class/initialize.st deleted file mode 100644 index 9bc489a..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/class/initialize.st +++ /dev/null @@ -1,8 +0,0 @@ -class initialization -initialize - - X509Certificate initialize. - X509CertificateExtension initialize. - self initializeASN1Types. - - diff --git a/source/PKCS12.package/Pkcs12PFX.class/class/initializeASN1Types.st b/source/PKCS12.package/Pkcs12PFX.class/class/initializeASN1Types.st deleted file mode 100644 index f151330..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/class/initializeASN1Types.st +++ /dev/null @@ -1,95 +0,0 @@ -class initialization -initializeASN1Types - - | module | - module := ASN1Module name: #pkcs. - module addImport: (ASN1Module name: #x509). - - (module sequence: #PFX mapping: Pkcs12PFX) - add: #version type: #ASN1IntegerType; - add: #authSafe type: #ContentInfo; - addOptional: #macData type: #MacData; - yourself. - - (module sequence: #ContentInfo mapping: PkcsContentInfo) - add: #contentType type: #ContentType; - add: #content type: #ContentInfoContents explicitTag: 0; - yourself. - module objectIdentifier: #ContentType. - (module any: #ContentInfoContents definedBy: #contentType) - at: (ASN1ObjectId fromString: '1.2.840.113549.1.7.1') put: #ASN1ByteArrayType; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.7.6') put: #EncryptedData; - yourself. - (module sequence: #EncryptedData mapping: PkcsEncryptedData) - add: #version type: #ASN1IntegerType; - add: #encryptedContentInfo type: #EncryptedContentInfo; - yourself. - (module sequence: #EncryptedContentInfo mapping: PkcsEncryptedContentInfo) - add: #contentType type: #ContentType; - add: #contentEncryptionAlgorithm type: #AlgorithmIdentifier; - addOptional: #encryptedContent type: #EncryptedContent implicitTag: 0; - yourself. - module byteArray: #EncryptedContent. - - (module sequence: #MacData mapping: Pkcs12MacData) - add: #mac type: #DigestInfo; - add: #macSalt type: #ASN1ByteArrayType; - add: #iterations type: #ASN1IntegerType default: 1; - yourself. - (module sequence: #DigestInfo mapping: PkcsDigestInfo) - add: #digestAlgorithm type: #AlgorithmIdentifier; - add: #digest type: #Digest; - yourself. - module byteArray: #Digest. - module sequence: #AuthenticatedSafe of: #ContentInfo. - module sequence: #SafeContents of: #SafeBag. - (module sequence: #SafeBag mapping: Pkcs12SafeBag) - add: #bagId type: #ASN1ObjectIdentifierType; - add: #bagValue type: #BagTypeChoice explicitTag: 0; - add: #bagAttributes type: #BagAttributes; - yourself. - module set: #BagAttributes of: #ASN1SequenceType. - (module any: #BagTypeChoice definedBy: #bagId) - at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.1') put: #KeyBag; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.2') put: #ShroudedKeyBag; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.3') put: #CertBag; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.4') put: #CRLBag; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.5') put: #SecretBag; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.6') put: #SafeContents; - yourself. - module assign: #KeyBag from: #PrivateKeyInfo. - module assign: #ShroudedKeyBag from: #EncryptedPrivateKeyInfo. - (module sequence: #PrivateKeyInfo mapping: Pkcs8PrivateKeyInfo) - add: #version type: #ASN1IntegerType; - add: #privateKeyAlgorithm type: #AlgorithmIdentifier; - add: #privateKey type: #ASN1ByteArrayType; - addOptional: #attributes type: #PrivateKeyInfoAttributes implicitTag: 0; - yourself. - module set: #PrivateKeyInfoAttributes of: #ASN1SequenceType. - (module sequence: #EncryptedPrivateKeyInfo mapping: Pkcs8EncryptedPrivateKeyInfo) - add: #encryptionAlgorithm type: #AlgorithmIdentifier; - add: #encryptedData type: #ASN1ByteArrayType; - yourself. - (module sequence: #CertBag mapping: Pkcs12CertBag) - add: #certId type: #ASN1ObjectIdentifierType; - add: #certValue type: #CertBagTypeChoice explicitTag: 0; - yourself. - (module any: #CertBagTypeChoice definedBy: #certId) - at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.22.1') put: #ASN1ByteArrayType; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.22.2') put: #ASN1IA5StringType; - yourself. - (module sequence: #CRLBag mapping: Pkcs12CRLBag) - add: #crlId type: #ASN1ObjectIdentifierType; - add: #crlValue type: #CRLBagTypeChoice explicitTag: 0; - yourself. - (module choice: #CRLBagTypeChoice) - add: (ASN1ObjectId fromString: '1.2.840.113549.1.9.22.1') type: #ASN1ByteArrayType; - yourself. - (module sequence: #SecretBag mapping: Pkcs12SecretBag) - add: #secretId type: #ASN1ObjectIdentifierType; - add: #secretValue type: #SecretBagTypeChoice explicitTag: 0; - yourself. - (module choice: #SecretBagTypeChoice) - yourself. - - diff --git a/source/PKCS12.package/Pkcs12PFX.class/instance/authSafe..st b/source/PKCS12.package/Pkcs12PFX.class/instance/authSafe..st deleted file mode 100644 index d9d3b32..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/instance/authSafe..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -authSafe: anObject - "Set the value of authSafe" - - authSafe := anObject. diff --git a/source/PKCS12.package/Pkcs12PFX.class/instance/authSafe.st b/source/PKCS12.package/Pkcs12PFX.class/instance/authSafe.st deleted file mode 100644 index 794431c..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/instance/authSafe.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -authSafe - "Answer the value of authSafe" - - ^ authSafe \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PFX.class/instance/macData..st b/source/PKCS12.package/Pkcs12PFX.class/instance/macData..st deleted file mode 100644 index 5d3863f..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/instance/macData..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -macData: anObject - "Set the value of macData" - - macData := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PFX.class/instance/macData.st b/source/PKCS12.package/Pkcs12PFX.class/instance/macData.st deleted file mode 100644 index b3f3c6b..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/instance/macData.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -macData - "Answer the value of macData" - - ^ macData \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PFX.class/instance/version..st b/source/PKCS12.package/Pkcs12PFX.class/instance/version..st deleted file mode 100644 index 26b1d28..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/instance/version..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version: anObject - "Set the value of version" - - version := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PFX.class/instance/version.st b/source/PKCS12.package/Pkcs12PFX.class/instance/version.st deleted file mode 100644 index 0d6003d..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/instance/version.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version - "Answer the value of version" - - ^ version \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PFX.class/properties.json b/source/PKCS12.package/Pkcs12PFX.class/properties.json deleted file mode 100644 index aef471f..0000000 --- a/source/PKCS12.package/Pkcs12PFX.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "version", - "authSafe", - "macData" - ], - "name" : "Pkcs12PFX", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/README.md b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/class/fromFile..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/class/fromFile..st deleted file mode 100644 index 3bc4e97..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/class/fromFile..st +++ /dev/null @@ -1,7 +0,0 @@ -as yet unclassified -fromFile: filename - "(Pkcs12PrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/usarhiocertpks12.pfx')" - - | password | - password := FillInTheBlank requestPassword: 'Enter your password'. - ^ self fromFile: filename password: password. diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/class/fromFile.password..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/class/fromFile.password..st deleted file mode 100644 index 145f2d4..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/class/fromFile.password..st +++ /dev/null @@ -1,10 +0,0 @@ -as yet unclassified -fromFile: filename password: aPassword - "(Pkcs12PrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/usarhiocertpks12.pfx')" - - | fs data | - fs := StandardFileStream fileNamed: filename. - data := fs contentsOfEntireFile. - ^ self new - password: aPassword; - initializeFromFileContents: data. diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/asCertificate.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/asCertificate.st deleted file mode 100644 index 828c368..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/asCertificate.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asCertificate - - self certs isEmpty ifTrue: [^ nil]. - ^ self certs first diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/asPrivateKey.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/asPrivateKey.st deleted file mode 100644 index 9b79a8d..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/asPrivateKey.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -asPrivateKey - - self privateKeys isEmpty ifTrue: [^ nil]. - ^ self privateKeys first \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/certs..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/certs..st deleted file mode 100644 index 348bfc1..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/certs..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certs: anObject - "Set the value of certs" - - certs := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/certs.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/certs.st deleted file mode 100644 index 9fdb35b..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/certs.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -certs - "Answer the value of certs" - - certs isNil ifTrue: [self certs: OrderedCollection new]. - ^ certs \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/decodeContentInfo..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/decodeContentInfo..st deleted file mode 100644 index 3af95ee..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/decodeContentInfo..st +++ /dev/null @@ -1,17 +0,0 @@ -initialize-release -decodeContentInfo: contentInfo - - | safeContents | - contentInfo contentType oid = '1.2.840.113549.1.7.1' - ifTrue: [ - safeContents := ASN1Stream - decodeBytes: contentInfo content - withType: ((ASN1Module name: #pkcs) find: #SafeContents). - safeContents do: [:eachSafeBag | self decodeSafeBag: eachSafeBag]. - ^ self]. - contentInfo contentType oid = '1.2.840.113549.1.7.6' - ifTrue: [ - safeContents := contentInfo content decryptWithPassword: self password. - safeContents do: [:eachSafeBag | self decodeSafeBag: eachSafeBag]. - ^ self]. - self error: 'unknown content info: ', contentInfo contentType oid. diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/decodeSafeBag..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/decodeSafeBag..st deleted file mode 100644 index 107a1e6..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/decodeSafeBag..st +++ /dev/null @@ -1,26 +0,0 @@ -initialize-release -decodeSafeBag: safeBag - - | asn1 key keyBag cert | - safeBag bagId oid = '1.2.840.113549.1.12.10.1.1' - ifTrue: [ - asn1 := ASN1Stream decodeBytes: safeBag bagValue. - (asn1 at: 1) > 0 - ifTrue: [key := RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 1)] - ifFalse: [key := RSAPrivateKey p: (asn1 at: 5) q: (asn1 at: 6) dP: (asn1 at: 7) dQ: (asn1 at: 8) qInv: (asn1 at: 9)]. - self privateKeys add: key. - ^ self]. - safeBag bagId oid = '1.2.840.113549.1.12.10.1.2' - ifTrue: [ - keyBag := safeBag bagValue decryptWithPassword: self password. - key := keyBag asPrivateKey. - self privateKeys add: key. - ^ self]. - safeBag bagId oid = '1.2.840.113549.1.12.10.1.3' - ifTrue: [ - cert := ASN1Stream - decodeBytes: safeBag bagValue certValue - withType: ((ASN1Module name: #x509) find: #Certificate). - self certs add: cert. - ^ self]. - self error: 'unknown safe bag: ', safeBag bagId oid. diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/initializeFromFileContents..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/initializeFromFileContents..st deleted file mode 100644 index 3eeb55b..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/initializeFromFileContents..st +++ /dev/null @@ -1,13 +0,0 @@ -initialize-release -initializeFromFileContents: data - - | authSafe | - self pfx: (ASN1Stream - decodeBytes: data asByteArray - withType: ((ASN1Module name: #pkcs) find: #PFX)). - self validatePFXMAC. - authSafe := ASN1Stream - decodeBytes: self pfx authSafe content - withType: ((ASN1Module name: #pkcs) find: #AuthenticatedSafe). - authSafe do: [:eachContentInfo | self decodeContentInfo: eachContentInfo]. - self password: nil. \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/password..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/password..st deleted file mode 100644 index 432aa09..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/password..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -password: anObject - "Set the value of password" - - password := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/password.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/password.st deleted file mode 100644 index 03b8c53..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/password.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -password - "Answer the value of password" - - ^ password \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/pfx..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/pfx..st deleted file mode 100644 index 3ec7e68..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/pfx..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -pfx: anObject - "Set the value of pfx" - - pfx := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/pfx.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/pfx.st deleted file mode 100644 index f93b0ca..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/pfx.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -pfx - "Answer the value of pfx" - - ^ pfx \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/privateKeys..st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/privateKeys..st deleted file mode 100644 index b66fe3f..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/privateKeys..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -privateKeys: anObject - "Set the value of privateKeys" - - privateKeys := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/privateKeys.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/privateKeys.st deleted file mode 100644 index b460766..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/privateKeys.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -privateKeys - "Answer the value of privateKeys" - - privateKeys isNil ifTrue: [self privateKeys: OrderedCollection new]. - ^ privateKeys \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/validatePFXMAC.st b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/validatePFXMAC.st deleted file mode 100644 index 2048434..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/instance/validatePFXMAC.st +++ /dev/null @@ -1,20 +0,0 @@ -initialize-release -validatePFXMAC - - | data salt iterations macValue calculatedMacValue hashMaterial hmac | - data := self pfx authSafe content. - salt := self pfx macData macSalt. - iterations := self pfx macData iterations. - macValue := self pfx macData mac digest. - hashMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 3 - fromPassword: self password - salt: salt - iterations: iterations - size: 20. - hmac := SHA1 new hmac. - hmac key: hashMaterial. - calculatedMacValue := hmac digestMessage: data. - calculatedMacValue = macValue - ifFalse: [self error: 'invalid MAC']. - \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/properties.json b/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/properties.json deleted file mode 100644 index 84b1e09..0000000 --- a/source/PKCS12.package/Pkcs12PrivateKeyFileReader.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "pfx", - "privateKeys", - "certs", - "password" - ], - "name" : "Pkcs12PrivateKeyFileReader", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/README.md b/source/PKCS12.package/Pkcs12SafeBag.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagAttributes..st b/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagAttributes..st deleted file mode 100644 index 74ff857..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagAttributes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bagAttributes: anObject - "Set the value of bagAttributes" - - bagAttributes := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagAttributes.st b/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagAttributes.st deleted file mode 100644 index 1514aa6..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagAttributes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bagAttributes - "Answer the value of bagAttributes" - - ^ bagAttributes \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagId..st b/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagId..st deleted file mode 100644 index 749caf3..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagId..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bagId: anObject - "Set the value of bagId" - - bagId := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagId.st b/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagId.st deleted file mode 100644 index 0bf0f46..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagId.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bagId - "Answer the value of bagId" - - ^ bagId \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagValue..st b/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagValue..st deleted file mode 100644 index 2505c2d..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bagValue: anObject - "Set the value of bagValue" - - bagValue := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagValue.st b/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagValue.st deleted file mode 100644 index 48c2ffc..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/instance/bagValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -bagValue - "Answer the value of bagValue" - - ^ bagValue \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SafeBag.class/properties.json b/source/PKCS12.package/Pkcs12SafeBag.class/properties.json deleted file mode 100644 index 3fd93f3..0000000 --- a/source/PKCS12.package/Pkcs12SafeBag.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "bagId", - "bagValue", - "bagAttributes" - ], - "name" : "Pkcs12SafeBag", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SecretBag.class/README.md b/source/PKCS12.package/Pkcs12SecretBag.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretId..st b/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretId..st deleted file mode 100644 index d942c46..0000000 --- a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretId..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -secretId: anObject - "Set the value of secretId" - - secretId := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretId.st b/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretId.st deleted file mode 100644 index 8077e1e..0000000 --- a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretId.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -secretId - "Answer the value of secretId" - - ^ secretId \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretValue..st b/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretValue..st deleted file mode 100644 index 9f50b44..0000000 --- a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -secretValue: anObject - "Set the value of secretValue" - - secretValue := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretValue.st b/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretValue.st deleted file mode 100644 index 73db2ae..0000000 --- a/source/PKCS12.package/Pkcs12SecretBag.class/instance/secretValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -secretValue - "Answer the value of secretValue" - - ^ secretValue \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs12SecretBag.class/properties.json b/source/PKCS12.package/Pkcs12SecretBag.class/properties.json deleted file mode 100644 index 020151d..0000000 --- a/source/PKCS12.package/Pkcs12SecretBag.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "secretId", - "secretValue" - ], - "name" : "Pkcs12SecretBag", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/README.md b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/cipherWithPassword..st b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/cipherWithPassword..st deleted file mode 100644 index 0bfcb58..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/cipherWithPassword..st +++ /dev/null @@ -1,79 +0,0 @@ -api -cipherWithPassword: password - - | salt iterations keyMaterial ivMaterial cipher | - salt := self encryptionAlgorithm parameters first. - iterations := self encryptionAlgorithm parameters last. - - self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.1' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 16. - cipher := ARC4 new key: keyMaterial. - ^ cipher]. - self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.2' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 5. - cipher := ARC4 new key: keyMaterial. - ^ cipher]. - self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.3' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 24. - ivMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: password - salt: salt - iterations: iterations - size: 8. - cipher := TripleDES new key: keyMaterial. - cipher := cipher cbc initialVector: ivMaterial. - ^ cipher]. - self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.5' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 16. - ivMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: password - salt: salt - iterations: iterations - size: 8. - cipher := ARC2 key: keyMaterial effectiveKeyLength: 128. - cipher := cipher cbc initialVector: ivMaterial. - ^ cipher]. - self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.6' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 5. - ivMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: password - salt: salt - iterations: iterations - size: 8. - cipher := ARC2 key: keyMaterial effectiveKeyLength: 40. - cipher := cipher cbc initialVector: ivMaterial. - ^ cipher]. - ^ nil \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/decryptWithPassword..st b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/decryptWithPassword..st deleted file mode 100644 index ded93ca..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/decryptWithPassword..st +++ /dev/null @@ -1,9 +0,0 @@ -api -decryptWithPassword: password - - | cipher asn1 | - cipher := self cipherWithPassword: password. - asn1 := cipher decrypt: self encryptedData. - ^ ASN1Stream - decodeBytes: asn1 - withType: ((ASN1Module name: #pkcs) find: #KeyBag) \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptedData..st b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptedData..st deleted file mode 100644 index e85e82c..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptedData..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptedData: anObject - "Set the value of encryptedData" - - encryptedData := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptedData.st b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptedData.st deleted file mode 100644 index 5b90859..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptedData.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptedData - "Answer the value of encryptedData" - - ^ encryptedData \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptionAlgorithm..st b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptionAlgorithm..st deleted file mode 100644 index 1afb5db..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptionAlgorithm..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptionAlgorithm: anObject - "Set the value of encryptionAlgorithm" - - encryptionAlgorithm := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptionAlgorithm.st b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptionAlgorithm.st deleted file mode 100644 index 478ea93..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/instance/encryptionAlgorithm.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptionAlgorithm - "Answer the value of encryptionAlgorithm" - - ^ encryptionAlgorithm \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/properties.json b/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/properties.json deleted file mode 100644 index 17ebd1a..0000000 --- a/source/PKCS12.package/Pkcs8EncryptedPrivateKeyInfo.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "encryptionAlgorithm", - "encryptedData" - ], - "name" : "Pkcs8EncryptedPrivateKeyInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/README.md b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/asPrivateKey.st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/asPrivateKey.st deleted file mode 100644 index 0e5f7de..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/asPrivateKey.st +++ /dev/null @@ -1,13 +0,0 @@ -api -asPrivateKey - - | asn1 | - asn1 := ASN1Stream decodeBytes: self privateKey. - (asn1 at: 1) > 0 - ifTrue: [^ RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 1)] - ifFalse: [^ RSAPrivateKey - p: (asn1 at: 5) - q: (asn1 at: 6) - dP: (asn1 at: 7) - dQ: (asn1 at: 8) - qInv: (asn1 at: 9)] \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/attributes..st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/attributes..st deleted file mode 100644 index 26322ed..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/attributes..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -attributes: anObject - "Set the value of attributes" - - attributes := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/attributes.st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/attributes.st deleted file mode 100644 index 269a017..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/attributes.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -attributes - "Answer the value of attributes" - - ^ attributes \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKey..st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKey..st deleted file mode 100644 index 6c98fa7..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKey..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -privateKey: anObject - "Set the value of privateKey" - - privateKey := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKey.st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKey.st deleted file mode 100644 index 7442954..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKey.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -privateKey - "Answer the value of privateKey" - - ^ privateKey \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKeyAlgorithm..st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKeyAlgorithm..st deleted file mode 100644 index 490fc98..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKeyAlgorithm..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -privateKeyAlgorithm: anObject - "Set the value of privateKeyAlgorithm" - - privateKeyAlgorithm := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKeyAlgorithm.st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKeyAlgorithm.st deleted file mode 100644 index 5fac850..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/privateKeyAlgorithm.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -privateKeyAlgorithm - "Answer the value of privateKeyAlgorithm" - - ^ privateKeyAlgorithm \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/version..st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/version..st deleted file mode 100644 index 26b1d28..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/version..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version: anObject - "Set the value of version" - - version := anObject \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/version.st b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/version.st deleted file mode 100644 index 0d6003d..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/instance/version.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version - "Answer the value of version" - - ^ version \ No newline at end of file diff --git a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/properties.json b/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/properties.json deleted file mode 100644 index 018f650..0000000 --- a/source/PKCS12.package/Pkcs8PrivateKeyInfo.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "version", - "privateKeyAlgorithm", - "privateKey", - "attributes" - ], - "name" : "Pkcs8PrivateKeyInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/PkcsContentInfo.class/README.md b/source/PKCS12.package/PkcsContentInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/PkcsContentInfo.class/instance/content..st b/source/PKCS12.package/PkcsContentInfo.class/instance/content..st deleted file mode 100644 index d8d4a81..0000000 --- a/source/PKCS12.package/PkcsContentInfo.class/instance/content..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -content: anObject - "Set the value of content" - - content := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsContentInfo.class/instance/content.st b/source/PKCS12.package/PkcsContentInfo.class/instance/content.st deleted file mode 100644 index 9eba9ac..0000000 --- a/source/PKCS12.package/PkcsContentInfo.class/instance/content.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -content - "Answer the value of content" - - ^ content \ No newline at end of file diff --git a/source/PKCS12.package/PkcsContentInfo.class/instance/contentType..st b/source/PKCS12.package/PkcsContentInfo.class/instance/contentType..st deleted file mode 100644 index c4e7a4a..0000000 --- a/source/PKCS12.package/PkcsContentInfo.class/instance/contentType..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -contentType: anObject - "Set the value of contentType" - - contentType := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsContentInfo.class/instance/contentType.st b/source/PKCS12.package/PkcsContentInfo.class/instance/contentType.st deleted file mode 100644 index 3f04194..0000000 --- a/source/PKCS12.package/PkcsContentInfo.class/instance/contentType.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -contentType - "Answer the value of contentType" - - ^ contentType \ No newline at end of file diff --git a/source/PKCS12.package/PkcsContentInfo.class/properties.json b/source/PKCS12.package/PkcsContentInfo.class/properties.json deleted file mode 100644 index 4a29203..0000000 --- a/source/PKCS12.package/PkcsContentInfo.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "contentType", - "content" - ], - "name" : "PkcsContentInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/PkcsDigestInfo.class/README.md b/source/PKCS12.package/PkcsDigestInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/PkcsDigestInfo.class/instance/digest..st b/source/PKCS12.package/PkcsDigestInfo.class/instance/digest..st deleted file mode 100644 index 50bbc8a..0000000 --- a/source/PKCS12.package/PkcsDigestInfo.class/instance/digest..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -digest: anObject - "Set the value of digest" - - digest := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsDigestInfo.class/instance/digest.st b/source/PKCS12.package/PkcsDigestInfo.class/instance/digest.st deleted file mode 100644 index 8b13f6b..0000000 --- a/source/PKCS12.package/PkcsDigestInfo.class/instance/digest.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -digest - "Answer the value of digest" - - ^ digest \ No newline at end of file diff --git a/source/PKCS12.package/PkcsDigestInfo.class/instance/digestAlgorithm..st b/source/PKCS12.package/PkcsDigestInfo.class/instance/digestAlgorithm..st deleted file mode 100644 index a74a893..0000000 --- a/source/PKCS12.package/PkcsDigestInfo.class/instance/digestAlgorithm..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -digestAlgorithm: anObject - "Set the value of digestAlgorithm" - - digestAlgorithm := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsDigestInfo.class/instance/digestAlgorithm.st b/source/PKCS12.package/PkcsDigestInfo.class/instance/digestAlgorithm.st deleted file mode 100644 index fe157af..0000000 --- a/source/PKCS12.package/PkcsDigestInfo.class/instance/digestAlgorithm.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -digestAlgorithm - "Answer the value of digestAlgorithm" - - ^ digestAlgorithm \ No newline at end of file diff --git a/source/PKCS12.package/PkcsDigestInfo.class/properties.json b/source/PKCS12.package/PkcsDigestInfo.class/properties.json deleted file mode 100644 index 27e5ef4..0000000 --- a/source/PKCS12.package/PkcsDigestInfo.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "digestAlgorithm", - "digest" - ], - "name" : "PkcsDigestInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/README.md b/source/PKCS12.package/PkcsEncryptedContentInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/cipherWithPassword..st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/cipherWithPassword..st deleted file mode 100644 index 050f85f..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/cipherWithPassword..st +++ /dev/null @@ -1,79 +0,0 @@ -api -cipherWithPassword: password - - | salt iterations keyMaterial ivMaterial cipher | - salt := self contentEncryptionAlgorithm parameters first. - iterations := self contentEncryptionAlgorithm parameters last. - - self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.1' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 16. - cipher := ARC4 new key: keyMaterial. - ^ cipher]. - self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.2' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 5. - cipher := ARC4 new key: keyMaterial. - ^ cipher]. - self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.3' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 24. - ivMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: password - salt: salt - iterations: iterations - size: 8. - cipher := TripleDES new key: keyMaterial. - cipher := cipher cbc initialVector: ivMaterial. - ^ cipher]. - self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.5' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 16. - ivMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: password - salt: salt - iterations: iterations - size: 8. - cipher := ARC2 key: keyMaterial effectiveKeyLength: 128. - cipher := cipher cbc initialVector: ivMaterial. - ^ cipher]. - self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.6' - ifTrue: [ - keyMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 1 - fromPassword: password - salt: salt - iterations: iterations - size: 5. - ivMaterial := Pkcs12KeyDerivationFunction new - derivedKeyWithId: 2 - fromPassword: password - salt: salt - iterations: iterations - size: 8. - cipher := ARC2 key: keyMaterial effectiveKeyLength: 40. - cipher := cipher cbc initialVector: ivMaterial. - ^ cipher]. - ^ nil \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentEncryptionAlgorithm..st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentEncryptionAlgorithm..st deleted file mode 100644 index 36e0720..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentEncryptionAlgorithm..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -contentEncryptionAlgorithm: anObject - "Set the value of contentEncryptionAlgorithm" - - contentEncryptionAlgorithm := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentEncryptionAlgorithm.st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentEncryptionAlgorithm.st deleted file mode 100644 index 59817e3..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentEncryptionAlgorithm.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -contentEncryptionAlgorithm - "Answer the value of contentEncryptionAlgorithm" - - ^ contentEncryptionAlgorithm \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentType..st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentType..st deleted file mode 100644 index c4e7a4a..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentType..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -contentType: anObject - "Set the value of contentType" - - contentType := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentType.st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentType.st deleted file mode 100644 index 3f04194..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/contentType.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -contentType - "Answer the value of contentType" - - ^ contentType \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/decryptWithPassword..st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/decryptWithPassword..st deleted file mode 100644 index 00b9347..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/decryptWithPassword..st +++ /dev/null @@ -1,9 +0,0 @@ -api -decryptWithPassword: password - - | cipher asn1 | - cipher := self cipherWithPassword: password. - asn1 := cipher decrypt: self encryptedContent. - ^ ASN1Stream - decodeBytes: asn1 - withType: ((ASN1Module name: #pkcs) find: #SafeContents). diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/encryptedContent..st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/encryptedContent..st deleted file mode 100644 index 2bb5d27..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/encryptedContent..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptedContent: anObject - "Set the value of encryptedContent" - - encryptedContent := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/encryptedContent.st b/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/encryptedContent.st deleted file mode 100644 index fb16f6f..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/instance/encryptedContent.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptedContent - "Answer the value of encryptedContent" - - ^ encryptedContent \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedContentInfo.class/properties.json b/source/PKCS12.package/PkcsEncryptedContentInfo.class/properties.json deleted file mode 100644 index 5c8f3f6..0000000 --- a/source/PKCS12.package/PkcsEncryptedContentInfo.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "contentType", - "contentEncryptionAlgorithm", - "encryptedContent" - ], - "name" : "PkcsEncryptedContentInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedData.class/README.md b/source/PKCS12.package/PkcsEncryptedData.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/PkcsEncryptedData.class/instance/decryptWithPassword..st b/source/PKCS12.package/PkcsEncryptedData.class/instance/decryptWithPassword..st deleted file mode 100644 index 533b055..0000000 --- a/source/PKCS12.package/PkcsEncryptedData.class/instance/decryptWithPassword..st +++ /dev/null @@ -1,4 +0,0 @@ -decrypting -decryptWithPassword: password - - ^ self encryptedContentInfo decryptWithPassword: password. diff --git a/source/PKCS12.package/PkcsEncryptedData.class/instance/encryptedContentInfo..st b/source/PKCS12.package/PkcsEncryptedData.class/instance/encryptedContentInfo..st deleted file mode 100644 index f7bba67..0000000 --- a/source/PKCS12.package/PkcsEncryptedData.class/instance/encryptedContentInfo..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptedContentInfo: anObject - "Set the value of encryptedContentInfo" - - encryptedContentInfo := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedData.class/instance/encryptedContentInfo.st b/source/PKCS12.package/PkcsEncryptedData.class/instance/encryptedContentInfo.st deleted file mode 100644 index 456958a..0000000 --- a/source/PKCS12.package/PkcsEncryptedData.class/instance/encryptedContentInfo.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -encryptedContentInfo - "Answer the value of encryptedContentInfo" - - ^ encryptedContentInfo \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedData.class/instance/version..st b/source/PKCS12.package/PkcsEncryptedData.class/instance/version..st deleted file mode 100644 index 26b1d28..0000000 --- a/source/PKCS12.package/PkcsEncryptedData.class/instance/version..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version: anObject - "Set the value of version" - - version := anObject \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedData.class/instance/version.st b/source/PKCS12.package/PkcsEncryptedData.class/instance/version.st deleted file mode 100644 index 0d6003d..0000000 --- a/source/PKCS12.package/PkcsEncryptedData.class/instance/version.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version - "Answer the value of version" - - ^ version \ No newline at end of file diff --git a/source/PKCS12.package/PkcsEncryptedData.class/properties.json b/source/PKCS12.package/PkcsEncryptedData.class/properties.json deleted file mode 100644 index 2d0a2ee..0000000 --- a/source/PKCS12.package/PkcsEncryptedData.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "PKCS12", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "version", - "encryptedContentInfo" - ], - "name" : "PkcsEncryptedData", - "type" : "normal" -} \ No newline at end of file diff --git a/source/PKCS12.package/monticello.meta/categories.st b/source/PKCS12.package/monticello.meta/categories.st deleted file mode 100644 index 5455f50..0000000 --- a/source/PKCS12.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #PKCS12! diff --git a/source/PKCS12.package/monticello.meta/initializers.st b/source/PKCS12.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/PKCS12.package/monticello.meta/package b/source/PKCS12.package/monticello.meta/package deleted file mode 100644 index 609ce6b..0000000 --- a/source/PKCS12.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'PKCS12') \ No newline at end of file diff --git a/source/PKCS12.package/properties.json b/source/PKCS12.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/PKCS12.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/PKCS12/Pkcs12CRLBag.class.st b/source/PKCS12/Pkcs12CRLBag.class.st new file mode 100644 index 0000000..c138fbd --- /dev/null +++ b/source/PKCS12/Pkcs12CRLBag.class.st @@ -0,0 +1,37 @@ +Class { + #name : #Pkcs12CRLBag, + #superclass : #Object, + #instVars : [ + 'crlId', + 'crlValue' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +Pkcs12CRLBag >> crlId [ + "Answer the value of crlId" + + ^ crlId +] + +{ #category : #accessing } +Pkcs12CRLBag >> crlId: anObject [ + "Set the value of crlId" + + crlId := anObject +] + +{ #category : #accessing } +Pkcs12CRLBag >> crlValue [ + "Answer the value of crlValue" + + ^ crlValue +] + +{ #category : #accessing } +Pkcs12CRLBag >> crlValue: anObject [ + "Set the value of crlValue" + + crlValue := anObject +] diff --git a/source/PKCS12/Pkcs12CertBag.class.st b/source/PKCS12/Pkcs12CertBag.class.st new file mode 100644 index 0000000..9ea62cc --- /dev/null +++ b/source/PKCS12/Pkcs12CertBag.class.st @@ -0,0 +1,37 @@ +Class { + #name : #Pkcs12CertBag, + #superclass : #Object, + #instVars : [ + 'certId', + 'certValue' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +Pkcs12CertBag >> certId [ + "Answer the value of certId" + + ^ certId +] + +{ #category : #accessing } +Pkcs12CertBag >> certId: anObject [ + "Set the value of certId" + + certId := anObject +] + +{ #category : #accessing } +Pkcs12CertBag >> certValue [ + "Answer the value of certValue" + + ^ certValue +] + +{ #category : #accessing } +Pkcs12CertBag >> certValue: anObject [ + "Set the value of certValue" + + certValue := anObject +] diff --git a/source/PKCS12/Pkcs12KeyDerivationFunction.class.st b/source/PKCS12/Pkcs12KeyDerivationFunction.class.st new file mode 100644 index 0000000..e147563 --- /dev/null +++ b/source/PKCS12/Pkcs12KeyDerivationFunction.class.st @@ -0,0 +1,80 @@ +Class { + #name : #Pkcs12KeyDerivationFunction, + #superclass : #Object, + #category : 'PKCS12' +} + +{ #category : #private } +Pkcs12KeyDerivationFunction >> copyResult: result toBufferOfSize: bufferSize [ + + | buffer | + buffer := ByteArray new: bufferSize. + 0 to: bufferSize-1 do: [:i | buffer at: i + 1 put: (result at: (i \\ result size + 1))]. + ^ buffer + +] + +{ #category : #'as yet unclassified' } +Pkcs12KeyDerivationFunction >> derivedKeyWithId: id fromDoubleBytePassword: passIn salt: saltIn iterations: iterate size: size [ + + | password salt diversifier initial final digest v u pLen sLen c k buffer ij | + v := 64. + u := 20. + diversifier := ByteArray new: v withAll: id. + pLen := v * (passIn size + v - 1 // v). + sLen := v * (saltIn size + v - 1 // v). + k := (passIn size + v - 1 // v) + (saltIn size + v - 1 // v). + + password := self passwordBufferFromPassword: passIn length: pLen. + salt := self saltBufferFromSalt: saltIn length: sLen. + initial := salt, password. + c := size + u - 1 // u. + final := ByteArray new. + 1 to: c do: [:idx | + digest := diversifier, initial. + iterate timesRepeat: [digest := SHA1 hashMessage: digest]. + final := final, digest. + buffer := self copyResult: digest toBufferOfSize: v. + 0 to: k - 1 do: [:j | + ij := initial copyFrom: v*j + 1 to: v*(j+1). + ij := (ij asInteger + buffer asInteger + 1) asByteArray. + ij size > v ifTrue: [ij := ij copyFrom: 2 to: v+1]. + ij size < v ifTrue: [ij := ij, (ByteArray new: v - ij size withAll: 0)]. + initial replaceFrom: v*j + 1 to: v*(j+1) with: ij]]. + ^ final copyFrom: 1 to: size. +] + +{ #category : #'as yet unclassified' } +Pkcs12KeyDerivationFunction >> derivedKeyWithId: id fromPassword: passIn salt: saltIn iterations: iterate size: size [ + + | stream password | + stream := WriteStream on: ByteArray new. + passIn do: [:e | stream nextPut: 0; nextPut: e asciiValue]. + password := stream nextPut: 0; nextPut: 0; contents. + + ^ self + derivedKeyWithId: id + fromDoubleBytePassword: password + salt: saltIn + iterations: iterate + size: size +] + +{ #category : #private } +Pkcs12KeyDerivationFunction >> passwordBufferFromPassword: pass length: pLen [ + + | password | + password := ByteArray new: pLen. + 0 to: pLen-1 do: [:i | password at: i + 1 put: (pass at: (i \\ pass size + 1))]. + ^ password +] + +{ #category : #private } +Pkcs12KeyDerivationFunction >> saltBufferFromSalt: saltIn length: sLen [ + + | salt | + salt := ByteArray new: sLen. + 0 to: sLen-1 do: [:i | salt at: i + 1 put: (saltIn at: (i \\ saltIn size + 1))]. + ^ salt + +] diff --git a/source/PKCS12/Pkcs12MacData.class.st b/source/PKCS12/Pkcs12MacData.class.st new file mode 100644 index 0000000..79a63cc --- /dev/null +++ b/source/PKCS12/Pkcs12MacData.class.st @@ -0,0 +1,52 @@ +Class { + #name : #Pkcs12MacData, + #superclass : #Object, + #instVars : [ + 'mac', + 'macSalt', + 'iterations' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +Pkcs12MacData >> iterations [ + "Answer the value of iterations" + + ^ iterations +] + +{ #category : #accessing } +Pkcs12MacData >> iterations: anObject [ + "Set the value of iterations" + + iterations := anObject +] + +{ #category : #accessing } +Pkcs12MacData >> mac [ + "Answer the value of mac" + + ^ mac +] + +{ #category : #accessing } +Pkcs12MacData >> mac: anObject [ + "Set the value of mac" + + mac := anObject +] + +{ #category : #accessing } +Pkcs12MacData >> macSalt [ + "Answer the value of macSalt" + + ^ macSalt +] + +{ #category : #accessing } +Pkcs12MacData >> macSalt: anObject [ + "Set the value of macSalt" + + macSalt := anObject +] diff --git a/source/PKCS12/Pkcs12PFX.class.st b/source/PKCS12/Pkcs12PFX.class.st new file mode 100644 index 0000000..61414ce --- /dev/null +++ b/source/PKCS12/Pkcs12PFX.class.st @@ -0,0 +1,162 @@ +Class { + #name : #Pkcs12PFX, + #superclass : #Object, + #instVars : [ + 'version', + 'authSafe', + 'macData' + ], + #category : 'PKCS12' +} + +{ #category : #'class initialization' } +Pkcs12PFX class >> initialize [ + + X509Certificate initialize. + X509CertificateExtension initialize. + self initializeASN1Types. + + + +] + +{ #category : #'class initialization' } +Pkcs12PFX class >> initializeASN1Types [ + + | module | + module := ASN1Module name: #pkcs. + module addImport: (ASN1Module name: #x509). + + (module sequence: #PFX mapping: Pkcs12PFX) + add: #version type: #ASN1IntegerType; + add: #authSafe type: #ContentInfo; + addOptional: #macData type: #MacData; + yourself. + + (module sequence: #ContentInfo mapping: PkcsContentInfo) + add: #contentType type: #ContentType; + add: #content type: #ContentInfoContents explicitTag: 0; + yourself. + module objectIdentifier: #ContentType. + (module any: #ContentInfoContents definedBy: #contentType) + at: (ASN1ObjectId fromString: '1.2.840.113549.1.7.1') put: #ASN1ByteArrayType; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.7.6') put: #EncryptedData; + yourself. + (module sequence: #EncryptedData mapping: PkcsEncryptedData) + add: #version type: #ASN1IntegerType; + add: #encryptedContentInfo type: #EncryptedContentInfo; + yourself. + (module sequence: #EncryptedContentInfo mapping: PkcsEncryptedContentInfo) + add: #contentType type: #ContentType; + add: #contentEncryptionAlgorithm type: #AlgorithmIdentifier; + addOptional: #encryptedContent type: #EncryptedContent implicitTag: 0; + yourself. + module byteArray: #EncryptedContent. + + (module sequence: #MacData mapping: Pkcs12MacData) + add: #mac type: #DigestInfo; + add: #macSalt type: #ASN1ByteArrayType; + add: #iterations type: #ASN1IntegerType default: 1; + yourself. + (module sequence: #DigestInfo mapping: PkcsDigestInfo) + add: #digestAlgorithm type: #AlgorithmIdentifier; + add: #digest type: #Digest; + yourself. + module byteArray: #Digest. + module sequence: #AuthenticatedSafe of: #ContentInfo. + module sequence: #SafeContents of: #SafeBag. + (module sequence: #SafeBag mapping: Pkcs12SafeBag) + add: #bagId type: #ASN1ObjectIdentifierType; + add: #bagValue type: #BagTypeChoice explicitTag: 0; + add: #bagAttributes type: #BagAttributes; + yourself. + module set: #BagAttributes of: #ASN1SequenceType. + (module any: #BagTypeChoice definedBy: #bagId) + at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.1') put: #KeyBag; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.2') put: #ShroudedKeyBag; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.3') put: #CertBag; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.4') put: #CRLBag; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.5') put: #SecretBag; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.12.10.1.6') put: #SafeContents; + yourself. + module assign: #KeyBag from: #PrivateKeyInfo. + module assign: #ShroudedKeyBag from: #EncryptedPrivateKeyInfo. + (module sequence: #PrivateKeyInfo mapping: Pkcs8PrivateKeyInfo) + add: #version type: #ASN1IntegerType; + add: #privateKeyAlgorithm type: #AlgorithmIdentifier; + add: #privateKey type: #ASN1ByteArrayType; + addOptional: #attributes type: #PrivateKeyInfoAttributes implicitTag: 0; + yourself. + module set: #PrivateKeyInfoAttributes of: #ASN1SequenceType. + (module sequence: #EncryptedPrivateKeyInfo mapping: Pkcs8EncryptedPrivateKeyInfo) + add: #encryptionAlgorithm type: #AlgorithmIdentifier; + add: #encryptedData type: #ASN1ByteArrayType; + yourself. + (module sequence: #CertBag mapping: Pkcs12CertBag) + add: #certId type: #ASN1ObjectIdentifierType; + add: #certValue type: #CertBagTypeChoice explicitTag: 0; + yourself. + (module any: #CertBagTypeChoice definedBy: #certId) + at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.22.1') put: #ASN1ByteArrayType; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.22.2') put: #ASN1IA5StringType; + yourself. + (module sequence: #CRLBag mapping: Pkcs12CRLBag) + add: #crlId type: #ASN1ObjectIdentifierType; + add: #crlValue type: #CRLBagTypeChoice explicitTag: 0; + yourself. + (module choice: #CRLBagTypeChoice) + add: (ASN1ObjectId fromString: '1.2.840.113549.1.9.22.1') type: #ASN1ByteArrayType; + yourself. + (module sequence: #SecretBag mapping: Pkcs12SecretBag) + add: #secretId type: #ASN1ObjectIdentifierType; + add: #secretValue type: #SecretBagTypeChoice explicitTag: 0; + yourself. + (module choice: #SecretBagTypeChoice) + yourself. + + + +] + +{ #category : #accessing } +Pkcs12PFX >> authSafe [ + "Answer the value of authSafe" + + ^ authSafe +] + +{ #category : #accessing } +Pkcs12PFX >> authSafe: anObject [ + "Set the value of authSafe" + + authSafe := anObject. + +] + +{ #category : #accessing } +Pkcs12PFX >> macData [ + "Answer the value of macData" + + ^ macData +] + +{ #category : #accessing } +Pkcs12PFX >> macData: anObject [ + "Set the value of macData" + + macData := anObject +] + +{ #category : #accessing } +Pkcs12PFX >> version [ + "Answer the value of version" + + ^ version +] + +{ #category : #accessing } +Pkcs12PFX >> version: anObject [ + "Set the value of version" + + version := anObject +] diff --git a/source/PKCS12/Pkcs12PrivateKeyFileReader.class.st b/source/PKCS12/Pkcs12PrivateKeyFileReader.class.st new file mode 100644 index 0000000..db68ebb --- /dev/null +++ b/source/PKCS12/Pkcs12PrivateKeyFileReader.class.st @@ -0,0 +1,193 @@ +Class { + #name : #Pkcs12PrivateKeyFileReader, + #superclass : #Object, + #instVars : [ + 'pfx', + 'privateKeys', + 'certs', + 'password' + ], + #category : 'PKCS12' +} + +{ #category : #'as yet unclassified' } +Pkcs12PrivateKeyFileReader class >> fromFile: filename [ + "(Pkcs12PrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/usarhiocertpks12.pfx')" + + | password | + password := FillInTheBlank requestPassword: 'Enter your password'. + ^ self fromFile: filename password: password. + +] + +{ #category : #'as yet unclassified' } +Pkcs12PrivateKeyFileReader class >> fromFile: filename password: aPassword [ + "(Pkcs12PrivateKeyFileReader fromFile: '/Users/slosher/Desktop/squeak/certificates/usarhiocertpks12.pfx')" + + | fs data | + fs := StandardFileStream fileNamed: filename. + data := fs contentsOfEntireFile. + ^ self new + password: aPassword; + initializeFromFileContents: data. + +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> asCertificate [ + + self certs isEmpty ifTrue: [^ nil]. + ^ self certs first + +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> asPrivateKey [ + + self privateKeys isEmpty ifTrue: [^ nil]. + ^ self privateKeys first +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> certs [ + "Answer the value of certs" + + certs isNil ifTrue: [self certs: OrderedCollection new]. + ^ certs +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> certs: anObject [ + "Set the value of certs" + + certs := anObject +] + +{ #category : #'initialize-release' } +Pkcs12PrivateKeyFileReader >> decodeContentInfo: contentInfo [ + + | safeContents | + contentInfo contentType oid = '1.2.840.113549.1.7.1' + ifTrue: [ + safeContents := ASN1Stream + decodeBytes: contentInfo content + withType: ((ASN1Module name: #pkcs) find: #SafeContents). + safeContents do: [:eachSafeBag | self decodeSafeBag: eachSafeBag]. + ^ self]. + contentInfo contentType oid = '1.2.840.113549.1.7.6' + ifTrue: [ + safeContents := contentInfo content decryptWithPassword: self password. + safeContents do: [:eachSafeBag | self decodeSafeBag: eachSafeBag]. + ^ self]. + self error: 'unknown content info: ', contentInfo contentType oid. + +] + +{ #category : #'initialize-release' } +Pkcs12PrivateKeyFileReader >> decodeSafeBag: safeBag [ + + | asn1 key keyBag cert | + safeBag bagId oid = '1.2.840.113549.1.12.10.1.1' + ifTrue: [ + asn1 := ASN1Stream decodeBytes: safeBag bagValue. + (asn1 at: 1) > 0 + ifTrue: [key := RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 1)] + ifFalse: [key := RSAPrivateKey p: (asn1 at: 5) q: (asn1 at: 6) dP: (asn1 at: 7) dQ: (asn1 at: 8) qInv: (asn1 at: 9)]. + self privateKeys add: key. + ^ self]. + safeBag bagId oid = '1.2.840.113549.1.12.10.1.2' + ifTrue: [ + keyBag := safeBag bagValue decryptWithPassword: self password. + key := keyBag asPrivateKey. + self privateKeys add: key. + ^ self]. + safeBag bagId oid = '1.2.840.113549.1.12.10.1.3' + ifTrue: [ + cert := ASN1Stream + decodeBytes: safeBag bagValue certValue + withType: ((ASN1Module name: #x509) find: #Certificate). + self certs add: cert. + ^ self]. + self error: 'unknown safe bag: ', safeBag bagId oid. + +] + +{ #category : #'initialize-release' } +Pkcs12PrivateKeyFileReader >> initializeFromFileContents: data [ + + | authSafe | + self pfx: (ASN1Stream + decodeBytes: data asByteArray + withType: ((ASN1Module name: #pkcs) find: #PFX)). + self validatePFXMAC. + authSafe := ASN1Stream + decodeBytes: self pfx authSafe content + withType: ((ASN1Module name: #pkcs) find: #AuthenticatedSafe). + authSafe do: [:eachContentInfo | self decodeContentInfo: eachContentInfo]. + self password: nil. +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> password [ + "Answer the value of password" + + ^ password +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> password: anObject [ + "Set the value of password" + + password := anObject +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> pfx [ + "Answer the value of pfx" + + ^ pfx +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> pfx: anObject [ + "Set the value of pfx" + + pfx := anObject +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> privateKeys [ + "Answer the value of privateKeys" + + privateKeys isNil ifTrue: [self privateKeys: OrderedCollection new]. + ^ privateKeys +] + +{ #category : #accessing } +Pkcs12PrivateKeyFileReader >> privateKeys: anObject [ + "Set the value of privateKeys" + + privateKeys := anObject +] + +{ #category : #'initialize-release' } +Pkcs12PrivateKeyFileReader >> validatePFXMAC [ + + | data salt iterations macValue calculatedMacValue hashMaterial hmac | + data := self pfx authSafe content. + salt := self pfx macData macSalt. + iterations := self pfx macData iterations. + macValue := self pfx macData mac digest. + hashMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 3 + fromPassword: self password + salt: salt + iterations: iterations + size: 20. + hmac := SHA1 new hmac. + hmac key: hashMaterial. + calculatedMacValue := hmac digestMessage: data. + calculatedMacValue = macValue + ifFalse: [self error: 'invalid MAC']. + +] diff --git a/source/PKCS12/Pkcs12SafeBag.class.st b/source/PKCS12/Pkcs12SafeBag.class.st new file mode 100644 index 0000000..60729fe --- /dev/null +++ b/source/PKCS12/Pkcs12SafeBag.class.st @@ -0,0 +1,52 @@ +Class { + #name : #Pkcs12SafeBag, + #superclass : #Object, + #instVars : [ + 'bagId', + 'bagValue', + 'bagAttributes' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +Pkcs12SafeBag >> bagAttributes [ + "Answer the value of bagAttributes" + + ^ bagAttributes +] + +{ #category : #accessing } +Pkcs12SafeBag >> bagAttributes: anObject [ + "Set the value of bagAttributes" + + bagAttributes := anObject +] + +{ #category : #accessing } +Pkcs12SafeBag >> bagId [ + "Answer the value of bagId" + + ^ bagId +] + +{ #category : #accessing } +Pkcs12SafeBag >> bagId: anObject [ + "Set the value of bagId" + + bagId := anObject +] + +{ #category : #accessing } +Pkcs12SafeBag >> bagValue [ + "Answer the value of bagValue" + + ^ bagValue +] + +{ #category : #accessing } +Pkcs12SafeBag >> bagValue: anObject [ + "Set the value of bagValue" + + bagValue := anObject +] diff --git a/source/PKCS12/Pkcs12SecretBag.class.st b/source/PKCS12/Pkcs12SecretBag.class.st new file mode 100644 index 0000000..b39393e --- /dev/null +++ b/source/PKCS12/Pkcs12SecretBag.class.st @@ -0,0 +1,37 @@ +Class { + #name : #Pkcs12SecretBag, + #superclass : #Object, + #instVars : [ + 'secretId', + 'secretValue' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +Pkcs12SecretBag >> secretId [ + "Answer the value of secretId" + + ^ secretId +] + +{ #category : #accessing } +Pkcs12SecretBag >> secretId: anObject [ + "Set the value of secretId" + + secretId := anObject +] + +{ #category : #accessing } +Pkcs12SecretBag >> secretValue [ + "Answer the value of secretValue" + + ^ secretValue +] + +{ #category : #accessing } +Pkcs12SecretBag >> secretValue: anObject [ + "Set the value of secretValue" + + secretValue := anObject +] diff --git a/source/PKCS12/Pkcs8EncryptedPrivateKeyInfo.class.st b/source/PKCS12/Pkcs8EncryptedPrivateKeyInfo.class.st new file mode 100644 index 0000000..2ac54db --- /dev/null +++ b/source/PKCS12/Pkcs8EncryptedPrivateKeyInfo.class.st @@ -0,0 +1,129 @@ +Class { + #name : #Pkcs8EncryptedPrivateKeyInfo, + #superclass : #Object, + #instVars : [ + 'encryptionAlgorithm', + 'encryptedData' + ], + #category : 'PKCS12' +} + +{ #category : #api } +Pkcs8EncryptedPrivateKeyInfo >> cipherWithPassword: password [ + + | salt iterations keyMaterial ivMaterial cipher | + salt := self encryptionAlgorithm parameters first. + iterations := self encryptionAlgorithm parameters last. + + self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.1' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 16. + cipher := ARC4 new key: keyMaterial. + ^ cipher]. + self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.2' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 5. + cipher := ARC4 new key: keyMaterial. + ^ cipher]. + self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.3' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 24. + ivMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: password + salt: salt + iterations: iterations + size: 8. + cipher := TripleDES new key: keyMaterial. + cipher := cipher cbc initialVector: ivMaterial. + ^ cipher]. + self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.5' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 16. + ivMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: password + salt: salt + iterations: iterations + size: 8. + cipher := ARC2 key: keyMaterial effectiveKeyLength: 128. + cipher := cipher cbc initialVector: ivMaterial. + ^ cipher]. + self encryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.6' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 5. + ivMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: password + salt: salt + iterations: iterations + size: 8. + cipher := ARC2 key: keyMaterial effectiveKeyLength: 40. + cipher := cipher cbc initialVector: ivMaterial. + ^ cipher]. + ^ nil +] + +{ #category : #api } +Pkcs8EncryptedPrivateKeyInfo >> decryptWithPassword: password [ + + | cipher asn1 | + cipher := self cipherWithPassword: password. + asn1 := cipher decrypt: self encryptedData. + ^ ASN1Stream + decodeBytes: asn1 + withType: ((ASN1Module name: #pkcs) find: #KeyBag) +] + +{ #category : #accessing } +Pkcs8EncryptedPrivateKeyInfo >> encryptedData [ + "Answer the value of encryptedData" + + ^ encryptedData +] + +{ #category : #accessing } +Pkcs8EncryptedPrivateKeyInfo >> encryptedData: anObject [ + "Set the value of encryptedData" + + encryptedData := anObject +] + +{ #category : #accessing } +Pkcs8EncryptedPrivateKeyInfo >> encryptionAlgorithm [ + "Answer the value of encryptionAlgorithm" + + ^ encryptionAlgorithm +] + +{ #category : #accessing } +Pkcs8EncryptedPrivateKeyInfo >> encryptionAlgorithm: anObject [ + "Set the value of encryptionAlgorithm" + + encryptionAlgorithm := anObject +] diff --git a/source/PKCS12/Pkcs8PrivateKeyInfo.class.st b/source/PKCS12/Pkcs8PrivateKeyInfo.class.st new file mode 100644 index 0000000..7f26499 --- /dev/null +++ b/source/PKCS12/Pkcs8PrivateKeyInfo.class.st @@ -0,0 +1,82 @@ +Class { + #name : #Pkcs8PrivateKeyInfo, + #superclass : #Object, + #instVars : [ + 'version', + 'privateKeyAlgorithm', + 'privateKey', + 'attributes' + ], + #category : 'PKCS12' +} + +{ #category : #api } +Pkcs8PrivateKeyInfo >> asPrivateKey [ + + | asn1 | + asn1 := ASN1Stream decodeBytes: self privateKey. + (asn1 at: 1) > 0 + ifTrue: [^ RSAPublicKey exponent: (asn1 at: 3) modulo: (asn1 at: 1)] + ifFalse: [^ RSAPrivateKey + p: (asn1 at: 5) + q: (asn1 at: 6) + dP: (asn1 at: 7) + dQ: (asn1 at: 8) + qInv: (asn1 at: 9)] +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> attributes [ + "Answer the value of attributes" + + ^ attributes +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> attributes: anObject [ + "Set the value of attributes" + + attributes := anObject +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> privateKey [ + "Answer the value of privateKey" + + ^ privateKey +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> privateKey: anObject [ + "Set the value of privateKey" + + privateKey := anObject +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> privateKeyAlgorithm [ + "Answer the value of privateKeyAlgorithm" + + ^ privateKeyAlgorithm +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> privateKeyAlgorithm: anObject [ + "Set the value of privateKeyAlgorithm" + + privateKeyAlgorithm := anObject +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> version [ + "Answer the value of version" + + ^ version +] + +{ #category : #accessing } +Pkcs8PrivateKeyInfo >> version: anObject [ + "Set the value of version" + + version := anObject +] diff --git a/source/PKCS12/PkcsContentInfo.class.st b/source/PKCS12/PkcsContentInfo.class.st new file mode 100644 index 0000000..9aaee32 --- /dev/null +++ b/source/PKCS12/PkcsContentInfo.class.st @@ -0,0 +1,37 @@ +Class { + #name : #PkcsContentInfo, + #superclass : #Object, + #instVars : [ + 'contentType', + 'content' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +PkcsContentInfo >> content [ + "Answer the value of content" + + ^ content +] + +{ #category : #accessing } +PkcsContentInfo >> content: anObject [ + "Set the value of content" + + content := anObject +] + +{ #category : #accessing } +PkcsContentInfo >> contentType [ + "Answer the value of contentType" + + ^ contentType +] + +{ #category : #accessing } +PkcsContentInfo >> contentType: anObject [ + "Set the value of contentType" + + contentType := anObject +] diff --git a/source/PKCS12/PkcsDigestInfo.class.st b/source/PKCS12/PkcsDigestInfo.class.st new file mode 100644 index 0000000..4b85e05 --- /dev/null +++ b/source/PKCS12/PkcsDigestInfo.class.st @@ -0,0 +1,37 @@ +Class { + #name : #PkcsDigestInfo, + #superclass : #Object, + #instVars : [ + 'digestAlgorithm', + 'digest' + ], + #category : 'PKCS12' +} + +{ #category : #accessing } +PkcsDigestInfo >> digest [ + "Answer the value of digest" + + ^ digest +] + +{ #category : #accessing } +PkcsDigestInfo >> digest: anObject [ + "Set the value of digest" + + digest := anObject +] + +{ #category : #accessing } +PkcsDigestInfo >> digestAlgorithm [ + "Answer the value of digestAlgorithm" + + ^ digestAlgorithm +] + +{ #category : #accessing } +PkcsDigestInfo >> digestAlgorithm: anObject [ + "Set the value of digestAlgorithm" + + digestAlgorithm := anObject +] diff --git a/source/PKCS12/PkcsEncryptedContentInfo.class.st b/source/PKCS12/PkcsEncryptedContentInfo.class.st new file mode 100644 index 0000000..1c41fca --- /dev/null +++ b/source/PKCS12/PkcsEncryptedContentInfo.class.st @@ -0,0 +1,145 @@ +Class { + #name : #PkcsEncryptedContentInfo, + #superclass : #Object, + #instVars : [ + 'contentType', + 'contentEncryptionAlgorithm', + 'encryptedContent' + ], + #category : 'PKCS12' +} + +{ #category : #api } +PkcsEncryptedContentInfo >> cipherWithPassword: password [ + + | salt iterations keyMaterial ivMaterial cipher | + salt := self contentEncryptionAlgorithm parameters first. + iterations := self contentEncryptionAlgorithm parameters last. + + self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.1' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 16. + cipher := ARC4 new key: keyMaterial. + ^ cipher]. + self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.2' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 5. + cipher := ARC4 new key: keyMaterial. + ^ cipher]. + self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.3' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 24. + ivMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: password + salt: salt + iterations: iterations + size: 8. + cipher := TripleDES new key: keyMaterial. + cipher := cipher cbc initialVector: ivMaterial. + ^ cipher]. + self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.5' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 16. + ivMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: password + salt: salt + iterations: iterations + size: 8. + cipher := ARC2 key: keyMaterial effectiveKeyLength: 128. + cipher := cipher cbc initialVector: ivMaterial. + ^ cipher]. + self contentEncryptionAlgorithm oid oid = '1.2.840.113549.1.12.1.6' + ifTrue: [ + keyMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 1 + fromPassword: password + salt: salt + iterations: iterations + size: 5. + ivMaterial := Pkcs12KeyDerivationFunction new + derivedKeyWithId: 2 + fromPassword: password + salt: salt + iterations: iterations + size: 8. + cipher := ARC2 key: keyMaterial effectiveKeyLength: 40. + cipher := cipher cbc initialVector: ivMaterial. + ^ cipher]. + ^ nil +] + +{ #category : #accessing } +PkcsEncryptedContentInfo >> contentEncryptionAlgorithm [ + "Answer the value of contentEncryptionAlgorithm" + + ^ contentEncryptionAlgorithm +] + +{ #category : #accessing } +PkcsEncryptedContentInfo >> contentEncryptionAlgorithm: anObject [ + "Set the value of contentEncryptionAlgorithm" + + contentEncryptionAlgorithm := anObject +] + +{ #category : #accessing } +PkcsEncryptedContentInfo >> contentType [ + "Answer the value of contentType" + + ^ contentType +] + +{ #category : #accessing } +PkcsEncryptedContentInfo >> contentType: anObject [ + "Set the value of contentType" + + contentType := anObject +] + +{ #category : #api } +PkcsEncryptedContentInfo >> decryptWithPassword: password [ + + | cipher asn1 | + cipher := self cipherWithPassword: password. + asn1 := cipher decrypt: self encryptedContent. + ^ ASN1Stream + decodeBytes: asn1 + withType: ((ASN1Module name: #pkcs) find: #SafeContents). + +] + +{ #category : #accessing } +PkcsEncryptedContentInfo >> encryptedContent [ + "Answer the value of encryptedContent" + + ^ encryptedContent +] + +{ #category : #accessing } +PkcsEncryptedContentInfo >> encryptedContent: anObject [ + "Set the value of encryptedContent" + + encryptedContent := anObject +] diff --git a/source/PKCS12/PkcsEncryptedData.class.st b/source/PKCS12/PkcsEncryptedData.class.st new file mode 100644 index 0000000..ca29379 --- /dev/null +++ b/source/PKCS12/PkcsEncryptedData.class.st @@ -0,0 +1,44 @@ +Class { + #name : #PkcsEncryptedData, + #superclass : #Object, + #instVars : [ + 'version', + 'encryptedContentInfo' + ], + #category : 'PKCS12' +} + +{ #category : #decrypting } +PkcsEncryptedData >> decryptWithPassword: password [ + + ^ self encryptedContentInfo decryptWithPassword: password. + +] + +{ #category : #accessing } +PkcsEncryptedData >> encryptedContentInfo [ + "Answer the value of encryptedContentInfo" + + ^ encryptedContentInfo +] + +{ #category : #accessing } +PkcsEncryptedData >> encryptedContentInfo: anObject [ + "Set the value of encryptedContentInfo" + + encryptedContentInfo := anObject +] + +{ #category : #accessing } +PkcsEncryptedData >> version [ + "Answer the value of version" + + ^ version +] + +{ #category : #accessing } +PkcsEncryptedData >> version: anObject [ + "Set the value of version" + + version := anObject +] diff --git a/source/PKCS12/package.st b/source/PKCS12/package.st new file mode 100644 index 0000000..18594af --- /dev/null +++ b/source/PKCS12/package.st @@ -0,0 +1 @@ +Package { #name : #PKCS12 } diff --git a/source/X509-Tests.package/.filetree b/source/X509-Tests.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/X509-Tests.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/X509-Tests.package/CryptoX509Test.class/README.md b/source/X509-Tests.package/CryptoX509Test.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate1.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate1.st deleted file mode 100644 index 1364faf..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate1.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate1 - - ^ X509Certificate fromBytes: self certificate1DerBytes. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate1DerBytes.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate1DerBytes.st deleted file mode 100644 index c0aaaed..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate1DerBytes.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate1DerBytes - - ^ #(48 130 7 61 48 130 5 37 160 3 2 1 2 2 1 0 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 30 23 13 48 51 48 51 51 48 49 50 50 57 52 57 90 23 13 51 51 48 51 50 57 49 50 50 57 52 57 90 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 130 2 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 2 15 0 48 130 2 10 2 130 2 1 0 206 34 192 226 70 125 236 54 40 7 80 150 242 160 51 64 140 75 241 59 102 63 49 229 107 2 54 219 214 124 246 241 136 143 78 119 54 5 65 149 249 9 240 18 207 70 134 115 96 183 110 126 232 192 88 100 174 205 176 173 69 23 12 99 250 103 10 232 214 210 191 62 231 152 196 240 76 250 224 3 187 53 93 108 33 222 158 32 217 186 205 102 50 55 114 250 247 8 245 199 205 88 201 142 231 14 94 234 62 254 28 161 20 10 21 108 134 132 91 100 102 42 122 169 75 83 121 245 136 162 123 238 47 10 97 43 141 178 126 77 86 165 19 236 234 218 146 158 172 68 65 30 88 96 101 5 102 248 192 68 189 203 148 247 66 126 11 247 101 104 152 81 5 240 243 5 145 4 29 27 23 130 236 200 87 187 195 107 122 136 241 176 114 204 37 91 32 145 236 22 2 18 143 50 233 23 24 72 208 199 5 46 2 48 66 184 37 156 5 107 63 170 58 167 235 83 72 247 232 210 182 7 152 220 27 198 52 127 127 201 28 130 122 5 88 43 8 91 243 56 162 171 23 93 102 201 152 215 158 16 139 162 210 221 116 154 247 113 12 114 96 223 205 111 152 51 157 150 52 118 62 36 122 146 176 14 149 30 111 230 160 69 56 71 170 215 65 237 74 183 18 246 215 27 131 138 15 46 216 9 182 89 215 170 4 255 210 147 125 104 46 221 139 75 171 88 186 47 141 234 149 167 160 195 84 137 165 251 219 139 81 34 157 178 195 190 17 190 44 145 134 139 150 120 173 32 211 138 47 26 63 198 208 81 101 135 33 177 25 1 101 127 69 28 135 245 124 208 65 76 79 41 152 33 253 51 31 117 12 4 81 250 25 119 219 212 20 28 238 129 195 29 245 152 183 105 6 145 34 221 0 80 204 129 49 172 18 7 123 56 218 104 91 230 43 212 126 201 95 173 232 235 114 76 243 1 229 75 32 191 154 166 87 202 145 0 1 139 161 117 33 55 181 99 13 103 62 70 79 112 32 103 206 197 214 89 219 2 224 240 210 203 205 186 98 183 144 65 232 221 32 228 41 188 100 41 66 200 34 220 120 154 255 67 236 152 27 9 81 75 90 90 194 113 241 196 203 115 169 229 161 11 2 3 1 0 1 163 130 1 206 48 130 1 202 48 29 6 3 85 29 14 4 22 4 20 22 181 50 27 212 199 243 224 230 142 243 189 210 176 58 238 178 57 24 209 48 129 163 6 3 85 29 35 4 129 155 48 129 152 128 20 22 181 50 27 212 199 243 224 230 142 243 189 210 176 58 238 178 57 24 209 161 125 164 123 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 130 1 0 48 15 6 3 85 29 19 1 1 255 4 5 48 3 1 1 255 48 50 6 3 85 29 31 4 43 48 41 48 39 160 37 160 35 134 33 104 116 116 112 115 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 114 101 118 111 107 101 46 99 114 108 48 48 6 9 96 134 72 1 134 248 66 1 4 4 35 22 33 104 116 116 112 115 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 114 101 118 111 107 101 46 99 114 108 48 52 6 9 96 134 72 1 134 248 66 1 8 4 39 22 37 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 105 110 100 101 120 46 112 104 112 63 105 100 61 49 48 48 86 6 9 96 134 72 1 134 248 66 1 13 4 73 22 71 84 111 32 103 101 116 32 121 111 117 114 32 111 119 110 32 99 101 114 116 105 102 105 99 97 116 101 32 102 111 114 32 70 82 69 69 32 104 101 97 100 32 111 118 101 114 32 116 111 32 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 3 130 2 1 0 40 199 238 156 130 2 186 92 128 18 202 53 10 29 129 111 137 106 153 204 242 104 15 127 167 225 141 88 149 62 189 242 6 195 144 90 172 181 96 246 153 67 1 163 136 112 156 157 98 157 164 135 175 103 88 13 48 54 59 230 173 72 211 203 116 2 134 113 62 226 43 3 104 241 52 98 64 70 59 83 234 40 244 172 251 102 149 83 138 77 93 253 59 217 96 215 202 121 105 59 177 101 146 166 198 129 130 92 156 205 235 77 1 138 165 223 17 85 170 21 202 31 55 192 130 152 112 97 219 106 124 150 163 142 46 84 62 79 33 169 144 239 220 130 191 220 232 69 173 77 144 115 8 60 148 101 176 4 153 118 127 226 188 194 106 21 170 151 4 55 36 216 30 148 78 109 14 81 190 214 196 143 202 150 109 247 67 223 232 48 101 39 59 123 187 67 67 99 196 67 247 178 236 104 204 225 25 142 34 251 152 225 123 90 62 1 55 59 139 8 176 162 243 149 78 26 203 155 205 154 177 219 178 112 240 45 74 219 216 176 227 111 69 72 51 18 255 254 60 50 42 84 247 196 247 138 240 136 35 194 71 254 100 122 113 192 209 30 166 99 176 7 126 164 47 211 1 143 220 159 43 182 198 8 169 15 147 72 37 252 18 253 159 66 220 243 196 62 246 87 176 215 221 105 209 6 119 52 10 75 210 202 160 255 28 198 140 201 22 190 196 204 50 55 104 115 95 8 251 81 247 73 83 54 5 10 149 2 76 242 121 26 16 246 216 58 117 156 243 29 241 162 13 112 103 134 27 179 22 245 47 229 164 235 121 134 249 61 11 194 115 11 165 153 172 111 252 103 184 229 47 11 166 24 36 141 123 209 72 53 41 24 64 172 147 96 225 150 134 80 180 122 89 216 143 33 11 159 207 130 145 198 59 191 107 220 7 145 185 151 86 35 170 182 108 148 198 72 6 60 228 206 78 170 228 246 47 9 220 83 111 46 252 116 235 58 99 153 194 166 172 137 188 167 178 68 160 13 138 16 227 108 242 36 203 250 155 159 112 71 46 222 20 139 212 178 32 9 150 162 100 241 36 28 220 161 53 156 21 178 212 188 85 46 125 6 245 156 14 85 244 90 214 147 218 118 173 37 115 76 197 67) asByteArray. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate2.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate2.st deleted file mode 100644 index 0e2edea..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate2.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate2 - - ^ X509Certificate fromBytes: self certificate2DerBytes. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate2DerBytes.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate2DerBytes.st deleted file mode 100644 index c1cc4cd..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate2DerBytes.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate2DerBytes - - ^ #(48 130 6 8 48 130 3 240 160 3 2 1 2 2 1 1 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 30 23 13 48 53 49 48 49 52 48 55 51 54 53 53 90 23 13 51 51 48 51 50 56 48 55 51 54 53 53 90 48 84 49 20 48 18 6 3 85 4 10 19 11 67 65 99 101 114 116 32 73 110 99 46 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 49 28 48 26 6 3 85 4 3 19 19 67 65 99 101 114 116 32 67 108 97 115 115 32 51 32 82 111 111 116 48 130 2 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 2 15 0 48 130 2 10 2 130 2 1 0 171 73 53 17 72 124 210 38 126 83 148 207 67 169 221 40 215 66 42 139 243 135 120 25 88 124 15 158 218 137 125 225 251 235 114 144 13 116 161 150 100 171 159 160 36 153 115 218 226 85 118 199 23 123 245 4 172 70 184 195 190 127 100 141 16 108 36 243 97 156 192 242 144 250 81 230 245 105 1 99 195 15 86 226 74 66 207 226 68 140 37 40 168 197 121 9 125 70 185 138 243 233 243 52 41 8 69 228 28 159 203 148 4 28 129 168 20 179 152 101 196 67 236 78 130 141 9 209 189 170 91 141 146 208 236 222 144 197 127 10 194 227 235 230 49 90 94 116 62 151 51 89 232 195 3 61 96 51 191 247 209 111 71 196 205 238 98 131 82 110 46 8 154 164 217 21 24 145 166 133 146 71 176 174 72 235 109 183 33 236 133 26 104 114 53 171 255 240 16 93 192 244 148 167 106 213 59 146 126 76 144 5 126 147 193 44 139 164 142 98 116 21 113 110 11 113 3 234 175 21 56 154 212 210 5 114 111 140 249 43 235 90 114 37 249 57 70 227 114 27 62 4 195 100 39 34 16 42 138 79 88 167 3 173 190 180 46 19 237 93 170 72 215 213 125 212 42 123 92 250 70 4 80 228 204 14 66 91 140 237 219 242 207 252 150 147 224 219 17 54 84 98 52 56 143 12 96 155 59 151 86 56 173 243 210 91 139 160 91 234 78 150 184 124 215 213 160 134 112 64 211 145 41 183 162 60 173 245 140 187 207 26 146 138 228 52 123 192 216 108 95 233 10 194 195 167 32 154 90 223 44 93 82 92 186 71 213 155 239 36 40 112 56 32 47 213 127 41 192 178 65 3 104 146 204 224 156 204 151 75 69 239 58 16 10 171 112 58 152 149 112 173 53 177 234 133 43 164 28 128 33 49 169 174 96 122 128 38 72 0 184 1 192 147 99 85 34 145 60 86 231 175 219 58 37 243 143 49 84 234 38 139 129 89 249 161 209 83 17 197 123 157 3 246 116 17 224 109 177 44 63 44 134 145 153 113 154 166 119 139 52 96 209 20 180 44 172 157 175 140 16 211 159 196 106 248 111 19 252 115 89 247 102 66 116 30 138 227 248 220 210 111 152 156 203 71 152 149 64 5 251 233 2 3 1 0 1 163 129 191 48 129 188 48 15 6 3 85 29 19 1 1 255 4 5 48 3 1 1 255 48 93 6 8 43 6 1 5 5 7 1 1 4 81 48 79 48 35 6 8 43 6 1 5 5 7 48 1 134 23 104 116 116 112 58 47 47 111 99 115 112 46 67 65 99 101 114 116 46 111 114 103 47 48 40 6 8 43 6 1 5 5 7 48 2 134 28 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 47 99 97 46 99 114 116 48 74 6 3 85 29 32 4 67 48 65 48 63 6 8 43 6 1 4 1 129 144 74 48 51 48 49 6 8 43 6 1 5 5 7 2 1 22 37 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 47 105 110 100 101 120 46 112 104 112 63 105 100 61 49 48 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 3 130 2 1 0 127 8 136 161 218 26 80 73 218 137 251 161 8 114 243 138 247 30 196 58 180 121 91 32 48 177 69 222 194 93 211 101 105 241 194 93 84 84 60 133 95 185 123 66 145 194 153 253 27 81 155 171 70 165 161 16 83 158 109 136 172 115 110 44 51 166 240 244 158 224 117 193 62 136 69 169 225 102 67 254 86 90 209 122 65 120 247 64 218 74 58 241 11 91 165 187 22 6 230 194 231 147 185 133 77 151 79 177 30 56 67 128 239 155 13 140 239 184 167 96 0 135 87 125 30 68 28 203 35 239 155 60 153 157 175 181 41 28 69 121 22 150 77 39 109 241 28 108 195 194 85 100 179 188 20 226 243 164 31 30 50 252 39 21 5 207 221 46 174 62 130 97 123 240 33 16 24 246 68 234 83 57 249 220 208 154 32 224 198 187 224 187 90 79 196 153 200 7 189 181 189 162 219 46 98 13 66 52 65 188 255 139 138 245 81 34 170 136 48 0 226 176 212 188 190 101 186 213 3 87 121 155 232 220 200 77 248 80 237 145 165 82 40 162 172 251 54 88 62 233 148 43 145 80 135 27 214 94 214 140 204 247 15 16 12 82 78 208 22 97 229 229 10 108 191 23 199 114 70 87 156 152 245 108 96 99 122 111 94 185 78 47 200 185 185 187 106 133 188 152 13 237 249 62 151 132 52 148 174 0 175 161 229 231 146 110 78 189 243 226 217 20 139 92 210 235 1 108 160 23 165 45 16 235 156 122 74 189 189 238 206 253 237 34 64 171 112 56 136 245 10 135 106 194 171 5 96 201 72 5 218 83 193 222 68 119 106 179 243 60 60 237 128 188 166 56 74 41 36 95 254 89 59 155 37 122 86 99 0 100 185 93 164 98 125 87 54 79 173 131 239 31 146 83 160 142 119 87 221 229 97 17 61 35 0 144 76 60 250 163 96 147 4 163 175 53 246 14 106 143 79 74 96 167 133 5 108 70 161 143 244 199 118 227 161 89 87 247 113 178 196 110 20 92 109 109 65 102 223 27 147 177 212 0 195 238 203 207 60 61 33 128 169 95 99 101 252 221 224 95 164 244 43 240 133 113 65 212 103 37 251 26 177 151 174 214 153 130 19 65 210 110 165 27 153 39 128 231 11 169 168 0) asByteArray. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate3.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate3.st deleted file mode 100644 index 075c3c5..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate3.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate3 - - ^ X509Certificate fromBytes: self certificate3DerBytes. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate3DerBytes.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate3DerBytes.st deleted file mode 100644 index 19e7096..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate3DerBytes.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate3DerBytes - - ^ #(48 130 3 218 48 130 3 67 160 3 2 1 2 2 9 0 140 185 190 232 201 54 220 170 48 13 6 9 42 134 72 134 247 13 1 1 5 5 0 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 30 23 13 48 54 49 48 48 55 48 50 48 56 51 48 90 23 13 48 55 49 48 48 55 48 50 48 56 51 48 90 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 129 159 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 129 141 0 48 129 137 2 129 129 0 173 143 214 185 218 87 229 44 80 166 163 79 54 238 238 119 250 53 201 194 83 47 165 93 236 136 156 46 77 254 204 84 226 23 111 253 38 70 57 58 130 98 203 75 33 203 85 148 159 177 158 236 221 210 151 41 37 7 83 177 232 28 230 226 191 202 195 198 223 81 96 247 16 120 199 245 55 1 145 99 139 182 214 231 29 109 72 55 73 246 85 59 164 254 31 162 150 99 140 150 67 8 16 83 63 207 232 61 89 54 141 207 173 40 23 78 187 244 106 67 120 163 239 85 59 200 124 61 2 3 1 0 1 163 130 1 14 48 130 1 10 48 29 6 3 85 29 14 4 22 4 20 67 174 154 200 134 183 132 64 188 62 117 70 124 98 142 30 69 38 161 230 48 129 218 6 3 85 29 35 4 129 210 48 129 207 128 20 67 174 154 200 134 183 132 64 188 62 117 70 124 98 142 30 69 38 161 230 161 129 171 164 129 168 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 130 9 0 140 185 190 232 201 54 220 170 48 12 6 3 85 29 19 4 5 48 3 1 1 255 48 13 6 9 42 134 72 134 247 13 1 1 5 5 0 3 129 129 0 79 3 254 24 194 236 174 88 62 93 13 195 62 47 243 181 54 113 91 48 128 148 120 173 2 1 51 18 196 218 199 69 29 231 71 24 218 25 17 243 248 83 91 122 39 123 67 16 98 89 209 5 21 66 13 136 121 140 204 84 230 21 24 192 227 5 43 17 247 76 225 145 99 92 76 8 36 109 101 240 168 154 255 189 83 12 33 102 59 37 143 208 66 84 85 31 168 17 247 136 63 139 191 106 35 64 245 22 196 75 35 38 0 254 250 220 45 51 223 179 185 178 240 208 173 126 147 152) asByteArray. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate4.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate4.st deleted file mode 100644 index 58ce671..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate4.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate4 - - ^ X509Certificate fromBytes: self certificate4DerBytes. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate4DerBytes.st b/source/X509-Tests.package/CryptoX509Test.class/instance/certificate4DerBytes.st deleted file mode 100644 index 1e57b50..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/certificate4DerBytes.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -certificate4DerBytes - - ^ #(48 130 4 137 48 130 4 73 160 3 2 1 2 2 9 0 154 108 174 196 121 225 111 157 48 9 6 7 42 134 72 206 56 4 3 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 30 23 13 48 54 48 57 50 56 48 52 49 53 51 51 90 23 13 48 54 49 48 50 56 48 52 49 53 51 51 90 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 130 1 183 48 130 1 44 6 7 42 134 72 206 56 4 1 48 130 1 31 2 129 129 0 250 96 75 234 179 162 106 27 210 120 121 182 48 224 158 231 231 116 83 4 28 182 178 246 152 16 150 177 67 14 236 84 56 64 219 142 235 4 111 152 120 85 6 62 102 184 175 81 233 109 104 178 27 106 172 97 253 21 99 12 140 21 14 216 115 42 143 224 135 188 153 111 36 159 142 12 41 238 55 59 94 180 57 133 189 198 57 4 163 61 51 142 29 231 71 224 122 161 249 134 11 134 43 20 141 119 35 142 141 59 209 199 110 252 23 73 58 69 117 164 138 128 254 190 152 130 42 65 2 21 0 159 107 157 78 74 110 231 182 181 187 55 19 124 95 51 60 134 133 168 103 2 129 129 0 214 76 85 195 53 194 159 183 253 102 252 10 113 203 200 193 57 75 243 100 44 206 117 94 67 207 50 1 64 23 204 213 112 114 34 195 102 129 186 25 125 252 4 201 46 88 162 165 78 87 59 206 12 166 187 218 247 64 250 138 202 204 155 26 15 109 105 56 169 238 90 33 62 138 79 38 71 61 46 141 66 61 61 110 131 118 161 114 217 62 223 157 179 210 149 43 42 107 71 46 117 53 119 94 53 254 235 66 211 152 65 189 249 159 197 241 44 226 46 18 12 93 15 214 27 124 253 79 3 129 132 0 2 129 128 84 161 136 129 16 99 74 218 90 65 16 71 166 38 143 10 165 41 134 237 141 14 5 87 20 71 3 94 182 16 107 16 91 12 143 147 6 170 148 250 182 123 86 130 79 57 254 4 127 138 195 16 101 241 185 100 136 27 253 136 126 59 165 82 146 162 56 39 152 46 131 55 63 82 49 139 225 16 22 149 83 96 162 233 177 202 22 57 248 74 120 243 187 167 234 144 229 181 193 42 251 189 228 84 111 147 98 118 135 146 234 67 51 70 126 83 150 165 232 238 137 129 6 68 227 141 211 183 163 130 1 9 48 130 1 5 48 29 6 3 85 29 14 4 22 4 20 209 186 247 182 110 187 240 40 78 115 97 182 249 254 36 98 42 89 70 8 48 129 213 6 3 85 29 35 4 129 205 48 129 202 128 20 209 186 247 182 110 187 240 40 78 115 97 182 249 254 36 98 42 89 70 8 161 129 166 164 129 163 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 130 9 0 154 108 174 196 121 225 111 157 48 12 6 3 85 29 19 4 5 48 3 1 1 255 48 9 6 7 42 134 72 206 56 4 3 3 47 0 48 44 2 20 25 205 133 210 227 114 134 176 207 219 77 229 215 40 87 0 147 167 239 95 2 20 16 53 89 74 65 85 26 169 123 55 90 120 145 26 152 190 159 192 92 212) asByteArray. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/testAsnDerEncoding.st b/source/X509-Tests.package/CryptoX509Test.class/instance/testAsnDerEncoding.st deleted file mode 100644 index 70e5d77..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/testAsnDerEncoding.st +++ /dev/null @@ -1,7 +0,0 @@ -as yet unclassified -testAsnDerEncoding - - self assert: self certificate1 asAsn1Bytes = self certificate1DerBytes. - self assert: self certificate2 asAsn1Bytes = self certificate2DerBytes. - self assert: self certificate3 asAsn1Bytes = self certificate3DerBytes. - self assert: self certificate4 asAsn1Bytes = self certificate4DerBytes. diff --git a/source/X509-Tests.package/CryptoX509Test.class/instance/testSignatureValidation.st b/source/X509-Tests.package/CryptoX509Test.class/instance/testSignatureValidation.st deleted file mode 100644 index 30b3366..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/instance/testSignatureValidation.st +++ /dev/null @@ -1,4 +0,0 @@ -as yet unclassified -testSignatureValidation - - self assert: (self certificate1 verifyFromParentCertificate: self certificate1). diff --git a/source/X509-Tests.package/CryptoX509Test.class/properties.json b/source/X509-Tests.package/CryptoX509Test.class/properties.json deleted file mode 100644 index 74c2a90..0000000 --- a/source/X509-Tests.package/CryptoX509Test.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "TestCase", - "category" : "X509-Tests", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "CryptoX509Test", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509-Tests.package/monticello.meta/categories.st b/source/X509-Tests.package/monticello.meta/categories.st deleted file mode 100644 index 401de09..0000000 --- a/source/X509-Tests.package/monticello.meta/categories.st +++ /dev/null @@ -1 +0,0 @@ -SystemOrganization addCategory: #'X509-Tests'! diff --git a/source/X509-Tests.package/monticello.meta/initializers.st b/source/X509-Tests.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509-Tests.package/monticello.meta/package b/source/X509-Tests.package/monticello.meta/package deleted file mode 100644 index 778a3e5..0000000 --- a/source/X509-Tests.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'X509-Tests') \ No newline at end of file diff --git a/source/X509-Tests.package/properties.json b/source/X509-Tests.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/X509-Tests.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/X509-Tests/CryptoX509Test.class.st b/source/X509-Tests/CryptoX509Test.class.st new file mode 100644 index 0000000..ab689f7 --- /dev/null +++ b/source/X509-Tests/CryptoX509Test.class.st @@ -0,0 +1,78 @@ +Class { + #name : #CryptoX509Test, + #superclass : #TestCase, + #category : 'X509-Tests' +} + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate1 [ + + ^ X509Certificate fromBytes: self certificate1DerBytes. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate1DerBytes [ + + ^ #(48 130 7 61 48 130 5 37 160 3 2 1 2 2 1 0 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 30 23 13 48 51 48 51 51 48 49 50 50 57 52 57 90 23 13 51 51 48 51 50 57 49 50 50 57 52 57 90 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 130 2 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 2 15 0 48 130 2 10 2 130 2 1 0 206 34 192 226 70 125 236 54 40 7 80 150 242 160 51 64 140 75 241 59 102 63 49 229 107 2 54 219 214 124 246 241 136 143 78 119 54 5 65 149 249 9 240 18 207 70 134 115 96 183 110 126 232 192 88 100 174 205 176 173 69 23 12 99 250 103 10 232 214 210 191 62 231 152 196 240 76 250 224 3 187 53 93 108 33 222 158 32 217 186 205 102 50 55 114 250 247 8 245 199 205 88 201 142 231 14 94 234 62 254 28 161 20 10 21 108 134 132 91 100 102 42 122 169 75 83 121 245 136 162 123 238 47 10 97 43 141 178 126 77 86 165 19 236 234 218 146 158 172 68 65 30 88 96 101 5 102 248 192 68 189 203 148 247 66 126 11 247 101 104 152 81 5 240 243 5 145 4 29 27 23 130 236 200 87 187 195 107 122 136 241 176 114 204 37 91 32 145 236 22 2 18 143 50 233 23 24 72 208 199 5 46 2 48 66 184 37 156 5 107 63 170 58 167 235 83 72 247 232 210 182 7 152 220 27 198 52 127 127 201 28 130 122 5 88 43 8 91 243 56 162 171 23 93 102 201 152 215 158 16 139 162 210 221 116 154 247 113 12 114 96 223 205 111 152 51 157 150 52 118 62 36 122 146 176 14 149 30 111 230 160 69 56 71 170 215 65 237 74 183 18 246 215 27 131 138 15 46 216 9 182 89 215 170 4 255 210 147 125 104 46 221 139 75 171 88 186 47 141 234 149 167 160 195 84 137 165 251 219 139 81 34 157 178 195 190 17 190 44 145 134 139 150 120 173 32 211 138 47 26 63 198 208 81 101 135 33 177 25 1 101 127 69 28 135 245 124 208 65 76 79 41 152 33 253 51 31 117 12 4 81 250 25 119 219 212 20 28 238 129 195 29 245 152 183 105 6 145 34 221 0 80 204 129 49 172 18 7 123 56 218 104 91 230 43 212 126 201 95 173 232 235 114 76 243 1 229 75 32 191 154 166 87 202 145 0 1 139 161 117 33 55 181 99 13 103 62 70 79 112 32 103 206 197 214 89 219 2 224 240 210 203 205 186 98 183 144 65 232 221 32 228 41 188 100 41 66 200 34 220 120 154 255 67 236 152 27 9 81 75 90 90 194 113 241 196 203 115 169 229 161 11 2 3 1 0 1 163 130 1 206 48 130 1 202 48 29 6 3 85 29 14 4 22 4 20 22 181 50 27 212 199 243 224 230 142 243 189 210 176 58 238 178 57 24 209 48 129 163 6 3 85 29 35 4 129 155 48 129 152 128 20 22 181 50 27 212 199 243 224 230 142 243 189 210 176 58 238 178 57 24 209 161 125 164 123 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 130 1 0 48 15 6 3 85 29 19 1 1 255 4 5 48 3 1 1 255 48 50 6 3 85 29 31 4 43 48 41 48 39 160 37 160 35 134 33 104 116 116 112 115 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 114 101 118 111 107 101 46 99 114 108 48 48 6 9 96 134 72 1 134 248 66 1 4 4 35 22 33 104 116 116 112 115 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 114 101 118 111 107 101 46 99 114 108 48 52 6 9 96 134 72 1 134 248 66 1 8 4 39 22 37 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 47 105 110 100 101 120 46 112 104 112 63 105 100 61 49 48 48 86 6 9 96 134 72 1 134 248 66 1 13 4 73 22 71 84 111 32 103 101 116 32 121 111 117 114 32 111 119 110 32 99 101 114 116 105 102 105 99 97 116 101 32 102 111 114 32 70 82 69 69 32 104 101 97 100 32 111 118 101 114 32 116 111 32 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 3 130 2 1 0 40 199 238 156 130 2 186 92 128 18 202 53 10 29 129 111 137 106 153 204 242 104 15 127 167 225 141 88 149 62 189 242 6 195 144 90 172 181 96 246 153 67 1 163 136 112 156 157 98 157 164 135 175 103 88 13 48 54 59 230 173 72 211 203 116 2 134 113 62 226 43 3 104 241 52 98 64 70 59 83 234 40 244 172 251 102 149 83 138 77 93 253 59 217 96 215 202 121 105 59 177 101 146 166 198 129 130 92 156 205 235 77 1 138 165 223 17 85 170 21 202 31 55 192 130 152 112 97 219 106 124 150 163 142 46 84 62 79 33 169 144 239 220 130 191 220 232 69 173 77 144 115 8 60 148 101 176 4 153 118 127 226 188 194 106 21 170 151 4 55 36 216 30 148 78 109 14 81 190 214 196 143 202 150 109 247 67 223 232 48 101 39 59 123 187 67 67 99 196 67 247 178 236 104 204 225 25 142 34 251 152 225 123 90 62 1 55 59 139 8 176 162 243 149 78 26 203 155 205 154 177 219 178 112 240 45 74 219 216 176 227 111 69 72 51 18 255 254 60 50 42 84 247 196 247 138 240 136 35 194 71 254 100 122 113 192 209 30 166 99 176 7 126 164 47 211 1 143 220 159 43 182 198 8 169 15 147 72 37 252 18 253 159 66 220 243 196 62 246 87 176 215 221 105 209 6 119 52 10 75 210 202 160 255 28 198 140 201 22 190 196 204 50 55 104 115 95 8 251 81 247 73 83 54 5 10 149 2 76 242 121 26 16 246 216 58 117 156 243 29 241 162 13 112 103 134 27 179 22 245 47 229 164 235 121 134 249 61 11 194 115 11 165 153 172 111 252 103 184 229 47 11 166 24 36 141 123 209 72 53 41 24 64 172 147 96 225 150 134 80 180 122 89 216 143 33 11 159 207 130 145 198 59 191 107 220 7 145 185 151 86 35 170 182 108 148 198 72 6 60 228 206 78 170 228 246 47 9 220 83 111 46 252 116 235 58 99 153 194 166 172 137 188 167 178 68 160 13 138 16 227 108 242 36 203 250 155 159 112 71 46 222 20 139 212 178 32 9 150 162 100 241 36 28 220 161 53 156 21 178 212 188 85 46 125 6 245 156 14 85 244 90 214 147 218 118 173 37 115 76 197 67) asByteArray. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate2 [ + + ^ X509Certificate fromBytes: self certificate2DerBytes. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate2DerBytes [ + + ^ #(48 130 6 8 48 130 3 240 160 3 2 1 2 2 1 1 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 48 121 49 16 48 14 6 3 85 4 10 19 7 82 111 111 116 32 67 65 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 99 97 99 101 114 116 46 111 114 103 49 34 48 32 6 3 85 4 3 19 25 67 65 32 67 101 114 116 32 83 105 103 110 105 110 103 32 65 117 116 104 111 114 105 116 121 49 33 48 31 6 9 42 134 72 134 247 13 1 9 1 22 18 115 117 112 112 111 114 116 64 99 97 99 101 114 116 46 111 114 103 48 30 23 13 48 53 49 48 49 52 48 55 51 54 53 53 90 23 13 51 51 48 51 50 56 48 55 51 54 53 53 90 48 84 49 20 48 18 6 3 85 4 10 19 11 67 65 99 101 114 116 32 73 110 99 46 49 30 48 28 6 3 85 4 11 19 21 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 49 28 48 26 6 3 85 4 3 19 19 67 65 99 101 114 116 32 67 108 97 115 115 32 51 32 82 111 111 116 48 130 2 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 2 15 0 48 130 2 10 2 130 2 1 0 171 73 53 17 72 124 210 38 126 83 148 207 67 169 221 40 215 66 42 139 243 135 120 25 88 124 15 158 218 137 125 225 251 235 114 144 13 116 161 150 100 171 159 160 36 153 115 218 226 85 118 199 23 123 245 4 172 70 184 195 190 127 100 141 16 108 36 243 97 156 192 242 144 250 81 230 245 105 1 99 195 15 86 226 74 66 207 226 68 140 37 40 168 197 121 9 125 70 185 138 243 233 243 52 41 8 69 228 28 159 203 148 4 28 129 168 20 179 152 101 196 67 236 78 130 141 9 209 189 170 91 141 146 208 236 222 144 197 127 10 194 227 235 230 49 90 94 116 62 151 51 89 232 195 3 61 96 51 191 247 209 111 71 196 205 238 98 131 82 110 46 8 154 164 217 21 24 145 166 133 146 71 176 174 72 235 109 183 33 236 133 26 104 114 53 171 255 240 16 93 192 244 148 167 106 213 59 146 126 76 144 5 126 147 193 44 139 164 142 98 116 21 113 110 11 113 3 234 175 21 56 154 212 210 5 114 111 140 249 43 235 90 114 37 249 57 70 227 114 27 62 4 195 100 39 34 16 42 138 79 88 167 3 173 190 180 46 19 237 93 170 72 215 213 125 212 42 123 92 250 70 4 80 228 204 14 66 91 140 237 219 242 207 252 150 147 224 219 17 54 84 98 52 56 143 12 96 155 59 151 86 56 173 243 210 91 139 160 91 234 78 150 184 124 215 213 160 134 112 64 211 145 41 183 162 60 173 245 140 187 207 26 146 138 228 52 123 192 216 108 95 233 10 194 195 167 32 154 90 223 44 93 82 92 186 71 213 155 239 36 40 112 56 32 47 213 127 41 192 178 65 3 104 146 204 224 156 204 151 75 69 239 58 16 10 171 112 58 152 149 112 173 53 177 234 133 43 164 28 128 33 49 169 174 96 122 128 38 72 0 184 1 192 147 99 85 34 145 60 86 231 175 219 58 37 243 143 49 84 234 38 139 129 89 249 161 209 83 17 197 123 157 3 246 116 17 224 109 177 44 63 44 134 145 153 113 154 166 119 139 52 96 209 20 180 44 172 157 175 140 16 211 159 196 106 248 111 19 252 115 89 247 102 66 116 30 138 227 248 220 210 111 152 156 203 71 152 149 64 5 251 233 2 3 1 0 1 163 129 191 48 129 188 48 15 6 3 85 29 19 1 1 255 4 5 48 3 1 1 255 48 93 6 8 43 6 1 5 5 7 1 1 4 81 48 79 48 35 6 8 43 6 1 5 5 7 48 1 134 23 104 116 116 112 58 47 47 111 99 115 112 46 67 65 99 101 114 116 46 111 114 103 47 48 40 6 8 43 6 1 5 5 7 48 2 134 28 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 47 99 97 46 99 114 116 48 74 6 3 85 29 32 4 67 48 65 48 63 6 8 43 6 1 4 1 129 144 74 48 51 48 49 6 8 43 6 1 5 5 7 2 1 22 37 104 116 116 112 58 47 47 119 119 119 46 67 65 99 101 114 116 46 111 114 103 47 105 110 100 101 120 46 112 104 112 63 105 100 61 49 48 48 13 6 9 42 134 72 134 247 13 1 1 4 5 0 3 130 2 1 0 127 8 136 161 218 26 80 73 218 137 251 161 8 114 243 138 247 30 196 58 180 121 91 32 48 177 69 222 194 93 211 101 105 241 194 93 84 84 60 133 95 185 123 66 145 194 153 253 27 81 155 171 70 165 161 16 83 158 109 136 172 115 110 44 51 166 240 244 158 224 117 193 62 136 69 169 225 102 67 254 86 90 209 122 65 120 247 64 218 74 58 241 11 91 165 187 22 6 230 194 231 147 185 133 77 151 79 177 30 56 67 128 239 155 13 140 239 184 167 96 0 135 87 125 30 68 28 203 35 239 155 60 153 157 175 181 41 28 69 121 22 150 77 39 109 241 28 108 195 194 85 100 179 188 20 226 243 164 31 30 50 252 39 21 5 207 221 46 174 62 130 97 123 240 33 16 24 246 68 234 83 57 249 220 208 154 32 224 198 187 224 187 90 79 196 153 200 7 189 181 189 162 219 46 98 13 66 52 65 188 255 139 138 245 81 34 170 136 48 0 226 176 212 188 190 101 186 213 3 87 121 155 232 220 200 77 248 80 237 145 165 82 40 162 172 251 54 88 62 233 148 43 145 80 135 27 214 94 214 140 204 247 15 16 12 82 78 208 22 97 229 229 10 108 191 23 199 114 70 87 156 152 245 108 96 99 122 111 94 185 78 47 200 185 185 187 106 133 188 152 13 237 249 62 151 132 52 148 174 0 175 161 229 231 146 110 78 189 243 226 217 20 139 92 210 235 1 108 160 23 165 45 16 235 156 122 74 189 189 238 206 253 237 34 64 171 112 56 136 245 10 135 106 194 171 5 96 201 72 5 218 83 193 222 68 119 106 179 243 60 60 237 128 188 166 56 74 41 36 95 254 89 59 155 37 122 86 99 0 100 185 93 164 98 125 87 54 79 173 131 239 31 146 83 160 142 119 87 221 229 97 17 61 35 0 144 76 60 250 163 96 147 4 163 175 53 246 14 106 143 79 74 96 167 133 5 108 70 161 143 244 199 118 227 161 89 87 247 113 178 196 110 20 92 109 109 65 102 223 27 147 177 212 0 195 238 203 207 60 61 33 128 169 95 99 101 252 221 224 95 164 244 43 240 133 113 65 212 103 37 251 26 177 151 174 214 153 130 19 65 210 110 165 27 153 39 128 231 11 169 168 0) asByteArray. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate3 [ + + ^ X509Certificate fromBytes: self certificate3DerBytes. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate3DerBytes [ + + ^ #(48 130 3 218 48 130 3 67 160 3 2 1 2 2 9 0 140 185 190 232 201 54 220 170 48 13 6 9 42 134 72 134 247 13 1 1 5 5 0 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 30 23 13 48 54 49 48 48 55 48 50 48 56 51 48 90 23 13 48 55 49 48 48 55 48 50 48 56 51 48 90 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 129 159 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 129 141 0 48 129 137 2 129 129 0 173 143 214 185 218 87 229 44 80 166 163 79 54 238 238 119 250 53 201 194 83 47 165 93 236 136 156 46 77 254 204 84 226 23 111 253 38 70 57 58 130 98 203 75 33 203 85 148 159 177 158 236 221 210 151 41 37 7 83 177 232 28 230 226 191 202 195 198 223 81 96 247 16 120 199 245 55 1 145 99 139 182 214 231 29 109 72 55 73 246 85 59 164 254 31 162 150 99 140 150 67 8 16 83 63 207 232 61 89 54 141 207 173 40 23 78 187 244 106 67 120 163 239 85 59 200 124 61 2 3 1 0 1 163 130 1 14 48 130 1 10 48 29 6 3 85 29 14 4 22 4 20 67 174 154 200 134 183 132 64 188 62 117 70 124 98 142 30 69 38 161 230 48 129 218 6 3 85 29 35 4 129 210 48 129 207 128 20 67 174 154 200 134 183 132 64 188 62 117 70 124 98 142 30 69 38 161 230 161 129 171 164 129 168 48 129 165 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 25 48 23 6 3 85 4 3 19 16 119 119 119 46 114 119 105 116 104 101 114 115 46 110 101 116 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 130 9 0 140 185 190 232 201 54 220 170 48 12 6 3 85 29 19 4 5 48 3 1 1 255 48 13 6 9 42 134 72 134 247 13 1 1 5 5 0 3 129 129 0 79 3 254 24 194 236 174 88 62 93 13 195 62 47 243 181 54 113 91 48 128 148 120 173 2 1 51 18 196 218 199 69 29 231 71 24 218 25 17 243 248 83 91 122 39 123 67 16 98 89 209 5 21 66 13 136 121 140 204 84 230 21 24 192 227 5 43 17 247 76 225 145 99 92 76 8 36 109 101 240 168 154 255 189 83 12 33 102 59 37 143 208 66 84 85 31 168 17 247 136 63 139 191 106 35 64 245 22 196 75 35 38 0 254 250 220 45 51 223 179 185 178 240 208 173 126 147 152) asByteArray. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate4 [ + + ^ X509Certificate fromBytes: self certificate4DerBytes. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> certificate4DerBytes [ + + ^ #(48 130 4 137 48 130 4 73 160 3 2 1 2 2 9 0 154 108 174 196 121 225 111 157 48 9 6 7 42 134 72 206 56 4 3 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 30 23 13 48 54 48 57 50 56 48 52 49 53 51 51 90 23 13 48 54 49 48 50 56 48 52 49 53 51 51 90 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 48 130 1 183 48 130 1 44 6 7 42 134 72 206 56 4 1 48 130 1 31 2 129 129 0 250 96 75 234 179 162 106 27 210 120 121 182 48 224 158 231 231 116 83 4 28 182 178 246 152 16 150 177 67 14 236 84 56 64 219 142 235 4 111 152 120 85 6 62 102 184 175 81 233 109 104 178 27 106 172 97 253 21 99 12 140 21 14 216 115 42 143 224 135 188 153 111 36 159 142 12 41 238 55 59 94 180 57 133 189 198 57 4 163 61 51 142 29 231 71 224 122 161 249 134 11 134 43 20 141 119 35 142 141 59 209 199 110 252 23 73 58 69 117 164 138 128 254 190 152 130 42 65 2 21 0 159 107 157 78 74 110 231 182 181 187 55 19 124 95 51 60 134 133 168 103 2 129 129 0 214 76 85 195 53 194 159 183 253 102 252 10 113 203 200 193 57 75 243 100 44 206 117 94 67 207 50 1 64 23 204 213 112 114 34 195 102 129 186 25 125 252 4 201 46 88 162 165 78 87 59 206 12 166 187 218 247 64 250 138 202 204 155 26 15 109 105 56 169 238 90 33 62 138 79 38 71 61 46 141 66 61 61 110 131 118 161 114 217 62 223 157 179 210 149 43 42 107 71 46 117 53 119 94 53 254 235 66 211 152 65 189 249 159 197 241 44 226 46 18 12 93 15 214 27 124 253 79 3 129 132 0 2 129 128 84 161 136 129 16 99 74 218 90 65 16 71 166 38 143 10 165 41 134 237 141 14 5 87 20 71 3 94 182 16 107 16 91 12 143 147 6 170 148 250 182 123 86 130 79 57 254 4 127 138 195 16 101 241 185 100 136 27 253 136 126 59 165 82 146 162 56 39 152 46 131 55 63 82 49 139 225 16 22 149 83 96 162 233 177 202 22 57 248 74 120 243 187 167 234 144 229 181 193 42 251 189 228 84 111 147 98 118 135 146 234 67 51 70 126 83 150 165 232 238 137 129 6 68 227 141 211 183 163 130 1 9 48 130 1 5 48 29 6 3 85 29 14 4 22 4 20 209 186 247 182 110 187 240 40 78 115 97 182 249 254 36 98 42 89 70 8 48 129 213 6 3 85 29 35 4 129 205 48 129 202 128 20 209 186 247 182 110 187 240 40 78 115 97 182 249 254 36 98 42 89 70 8 161 129 166 164 129 163 48 129 160 49 11 48 9 6 3 85 4 6 19 2 85 83 49 19 48 17 6 3 85 4 8 19 10 87 97 115 104 105 110 103 116 111 110 49 16 48 14 6 3 85 4 7 19 7 83 101 97 116 116 108 101 49 29 48 27 6 3 85 4 10 19 20 67 97 108 108 105 115 116 111 32 69 110 116 101 114 112 114 105 115 101 115 49 17 48 15 6 3 85 4 11 19 8 82 101 115 101 97 114 99 104 49 20 48 18 6 3 85 4 3 19 11 117 115 97 114 104 105 111 46 99 111 109 49 34 48 32 6 9 42 134 72 134 247 13 1 9 1 22 19 114 101 101 102 101 100 106 105 98 64 121 97 104 111 111 46 99 111 109 130 9 0 154 108 174 196 121 225 111 157 48 12 6 3 85 29 19 4 5 48 3 1 1 255 48 9 6 7 42 134 72 206 56 4 3 3 47 0 48 44 2 20 25 205 133 210 227 114 134 176 207 219 77 229 215 40 87 0 147 167 239 95 2 20 16 53 89 74 65 85 26 169 123 55 90 120 145 26 152 190 159 192 92 212) asByteArray. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> testAsnDerEncoding [ + + self assert: self certificate1 asAsn1Bytes = self certificate1DerBytes. + self assert: self certificate2 asAsn1Bytes = self certificate2DerBytes. + self assert: self certificate3 asAsn1Bytes = self certificate3DerBytes. + self assert: self certificate4 asAsn1Bytes = self certificate4DerBytes. + +] + +{ #category : #'as yet unclassified' } +CryptoX509Test >> testSignatureValidation [ + + self assert: (self certificate1 verifyFromParentCertificate: self certificate1). + +] diff --git a/source/X509-Tests/package.st b/source/X509-Tests/package.st new file mode 100644 index 0000000..533a29c --- /dev/null +++ b/source/X509-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'X509-Tests' } diff --git a/source/X509.package/.filetree b/source/X509.package/.filetree deleted file mode 100644 index 57a6797..0000000 --- a/source/X509.package/.filetree +++ /dev/null @@ -1,5 +0,0 @@ -{ - "separateMethodMetaAndSource" : false, - "noMethodMetaData" : true, - "useCypressPropertiesFile" : true -} \ No newline at end of file diff --git a/source/X509.package/X509AccessDescription.class/README.md b/source/X509.package/X509AccessDescription.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509AccessDescription.class/instance/accessLocation..st b/source/X509.package/X509AccessDescription.class/instance/accessLocation..st deleted file mode 100644 index 8c0569f..0000000 --- a/source/X509.package/X509AccessDescription.class/instance/accessLocation..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -accessLocation: anObject - "Set the value of accessLocation" - - accessLocation := anObject \ No newline at end of file diff --git a/source/X509.package/X509AccessDescription.class/instance/accessLocation.st b/source/X509.package/X509AccessDescription.class/instance/accessLocation.st deleted file mode 100644 index c4ed694..0000000 --- a/source/X509.package/X509AccessDescription.class/instance/accessLocation.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -accessLocation - "Answer the value of accessLocation" - - ^ accessLocation \ No newline at end of file diff --git a/source/X509.package/X509AccessDescription.class/instance/accessMethod..st b/source/X509.package/X509AccessDescription.class/instance/accessMethod..st deleted file mode 100644 index 9ad4491..0000000 --- a/source/X509.package/X509AccessDescription.class/instance/accessMethod..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -accessMethod: anObject - "Set the value of accessMethod" - - accessMethod := anObject \ No newline at end of file diff --git a/source/X509.package/X509AccessDescription.class/instance/accessMethod.st b/source/X509.package/X509AccessDescription.class/instance/accessMethod.st deleted file mode 100644 index 9538752..0000000 --- a/source/X509.package/X509AccessDescription.class/instance/accessMethod.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -accessMethod - "Answer the value of accessMethod" - - ^ accessMethod \ No newline at end of file diff --git a/source/X509.package/X509AccessDescription.class/properties.json b/source/X509.package/X509AccessDescription.class/properties.json deleted file mode 100644 index 4dcfdb1..0000000 --- a/source/X509.package/X509AccessDescription.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "accessMethod", - "accessLocation" - ], - "name" : "X509AccessDescription", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/README.md b/source/X509.package/X509AlgorithmIdentifier.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509AlgorithmIdentifier.class/class/oid..st b/source/X509.package/X509AlgorithmIdentifier.class/class/oid..st deleted file mode 100644 index eae429e..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/class/oid..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -oid: oid - - ^ self new - oid: oid; - yourself \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/class/oid.parameters..st b/source/X509.package/X509AlgorithmIdentifier.class/class/oid.parameters..st deleted file mode 100644 index f72f3e2..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/class/oid.parameters..st +++ /dev/null @@ -1,7 +0,0 @@ -instance creation -oid: oid parameters: params - - ^ self new - oid: oid; - parameters: params; - yourself \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/class/oidString..st b/source/X509.package/X509AlgorithmIdentifier.class/class/oidString..st deleted file mode 100644 index 9beb9e6..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/class/oidString..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -oidString: oidString - - ^ self oid: (ASN1ObjectId fromString: oidString). diff --git a/source/X509.package/X509AlgorithmIdentifier.class/class/oidString.parameters..st b/source/X509.package/X509AlgorithmIdentifier.class/class/oidString.parameters..st deleted file mode 100644 index 2b53c64..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/class/oidString.parameters..st +++ /dev/null @@ -1,4 +0,0 @@ -instance creation -oidString: oidString parameters: params - - ^ self oid: (ASN1ObjectId fromString: oidString) parameters: params. diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/hasParameters..st b/source/X509.package/X509AlgorithmIdentifier.class/instance/hasParameters..st deleted file mode 100644 index d773808..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/hasParameters..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -hasParameters: anObject - "Set the value of hasParameters" - - hasParameters := anObject \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/hasParameters.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/hasParameters.st deleted file mode 100644 index 9d4f306..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/hasParameters.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -hasParameters - "Answer the value of hasParameters" - - ^ hasParameters \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/initialize.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/initialize.st deleted file mode 100644 index 01ea50e..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -initialize - - self hasParameters: false. \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/isDSA.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/isDSA.st deleted file mode 100644 index b51bdab..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/isDSA.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isDSA - - ^ self oid oid = '1.2.840.10040.4.1' diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/isRSA.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/isRSA.st deleted file mode 100644 index 23265a3..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/isRSA.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isRSA - - ^ self oid oid = '1.2.840.113549.1.1.1' diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/isTripleDESCBC.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/isTripleDESCBC.st deleted file mode 100644 index 0feeab4..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/isTripleDESCBC.st +++ /dev/null @@ -1,4 +0,0 @@ -testing -isTripleDESCBC - - ^ self oid oid = '1.2.840.113549.3.7' diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/oid..st b/source/X509.package/X509AlgorithmIdentifier.class/instance/oid..st deleted file mode 100644 index 278fde0..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/oid..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -oid: anObject - "Set the value of oid" - - oid := anObject \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/oid.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/oid.st deleted file mode 100644 index bf4526e..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/oid.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -oid - "Answer the value of oid" - - ^ oid \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/parameters..st b/source/X509.package/X509AlgorithmIdentifier.class/instance/parameters..st deleted file mode 100644 index 799e219..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/parameters..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -parameters: anObject - "Set the value of parameters" - - self hasParameters: true. - parameters := anObject \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/parameters.st b/source/X509.package/X509AlgorithmIdentifier.class/instance/parameters.st deleted file mode 100644 index 9bb62fa..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/parameters.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -parameters - "Answer the value of parameters" - - ^ parameters \ No newline at end of file diff --git a/source/X509.package/X509AlgorithmIdentifier.class/instance/printOn..st b/source/X509.package/X509AlgorithmIdentifier.class/instance/printOn..st deleted file mode 100644 index 1566d3f..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/instance/printOn..st +++ /dev/null @@ -1,7 +0,0 @@ -printing -printOn: stream - - super printOn: stream. - stream nextPutAll: '('. - stream nextPutAll: self oid asString. - stream nextPutAll: ')'. diff --git a/source/X509.package/X509AlgorithmIdentifier.class/properties.json b/source/X509.package/X509AlgorithmIdentifier.class/properties.json deleted file mode 100644 index d1f594c..0000000 --- a/source/X509.package/X509AlgorithmIdentifier.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "oid", - "parameters", - "hasParameters" - ], - "name" : "X509AlgorithmIdentifier", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509AnotherName.class/README.md b/source/X509.package/X509AnotherName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509AnotherName.class/instance/typeId..st b/source/X509.package/X509AnotherName.class/instance/typeId..st deleted file mode 100644 index 3237dad..0000000 --- a/source/X509.package/X509AnotherName.class/instance/typeId..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -typeId: anObject - "Set the value of typeId" - - typeId := anObject \ No newline at end of file diff --git a/source/X509.package/X509AnotherName.class/instance/typeId.st b/source/X509.package/X509AnotherName.class/instance/typeId.st deleted file mode 100644 index 9758cef..0000000 --- a/source/X509.package/X509AnotherName.class/instance/typeId.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -typeId - "Answer the value of typeId" - - ^ typeId \ No newline at end of file diff --git a/source/X509.package/X509AnotherName.class/instance/value..st b/source/X509.package/X509AnotherName.class/instance/value..st deleted file mode 100644 index d2e0f41..0000000 --- a/source/X509.package/X509AnotherName.class/instance/value..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -value: anObject - "Set the value of value" - - value := anObject \ No newline at end of file diff --git a/source/X509.package/X509AnotherName.class/instance/value.st b/source/X509.package/X509AnotherName.class/instance/value.st deleted file mode 100644 index ddcd5a1..0000000 --- a/source/X509.package/X509AnotherName.class/instance/value.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -value - - ^ value \ No newline at end of file diff --git a/source/X509.package/X509AnotherName.class/properties.json b/source/X509.package/X509AnotherName.class/properties.json deleted file mode 100644 index 50de87e..0000000 --- a/source/X509.package/X509AnotherName.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "typeId", - "value" - ], - "name" : "X509AnotherName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/README.md b/source/X509.package/X509AuthorityKeyIdentifier.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/class/initializeASN1Types.st b/source/X509.package/X509AuthorityKeyIdentifier.class/class/initializeASN1Types.st deleted file mode 100644 index 190dbe1..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/class/initializeASN1Types.st +++ /dev/null @@ -1,106 +0,0 @@ -as yet unclassified -initializeASN1Types - - ((ASN1Module name: #x509) sequence: #Certificate mapping: X509Certificate) - add: #tbsCertificate type: #TBSCertificate; - add: #signatureAlgorithm type: #AlgorithmIdentifier; - add: #signature type: #ASN1BitStringType; - yourself. - (ASN1Module name: #x509) find: #Certificate. - - ((ASN1Module name: #x509) sequence: #TBSCertificate mapping: X509TBSCertificate) - add: #version type: #Version explicitTag: 0 default: 0; - add: #serialNumber type: #CertificateSerialNumber; - add: #signature type: #AlgorithmIdentifier; - add: #issuer type: #Name; - add: #validity type: #Validity; - add: #subject type: #Name; - add: #subjectPublicKeyInfo type: #SubjectPublicKeyInfo; - addOptional: #issuerUniqueID type: #UniqueIdentifier implicitTag: 1; - addOptional: #subjectUniqueID type: #UniqueIdentifier implicitTag: 2; - addOptional: #extensions type: #Extensions explicitTag: 3; - yourself. - - ((ASN1Module name: #x509) sequence: #AlgorithmIdentifier mapping: X509AlgorithmIdentifier) - add: #oid type: #ASN1ObjectIdentifierType; - addOptional: #parameters type: #ASN1AnyType; - yourself. - - (ASN1Module name: #x509) integer: #Version. - (ASN1Module name: #x509) integer: #CertificateSerialNumber. - (ASN1Module name: #x509) bitString: #UniqueIdentifier. - (ASN1Module name: #x509) sequence: #Extensions of: #Extension. - - ((ASN1Module name: #x509) sequence: #Validity mapping: X509Validity) - add: #notBefore type: #Time; - add: #notAfter type: #Time; - yourself. - (ASN1Module name: #x509) utcTime: #Time. - - ((ASN1Module name: #x509) sequence: #AttributeTypeAndValue mapping: X520Attribute) - add: #attrOid type: #AttributeType; - add: #attrValue type: #AttributeValue; - yourself. - (ASN1Module name: #x509) objectIdentifier: #AttributeType. - ((ASN1Module name: #x509) any: #AttributeValue definedBy: #attrOid) - at: (ASN1ObjectId fromString: '2.5.4.41') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.4') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.42') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.43') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.44') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.3') put: #X520CommonName; - at: (ASN1ObjectId fromString: '2.5.4.7') put: #X520LocalityName; - at: (ASN1ObjectId fromString: '2.5.4.8') put: #X520StateOrProvinceName; - at: (ASN1ObjectId fromString: '2.5.4.10') put: #X520OrganizationName; - at: (ASN1ObjectId fromString: '2.5.4.11') put: #X520OrganizationalUnitName; - at: (ASN1ObjectId fromString: '2.5.4.6') put: #X520CountryName; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.1') put: #X520Pkcs9EmailAddress; - defaultType: #ASN1StringType; - yourself. - ((ASN1Module name: #x509) choice: #X509StringChoice) - add: #teletexString type: #ASN1TeletexStringType; - add: #printableString type: #ASN1PrintableStringType; - add: #universalString type: #ASN1UniversalStringType; - add: #utf8String type: #ASN1StringType; - add: #bmpString type: #ASN1BMPStringType; - yourself. - ((ASN1Module name: #x509) mapped: #X520Name) - mapping: X520Name mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520CommonName) - mapping: X520CommonName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520LocalityName) - mapping: X520LocalityName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520StateOrProvinceName) - mapping: X520StateOrProvinceName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520OrganizationName) - mapping: X520OrganizationName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520OrganizationalUnitName) - mapping: X520OrganizationalUnitName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520CountryName) - mapping: X520CountryName mappingSymbol: #string type: #ASN1PrintableStringType. - ((ASN1Module name: #x509) mapped: #X520Pkcs9EmailAddress) - mapping: X520Pkcs9EmailAddress mappingSymbol: #string type: #ASN1IA5StringType. - - - (ASN1Module name: #x509) set: #RelativeDistinguishedName of: #AttributeTypeAndValue. - (ASN1Module name: #x509) sequence: #RDNSequence of: #RelativeDistinguishedName. - ((ASN1Module name: #x509) choice: #Name) - add: #names type: #RDNSequence. - - ((ASN1Module name: #x509) sequence: #Extension mapping: X509CertificateExtension) - add: #extnId type: #ASN1ObjectIdentifierType; - addOptional: #extnCritical type: #ASN1BooleanType default: false; - add: #extnValue type: #ASN1ByteArrayType; - yourself. - - ((ASN1Module name: #x509) sequence: #SubjectPublicKeyInfo mapping: X509SubjectPublicKeyInfo) - add: #algorithm type: #AlgorithmIdentifier; - add: #subjectPublicKey type: #ASN1BitStringType; - yourself. - - ((ASN1Module name: #x509) sequence: #AuthorityKeyIdentifier mapping: X509AuthorityKeyIdentifier) - addOptional: #keyIdentifier type: #KeyIdentifier implicitTag: 0; - addOptional: #certIssuer type: #GeneralNames implicitTag: 0; - addOptional: #certSerialNumber type: #CertificateSerialNumber implicitTag: 0; - yourself. - diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certIssuer..st b/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certIssuer..st deleted file mode 100644 index 71dbae4..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certIssuer..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certIssuer: anObject - "Set the value of certIssuer" - - certIssuer := anObject \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certIssuer.st b/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certIssuer.st deleted file mode 100644 index cd4e3e3..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certIssuer.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certIssuer - "Answer the value of certIssuer" - - ^ certIssuer \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certSerialNumber..st b/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certSerialNumber..st deleted file mode 100644 index 67939f0..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certSerialNumber..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certSerialNumber: anObject - "Set the value of certSerialNumber" - - certSerialNumber := anObject \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certSerialNumber.st b/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certSerialNumber.st deleted file mode 100644 index 6fc0502..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/certSerialNumber.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -certSerialNumber - "Answer the value of certSerialNumber" - - ^ certSerialNumber \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/keyIdentifier..st b/source/X509.package/X509AuthorityKeyIdentifier.class/instance/keyIdentifier..st deleted file mode 100644 index 8318598..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/keyIdentifier..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keyIdentifier: anObject - "Set the value of keyIdentifier" - - keyIdentifier := anObject \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/keyIdentifier.st b/source/X509.package/X509AuthorityKeyIdentifier.class/instance/keyIdentifier.st deleted file mode 100644 index e361c2f..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/instance/keyIdentifier.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -keyIdentifier - "Answer the value of keyIdentifier" - - ^ keyIdentifier \ No newline at end of file diff --git a/source/X509.package/X509AuthorityKeyIdentifier.class/properties.json b/source/X509.package/X509AuthorityKeyIdentifier.class/properties.json deleted file mode 100644 index d14325e..0000000 --- a/source/X509.package/X509AuthorityKeyIdentifier.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "keyIdentifier", - "certIssuer", - "certSerialNumber" - ], - "name" : "X509AuthorityKeyIdentifier", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509BasicConstraints.class/README.md b/source/X509.package/X509BasicConstraints.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509BasicConstraints.class/class/initializeASN1Types.st b/source/X509.package/X509BasicConstraints.class/class/initializeASN1Types.st deleted file mode 100644 index a78e7a4..0000000 --- a/source/X509.package/X509BasicConstraints.class/class/initializeASN1Types.st +++ /dev/null @@ -1,80 +0,0 @@ -class initialization -initializeASN1Types - - ((ASN1Module name: #x509) sequence: #AuthorityKeyIdentifier mapping: X509AuthorityKeyIdentifier) - addOptional: #keyIdentifier type: #KeyIdentifier implicitTag: 0; - addOptional: #certIssuer type: #GeneralNames implicitTag: 1; - addOptional: #certSerialNumber type: #CertificateSerialNumber implicitTag: 2; - yourself. - (ASN1Module name: #x509) byteArray: #KeyIdentifier. - - (ASN1Module name: #x509) sequence: #GeneralNames of: #GeneralName. - ((ASN1Module name: #x509) choice: #GeneralName) - add: #otherName type: #AnotherName implicitTag: 0; - add: #rfc822Name type: #ASN1IA5StringType implicitTag: 1; - add: #dNSName type: #ASN1IA5StringType implicitTag: 2; -" add: #x400Address type: #ORAddress implicitTag: 3;" - add: #directoryName type: #Name explicitTag: 4; - add: #ediPartyName type: #EDIPartyName implicitTag: 5; - add: #uniformResourceIdenifier type: #ASN1IA5StringType implicitTag: 6; - add: #iPAddress type: #ASN1ByteArrayType implicitTag: 7; - add: #registeredID type: #ASN1ObjectIdentifierType implicitTag: 8; - yourself. - ((ASN1Module name: #x509) sequence: #AnotherName mapping: X509AnotherName) - add: #typeId type: #ASN1ObjectIdentifierType; - add: #value type: #ASN1AnyType explicitTag: 0; - yourself. - ((ASN1Module name: #x509) sequence: #EDIPartyName mapping: X509EDIPartyName) - addOptional: #nameAssigner type: #X509StringChoice implicitTag: 0; - add: #partyName type: #X509StringChoice implicitTag: 1; - yourself. - - (ASN1Module name: #x509) bitString: #KeyUsage. - - ((ASN1Module name: #x509) sequence: #PrivateKeyUsagePeriod mapping: X509Validity) - addOptional: #notBefore type: #ASN1UTCTimeType implicitTag: 0; - addOptional: #notAfter type: #ASN1UTCTimeType implicitTag: 1; - yourself. - - (ASN1Module name: #x509) sequence: #CertificatePolicies of: #PolicyInformation. - ((ASN1Module name: #x509) sequence: #PolicyInformation mapping: X509PolicyInformation) - add: #id type: #ASN1ObjectIdentifierType; - addOptional: #qualifiers type: #PolicyQualifierInfos; - yourself. - (ASN1Module name: #x509) sequence: #PolicyQualifierInfos of: #PolicyQualifierInfo. - ((ASN1Module name: #x509) sequence: #PolicyQualifierInfo mapping: X509PolicyQualifierInfo) - add: #id type: #ASN1ObjectIdentifierType; - add: #qualifier type: #ASN1AnyType; - yourself. - - (ASN1Module name: #x509) sequence: #PolicyMappings of: #PolicyMapping. - ((ASN1Module name: #x509) sequence: #PolicyMapping mapping: X509PolicyMapping) - add: #issuerDomainPolicy type: #ASN1ObjectIdentifierType; - add: #subjectDomainPolicy type: #ASN1ObjectIdentifierType; - yourself. - - (ASN1Module name: #x509) sequence: #SubjectDirectoryAttributes of: #Attribute. - - ((ASN1Module name: #x509) sequence: #BasicConstraints mapping: X509BasicConstraints) - add: #ca type: #ASN1BooleanType default: false; - addOptional: #pathLengthConstraint type: #ASN1IntegerType; - yourself. - -" -#NameConstraints -#PolicyConstraints -#CRLDistributionPoints -#ExtKeyUsageSyntax -#InhibitAnyPolicy -#FreshestCRL -#AuthorityInfoAccessSyntax -#SubjectInfoAccessSyntax -#CRLNumber -#IssuingDistributionPoint -#BaseCRLNumber -#CRLReason -#BaseCRLNumber -#CertificateIssuer -#HoldInstructionCode -#InvalidityDate -" \ No newline at end of file diff --git a/source/X509.package/X509BasicConstraints.class/instance/ca..st b/source/X509.package/X509BasicConstraints.class/instance/ca..st deleted file mode 100644 index 951077e..0000000 --- a/source/X509.package/X509BasicConstraints.class/instance/ca..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -ca: anObject - "Set the value of ca" - - ca := anObject \ No newline at end of file diff --git a/source/X509.package/X509BasicConstraints.class/instance/ca.st b/source/X509.package/X509BasicConstraints.class/instance/ca.st deleted file mode 100644 index 43b5c33..0000000 --- a/source/X509.package/X509BasicConstraints.class/instance/ca.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -ca - "Answer the value of ca" - - ^ ca \ No newline at end of file diff --git a/source/X509.package/X509BasicConstraints.class/instance/pathLengthConstraint..st b/source/X509.package/X509BasicConstraints.class/instance/pathLengthConstraint..st deleted file mode 100644 index 2717105..0000000 --- a/source/X509.package/X509BasicConstraints.class/instance/pathLengthConstraint..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -pathLengthConstraint: anObject - "Set the value of pathLengthConstraint" - - pathLengthConstraint := anObject \ No newline at end of file diff --git a/source/X509.package/X509BasicConstraints.class/instance/pathLengthConstraint.st b/source/X509.package/X509BasicConstraints.class/instance/pathLengthConstraint.st deleted file mode 100644 index de4f1e1..0000000 --- a/source/X509.package/X509BasicConstraints.class/instance/pathLengthConstraint.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -pathLengthConstraint - "Answer the value of pathLengthConstraint" - - ^ pathLengthConstraint \ No newline at end of file diff --git a/source/X509.package/X509BasicConstraints.class/properties.json b/source/X509.package/X509BasicConstraints.class/properties.json deleted file mode 100644 index 7c8e2f8..0000000 --- a/source/X509.package/X509BasicConstraints.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "ca", - "pathLengthConstraint" - ], - "name" : "X509BasicConstraints", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/README.md b/source/X509.package/X509Certificate.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509Certificate.class/class/fromBytes..st b/source/X509.package/X509Certificate.class/class/fromBytes..st deleted file mode 100644 index 32f0995..0000000 --- a/source/X509.package/X509Certificate.class/class/fromBytes..st +++ /dev/null @@ -1,6 +0,0 @@ -instance creation -fromBytes: bytes - - | type | - type := (ASN1Module name: #x509) find: #Certificate. - ^ ASN1Stream decodeBytes: bytes withType: type. diff --git a/source/X509.package/X509Certificate.class/class/fromFile..st b/source/X509.package/X509Certificate.class/class/fromFile..st deleted file mode 100644 index ad2e54d..0000000 --- a/source/X509.package/X509Certificate.class/class/fromFile..st +++ /dev/null @@ -1,15 +0,0 @@ -instance creation -fromFile: filename - - | fs data i j | - fs := StandardFileStream readOnlyFileNamed: filename. - data := fs contentsOfEntireFile. - i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. - i = 0 ifTrue: [^ self fromBytes: data asByteArray]. - i := data indexOfSubCollection: 'CERTIFICATE--' startingAt: i. - j := data indexOfSubCollection: '--END ' startingAt: i. - i := data findAnySubStr: String crlf startingAt: i. - data := (data copyFrom: i to: j) - reject: [:c | (c = $-) or: [c isSeparator]]. - data := (Base64MimeConverter mimeDecodeToBytes: data readStream) contents. - ^ self fromBytes: data. diff --git a/source/X509.package/X509Certificate.class/class/initialize.st b/source/X509.package/X509Certificate.class/class/initialize.st deleted file mode 100644 index af71677..0000000 --- a/source/X509.package/X509Certificate.class/class/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -initialize - - self initializeASN1Types. diff --git a/source/X509.package/X509Certificate.class/class/initializeASN1Types.st b/source/X509.package/X509Certificate.class/class/initializeASN1Types.st deleted file mode 100644 index eb5ef57..0000000 --- a/source/X509.package/X509Certificate.class/class/initializeASN1Types.st +++ /dev/null @@ -1,99 +0,0 @@ -class initialization -initializeASN1Types - - ((ASN1Module name: #x509) sequence: #Certificate mapping: X509Certificate) - add: #tbsCertificate type: #TBSCertificate; - add: #signatureAlgorithm type: #AlgorithmIdentifier; - add: #signature type: #ASN1BitStringType; - yourself. - (ASN1Module name: #x509) find: #Certificate. - - ((ASN1Module name: #x509) sequence: #TBSCertificate mapping: X509TBSCertificate) - add: #version type: #Version explicitTag: 0 default: 0; - add: #serialNumber type: #CertificateSerialNumber; - add: #signature type: #AlgorithmIdentifier; - add: #issuer type: #Name; - add: #validity type: #Validity; - add: #subject type: #Name; - add: #subjectPublicKeyInfo type: #SubjectPublicKeyInfo; - addOptional: #issuerUniqueID type: #UniqueIdentifier implicitTag: 1; - addOptional: #subjectUniqueID type: #UniqueIdentifier implicitTag: 2; - addOptional: #extensions type: #Extensions explicitTag: 3; - yourself. - - ((ASN1Module name: #x509) sequence: #AlgorithmIdentifier mapping: X509AlgorithmIdentifier) - add: #oid type: #ASN1ObjectIdentifierType; - addOptional: #parameters type: #ASN1AnyType; - yourself. - - (ASN1Module name: #x509) integer: #Version. - (ASN1Module name: #x509) integer: #CertificateSerialNumber. - (ASN1Module name: #x509) bitString: #UniqueIdentifier. - (ASN1Module name: #x509) sequence: #Extensions of: #Extension. - - ((ASN1Module name: #x509) sequence: #SubjectPublicKeyInfo mapping: X509SubjectPublicKeyInfo) - add: #algorithm type: #AlgorithmIdentifier; - add: #subjectPublicKey type: #ASN1BitStringType; - yourself. - - ((ASN1Module name: #x509) sequence: #Validity mapping: X509Validity) - add: #notBefore type: #Time; - add: #notAfter type: #Time; - yourself. - (ASN1Module name: #x509) utcTime: #Time. - - ((ASN1Module name: #x509) choice: #Name) - add: #names type: #RDNSequence. - (ASN1Module name: #x509) sequence: #RDNSequence of: #RelativeDistinguishedName. - (ASN1Module name: #x509) set: #RelativeDistinguishedName of: #AttributeTypeAndValue. - - ((ASN1Module name: #x509) sequence: #Extension mapping: X509CertificateExtension) - add: #extnId type: #ASN1ObjectIdentifierType; - addOptional: #extnCritical type: #ASN1BooleanType default: false; - add: #extnValue type: #ASN1ByteArrayType; - yourself. - - ((ASN1Module name: #x509) sequence: #AttributeTypeAndValue mapping: X520Attribute) - add: #attrOid type: #AttributeType; - add: #attrValue type: #AttributeValue; - yourself. - (ASN1Module name: #x509) objectIdentifier: #AttributeType. - ((ASN1Module name: #x509) any: #AttributeValue definedBy: #attrOid) - at: (ASN1ObjectId fromString: '2.5.4.41') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.4') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.42') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.43') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.44') put: #X520Name; - at: (ASN1ObjectId fromString: '2.5.4.3') put: #X520CommonName; - at: (ASN1ObjectId fromString: '2.5.4.7') put: #X520LocalityName; - at: (ASN1ObjectId fromString: '2.5.4.8') put: #X520StateOrProvinceName; - at: (ASN1ObjectId fromString: '2.5.4.10') put: #X520OrganizationName; - at: (ASN1ObjectId fromString: '2.5.4.11') put: #X520OrganizationalUnitName; - at: (ASN1ObjectId fromString: '2.5.4.6') put: #X520CountryName; - at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.1') put: #X520Pkcs9EmailAddress; - defaultType: #X509StringChoice; - yourself. - ((ASN1Module name: #x509) choice: #X509StringChoice) - add: #teletexString type: #ASN1TeletexStringType; - add: #printableString type: #ASN1PrintableStringType; - add: #universalString type: #ASN1UniversalStringType; - add: #utf8String type: #ASN1StringType; - add: #bmpString type: #ASN1BMPStringType; - yourself. - ((ASN1Module name: #x509) mapped: #X520Name) - mapping: X520Name mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520CommonName) - mapping: X520CommonName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520LocalityName) - mapping: X520LocalityName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520StateOrProvinceName) - mapping: X520StateOrProvinceName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520OrganizationName) - mapping: X520OrganizationName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520OrganizationalUnitName) - mapping: X520OrganizationalUnitName mappingSymbol: #string type: #X509StringChoice. - ((ASN1Module name: #x509) mapped: #X520CountryName) - mapping: X520CountryName mappingSymbol: #string type: #ASN1PrintableStringType. - ((ASN1Module name: #x509) mapped: #X520Pkcs9EmailAddress) - mapping: X520Pkcs9EmailAddress mappingSymbol: #string type: #ASN1IA5StringType. - diff --git a/source/X509.package/X509Certificate.class/instance/asAsn1Bytes.st b/source/X509.package/X509Certificate.class/instance/asAsn1Bytes.st deleted file mode 100644 index 52430e7..0000000 --- a/source/X509.package/X509Certificate.class/instance/asAsn1Bytes.st +++ /dev/null @@ -1,6 +0,0 @@ -converting -asAsn1Bytes - - | type | - type := (ASN1Module name: #x509) find: #Certificate. - ^ ASN1Stream encode: self withType: type diff --git a/source/X509.package/X509Certificate.class/instance/asDerCertificateList.st b/source/X509.package/X509Certificate.class/instance/asDerCertificateList.st deleted file mode 100644 index db0238b..0000000 --- a/source/X509.package/X509Certificate.class/instance/asDerCertificateList.st +++ /dev/null @@ -1,4 +0,0 @@ -converting -asDerCertificateList - - ^ (OrderedCollection with: self) asAsn1Bytes diff --git a/source/X509.package/X509Certificate.class/instance/signature..st b/source/X509.package/X509Certificate.class/instance/signature..st deleted file mode 100644 index 64aac4f..0000000 --- a/source/X509.package/X509Certificate.class/instance/signature..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -signature: anObject - "Set the value of signature" - - signature := anObject \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/instance/signature.st b/source/X509.package/X509Certificate.class/instance/signature.st deleted file mode 100644 index a3c79be..0000000 --- a/source/X509.package/X509Certificate.class/instance/signature.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -signature - "Answer the value of signature" - - ^ signature \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/instance/signatureAlgorithm..st b/source/X509.package/X509Certificate.class/instance/signatureAlgorithm..st deleted file mode 100644 index 86f016b..0000000 --- a/source/X509.package/X509Certificate.class/instance/signatureAlgorithm..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -signatureAlgorithm: anObject - "Set the value of signatureAlgorithm" - - signatureAlgorithm := anObject \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/instance/signatureAlgorithm.st b/source/X509.package/X509Certificate.class/instance/signatureAlgorithm.st deleted file mode 100644 index 502e7f6..0000000 --- a/source/X509.package/X509Certificate.class/instance/signatureAlgorithm.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -signatureAlgorithm - "Answer the value of signatureAlgorithm" - - ^ signatureAlgorithm \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/instance/tbsCertificate..st b/source/X509.package/X509Certificate.class/instance/tbsCertificate..st deleted file mode 100644 index ef27549..0000000 --- a/source/X509.package/X509Certificate.class/instance/tbsCertificate..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tbsCertificate: anObject - "Set the value of tbsCertificate" - - tbsCertificate := anObject \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/instance/tbsCertificate.st b/source/X509.package/X509Certificate.class/instance/tbsCertificate.st deleted file mode 100644 index 06e7df8..0000000 --- a/source/X509.package/X509Certificate.class/instance/tbsCertificate.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -tbsCertificate - "Answer the value of tbsCertificate" - - ^ tbsCertificate \ No newline at end of file diff --git a/source/X509.package/X509Certificate.class/instance/verifyFromParentCertificate..st b/source/X509.package/X509Certificate.class/instance/verifyFromParentCertificate..st deleted file mode 100644 index a15393a..0000000 --- a/source/X509.package/X509Certificate.class/instance/verifyFromParentCertificate..st +++ /dev/null @@ -1,18 +0,0 @@ -verifying -verifyFromParentCertificate: parentCert - - (DateAndTime now - between: self tbsCertificate validity notBefore - and: self tbsCertificate validity notAfter) - ifFalse: [^ false]. - self tbsCertificate issuer = parentCert tbsCertificate subject - ifFalse: [^ false]. - (self tbsCertificate signature oid oid = '1.2.840.113549.1.1.2') - ifTrue: [^ self verifyMD2WithRSAEncryptionFromParentCertificate: parentCert]. - (self tbsCertificate signature oid oid = '1.2.840.113549.1.1.4') - ifTrue: [^ self verifyMD5WithRSAEncryptionFromParentCertificate: parentCert]. - (self tbsCertificate signature oid oid = '1.2.840.113549.1.1.5') - ifTrue: [^ self verifySHA1WithRSAEncryptionFromParentCertificate: parentCert]. - (self tbsCertificate signature oid oid = '1.2.840.10040.4.3') - ifTrue: [^ self verifySHA1WithDSAEncryptionFromParentCertificate: parentCert]. - ^ false. diff --git a/source/X509.package/X509Certificate.class/instance/verifyMD2WithRSAEncryptionFromParentCertificate..st b/source/X509.package/X509Certificate.class/instance/verifyMD2WithRSAEncryptionFromParentCertificate..st deleted file mode 100644 index 8f7865d..0000000 --- a/source/X509.package/X509Certificate.class/instance/verifyMD2WithRSAEncryptionFromParentCertificate..st +++ /dev/null @@ -1,12 +0,0 @@ -verifying -verifyMD2WithRSAEncryptionFromParentCertificate: parentCert - - | publicKey hash msg | - publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. - - hash := MD2 hashMessage: self tbsCertificate asAsn1Bytes. - msg := OrderedCollection new - add: (OrderedCollection new add: (ASN1ObjectId fromString: '1.2.840.113549.2.2'); add: nil; yourself); - add: hash; - asAsn1Bytes. - ^ publicKey v15VerifySignature: self signature bytes ofMessageHash: msg. diff --git a/source/X509.package/X509Certificate.class/instance/verifyMD5WithRSAEncryptionFromParentCertificate..st b/source/X509.package/X509Certificate.class/instance/verifyMD5WithRSAEncryptionFromParentCertificate..st deleted file mode 100644 index 4d176a2..0000000 --- a/source/X509.package/X509Certificate.class/instance/verifyMD5WithRSAEncryptionFromParentCertificate..st +++ /dev/null @@ -1,11 +0,0 @@ -verifying -verifyMD5WithRSAEncryptionFromParentCertificate: parentCert - - | publicKey hash msg | - publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. - hash := MD5 hashMessage: self tbsCertificate asAsn1Bytes. - msg := OrderedCollection new - add: (OrderedCollection new add: (ASN1ObjectId fromString: '1.2.840.113549.2.5'); add: nil; yourself); - add: hash; - asAsn1Bytes. - ^ publicKey v15VerifySignature: self signature bytes ofMessageHash: msg. diff --git a/source/X509.package/X509Certificate.class/instance/verifySHA1WithDSAEncryptionFromParentCertificate..st b/source/X509.package/X509Certificate.class/instance/verifySHA1WithDSAEncryptionFromParentCertificate..st deleted file mode 100644 index d5e6681..0000000 --- a/source/X509.package/X509Certificate.class/instance/verifySHA1WithDSAEncryptionFromParentCertificate..st +++ /dev/null @@ -1,8 +0,0 @@ -verifying -verifySHA1WithDSAEncryptionFromParentCertificate: parentCert - - | publicKey sig toBeSigned | - publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. - sig := ASN1Stream decodeBytes: self signature bytes. - toBeSigned := SHA1 hashMessage: self tbsCertificate asAsn1Bytes. - ^ publicKey verifySignature: sig ofMessageHash: toBeSigned. diff --git a/source/X509.package/X509Certificate.class/instance/verifySHA1WithRSAEncryptionFromParentCertificate..st b/source/X509.package/X509Certificate.class/instance/verifySHA1WithRSAEncryptionFromParentCertificate..st deleted file mode 100644 index 4de18c4..0000000 --- a/source/X509.package/X509Certificate.class/instance/verifySHA1WithRSAEncryptionFromParentCertificate..st +++ /dev/null @@ -1,12 +0,0 @@ -verifying -verifySHA1WithRSAEncryptionFromParentCertificate: parentCert - - | publicKey hash msg | - publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. - - hash := SHA1 hashMessage: self tbsCertificate asAsn1Bytes. - msg := OrderedCollection new - add: (OrderedCollection new add: (ASN1ObjectId fromString: '1.3.14.3.2.26'); add: nil; yourself); - add: hash; - asAsn1Bytes. - ^ publicKey v15VerifySignature: self signature bytes ofMessageHash: msg. diff --git a/source/X509.package/X509Certificate.class/properties.json b/source/X509.package/X509Certificate.class/properties.json deleted file mode 100644 index 1229d1a..0000000 --- a/source/X509.package/X509Certificate.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "tbsCertificate", - "signatureAlgorithm", - "signature" - ], - "name" : "X509Certificate", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509CertificateDerReader.extension/instance/asCertificate.st b/source/X509.package/X509CertificateDerReader.extension/instance/asCertificate.st deleted file mode 100644 index ce8a253..0000000 --- a/source/X509.package/X509CertificateDerReader.extension/instance/asCertificate.st +++ /dev/null @@ -1,4 +0,0 @@ -*X509 -asCertificate - - ^ X509Certificate fromBytes: self derBytes. diff --git a/source/X509.package/X509CertificateDerReader.extension/properties.json b/source/X509.package/X509CertificateDerReader.extension/properties.json deleted file mode 100644 index 124505e..0000000 --- a/source/X509.package/X509CertificateDerReader.extension/properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "X509CertificateDerReader" -} \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/README.md b/source/X509.package/X509CertificateExtension.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509CertificateExtension.class/class/initialize.st b/source/X509.package/X509CertificateExtension.class/class/initialize.st deleted file mode 100644 index af71677..0000000 --- a/source/X509.package/X509CertificateExtension.class/class/initialize.st +++ /dev/null @@ -1,4 +0,0 @@ -class initialization -initialize - - self initializeASN1Types. diff --git a/source/X509.package/X509CertificateExtension.class/class/initializeASN1Types.st b/source/X509.package/X509CertificateExtension.class/class/initializeASN1Types.st deleted file mode 100644 index 1400035..0000000 --- a/source/X509.package/X509CertificateExtension.class/class/initializeASN1Types.st +++ /dev/null @@ -1,131 +0,0 @@ -class initialization -initializeASN1Types - - ((ASN1Module name: #x509) sequence: #AuthorityKeyIdentifier mapping: X509AuthorityKeyIdentifier) - addOptional: #keyIdentifier type: #KeyIdentifier implicitTag: 0; - addOptional: #certIssuer type: #GeneralNames implicitTag: 1; - addOptional: #certSerialNumber type: #CertificateSerialNumber implicitTag: 2; - yourself. - (ASN1Module name: #x509) byteArray: #KeyIdentifier. - - (ASN1Module name: #x509) sequence: #GeneralNames of: #GeneralName. - ((ASN1Module name: #x509) choice: #GeneralName) - add: #otherName type: #AnotherName implicitTag: 0; - add: #rfc822Name type: #ASN1IA5StringType implicitTag: 1; - add: #dNSName type: #ASN1IA5StringType implicitTag: 2; -" add: #x400Address type: #ORAddress implicitTag: 3;" - add: #directoryName type: #Name explicitTag: 4; - add: #ediPartyName type: #EDIPartyName implicitTag: 5; - add: #uniformResourceIdenifier type: #ASN1IA5StringType implicitTag: 6; - add: #iPAddress type: #ASN1ByteArrayType implicitTag: 7; - add: #registeredID type: #ASN1ObjectIdentifierType implicitTag: 8; - yourself. - ((ASN1Module name: #x509) sequence: #AnotherName mapping: X509AnotherName) - add: #typeId type: #ASN1ObjectIdentifierType; - add: #value type: #ASN1AnyType explicitTag: 0; - yourself. - ((ASN1Module name: #x509) sequence: #EDIPartyName mapping: X509EDIPartyName) - addOptional: #nameAssigner type: #X509StringChoice implicitTag: 0; - add: #partyName type: #X509StringChoice implicitTag: 1; - yourself. - - (ASN1Module name: #x509) bitString: #KeyUsage. - - ((ASN1Module name: #x509) sequence: #PrivateKeyUsagePeriod mapping: X509Validity) - addOptional: #notBefore type: #ASN1UTCTimeType implicitTag: 0; - addOptional: #notAfter type: #ASN1UTCTimeType implicitTag: 1; - yourself. - - (ASN1Module name: #x509) sequence: #CertificatePolicies of: #PolicyInformation. - ((ASN1Module name: #x509) sequence: #PolicyInformation mapping: X509PolicyInformation) - add: #id type: #CertPolicyId; - addOptional: #qualifiers type: #PolicyQualifierInfos; - yourself. - (ASN1Module name: #x509) objectIdentifier: #CertPolicyId. - (ASN1Module name: #x509) sequence: #PolicyQualifierInfos of: #PolicyQualifierInfo. - ((ASN1Module name: #x509) sequence: #PolicyQualifierInfo mapping: X509PolicyQualifierInfo) - add: #id type: #ASN1ObjectIdentifierType; - add: #qualifier type: #ASN1AnyType; - yourself. - - (ASN1Module name: #x509) sequence: #PolicyMappings of: #PolicyMapping. - ((ASN1Module name: #x509) sequence: #PolicyMapping mapping: X509PolicyMapping) - add: #issuerDomainPolicy type: #CertPolicyId; - add: #subjectDomainPolicy type: #CertPolicyId; - yourself. - - (ASN1Module name: #x509) assign: #SubjectAltName from: #GeneralNames. - (ASN1Module name: #x509) assign: #IssuerAltName from: #GeneralNames. - - (ASN1Module name: #x509) sequence: #SubjectDirectoryAttributes of: #Attribute. - - ((ASN1Module name: #x509) sequence: #BasicConstraints mapping: X509BasicConstraints) - add: #ca type: #ASN1BooleanType default: false; - addOptional: #pathLengthConstraint type: #ASN1IntegerType; - yourself. - - ((ASN1Module name: #x509) sequence: #NameConstraints mapping: X509NameConstraints) - addOptional: #permittedSubtrees type: #GeneralSubtrees implicitTag: 0; - addOptional: #excludedSubtrees type: #GeneralSubtrees implicitTag: 1; - yourself. - (ASN1Module name: #x509) sequence: #GeneralSubtrees of: #GeneralSubtree. - ((ASN1Module name: #x509) sequence: #GeneralSubtree mapping: X509GeneralSubtree) - add: #base type: #GeneralName; - add: #minimum type: #BaseDistance implicitTag: 0 default: 0; - addOptional: #maximum type: #BaseDistance implicitTag: 1; - yourself. - (ASN1Module name: #x509) integer: #BaseDistance. - - ((ASN1Module name: #x509) sequence: #PolicyConstraints mapping: X509PolicyConstraints) - addOptional: #requireExplicitPolicy type: #SkipCerts implicitTag: 0; - addOptional: #inhibitPolicyMapping type: #SkipCerts implicitTag: 1; - yourself. - (ASN1Module name: #x509) integer: #SkipCerts. - - (ASN1Module name: #x509) sequence: #CRLDistributionPoints of: #DistributionPoint. - ((ASN1Module name: #x509) sequence: #DistributionPoint mapping: X509DistributionPoint) - addOptional: #distributionPoint type: #DistributionPointName explicitTag: 0; - addOptional: #reasons type: #ReasonFlags implicitTag: 1; - addOptional: #cRLIssuer type: #GeneralNames implicitTag: 2; - yourself. - ((ASN1Module name: #x509) choice: #DistributionPointName) - add: #fullName type: #GeneralNames implicitTag: 0; - add: #nameRelativeToCRLIssuer type: #RelativeDistinguishedName implicitTag: 1; - yourself. - (ASN1Module name: #x509) bitString: #ReasonFlags. - - (ASN1Module name: #x509) sequence: #ExtKeyUsageSyntax of: #KeyPurposeId. - (ASN1Module name: #x509) objectIdentifier: #KeyPurposeId. - - (ASN1Module name: #x509) assign: #InhibitAnyPolicy from: #SkipCerts. - - (ASN1Module name: #x509) assign: #FreshestCRL from: #CRLDistributionPoints. - - (ASN1Module name: #x509) sequence: #AuthorityInfoAccessSyntax of: #AccessDescription. - ((ASN1Module name: #x509) sequence: #AccessDescription mapping: X509AccessDescription) - add: #accessMethod type: #ASN1ObjectIdentifierType; - add: #accessLocation type: #GeneralName; - yourself. - - (ASN1Module name: #x509) sequence: #SubjectInfoAccessSyntax of: #AccessDescription. - - (ASN1Module name: #x509) integer: #CRLNumber. - - ((ASN1Module name: #x509) sequence: #IssuingDistributionPoint mapping: X509IssuingDistributionPoint) - addOptional: #distributionPoint type: #DistributionPointName explicitTag: 0; - add: #onlyContainsUserCerts type: #ASN1BooleanType implicitTag: 1 default: false; - add: #onlyContainsCACerts type: #ASN1BooleanType implicitTag: 2 default: false; - addOptional: #onlySomeReasons type: #ReasonFlags implicitTag: 3; - add: #indirectCRL type: #ASN1BooleanType implicitTag: 4 default: false; - add: #onlyContainsAttributeCerts type: #ASN1BooleanType implicitTag: 5 default: false; - yourself. - - (ASN1Module name: #x509) assign: #BaseCRLNumber from: #CRLNumber. - -" (ASN1Module name: #x509) enumerated: #CRLReason." - - (ASN1Module name: #x509) assign: #CertificateIssuer from: #GeneralNames. - - (ASN1Module name: #x509) objectIdentifier: #HoldInstructionCode. - - (ASN1Module name: #x509) utcTime: #InvalidityDate. diff --git a/source/X509.package/X509CertificateExtension.class/class/objectIdToTypeSymbolMap.st b/source/X509.package/X509CertificateExtension.class/class/objectIdToTypeSymbolMap.st deleted file mode 100644 index 8ec703a..0000000 --- a/source/X509.package/X509CertificateExtension.class/class/objectIdToTypeSymbolMap.st +++ /dev/null @@ -1,32 +0,0 @@ -class initialization -objectIdToTypeSymbolMap - - | map | - map := Dictionary new - at: (ASN1ObjectId fromString: '2.5.29.35') put: #AuthorityKeyIdentifier; - at: (ASN1ObjectId fromString: '2.5.29.14') put: #KeyIdentifier; - at: (ASN1ObjectId fromString: '2.5.29.15') put: #KeyUsage; - at: (ASN1ObjectId fromString: '2.5.29.16') put: #PrivateKeyUsagePeriod; - at: (ASN1ObjectId fromString: '2.5.29.32') put: #CertificatePolicies; - at: (ASN1ObjectId fromString: '2.5.29.33') put: #PolicyMappings; - at: (ASN1ObjectId fromString: '2.5.29.17') put: #SubjectAltName; - at: (ASN1ObjectId fromString: '2.5.29.18') put: #IssuerAltName; - at: (ASN1ObjectId fromString: '2.5.29.9') put: #SubjectDirectoryAttributes; - at: (ASN1ObjectId fromString: '2.5.29.19') put: #BasicConstraints; - at: (ASN1ObjectId fromString: '2.5.29.30') put: #NameConstraints; - at: (ASN1ObjectId fromString: '2.5.29.36') put: #PolicyConstraints; - at: (ASN1ObjectId fromString: '2.5.29.31') put: #CRLDistributionPoints; - at: (ASN1ObjectId fromString: '2.5.29.37') put: #ExtKeyUsageSyntax; - at: (ASN1ObjectId fromString: '2.5.29.54') put: #InhibitAnyPolicy; - at: (ASN1ObjectId fromString: '2.5.29.46') put: #FreshestCRL; - at: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.1.1') put: #AuthorityInfoAccessSyntax; - at: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.1.11') put: #SubjectInfoAccessSyntax; - at: (ASN1ObjectId fromString: '2.5.29.20') put: #CRLNumber; - at: (ASN1ObjectId fromString: '2.5.29.28') put: #IssuingDistributionPoint; - at: (ASN1ObjectId fromString: '2.5.29.27') put: #BaseCRLNumber; - at: (ASN1ObjectId fromString: '2.5.29.21') put: #CRLReason; - at: (ASN1ObjectId fromString: '2.5.29.29') put: #CertificateIssuer; - at: (ASN1ObjectId fromString: '2.5.29.23') put: #HoldInstructionCode; - at: (ASN1ObjectId fromString: '2.5.29.24') put: #InvalidityDate; - yourself. - ^ map \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/asn1TypeForExtension.st b/source/X509.package/X509CertificateExtension.class/instance/asn1TypeForExtension.st deleted file mode 100644 index f51374f..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/asn1TypeForExtension.st +++ /dev/null @@ -1,14 +0,0 @@ -private -asn1TypeForExtension - " - id-ce = 2.5.29 - id-pe = 1.3.6.1.5.5.7.1 - id-qt = 1.3.6.1.5.5.7.2 - id-kp = 1.3.6.1.5.5.7.3 - id-ad = 1.3.6.1.5.5.7.48 - " - - | typeSymbol | - typeSymbol := self class objectIdToTypeSymbolMap at: self extnId ifAbsent: [^nil]. - ^ (ASN1Module name: #x509) find: typeSymbol. - \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/decodeExtension.st b/source/X509.package/X509CertificateExtension.class/instance/decodeExtension.st deleted file mode 100644 index d0c7068..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/decodeExtension.st +++ /dev/null @@ -1,9 +0,0 @@ -private -decodeExtension - - | type ext | - type := self asn1TypeForExtension. - ext := [ASN1Stream decodeBytes: self extnValue withType: type] - on: Error - do: [:ex | ASN1Stream decodeBytes: self extnValue]. - self decodedExtension: ext. diff --git a/source/X509.package/X509CertificateExtension.class/instance/decodedExtension..st b/source/X509.package/X509CertificateExtension.class/instance/decodedExtension..st deleted file mode 100644 index 93b8723..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/decodedExtension..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decodedExtension: anObject - "Set the value of decodedExtension" - - decodedExtension := anObject \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/decodedExtension.st b/source/X509.package/X509CertificateExtension.class/instance/decodedExtension.st deleted file mode 100644 index 890c157..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/decodedExtension.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -decodedExtension - "Answer the value of decodedExtension" - - ^ decodedExtension \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/extnCritical..st b/source/X509.package/X509CertificateExtension.class/instance/extnCritical..st deleted file mode 100644 index 7334945..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/extnCritical..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extnCritical: anObject - "Set the value of extnCritical" - - extnCritical := anObject \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/extnCritical.st b/source/X509.package/X509CertificateExtension.class/instance/extnCritical.st deleted file mode 100644 index 5585dca..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/extnCritical.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extnCritical - "Answer the value of extnCritical" - - ^ extnCritical \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/extnId..st b/source/X509.package/X509CertificateExtension.class/instance/extnId..st deleted file mode 100644 index 1b8823d..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/extnId..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extnId: anObject - "Set the value of extnId" - - extnId := anObject \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/extnId.st b/source/X509.package/X509CertificateExtension.class/instance/extnId.st deleted file mode 100644 index 922a796..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/extnId.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extnId - "Answer the value of extnId" - - ^ extnId \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/extnValue..st b/source/X509.package/X509CertificateExtension.class/instance/extnValue..st deleted file mode 100644 index 024a294..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/extnValue..st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -extnValue: anObject - "Set the value of extnValue" - - extnValue := anObject. - self decodeExtension. \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/instance/extnValue.st b/source/X509.package/X509CertificateExtension.class/instance/extnValue.st deleted file mode 100644 index 6dd8f59..0000000 --- a/source/X509.package/X509CertificateExtension.class/instance/extnValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extnValue - "Answer the value of extnValue" - - ^ extnValue \ No newline at end of file diff --git a/source/X509.package/X509CertificateExtension.class/properties.json b/source/X509.package/X509CertificateExtension.class/properties.json deleted file mode 100644 index 08b7236..0000000 --- a/source/X509.package/X509CertificateExtension.class/properties.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "extnId", - "extnCritical", - "extnValue", - "decodedExtension" - ], - "name" : "X509CertificateExtension", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/README.md b/source/X509.package/X509DistributionPoint.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509DistributionPoint.class/instance/cRLIssuer..st b/source/X509.package/X509DistributionPoint.class/instance/cRLIssuer..st deleted file mode 100644 index 428d977..0000000 --- a/source/X509.package/X509DistributionPoint.class/instance/cRLIssuer..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -cRLIssuer: anObject - "Set the value of cRLIssuer" - - cRLIssuer := anObject \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/instance/cRLIssuer.st b/source/X509.package/X509DistributionPoint.class/instance/cRLIssuer.st deleted file mode 100644 index 79b1d04..0000000 --- a/source/X509.package/X509DistributionPoint.class/instance/cRLIssuer.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -cRLIssuer - "Answer the value of cRLIssuer" - - ^ cRLIssuer \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/instance/distributionPoint..st b/source/X509.package/X509DistributionPoint.class/instance/distributionPoint..st deleted file mode 100644 index e1afec5..0000000 --- a/source/X509.package/X509DistributionPoint.class/instance/distributionPoint..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -distributionPoint: anObject - "Set the value of distributionPoint" - - distributionPoint := anObject \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/instance/distributionPoint.st b/source/X509.package/X509DistributionPoint.class/instance/distributionPoint.st deleted file mode 100644 index 2d5f0e0..0000000 --- a/source/X509.package/X509DistributionPoint.class/instance/distributionPoint.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -distributionPoint - "Answer the value of distributionPoint" - - ^ distributionPoint \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/instance/reasons..st b/source/X509.package/X509DistributionPoint.class/instance/reasons..st deleted file mode 100644 index 7b896de..0000000 --- a/source/X509.package/X509DistributionPoint.class/instance/reasons..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -reasons: anObject - "Set the value of reasons" - - reasons := anObject \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/instance/reasons.st b/source/X509.package/X509DistributionPoint.class/instance/reasons.st deleted file mode 100644 index b753e8a..0000000 --- a/source/X509.package/X509DistributionPoint.class/instance/reasons.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -reasons - "Answer the value of reasons" - - ^ reasons \ No newline at end of file diff --git a/source/X509.package/X509DistributionPoint.class/properties.json b/source/X509.package/X509DistributionPoint.class/properties.json deleted file mode 100644 index e5fbfcf..0000000 --- a/source/X509.package/X509DistributionPoint.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "distributionPoint", - "reasons", - "cRLIssuer" - ], - "name" : "X509DistributionPoint", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509EDIPartyName.class/README.md b/source/X509.package/X509EDIPartyName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509EDIPartyName.class/instance/nameAssigner..st b/source/X509.package/X509EDIPartyName.class/instance/nameAssigner..st deleted file mode 100644 index 659c068..0000000 --- a/source/X509.package/X509EDIPartyName.class/instance/nameAssigner..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -nameAssigner: anObject - "Set the value of nameAssigner" - - nameAssigner := anObject \ No newline at end of file diff --git a/source/X509.package/X509EDIPartyName.class/instance/nameAssigner.st b/source/X509.package/X509EDIPartyName.class/instance/nameAssigner.st deleted file mode 100644 index c79ae96..0000000 --- a/source/X509.package/X509EDIPartyName.class/instance/nameAssigner.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -nameAssigner - "Answer the value of nameAssigner" - - ^ nameAssigner \ No newline at end of file diff --git a/source/X509.package/X509EDIPartyName.class/instance/partyName..st b/source/X509.package/X509EDIPartyName.class/instance/partyName..st deleted file mode 100644 index 8fe5b61..0000000 --- a/source/X509.package/X509EDIPartyName.class/instance/partyName..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -partyName: anObject - "Set the value of partyName" - - partyName := anObject \ No newline at end of file diff --git a/source/X509.package/X509EDIPartyName.class/instance/partyName.st b/source/X509.package/X509EDIPartyName.class/instance/partyName.st deleted file mode 100644 index b376783..0000000 --- a/source/X509.package/X509EDIPartyName.class/instance/partyName.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -partyName - "Answer the value of partyName" - - ^ partyName \ No newline at end of file diff --git a/source/X509.package/X509EDIPartyName.class/properties.json b/source/X509.package/X509EDIPartyName.class/properties.json deleted file mode 100644 index 897200e..0000000 --- a/source/X509.package/X509EDIPartyName.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "nameAssigner", - "partyName" - ], - "name" : "X509EDIPartyName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/README.md b/source/X509.package/X509GeneralSubtree.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509GeneralSubtree.class/instance/base..st b/source/X509.package/X509GeneralSubtree.class/instance/base..st deleted file mode 100644 index 4719bf5..0000000 --- a/source/X509.package/X509GeneralSubtree.class/instance/base..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -base: anObject - "Set the value of base" - - base := anObject \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/instance/base.st b/source/X509.package/X509GeneralSubtree.class/instance/base.st deleted file mode 100644 index 99d6a3a..0000000 --- a/source/X509.package/X509GeneralSubtree.class/instance/base.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -base - "Answer the value of base" - - ^ base \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/instance/maximum..st b/source/X509.package/X509GeneralSubtree.class/instance/maximum..st deleted file mode 100644 index a64cc65..0000000 --- a/source/X509.package/X509GeneralSubtree.class/instance/maximum..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -maximum: anObject - "Set the value of maximum" - - maximum := anObject \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/instance/maximum.st b/source/X509.package/X509GeneralSubtree.class/instance/maximum.st deleted file mode 100644 index 906e9f8..0000000 --- a/source/X509.package/X509GeneralSubtree.class/instance/maximum.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -maximum - "Answer the value of maximum" - - ^ maximum \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/instance/minimum..st b/source/X509.package/X509GeneralSubtree.class/instance/minimum..st deleted file mode 100644 index 37b181e..0000000 --- a/source/X509.package/X509GeneralSubtree.class/instance/minimum..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -minimum: anObject - "Set the value of minimum" - - minimum := anObject \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/instance/minimum.st b/source/X509.package/X509GeneralSubtree.class/instance/minimum.st deleted file mode 100644 index c614ed6..0000000 --- a/source/X509.package/X509GeneralSubtree.class/instance/minimum.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -minimum - "Answer the value of minimum" - - ^ minimum \ No newline at end of file diff --git a/source/X509.package/X509GeneralSubtree.class/properties.json b/source/X509.package/X509GeneralSubtree.class/properties.json deleted file mode 100644 index 44b9d36..0000000 --- a/source/X509.package/X509GeneralSubtree.class/properties.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "base", - "minimum", - "maximum" - ], - "name" : "X509GeneralSubtree", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/README.md b/source/X509.package/X509IssuingDistributionPoint.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/distributionPoint..st b/source/X509.package/X509IssuingDistributionPoint.class/instance/distributionPoint..st deleted file mode 100644 index e1afec5..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/distributionPoint..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -distributionPoint: anObject - "Set the value of distributionPoint" - - distributionPoint := anObject \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/distributionPoint.st b/source/X509.package/X509IssuingDistributionPoint.class/instance/distributionPoint.st deleted file mode 100644 index 2d5f0e0..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/distributionPoint.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -distributionPoint - "Answer the value of distributionPoint" - - ^ distributionPoint \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/indirectCRL..st b/source/X509.package/X509IssuingDistributionPoint.class/instance/indirectCRL..st deleted file mode 100644 index b6cce4c..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/indirectCRL..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -indirectCRL: anObject - "Set the value of indirectCRL" - - indirectCRL := anObject \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/indirectCRL.st b/source/X509.package/X509IssuingDistributionPoint.class/instance/indirectCRL.st deleted file mode 100644 index aefb5ae..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/indirectCRL.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -indirectCRL - "Answer the value of indirectCRL" - - ^ indirectCRL \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsAttributeCerts..st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsAttributeCerts..st deleted file mode 100644 index b8de843..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsAttributeCerts..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlyContainsAttributeCerts: anObject - "Set the value of onlyContainsAttributeCerts" - - onlyContainsAttributeCerts := anObject \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsAttributeCerts.st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsAttributeCerts.st deleted file mode 100644 index e4a39be..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsAttributeCerts.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlyContainsAttributeCerts - "Answer the value of onlyContainsAttributeCerts" - - ^ onlyContainsAttributeCerts \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsCACerts..st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsCACerts..st deleted file mode 100644 index 371a175..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsCACerts..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlyContainsCACerts: anObject - "Set the value of onlyContainsCACerts" - - onlyContainsCACerts := anObject \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsCACerts.st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsCACerts.st deleted file mode 100644 index 129e896..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsCACerts.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlyContainsCACerts - "Answer the value of onlyContainsCACerts" - - ^ onlyContainsCACerts \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsUserCerts..st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsUserCerts..st deleted file mode 100644 index f7a50d7..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsUserCerts..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlyContainsUserCerts: anObject - "Set the value of onlyContainsUserCerts" - - onlyContainsUserCerts := anObject \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsUserCerts.st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsUserCerts.st deleted file mode 100644 index 74ab30e..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlyContainsUserCerts.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlyContainsUserCerts - "Answer the value of onlyContainsUserCerts" - - ^ onlyContainsUserCerts \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlySomeReasons..st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlySomeReasons..st deleted file mode 100644 index f56e50f..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlySomeReasons..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlySomeReasons: anObject - "Set the value of onlySomeReasons" - - onlySomeReasons := anObject \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlySomeReasons.st b/source/X509.package/X509IssuingDistributionPoint.class/instance/onlySomeReasons.st deleted file mode 100644 index 25b2762..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/instance/onlySomeReasons.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -onlySomeReasons - "Answer the value of onlySomeReasons" - - ^ onlySomeReasons \ No newline at end of file diff --git a/source/X509.package/X509IssuingDistributionPoint.class/properties.json b/source/X509.package/X509IssuingDistributionPoint.class/properties.json deleted file mode 100644 index 1825bd4..0000000 --- a/source/X509.package/X509IssuingDistributionPoint.class/properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "distributionPoint", - "onlyContainsUserCerts", - "onlyContainsCACerts", - "onlySomeReasons", - "indirectCRL", - "onlyContainsAttributeCerts" - ], - "name" : "X509IssuingDistributionPoint", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509NameConstraints.class/README.md b/source/X509.package/X509NameConstraints.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509NameConstraints.class/instance/excludedSubtrees..st b/source/X509.package/X509NameConstraints.class/instance/excludedSubtrees..st deleted file mode 100644 index c11be0f..0000000 --- a/source/X509.package/X509NameConstraints.class/instance/excludedSubtrees..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -excludedSubtrees: anObject - "Set the value of excludedSubtrees" - - excludedSubtrees := anObject \ No newline at end of file diff --git a/source/X509.package/X509NameConstraints.class/instance/excludedSubtrees.st b/source/X509.package/X509NameConstraints.class/instance/excludedSubtrees.st deleted file mode 100644 index 74a17fe..0000000 --- a/source/X509.package/X509NameConstraints.class/instance/excludedSubtrees.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -excludedSubtrees - "Answer the value of excludedSubtrees" - - ^ excludedSubtrees \ No newline at end of file diff --git a/source/X509.package/X509NameConstraints.class/instance/permittedSubtrees..st b/source/X509.package/X509NameConstraints.class/instance/permittedSubtrees..st deleted file mode 100644 index 61cca98..0000000 --- a/source/X509.package/X509NameConstraints.class/instance/permittedSubtrees..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -permittedSubtrees: anObject - "Set the value of permittedSubtrees" - - permittedSubtrees := anObject \ No newline at end of file diff --git a/source/X509.package/X509NameConstraints.class/instance/permittedSubtrees.st b/source/X509.package/X509NameConstraints.class/instance/permittedSubtrees.st deleted file mode 100644 index 22b47be..0000000 --- a/source/X509.package/X509NameConstraints.class/instance/permittedSubtrees.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -permittedSubtrees - "Answer the value of permittedSubtrees" - - ^ permittedSubtrees \ No newline at end of file diff --git a/source/X509.package/X509NameConstraints.class/properties.json b/source/X509.package/X509NameConstraints.class/properties.json deleted file mode 100644 index 7a2f683..0000000 --- a/source/X509.package/X509NameConstraints.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "permittedSubtrees", - "excludedSubtrees" - ], - "name" : "X509NameConstraints", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509PolicyConstraints.class/README.md b/source/X509.package/X509PolicyConstraints.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509PolicyConstraints.class/instance/inhibitPolicyMapping..st b/source/X509.package/X509PolicyConstraints.class/instance/inhibitPolicyMapping..st deleted file mode 100644 index 779bfb8..0000000 --- a/source/X509.package/X509PolicyConstraints.class/instance/inhibitPolicyMapping..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -inhibitPolicyMapping: anObject - "Set the value of inhibitPolicyMapping" - - inhibitPolicyMapping := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyConstraints.class/instance/inhibitPolicyMapping.st b/source/X509.package/X509PolicyConstraints.class/instance/inhibitPolicyMapping.st deleted file mode 100644 index dbe5eb7..0000000 --- a/source/X509.package/X509PolicyConstraints.class/instance/inhibitPolicyMapping.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -inhibitPolicyMapping - "Answer the value of inhibitPolicyMapping" - - ^ inhibitPolicyMapping \ No newline at end of file diff --git a/source/X509.package/X509PolicyConstraints.class/instance/requireExplicitPolicy..st b/source/X509.package/X509PolicyConstraints.class/instance/requireExplicitPolicy..st deleted file mode 100644 index 1c30630..0000000 --- a/source/X509.package/X509PolicyConstraints.class/instance/requireExplicitPolicy..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -requireExplicitPolicy: anObject - "Set the value of requireExplicitPolicy" - - requireExplicitPolicy := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyConstraints.class/instance/requireExplicitPolicy.st b/source/X509.package/X509PolicyConstraints.class/instance/requireExplicitPolicy.st deleted file mode 100644 index bde1520..0000000 --- a/source/X509.package/X509PolicyConstraints.class/instance/requireExplicitPolicy.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -requireExplicitPolicy - "Answer the value of requireExplicitPolicy" - - ^ requireExplicitPolicy \ No newline at end of file diff --git a/source/X509.package/X509PolicyConstraints.class/properties.json b/source/X509.package/X509PolicyConstraints.class/properties.json deleted file mode 100644 index 833fdd6..0000000 --- a/source/X509.package/X509PolicyConstraints.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "requireExplicitPolicy", - "inhibitPolicyMapping" - ], - "name" : "X509PolicyConstraints", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509PolicyInformation.class/README.md b/source/X509.package/X509PolicyInformation.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509PolicyInformation.class/instance/id..st b/source/X509.package/X509PolicyInformation.class/instance/id..st deleted file mode 100644 index 5c091f3..0000000 --- a/source/X509.package/X509PolicyInformation.class/instance/id..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -id: anObject - "Set the value of id" - - id := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyInformation.class/instance/id.st b/source/X509.package/X509PolicyInformation.class/instance/id.st deleted file mode 100644 index c6d3a2f..0000000 --- a/source/X509.package/X509PolicyInformation.class/instance/id.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -id - "Answer the value of id" - - ^ id \ No newline at end of file diff --git a/source/X509.package/X509PolicyInformation.class/instance/qualifiers..st b/source/X509.package/X509PolicyInformation.class/instance/qualifiers..st deleted file mode 100644 index 57f4930..0000000 --- a/source/X509.package/X509PolicyInformation.class/instance/qualifiers..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -qualifiers: anObject - "Set the value of qualifiers" - - qualifiers := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyInformation.class/instance/qualifiers.st b/source/X509.package/X509PolicyInformation.class/instance/qualifiers.st deleted file mode 100644 index 728f5f6..0000000 --- a/source/X509.package/X509PolicyInformation.class/instance/qualifiers.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -qualifiers - "Answer the value of qualifiers" - - ^ qualifiers \ No newline at end of file diff --git a/source/X509.package/X509PolicyInformation.class/properties.json b/source/X509.package/X509PolicyInformation.class/properties.json deleted file mode 100644 index 31a78b1..0000000 --- a/source/X509.package/X509PolicyInformation.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "id", - "qualifiers" - ], - "name" : "X509PolicyInformation", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509PolicyMapping.class/README.md b/source/X509.package/X509PolicyMapping.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509PolicyMapping.class/instance/issuerDomainPolicy..st b/source/X509.package/X509PolicyMapping.class/instance/issuerDomainPolicy..st deleted file mode 100644 index 0f0ef1e..0000000 --- a/source/X509.package/X509PolicyMapping.class/instance/issuerDomainPolicy..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -issuerDomainPolicy: anObject - "Set the value of issuerDomainPolicy" - - issuerDomainPolicy := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyMapping.class/instance/issuerDomainPolicy.st b/source/X509.package/X509PolicyMapping.class/instance/issuerDomainPolicy.st deleted file mode 100644 index f13cffc..0000000 --- a/source/X509.package/X509PolicyMapping.class/instance/issuerDomainPolicy.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -issuerDomainPolicy - "Answer the value of issuerDomainPolicy" - - ^ issuerDomainPolicy \ No newline at end of file diff --git a/source/X509.package/X509PolicyMapping.class/instance/subjectDomainPolicy..st b/source/X509.package/X509PolicyMapping.class/instance/subjectDomainPolicy..st deleted file mode 100644 index 5db7257..0000000 --- a/source/X509.package/X509PolicyMapping.class/instance/subjectDomainPolicy..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subjectDomainPolicy: anObject - "Set the value of subjectDomainPolicy" - - subjectDomainPolicy := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyMapping.class/instance/subjectDomainPolicy.st b/source/X509.package/X509PolicyMapping.class/instance/subjectDomainPolicy.st deleted file mode 100644 index 19ce125..0000000 --- a/source/X509.package/X509PolicyMapping.class/instance/subjectDomainPolicy.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subjectDomainPolicy - "Answer the value of subjectDomainPolicy" - - ^ subjectDomainPolicy \ No newline at end of file diff --git a/source/X509.package/X509PolicyMapping.class/properties.json b/source/X509.package/X509PolicyMapping.class/properties.json deleted file mode 100644 index 3ed5e2c..0000000 --- a/source/X509.package/X509PolicyMapping.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "issuerDomainPolicy", - "subjectDomainPolicy" - ], - "name" : "X509PolicyMapping", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509PolicyQualifierInfo.class/README.md b/source/X509.package/X509PolicyQualifierInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509PolicyQualifierInfo.class/instance/id..st b/source/X509.package/X509PolicyQualifierInfo.class/instance/id..st deleted file mode 100644 index 5c091f3..0000000 --- a/source/X509.package/X509PolicyQualifierInfo.class/instance/id..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -id: anObject - "Set the value of id" - - id := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyQualifierInfo.class/instance/id.st b/source/X509.package/X509PolicyQualifierInfo.class/instance/id.st deleted file mode 100644 index c6d3a2f..0000000 --- a/source/X509.package/X509PolicyQualifierInfo.class/instance/id.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -id - "Answer the value of id" - - ^ id \ No newline at end of file diff --git a/source/X509.package/X509PolicyQualifierInfo.class/instance/qualifier..st b/source/X509.package/X509PolicyQualifierInfo.class/instance/qualifier..st deleted file mode 100644 index 509f46d..0000000 --- a/source/X509.package/X509PolicyQualifierInfo.class/instance/qualifier..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -qualifier: anObject - "Set the value of qualifier" - - qualifier := anObject \ No newline at end of file diff --git a/source/X509.package/X509PolicyQualifierInfo.class/instance/qualifier.st b/source/X509.package/X509PolicyQualifierInfo.class/instance/qualifier.st deleted file mode 100644 index a62923c..0000000 --- a/source/X509.package/X509PolicyQualifierInfo.class/instance/qualifier.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -qualifier - "Answer the value of qualifier" - - ^ qualifier \ No newline at end of file diff --git a/source/X509.package/X509PolicyQualifierInfo.class/properties.json b/source/X509.package/X509PolicyQualifierInfo.class/properties.json deleted file mode 100644 index 75a29c0..0000000 --- a/source/X509.package/X509PolicyQualifierInfo.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509-Extensions", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "id", - "qualifier" - ], - "name" : "X509PolicyQualifierInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/README.md b/source/X509.package/X509SubjectPublicKeyInfo.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/algorithm..st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/algorithm..st deleted file mode 100644 index cf29740..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/algorithm..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -algorithm: anObject - "Set the value of algorithm" - - algorithm := anObject \ No newline at end of file diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/algorithm.st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/algorithm.st deleted file mode 100644 index a0f8072..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/algorithm.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -algorithm - "Answer the value of algorithm" - - ^ algorithm \ No newline at end of file diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asDSAPublicKey.st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asDSAPublicKey.st deleted file mode 100644 index f20bfd1..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asDSAPublicKey.st +++ /dev/null @@ -1,7 +0,0 @@ -private -asDSAPublicKey - - | params y | - params := self algorithm parameters. - y := self subjectPublicKeyDecoded. - ^ DSAPublicKey p: (params at: 1) q: (params at: 2) g: (params at: 3) y: y. diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asPublicKey.st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asPublicKey.st deleted file mode 100644 index 49ee2a8..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asPublicKey.st +++ /dev/null @@ -1,6 +0,0 @@ -accessing -asPublicKey - - self algorithm isDSA ifTrue: [^ self asDSAPublicKey]. - self algorithm isRSA ifTrue: [^ self asRSAPublicKey]. - ^ nil \ No newline at end of file diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asRSAPublicKey.st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asRSAPublicKey.st deleted file mode 100644 index e38b29f..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/asRSAPublicKey.st +++ /dev/null @@ -1,6 +0,0 @@ -private -asRSAPublicKey - - | keys | - keys := self subjectPublicKeyDecoded. - ^ (RSAPublicKey exponent: (keys at: 2) asInteger modulo: (keys at: 1) asInteger). diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKey..st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKey..st deleted file mode 100644 index 8e1d8b0..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKey..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subjectPublicKey: anObject - "Set the value of subjectPublicKey" - - subjectPublicKey := anObject \ No newline at end of file diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKey.st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKey.st deleted file mode 100644 index c407025..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKey.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subjectPublicKey - "Answer the value of subjectPublicKey" - - ^ subjectPublicKey \ No newline at end of file diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKeyDecoded.st b/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKeyDecoded.st deleted file mode 100644 index c77f2ce..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/instance/subjectPublicKeyDecoded.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -subjectPublicKeyDecoded - - ^ ASN1Stream decodeBytes: self subjectPublicKey bytes. diff --git a/source/X509.package/X509SubjectPublicKeyInfo.class/properties.json b/source/X509.package/X509SubjectPublicKeyInfo.class/properties.json deleted file mode 100644 index c572094..0000000 --- a/source/X509.package/X509SubjectPublicKeyInfo.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "algorithm", - "subjectPublicKey" - ], - "name" : "X509SubjectPublicKeyInfo", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/README.md b/source/X509.package/X509TBSCertificate.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509TBSCertificate.class/instance/asAsn1Bytes.st b/source/X509.package/X509TBSCertificate.class/instance/asAsn1Bytes.st deleted file mode 100644 index 6bde2b4..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/asAsn1Bytes.st +++ /dev/null @@ -1,6 +0,0 @@ -initialize-release -asAsn1Bytes - - | type | - type := (ASN1Module name: #x509) find: #TBSCertificate. - ^ ASN1Stream encode: self withType: type diff --git a/source/X509.package/X509TBSCertificate.class/instance/extensions..st b/source/X509.package/X509TBSCertificate.class/instance/extensions..st deleted file mode 100644 index 167bb8f..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/extensions..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extensions: anObject - "Set the value of extensions" - - extensions := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/extensions.st b/source/X509.package/X509TBSCertificate.class/instance/extensions.st deleted file mode 100644 index 5696bff..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/extensions.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -extensions - "Answer the value of extensions" - - ^ extensions \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/issuer..st b/source/X509.package/X509TBSCertificate.class/instance/issuer..st deleted file mode 100644 index 71aaa7f..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/issuer..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -issuer: anObject - "Set the value of issuer" - - issuer := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/issuer.st b/source/X509.package/X509TBSCertificate.class/instance/issuer.st deleted file mode 100644 index 883c5df..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/issuer.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -issuer - "Answer the value of issuer" - - ^ issuer \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/issuerUniqueID.st b/source/X509.package/X509TBSCertificate.class/instance/issuerUniqueID.st deleted file mode 100644 index 2ac4ba2..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/issuerUniqueID.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -issuerUniqueID - - ^ nil \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/serialNumber..st b/source/X509.package/X509TBSCertificate.class/instance/serialNumber..st deleted file mode 100644 index 484ec36..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/serialNumber..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -serialNumber: anObject - "Set the value of serialNumber" - - serialNumber := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/serialNumber.st b/source/X509.package/X509TBSCertificate.class/instance/serialNumber.st deleted file mode 100644 index b9efcb6..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/serialNumber.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -serialNumber - "Answer the value of serialNumber" - - ^ serialNumber \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/signature..st b/source/X509.package/X509TBSCertificate.class/instance/signature..st deleted file mode 100644 index 64aac4f..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/signature..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -signature: anObject - "Set the value of signature" - - signature := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/signature.st b/source/X509.package/X509TBSCertificate.class/instance/signature.st deleted file mode 100644 index a3c79be..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/signature.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -signature - "Answer the value of signature" - - ^ signature \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/subject..st b/source/X509.package/X509TBSCertificate.class/instance/subject..st deleted file mode 100644 index f9f8273..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/subject..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subject: anObject - "Set the value of subject" - - subject := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/subject.st b/source/X509.package/X509TBSCertificate.class/instance/subject.st deleted file mode 100644 index 288400b..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/subject.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subject - "Answer the value of subject" - - ^ subject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/subjectPublicKeyInfo..st b/source/X509.package/X509TBSCertificate.class/instance/subjectPublicKeyInfo..st deleted file mode 100644 index 350f48f..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/subjectPublicKeyInfo..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subjectPublicKeyInfo: anObject - "Set the value of subjectPublicKeyInfo" - - subjectPublicKeyInfo := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/subjectPublicKeyInfo.st b/source/X509.package/X509TBSCertificate.class/instance/subjectPublicKeyInfo.st deleted file mode 100644 index d5364cc..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/subjectPublicKeyInfo.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -subjectPublicKeyInfo - "Answer the value of subjectPublicKeyInfo" - - ^ subjectPublicKeyInfo \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/subjectUniqueID.st b/source/X509.package/X509TBSCertificate.class/instance/subjectUniqueID.st deleted file mode 100644 index be98f7a..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/subjectUniqueID.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -subjectUniqueID - - ^ nil \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/validity..st b/source/X509.package/X509TBSCertificate.class/instance/validity..st deleted file mode 100644 index dcee5bf..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/validity..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -validity: anObject - "Set the value of validity" - - validity := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/validity.st b/source/X509.package/X509TBSCertificate.class/instance/validity.st deleted file mode 100644 index 71fc3b0..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/validity.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -validity - "Answer the value of validity" - - ^ validity \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/version..st b/source/X509.package/X509TBSCertificate.class/instance/version..st deleted file mode 100644 index 26b1d28..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/version..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version: anObject - "Set the value of version" - - version := anObject \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/instance/version.st b/source/X509.package/X509TBSCertificate.class/instance/version.st deleted file mode 100644 index 0d6003d..0000000 --- a/source/X509.package/X509TBSCertificate.class/instance/version.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -version - "Answer the value of version" - - ^ version \ No newline at end of file diff --git a/source/X509.package/X509TBSCertificate.class/properties.json b/source/X509.package/X509TBSCertificate.class/properties.json deleted file mode 100644 index ab69ed7..0000000 --- a/source/X509.package/X509TBSCertificate.class/properties.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "version", - "serialNumber", - "signature", - "issuer", - "validity", - "subject", - "subjectPublicKeyInfo", - "extensions" - ], - "name" : "X509TBSCertificate", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X509Validity.class/README.md b/source/X509.package/X509Validity.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X509Validity.class/instance/notAfter..st b/source/X509.package/X509Validity.class/instance/notAfter..st deleted file mode 100644 index f3befda..0000000 --- a/source/X509.package/X509Validity.class/instance/notAfter..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -notAfter: anObject - "Set the value of notAfter" - - notAfter := anObject \ No newline at end of file diff --git a/source/X509.package/X509Validity.class/instance/notAfter.st b/source/X509.package/X509Validity.class/instance/notAfter.st deleted file mode 100644 index 285042c..0000000 --- a/source/X509.package/X509Validity.class/instance/notAfter.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -notAfter - "Answer the value of notAfter" - - ^ notAfter \ No newline at end of file diff --git a/source/X509.package/X509Validity.class/instance/notBefore..st b/source/X509.package/X509Validity.class/instance/notBefore..st deleted file mode 100644 index 3dfaea5..0000000 --- a/source/X509.package/X509Validity.class/instance/notBefore..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -notBefore: anObject - "Set the value of notBefore" - - notBefore := anObject \ No newline at end of file diff --git a/source/X509.package/X509Validity.class/instance/notBefore.st b/source/X509.package/X509Validity.class/instance/notBefore.st deleted file mode 100644 index 1531636..0000000 --- a/source/X509.package/X509Validity.class/instance/notBefore.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -notBefore - "Answer the value of notBefore" - - ^ notBefore \ No newline at end of file diff --git a/source/X509.package/X509Validity.class/properties.json b/source/X509.package/X509Validity.class/properties.json deleted file mode 100644 index 21aa1da..0000000 --- a/source/X509.package/X509Validity.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "notBefore", - "notAfter" - ], - "name" : "X509Validity", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520AbstractName.class/README.md b/source/X509.package/X520AbstractName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520AbstractName.class/instance/^equals.st b/source/X509.package/X520AbstractName.class/instance/^equals.st deleted file mode 100644 index 8e7ef69..0000000 --- a/source/X509.package/X520AbstractName.class/instance/^equals.st +++ /dev/null @@ -1,4 +0,0 @@ -comparing -= anotherName - - ^ self string = anotherName string diff --git a/source/X509.package/X520AbstractName.class/instance/displayName.st b/source/X509.package/X520AbstractName.class/instance/displayName.st deleted file mode 100644 index 63033df..0000000 --- a/source/X509.package/X520AbstractName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'A' \ No newline at end of file diff --git a/source/X509.package/X520AbstractName.class/instance/hash.st b/source/X509.package/X520AbstractName.class/instance/hash.st deleted file mode 100644 index 8079d51..0000000 --- a/source/X509.package/X520AbstractName.class/instance/hash.st +++ /dev/null @@ -1,4 +0,0 @@ -comparing -hash - - ^ self string hash diff --git a/source/X509.package/X520AbstractName.class/instance/printOn..st b/source/X509.package/X520AbstractName.class/instance/printOn..st deleted file mode 100644 index 88849e8..0000000 --- a/source/X509.package/X520AbstractName.class/instance/printOn..st +++ /dev/null @@ -1,6 +0,0 @@ -printing -printOn: stream - - stream nextPutAll: self displayName. - stream nextPutAll: ' = '. - self string printOn: stream. diff --git a/source/X509.package/X520AbstractName.class/instance/string..st b/source/X509.package/X520AbstractName.class/instance/string..st deleted file mode 100644 index 41f5094..0000000 --- a/source/X509.package/X520AbstractName.class/instance/string..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -string: anObject - "Set the value of string" - - string := anObject \ No newline at end of file diff --git a/source/X509.package/X520AbstractName.class/instance/string.st b/source/X509.package/X520AbstractName.class/instance/string.st deleted file mode 100644 index 1b9f672..0000000 --- a/source/X509.package/X520AbstractName.class/instance/string.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -string - "Answer the value of string" - - ^ string \ No newline at end of file diff --git a/source/X509.package/X520AbstractName.class/properties.json b/source/X509.package/X520AbstractName.class/properties.json deleted file mode 100644 index f1850f2..0000000 --- a/source/X509.package/X520AbstractName.class/properties.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "string" - ], - "name" : "X520AbstractName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/README.md b/source/X509.package/X520Attribute.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520Attribute.class/instance/^equals.st b/source/X509.package/X520Attribute.class/instance/^equals.st deleted file mode 100644 index e4a4f21..0000000 --- a/source/X509.package/X520Attribute.class/instance/^equals.st +++ /dev/null @@ -1,5 +0,0 @@ -comparing -= attr - - ^ self attrOid = attr attrOid - and: [self attrValue = attr attrValue] \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/instance/attrOid..st b/source/X509.package/X520Attribute.class/instance/attrOid..st deleted file mode 100644 index 284e64f..0000000 --- a/source/X509.package/X520Attribute.class/instance/attrOid..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -attrOid: anObject - "Set the value of attrOid" - - attrOid := anObject \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/instance/attrOid.st b/source/X509.package/X520Attribute.class/instance/attrOid.st deleted file mode 100644 index 5ad1a4c..0000000 --- a/source/X509.package/X520Attribute.class/instance/attrOid.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -attrOid - "Answer the value of attrOid" - - ^ attrOid \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/instance/attrValue..st b/source/X509.package/X520Attribute.class/instance/attrValue..st deleted file mode 100644 index 8b8a76c..0000000 --- a/source/X509.package/X520Attribute.class/instance/attrValue..st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -attrValue: anObject - "Set the value of attrValue" - - attrValue := anObject \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/instance/attrValue.st b/source/X509.package/X520Attribute.class/instance/attrValue.st deleted file mode 100644 index aa9ee60..0000000 --- a/source/X509.package/X520Attribute.class/instance/attrValue.st +++ /dev/null @@ -1,5 +0,0 @@ -accessing -attrValue - "Answer the value of attrValue" - - ^ attrValue \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/instance/hash.st b/source/X509.package/X520Attribute.class/instance/hash.st deleted file mode 100644 index 2d7f99c..0000000 --- a/source/X509.package/X520Attribute.class/instance/hash.st +++ /dev/null @@ -1,4 +0,0 @@ -comparing -hash - - ^ self attrOid hash + self attrValue hash \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/instance/printOn..st b/source/X509.package/X520Attribute.class/instance/printOn..st deleted file mode 100644 index 1023ddc..0000000 --- a/source/X509.package/X520Attribute.class/instance/printOn..st +++ /dev/null @@ -1,4 +0,0 @@ -initialize-release -printOn: stream - - stream nextPutAll: self attrValue asString. diff --git a/source/X509.package/X520Attribute.class/instance/shortName.st b/source/X509.package/X520Attribute.class/instance/shortName.st deleted file mode 100644 index 8231a08..0000000 --- a/source/X509.package/X520Attribute.class/instance/shortName.st +++ /dev/null @@ -1,4 +0,0 @@ -accessing -shortName - - ^ 'Attribute-', self attrOid oid \ No newline at end of file diff --git a/source/X509.package/X520Attribute.class/properties.json b/source/X509.package/X520Attribute.class/properties.json deleted file mode 100644 index b60021c..0000000 --- a/source/X509.package/X520Attribute.class/properties.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "commentStamp" : "", - "super" : "Object", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ - "attrOid", - "attrValue" - ], - "name" : "X520Attribute", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520CommonName.class/README.md b/source/X509.package/X520CommonName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520CommonName.class/instance/displayName.st b/source/X509.package/X520CommonName.class/instance/displayName.st deleted file mode 100644 index 8e3a926..0000000 --- a/source/X509.package/X520CommonName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'CN' \ No newline at end of file diff --git a/source/X509.package/X520CommonName.class/properties.json b/source/X509.package/X520CommonName.class/properties.json deleted file mode 100644 index 557fd3b..0000000 --- a/source/X509.package/X520CommonName.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520CommonName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520CountryName.class/README.md b/source/X509.package/X520CountryName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520CountryName.class/instance/displayName.st b/source/X509.package/X520CountryName.class/instance/displayName.st deleted file mode 100644 index 45c427e..0000000 --- a/source/X509.package/X520CountryName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'C' \ No newline at end of file diff --git a/source/X509.package/X520CountryName.class/properties.json b/source/X509.package/X520CountryName.class/properties.json deleted file mode 100644 index 22738b2..0000000 --- a/source/X509.package/X520CountryName.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520CountryName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520LocalityName.class/README.md b/source/X509.package/X520LocalityName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520LocalityName.class/instance/displayName.st b/source/X509.package/X520LocalityName.class/instance/displayName.st deleted file mode 100644 index f59862d..0000000 --- a/source/X509.package/X520LocalityName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'L' \ No newline at end of file diff --git a/source/X509.package/X520LocalityName.class/properties.json b/source/X509.package/X520LocalityName.class/properties.json deleted file mode 100644 index 2530931..0000000 --- a/source/X509.package/X520LocalityName.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520LocalityName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520Name.class/README.md b/source/X509.package/X520Name.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520Name.class/instance/displayName.st b/source/X509.package/X520Name.class/instance/displayName.st deleted file mode 100644 index c076b88..0000000 --- a/source/X509.package/X520Name.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'N' \ No newline at end of file diff --git a/source/X509.package/X520Name.class/properties.json b/source/X509.package/X520Name.class/properties.json deleted file mode 100644 index 377cd5e..0000000 --- a/source/X509.package/X520Name.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520Name", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520OrganizationName.class/README.md b/source/X509.package/X520OrganizationName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520OrganizationName.class/instance/displayName.st b/source/X509.package/X520OrganizationName.class/instance/displayName.st deleted file mode 100644 index cf5501d..0000000 --- a/source/X509.package/X520OrganizationName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'O' \ No newline at end of file diff --git a/source/X509.package/X520OrganizationName.class/properties.json b/source/X509.package/X520OrganizationName.class/properties.json deleted file mode 100644 index c9047b5..0000000 --- a/source/X509.package/X520OrganizationName.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520OrganizationName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520OrganizationalUnitName.class/README.md b/source/X509.package/X520OrganizationalUnitName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520OrganizationalUnitName.class/instance/displayName.st b/source/X509.package/X520OrganizationalUnitName.class/instance/displayName.st deleted file mode 100644 index 40283a9..0000000 --- a/source/X509.package/X520OrganizationalUnitName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'OU' \ No newline at end of file diff --git a/source/X509.package/X520OrganizationalUnitName.class/properties.json b/source/X509.package/X520OrganizationalUnitName.class/properties.json deleted file mode 100644 index 77527fd..0000000 --- a/source/X509.package/X520OrganizationalUnitName.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520OrganizationalUnitName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520Pkcs9EmailAddress.class/README.md b/source/X509.package/X520Pkcs9EmailAddress.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520Pkcs9EmailAddress.class/instance/displayName.st b/source/X509.package/X520Pkcs9EmailAddress.class/instance/displayName.st deleted file mode 100644 index 94a7509..0000000 --- a/source/X509.package/X520Pkcs9EmailAddress.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'E' \ No newline at end of file diff --git a/source/X509.package/X520Pkcs9EmailAddress.class/properties.json b/source/X509.package/X520Pkcs9EmailAddress.class/properties.json deleted file mode 100644 index 0d8774d..0000000 --- a/source/X509.package/X520Pkcs9EmailAddress.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520Pkcs9EmailAddress", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/X520StateOrProvinceName.class/README.md b/source/X509.package/X520StateOrProvinceName.class/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/X520StateOrProvinceName.class/instance/displayName.st b/source/X509.package/X520StateOrProvinceName.class/instance/displayName.st deleted file mode 100644 index d86ecb4..0000000 --- a/source/X509.package/X520StateOrProvinceName.class/instance/displayName.st +++ /dev/null @@ -1,4 +0,0 @@ -printing -displayName - - ^ 'S' \ No newline at end of file diff --git a/source/X509.package/X520StateOrProvinceName.class/properties.json b/source/X509.package/X520StateOrProvinceName.class/properties.json deleted file mode 100644 index e548601..0000000 --- a/source/X509.package/X520StateOrProvinceName.class/properties.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commentStamp" : "", - "super" : "X520AbstractName", - "category" : "X509", - "classinstvars" : [ ], - "pools" : [ ], - "classvars" : [ ], - "instvars" : [ ], - "name" : "X520StateOrProvinceName", - "type" : "normal" -} \ No newline at end of file diff --git a/source/X509.package/monticello.meta/categories.st b/source/X509.package/monticello.meta/categories.st deleted file mode 100644 index d0fbf1f..0000000 --- a/source/X509.package/monticello.meta/categories.st +++ /dev/null @@ -1,2 +0,0 @@ -SystemOrganization addCategory: #X509! -SystemOrganization addCategory: #'X509-Extensions'! diff --git a/source/X509.package/monticello.meta/initializers.st b/source/X509.package/monticello.meta/initializers.st deleted file mode 100644 index e69de29..0000000 diff --git a/source/X509.package/monticello.meta/package b/source/X509.package/monticello.meta/package deleted file mode 100644 index 41f8923..0000000 --- a/source/X509.package/monticello.meta/package +++ /dev/null @@ -1 +0,0 @@ -(name 'X509') \ No newline at end of file diff --git a/source/X509.package/properties.json b/source/X509.package/properties.json deleted file mode 100644 index 6f31cf5..0000000 --- a/source/X509.package/properties.json +++ /dev/null @@ -1 +0,0 @@ -{ } \ No newline at end of file diff --git a/source/X509/X509AccessDescription.class.st b/source/X509/X509AccessDescription.class.st new file mode 100644 index 0000000..c6cf8f4 --- /dev/null +++ b/source/X509/X509AccessDescription.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509AccessDescription, + #superclass : #Object, + #instVars : [ + 'accessMethod', + 'accessLocation' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509AccessDescription >> accessLocation [ + "Answer the value of accessLocation" + + ^ accessLocation +] + +{ #category : #accessing } +X509AccessDescription >> accessLocation: anObject [ + "Set the value of accessLocation" + + accessLocation := anObject +] + +{ #category : #accessing } +X509AccessDescription >> accessMethod [ + "Answer the value of accessMethod" + + ^ accessMethod +] + +{ #category : #accessing } +X509AccessDescription >> accessMethod: anObject [ + "Set the value of accessMethod" + + accessMethod := anObject +] diff --git a/source/X509/X509AlgorithmIdentifier.class.st b/source/X509/X509AlgorithmIdentifier.class.st new file mode 100644 index 0000000..3901cb2 --- /dev/null +++ b/source/X509/X509AlgorithmIdentifier.class.st @@ -0,0 +1,121 @@ +Class { + #name : #X509AlgorithmIdentifier, + #superclass : #Object, + #instVars : [ + 'oid', + 'parameters', + 'hasParameters' + ], + #category : 'X509' +} + +{ #category : #'instance creation' } +X509AlgorithmIdentifier class >> oid: oid [ + + ^ self new + oid: oid; + yourself +] + +{ #category : #'instance creation' } +X509AlgorithmIdentifier class >> oid: oid parameters: params [ + + ^ self new + oid: oid; + parameters: params; + yourself +] + +{ #category : #'instance creation' } +X509AlgorithmIdentifier class >> oidString: oidString [ + + ^ self oid: (ASN1ObjectId fromString: oidString). + +] + +{ #category : #'instance creation' } +X509AlgorithmIdentifier class >> oidString: oidString parameters: params [ + + ^ self oid: (ASN1ObjectId fromString: oidString) parameters: params. + +] + +{ #category : #accessing } +X509AlgorithmIdentifier >> hasParameters [ + "Answer the value of hasParameters" + + ^ hasParameters +] + +{ #category : #accessing } +X509AlgorithmIdentifier >> hasParameters: anObject [ + "Set the value of hasParameters" + + hasParameters := anObject +] + +{ #category : #'initialize-release' } +X509AlgorithmIdentifier >> initialize [ + + self hasParameters: false. +] + +{ #category : #testing } +X509AlgorithmIdentifier >> isDSA [ + + ^ self oid oid = '1.2.840.10040.4.1' + +] + +{ #category : #testing } +X509AlgorithmIdentifier >> isRSA [ + + ^ self oid oid = '1.2.840.113549.1.1.1' + +] + +{ #category : #testing } +X509AlgorithmIdentifier >> isTripleDESCBC [ + + ^ self oid oid = '1.2.840.113549.3.7' + +] + +{ #category : #accessing } +X509AlgorithmIdentifier >> oid [ + "Answer the value of oid" + + ^ oid +] + +{ #category : #accessing } +X509AlgorithmIdentifier >> oid: anObject [ + "Set the value of oid" + + oid := anObject +] + +{ #category : #accessing } +X509AlgorithmIdentifier >> parameters [ + "Answer the value of parameters" + + ^ parameters +] + +{ #category : #accessing } +X509AlgorithmIdentifier >> parameters: anObject [ + "Set the value of parameters" + + self hasParameters: true. + parameters := anObject +] + +{ #category : #printing } +X509AlgorithmIdentifier >> printOn: stream [ + + super printOn: stream. + stream nextPutAll: '('. + stream nextPutAll: self oid asString. + stream nextPutAll: ')'. + +] diff --git a/source/X509/X509AnotherName.class.st b/source/X509/X509AnotherName.class.st new file mode 100644 index 0000000..3087234 --- /dev/null +++ b/source/X509/X509AnotherName.class.st @@ -0,0 +1,36 @@ +Class { + #name : #X509AnotherName, + #superclass : #Object, + #instVars : [ + 'typeId', + 'value' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509AnotherName >> typeId [ + "Answer the value of typeId" + + ^ typeId +] + +{ #category : #accessing } +X509AnotherName >> typeId: anObject [ + "Set the value of typeId" + + typeId := anObject +] + +{ #category : #accessing } +X509AnotherName >> value [ + + ^ value +] + +{ #category : #accessing } +X509AnotherName >> value: anObject [ + "Set the value of value" + + value := anObject +] diff --git a/source/X509/X509AuthorityKeyIdentifier.class.st b/source/X509/X509AuthorityKeyIdentifier.class.st new file mode 100644 index 0000000..e27d91f --- /dev/null +++ b/source/X509/X509AuthorityKeyIdentifier.class.st @@ -0,0 +1,161 @@ +Class { + #name : #X509AuthorityKeyIdentifier, + #superclass : #Object, + #instVars : [ + 'keyIdentifier', + 'certIssuer', + 'certSerialNumber' + ], + #category : 'X509-Extensions' +} + +{ #category : #'as yet unclassified' } +X509AuthorityKeyIdentifier class >> initializeASN1Types [ + + ((ASN1Module name: #x509) sequence: #Certificate mapping: X509Certificate) + add: #tbsCertificate type: #TBSCertificate; + add: #signatureAlgorithm type: #AlgorithmIdentifier; + add: #signature type: #ASN1BitStringType; + yourself. + (ASN1Module name: #x509) find: #Certificate. + + ((ASN1Module name: #x509) sequence: #TBSCertificate mapping: X509TBSCertificate) + add: #version type: #Version explicitTag: 0 default: 0; + add: #serialNumber type: #CertificateSerialNumber; + add: #signature type: #AlgorithmIdentifier; + add: #issuer type: #Name; + add: #validity type: #Validity; + add: #subject type: #Name; + add: #subjectPublicKeyInfo type: #SubjectPublicKeyInfo; + addOptional: #issuerUniqueID type: #UniqueIdentifier implicitTag: 1; + addOptional: #subjectUniqueID type: #UniqueIdentifier implicitTag: 2; + addOptional: #extensions type: #Extensions explicitTag: 3; + yourself. + + ((ASN1Module name: #x509) sequence: #AlgorithmIdentifier mapping: X509AlgorithmIdentifier) + add: #oid type: #ASN1ObjectIdentifierType; + addOptional: #parameters type: #ASN1AnyType; + yourself. + + (ASN1Module name: #x509) integer: #Version. + (ASN1Module name: #x509) integer: #CertificateSerialNumber. + (ASN1Module name: #x509) bitString: #UniqueIdentifier. + (ASN1Module name: #x509) sequence: #Extensions of: #Extension. + + ((ASN1Module name: #x509) sequence: #Validity mapping: X509Validity) + add: #notBefore type: #Time; + add: #notAfter type: #Time; + yourself. + (ASN1Module name: #x509) utcTime: #Time. + + ((ASN1Module name: #x509) sequence: #AttributeTypeAndValue mapping: X520Attribute) + add: #attrOid type: #AttributeType; + add: #attrValue type: #AttributeValue; + yourself. + (ASN1Module name: #x509) objectIdentifier: #AttributeType. + ((ASN1Module name: #x509) any: #AttributeValue definedBy: #attrOid) + at: (ASN1ObjectId fromString: '2.5.4.41') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.4') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.42') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.43') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.44') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.3') put: #X520CommonName; + at: (ASN1ObjectId fromString: '2.5.4.7') put: #X520LocalityName; + at: (ASN1ObjectId fromString: '2.5.4.8') put: #X520StateOrProvinceName; + at: (ASN1ObjectId fromString: '2.5.4.10') put: #X520OrganizationName; + at: (ASN1ObjectId fromString: '2.5.4.11') put: #X520OrganizationalUnitName; + at: (ASN1ObjectId fromString: '2.5.4.6') put: #X520CountryName; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.1') put: #X520Pkcs9EmailAddress; + defaultType: #ASN1StringType; + yourself. + ((ASN1Module name: #x509) choice: #X509StringChoice) + add: #teletexString type: #ASN1TeletexStringType; + add: #printableString type: #ASN1PrintableStringType; + add: #universalString type: #ASN1UniversalStringType; + add: #utf8String type: #ASN1StringType; + add: #bmpString type: #ASN1BMPStringType; + yourself. + ((ASN1Module name: #x509) mapped: #X520Name) + mapping: X520Name mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520CommonName) + mapping: X520CommonName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520LocalityName) + mapping: X520LocalityName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520StateOrProvinceName) + mapping: X520StateOrProvinceName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520OrganizationName) + mapping: X520OrganizationName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520OrganizationalUnitName) + mapping: X520OrganizationalUnitName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520CountryName) + mapping: X520CountryName mappingSymbol: #string type: #ASN1PrintableStringType. + ((ASN1Module name: #x509) mapped: #X520Pkcs9EmailAddress) + mapping: X520Pkcs9EmailAddress mappingSymbol: #string type: #ASN1IA5StringType. + + + (ASN1Module name: #x509) set: #RelativeDistinguishedName of: #AttributeTypeAndValue. + (ASN1Module name: #x509) sequence: #RDNSequence of: #RelativeDistinguishedName. + ((ASN1Module name: #x509) choice: #Name) + add: #names type: #RDNSequence. + + ((ASN1Module name: #x509) sequence: #Extension mapping: X509CertificateExtension) + add: #extnId type: #ASN1ObjectIdentifierType; + addOptional: #extnCritical type: #ASN1BooleanType default: false; + add: #extnValue type: #ASN1ByteArrayType; + yourself. + + ((ASN1Module name: #x509) sequence: #SubjectPublicKeyInfo mapping: X509SubjectPublicKeyInfo) + add: #algorithm type: #AlgorithmIdentifier; + add: #subjectPublicKey type: #ASN1BitStringType; + yourself. + + ((ASN1Module name: #x509) sequence: #AuthorityKeyIdentifier mapping: X509AuthorityKeyIdentifier) + addOptional: #keyIdentifier type: #KeyIdentifier implicitTag: 0; + addOptional: #certIssuer type: #GeneralNames implicitTag: 0; + addOptional: #certSerialNumber type: #CertificateSerialNumber implicitTag: 0; + yourself. + + +] + +{ #category : #accessing } +X509AuthorityKeyIdentifier >> certIssuer [ + "Answer the value of certIssuer" + + ^ certIssuer +] + +{ #category : #accessing } +X509AuthorityKeyIdentifier >> certIssuer: anObject [ + "Set the value of certIssuer" + + certIssuer := anObject +] + +{ #category : #accessing } +X509AuthorityKeyIdentifier >> certSerialNumber [ + "Answer the value of certSerialNumber" + + ^ certSerialNumber +] + +{ #category : #accessing } +X509AuthorityKeyIdentifier >> certSerialNumber: anObject [ + "Set the value of certSerialNumber" + + certSerialNumber := anObject +] + +{ #category : #accessing } +X509AuthorityKeyIdentifier >> keyIdentifier [ + "Answer the value of keyIdentifier" + + ^ keyIdentifier +] + +{ #category : #accessing } +X509AuthorityKeyIdentifier >> keyIdentifier: anObject [ + "Set the value of keyIdentifier" + + keyIdentifier := anObject +] diff --git a/source/X509/X509BasicConstraints.class.st b/source/X509/X509BasicConstraints.class.st new file mode 100644 index 0000000..ba91ecd --- /dev/null +++ b/source/X509/X509BasicConstraints.class.st @@ -0,0 +1,119 @@ +Class { + #name : #X509BasicConstraints, + #superclass : #Object, + #instVars : [ + 'ca', + 'pathLengthConstraint' + ], + #category : 'X509-Extensions' +} + +{ #category : #'class initialization' } +X509BasicConstraints class >> initializeASN1Types [ + + ((ASN1Module name: #x509) sequence: #AuthorityKeyIdentifier mapping: X509AuthorityKeyIdentifier) + addOptional: #keyIdentifier type: #KeyIdentifier implicitTag: 0; + addOptional: #certIssuer type: #GeneralNames implicitTag: 1; + addOptional: #certSerialNumber type: #CertificateSerialNumber implicitTag: 2; + yourself. + (ASN1Module name: #x509) byteArray: #KeyIdentifier. + + (ASN1Module name: #x509) sequence: #GeneralNames of: #GeneralName. + ((ASN1Module name: #x509) choice: #GeneralName) + add: #otherName type: #AnotherName implicitTag: 0; + add: #rfc822Name type: #ASN1IA5StringType implicitTag: 1; + add: #dNSName type: #ASN1IA5StringType implicitTag: 2; +" add: #x400Address type: #ORAddress implicitTag: 3;" + add: #directoryName type: #Name explicitTag: 4; + add: #ediPartyName type: #EDIPartyName implicitTag: 5; + add: #uniformResourceIdenifier type: #ASN1IA5StringType implicitTag: 6; + add: #iPAddress type: #ASN1ByteArrayType implicitTag: 7; + add: #registeredID type: #ASN1ObjectIdentifierType implicitTag: 8; + yourself. + ((ASN1Module name: #x509) sequence: #AnotherName mapping: X509AnotherName) + add: #typeId type: #ASN1ObjectIdentifierType; + add: #value type: #ASN1AnyType explicitTag: 0; + yourself. + ((ASN1Module name: #x509) sequence: #EDIPartyName mapping: X509EDIPartyName) + addOptional: #nameAssigner type: #X509StringChoice implicitTag: 0; + add: #partyName type: #X509StringChoice implicitTag: 1; + yourself. + + (ASN1Module name: #x509) bitString: #KeyUsage. + + ((ASN1Module name: #x509) sequence: #PrivateKeyUsagePeriod mapping: X509Validity) + addOptional: #notBefore type: #ASN1UTCTimeType implicitTag: 0; + addOptional: #notAfter type: #ASN1UTCTimeType implicitTag: 1; + yourself. + + (ASN1Module name: #x509) sequence: #CertificatePolicies of: #PolicyInformation. + ((ASN1Module name: #x509) sequence: #PolicyInformation mapping: X509PolicyInformation) + add: #id type: #ASN1ObjectIdentifierType; + addOptional: #qualifiers type: #PolicyQualifierInfos; + yourself. + (ASN1Module name: #x509) sequence: #PolicyQualifierInfos of: #PolicyQualifierInfo. + ((ASN1Module name: #x509) sequence: #PolicyQualifierInfo mapping: X509PolicyQualifierInfo) + add: #id type: #ASN1ObjectIdentifierType; + add: #qualifier type: #ASN1AnyType; + yourself. + + (ASN1Module name: #x509) sequence: #PolicyMappings of: #PolicyMapping. + ((ASN1Module name: #x509) sequence: #PolicyMapping mapping: X509PolicyMapping) + add: #issuerDomainPolicy type: #ASN1ObjectIdentifierType; + add: #subjectDomainPolicy type: #ASN1ObjectIdentifierType; + yourself. + + (ASN1Module name: #x509) sequence: #SubjectDirectoryAttributes of: #Attribute. + + ((ASN1Module name: #x509) sequence: #BasicConstraints mapping: X509BasicConstraints) + add: #ca type: #ASN1BooleanType default: false; + addOptional: #pathLengthConstraint type: #ASN1IntegerType; + yourself. + +" +#NameConstraints +#PolicyConstraints +#CRLDistributionPoints +#ExtKeyUsageSyntax +#InhibitAnyPolicy +#FreshestCRL +#AuthorityInfoAccessSyntax +#SubjectInfoAccessSyntax +#CRLNumber +#IssuingDistributionPoint +#BaseCRLNumber +#CRLReason +#BaseCRLNumber +#CertificateIssuer +#HoldInstructionCode +#InvalidityDate +" +] + +{ #category : #accessing } +X509BasicConstraints >> ca [ + "Answer the value of ca" + + ^ ca +] + +{ #category : #accessing } +X509BasicConstraints >> ca: anObject [ + "Set the value of ca" + + ca := anObject +] + +{ #category : #accessing } +X509BasicConstraints >> pathLengthConstraint [ + "Answer the value of pathLengthConstraint" + + ^ pathLengthConstraint +] + +{ #category : #accessing } +X509BasicConstraints >> pathLengthConstraint: anObject [ + "Set the value of pathLengthConstraint" + + pathLengthConstraint := anObject +] diff --git a/source/X509/X509Certificate.class.st b/source/X509/X509Certificate.class.st new file mode 100644 index 0000000..4a50378 --- /dev/null +++ b/source/X509/X509Certificate.class.st @@ -0,0 +1,280 @@ +Class { + #name : #X509Certificate, + #superclass : #Object, + #instVars : [ + 'tbsCertificate', + 'signatureAlgorithm', + 'signature' + ], + #category : 'X509' +} + +{ #category : #'instance creation' } +X509Certificate class >> fromBytes: bytes [ + + | type | + type := (ASN1Module name: #x509) find: #Certificate. + ^ ASN1Stream decodeBytes: bytes withType: type. + +] + +{ #category : #'instance creation' } +X509Certificate class >> fromFile: filename [ + + | fs data i j | + fs := StandardFileStream readOnlyFileNamed: filename. + data := fs contentsOfEntireFile. + i := data indexOfSubCollection: '--BEGIN ' startingAt: 1. + i = 0 ifTrue: [^ self fromBytes: data asByteArray]. + i := data indexOfSubCollection: 'CERTIFICATE--' startingAt: i. + j := data indexOfSubCollection: '--END ' startingAt: i. + i := data findAnySubStr: String crlf startingAt: i. + data := (data copyFrom: i to: j) + reject: [:c | (c = $-) or: [c isSeparator]]. + data := (Base64MimeConverter mimeDecodeToBytes: data readStream) contents. + ^ self fromBytes: data. + +] + +{ #category : #'class initialization' } +X509Certificate class >> initialize [ + + self initializeASN1Types. + +] + +{ #category : #'class initialization' } +X509Certificate class >> initializeASN1Types [ + + ((ASN1Module name: #x509) sequence: #Certificate mapping: X509Certificate) + add: #tbsCertificate type: #TBSCertificate; + add: #signatureAlgorithm type: #AlgorithmIdentifier; + add: #signature type: #ASN1BitStringType; + yourself. + (ASN1Module name: #x509) find: #Certificate. + + ((ASN1Module name: #x509) sequence: #TBSCertificate mapping: X509TBSCertificate) + add: #version type: #Version explicitTag: 0 default: 0; + add: #serialNumber type: #CertificateSerialNumber; + add: #signature type: #AlgorithmIdentifier; + add: #issuer type: #Name; + add: #validity type: #Validity; + add: #subject type: #Name; + add: #subjectPublicKeyInfo type: #SubjectPublicKeyInfo; + addOptional: #issuerUniqueID type: #UniqueIdentifier implicitTag: 1; + addOptional: #subjectUniqueID type: #UniqueIdentifier implicitTag: 2; + addOptional: #extensions type: #Extensions explicitTag: 3; + yourself. + + ((ASN1Module name: #x509) sequence: #AlgorithmIdentifier mapping: X509AlgorithmIdentifier) + add: #oid type: #ASN1ObjectIdentifierType; + addOptional: #parameters type: #ASN1AnyType; + yourself. + + (ASN1Module name: #x509) integer: #Version. + (ASN1Module name: #x509) integer: #CertificateSerialNumber. + (ASN1Module name: #x509) bitString: #UniqueIdentifier. + (ASN1Module name: #x509) sequence: #Extensions of: #Extension. + + ((ASN1Module name: #x509) sequence: #SubjectPublicKeyInfo mapping: X509SubjectPublicKeyInfo) + add: #algorithm type: #AlgorithmIdentifier; + add: #subjectPublicKey type: #ASN1BitStringType; + yourself. + + ((ASN1Module name: #x509) sequence: #Validity mapping: X509Validity) + add: #notBefore type: #Time; + add: #notAfter type: #Time; + yourself. + (ASN1Module name: #x509) utcTime: #Time. + + ((ASN1Module name: #x509) choice: #Name) + add: #names type: #RDNSequence. + (ASN1Module name: #x509) sequence: #RDNSequence of: #RelativeDistinguishedName. + (ASN1Module name: #x509) set: #RelativeDistinguishedName of: #AttributeTypeAndValue. + + ((ASN1Module name: #x509) sequence: #Extension mapping: X509CertificateExtension) + add: #extnId type: #ASN1ObjectIdentifierType; + addOptional: #extnCritical type: #ASN1BooleanType default: false; + add: #extnValue type: #ASN1ByteArrayType; + yourself. + + ((ASN1Module name: #x509) sequence: #AttributeTypeAndValue mapping: X520Attribute) + add: #attrOid type: #AttributeType; + add: #attrValue type: #AttributeValue; + yourself. + (ASN1Module name: #x509) objectIdentifier: #AttributeType. + ((ASN1Module name: #x509) any: #AttributeValue definedBy: #attrOid) + at: (ASN1ObjectId fromString: '2.5.4.41') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.4') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.42') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.43') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.44') put: #X520Name; + at: (ASN1ObjectId fromString: '2.5.4.3') put: #X520CommonName; + at: (ASN1ObjectId fromString: '2.5.4.7') put: #X520LocalityName; + at: (ASN1ObjectId fromString: '2.5.4.8') put: #X520StateOrProvinceName; + at: (ASN1ObjectId fromString: '2.5.4.10') put: #X520OrganizationName; + at: (ASN1ObjectId fromString: '2.5.4.11') put: #X520OrganizationalUnitName; + at: (ASN1ObjectId fromString: '2.5.4.6') put: #X520CountryName; + at: (ASN1ObjectId fromString: '1.2.840.113549.1.9.1') put: #X520Pkcs9EmailAddress; + defaultType: #X509StringChoice; + yourself. + ((ASN1Module name: #x509) choice: #X509StringChoice) + add: #teletexString type: #ASN1TeletexStringType; + add: #printableString type: #ASN1PrintableStringType; + add: #universalString type: #ASN1UniversalStringType; + add: #utf8String type: #ASN1StringType; + add: #bmpString type: #ASN1BMPStringType; + yourself. + ((ASN1Module name: #x509) mapped: #X520Name) + mapping: X520Name mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520CommonName) + mapping: X520CommonName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520LocalityName) + mapping: X520LocalityName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520StateOrProvinceName) + mapping: X520StateOrProvinceName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520OrganizationName) + mapping: X520OrganizationName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520OrganizationalUnitName) + mapping: X520OrganizationalUnitName mappingSymbol: #string type: #X509StringChoice. + ((ASN1Module name: #x509) mapped: #X520CountryName) + mapping: X520CountryName mappingSymbol: #string type: #ASN1PrintableStringType. + ((ASN1Module name: #x509) mapped: #X520Pkcs9EmailAddress) + mapping: X520Pkcs9EmailAddress mappingSymbol: #string type: #ASN1IA5StringType. + + +] + +{ #category : #converting } +X509Certificate >> asAsn1Bytes [ + + | type | + type := (ASN1Module name: #x509) find: #Certificate. + ^ ASN1Stream encode: self withType: type + +] + +{ #category : #converting } +X509Certificate >> asDerCertificateList [ + + ^ (OrderedCollection with: self) asAsn1Bytes + +] + +{ #category : #accessing } +X509Certificate >> signature [ + "Answer the value of signature" + + ^ signature +] + +{ #category : #accessing } +X509Certificate >> signature: anObject [ + "Set the value of signature" + + signature := anObject +] + +{ #category : #accessing } +X509Certificate >> signatureAlgorithm [ + "Answer the value of signatureAlgorithm" + + ^ signatureAlgorithm +] + +{ #category : #accessing } +X509Certificate >> signatureAlgorithm: anObject [ + "Set the value of signatureAlgorithm" + + signatureAlgorithm := anObject +] + +{ #category : #accessing } +X509Certificate >> tbsCertificate [ + "Answer the value of tbsCertificate" + + ^ tbsCertificate +] + +{ #category : #accessing } +X509Certificate >> tbsCertificate: anObject [ + "Set the value of tbsCertificate" + + tbsCertificate := anObject +] + +{ #category : #verifying } +X509Certificate >> verifyFromParentCertificate: parentCert [ + + (DateAndTime now + between: self tbsCertificate validity notBefore + and: self tbsCertificate validity notAfter) + ifFalse: [^ false]. + self tbsCertificate issuer = parentCert tbsCertificate subject + ifFalse: [^ false]. + (self tbsCertificate signature oid oid = '1.2.840.113549.1.1.2') + ifTrue: [^ self verifyMD2WithRSAEncryptionFromParentCertificate: parentCert]. + (self tbsCertificate signature oid oid = '1.2.840.113549.1.1.4') + ifTrue: [^ self verifyMD5WithRSAEncryptionFromParentCertificate: parentCert]. + (self tbsCertificate signature oid oid = '1.2.840.113549.1.1.5') + ifTrue: [^ self verifySHA1WithRSAEncryptionFromParentCertificate: parentCert]. + (self tbsCertificate signature oid oid = '1.2.840.10040.4.3') + ifTrue: [^ self verifySHA1WithDSAEncryptionFromParentCertificate: parentCert]. + ^ false. + +] + +{ #category : #verifying } +X509Certificate >> verifyMD2WithRSAEncryptionFromParentCertificate: parentCert [ + + | publicKey hash msg | + publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. + + hash := MD2 hashMessage: self tbsCertificate asAsn1Bytes. + msg := OrderedCollection new + add: (OrderedCollection new add: (ASN1ObjectId fromString: '1.2.840.113549.2.2'); add: nil; yourself); + add: hash; + asAsn1Bytes. + ^ publicKey v15VerifySignature: self signature bytes ofMessageHash: msg. + +] + +{ #category : #verifying } +X509Certificate >> verifyMD5WithRSAEncryptionFromParentCertificate: parentCert [ + + | publicKey hash msg | + publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. + hash := MD5 hashMessage: self tbsCertificate asAsn1Bytes. + msg := OrderedCollection new + add: (OrderedCollection new add: (ASN1ObjectId fromString: '1.2.840.113549.2.5'); add: nil; yourself); + add: hash; + asAsn1Bytes. + ^ publicKey v15VerifySignature: self signature bytes ofMessageHash: msg. + +] + +{ #category : #verifying } +X509Certificate >> verifySHA1WithDSAEncryptionFromParentCertificate: parentCert [ + + | publicKey sig toBeSigned | + publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. + sig := ASN1Stream decodeBytes: self signature bytes. + toBeSigned := SHA1 hashMessage: self tbsCertificate asAsn1Bytes. + ^ publicKey verifySignature: sig ofMessageHash: toBeSigned. + +] + +{ #category : #verifying } +X509Certificate >> verifySHA1WithRSAEncryptionFromParentCertificate: parentCert [ + + | publicKey hash msg | + publicKey := parentCert tbsCertificate subjectPublicKeyInfo asPublicKey. + + hash := SHA1 hashMessage: self tbsCertificate asAsn1Bytes. + msg := OrderedCollection new + add: (OrderedCollection new add: (ASN1ObjectId fromString: '1.3.14.3.2.26'); add: nil; yourself); + add: hash; + asAsn1Bytes. + ^ publicKey v15VerifySignature: self signature bytes ofMessageHash: msg. + +] diff --git a/source/X509/X509CertificateDerReader.extension.st b/source/X509/X509CertificateDerReader.extension.st new file mode 100644 index 0000000..ed04429 --- /dev/null +++ b/source/X509/X509CertificateDerReader.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #X509CertificateDerReader } + +{ #category : #'*X509' } +X509CertificateDerReader >> asCertificate [ + + ^ X509Certificate fromBytes: self derBytes. + +] diff --git a/source/X509/X509CertificateExtension.class.st b/source/X509/X509CertificateExtension.class.st new file mode 100644 index 0000000..2e46910 --- /dev/null +++ b/source/X509/X509CertificateExtension.class.st @@ -0,0 +1,271 @@ +Class { + #name : #X509CertificateExtension, + #superclass : #Object, + #instVars : [ + 'extnId', + 'extnCritical', + 'extnValue', + 'decodedExtension' + ], + #category : 'X509-Extensions' +} + +{ #category : #'class initialization' } +X509CertificateExtension class >> initialize [ + + self initializeASN1Types. + +] + +{ #category : #'class initialization' } +X509CertificateExtension class >> initializeASN1Types [ + + ((ASN1Module name: #x509) sequence: #AuthorityKeyIdentifier mapping: X509AuthorityKeyIdentifier) + addOptional: #keyIdentifier type: #KeyIdentifier implicitTag: 0; + addOptional: #certIssuer type: #GeneralNames implicitTag: 1; + addOptional: #certSerialNumber type: #CertificateSerialNumber implicitTag: 2; + yourself. + (ASN1Module name: #x509) byteArray: #KeyIdentifier. + + (ASN1Module name: #x509) sequence: #GeneralNames of: #GeneralName. + ((ASN1Module name: #x509) choice: #GeneralName) + add: #otherName type: #AnotherName implicitTag: 0; + add: #rfc822Name type: #ASN1IA5StringType implicitTag: 1; + add: #dNSName type: #ASN1IA5StringType implicitTag: 2; +" add: #x400Address type: #ORAddress implicitTag: 3;" + add: #directoryName type: #Name explicitTag: 4; + add: #ediPartyName type: #EDIPartyName implicitTag: 5; + add: #uniformResourceIdenifier type: #ASN1IA5StringType implicitTag: 6; + add: #iPAddress type: #ASN1ByteArrayType implicitTag: 7; + add: #registeredID type: #ASN1ObjectIdentifierType implicitTag: 8; + yourself. + ((ASN1Module name: #x509) sequence: #AnotherName mapping: X509AnotherName) + add: #typeId type: #ASN1ObjectIdentifierType; + add: #value type: #ASN1AnyType explicitTag: 0; + yourself. + ((ASN1Module name: #x509) sequence: #EDIPartyName mapping: X509EDIPartyName) + addOptional: #nameAssigner type: #X509StringChoice implicitTag: 0; + add: #partyName type: #X509StringChoice implicitTag: 1; + yourself. + + (ASN1Module name: #x509) bitString: #KeyUsage. + + ((ASN1Module name: #x509) sequence: #PrivateKeyUsagePeriod mapping: X509Validity) + addOptional: #notBefore type: #ASN1UTCTimeType implicitTag: 0; + addOptional: #notAfter type: #ASN1UTCTimeType implicitTag: 1; + yourself. + + (ASN1Module name: #x509) sequence: #CertificatePolicies of: #PolicyInformation. + ((ASN1Module name: #x509) sequence: #PolicyInformation mapping: X509PolicyInformation) + add: #id type: #CertPolicyId; + addOptional: #qualifiers type: #PolicyQualifierInfos; + yourself. + (ASN1Module name: #x509) objectIdentifier: #CertPolicyId. + (ASN1Module name: #x509) sequence: #PolicyQualifierInfos of: #PolicyQualifierInfo. + ((ASN1Module name: #x509) sequence: #PolicyQualifierInfo mapping: X509PolicyQualifierInfo) + add: #id type: #ASN1ObjectIdentifierType; + add: #qualifier type: #ASN1AnyType; + yourself. + + (ASN1Module name: #x509) sequence: #PolicyMappings of: #PolicyMapping. + ((ASN1Module name: #x509) sequence: #PolicyMapping mapping: X509PolicyMapping) + add: #issuerDomainPolicy type: #CertPolicyId; + add: #subjectDomainPolicy type: #CertPolicyId; + yourself. + + (ASN1Module name: #x509) assign: #SubjectAltName from: #GeneralNames. + (ASN1Module name: #x509) assign: #IssuerAltName from: #GeneralNames. + + (ASN1Module name: #x509) sequence: #SubjectDirectoryAttributes of: #Attribute. + + ((ASN1Module name: #x509) sequence: #BasicConstraints mapping: X509BasicConstraints) + add: #ca type: #ASN1BooleanType default: false; + addOptional: #pathLengthConstraint type: #ASN1IntegerType; + yourself. + + ((ASN1Module name: #x509) sequence: #NameConstraints mapping: X509NameConstraints) + addOptional: #permittedSubtrees type: #GeneralSubtrees implicitTag: 0; + addOptional: #excludedSubtrees type: #GeneralSubtrees implicitTag: 1; + yourself. + (ASN1Module name: #x509) sequence: #GeneralSubtrees of: #GeneralSubtree. + ((ASN1Module name: #x509) sequence: #GeneralSubtree mapping: X509GeneralSubtree) + add: #base type: #GeneralName; + add: #minimum type: #BaseDistance implicitTag: 0 default: 0; + addOptional: #maximum type: #BaseDistance implicitTag: 1; + yourself. + (ASN1Module name: #x509) integer: #BaseDistance. + + ((ASN1Module name: #x509) sequence: #PolicyConstraints mapping: X509PolicyConstraints) + addOptional: #requireExplicitPolicy type: #SkipCerts implicitTag: 0; + addOptional: #inhibitPolicyMapping type: #SkipCerts implicitTag: 1; + yourself. + (ASN1Module name: #x509) integer: #SkipCerts. + + (ASN1Module name: #x509) sequence: #CRLDistributionPoints of: #DistributionPoint. + ((ASN1Module name: #x509) sequence: #DistributionPoint mapping: X509DistributionPoint) + addOptional: #distributionPoint type: #DistributionPointName explicitTag: 0; + addOptional: #reasons type: #ReasonFlags implicitTag: 1; + addOptional: #cRLIssuer type: #GeneralNames implicitTag: 2; + yourself. + ((ASN1Module name: #x509) choice: #DistributionPointName) + add: #fullName type: #GeneralNames implicitTag: 0; + add: #nameRelativeToCRLIssuer type: #RelativeDistinguishedName implicitTag: 1; + yourself. + (ASN1Module name: #x509) bitString: #ReasonFlags. + + (ASN1Module name: #x509) sequence: #ExtKeyUsageSyntax of: #KeyPurposeId. + (ASN1Module name: #x509) objectIdentifier: #KeyPurposeId. + + (ASN1Module name: #x509) assign: #InhibitAnyPolicy from: #SkipCerts. + + (ASN1Module name: #x509) assign: #FreshestCRL from: #CRLDistributionPoints. + + (ASN1Module name: #x509) sequence: #AuthorityInfoAccessSyntax of: #AccessDescription. + ((ASN1Module name: #x509) sequence: #AccessDescription mapping: X509AccessDescription) + add: #accessMethod type: #ASN1ObjectIdentifierType; + add: #accessLocation type: #GeneralName; + yourself. + + (ASN1Module name: #x509) sequence: #SubjectInfoAccessSyntax of: #AccessDescription. + + (ASN1Module name: #x509) integer: #CRLNumber. + + ((ASN1Module name: #x509) sequence: #IssuingDistributionPoint mapping: X509IssuingDistributionPoint) + addOptional: #distributionPoint type: #DistributionPointName explicitTag: 0; + add: #onlyContainsUserCerts type: #ASN1BooleanType implicitTag: 1 default: false; + add: #onlyContainsCACerts type: #ASN1BooleanType implicitTag: 2 default: false; + addOptional: #onlySomeReasons type: #ReasonFlags implicitTag: 3; + add: #indirectCRL type: #ASN1BooleanType implicitTag: 4 default: false; + add: #onlyContainsAttributeCerts type: #ASN1BooleanType implicitTag: 5 default: false; + yourself. + + (ASN1Module name: #x509) assign: #BaseCRLNumber from: #CRLNumber. + +" (ASN1Module name: #x509) enumerated: #CRLReason." + + (ASN1Module name: #x509) assign: #CertificateIssuer from: #GeneralNames. + + (ASN1Module name: #x509) objectIdentifier: #HoldInstructionCode. + + (ASN1Module name: #x509) utcTime: #InvalidityDate. + +] + +{ #category : #'class initialization' } +X509CertificateExtension class >> objectIdToTypeSymbolMap [ + + | map | + map := Dictionary new + at: (ASN1ObjectId fromString: '2.5.29.35') put: #AuthorityKeyIdentifier; + at: (ASN1ObjectId fromString: '2.5.29.14') put: #KeyIdentifier; + at: (ASN1ObjectId fromString: '2.5.29.15') put: #KeyUsage; + at: (ASN1ObjectId fromString: '2.5.29.16') put: #PrivateKeyUsagePeriod; + at: (ASN1ObjectId fromString: '2.5.29.32') put: #CertificatePolicies; + at: (ASN1ObjectId fromString: '2.5.29.33') put: #PolicyMappings; + at: (ASN1ObjectId fromString: '2.5.29.17') put: #SubjectAltName; + at: (ASN1ObjectId fromString: '2.5.29.18') put: #IssuerAltName; + at: (ASN1ObjectId fromString: '2.5.29.9') put: #SubjectDirectoryAttributes; + at: (ASN1ObjectId fromString: '2.5.29.19') put: #BasicConstraints; + at: (ASN1ObjectId fromString: '2.5.29.30') put: #NameConstraints; + at: (ASN1ObjectId fromString: '2.5.29.36') put: #PolicyConstraints; + at: (ASN1ObjectId fromString: '2.5.29.31') put: #CRLDistributionPoints; + at: (ASN1ObjectId fromString: '2.5.29.37') put: #ExtKeyUsageSyntax; + at: (ASN1ObjectId fromString: '2.5.29.54') put: #InhibitAnyPolicy; + at: (ASN1ObjectId fromString: '2.5.29.46') put: #FreshestCRL; + at: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.1.1') put: #AuthorityInfoAccessSyntax; + at: (ASN1ObjectId fromString: '1.3.6.1.5.5.7.1.11') put: #SubjectInfoAccessSyntax; + at: (ASN1ObjectId fromString: '2.5.29.20') put: #CRLNumber; + at: (ASN1ObjectId fromString: '2.5.29.28') put: #IssuingDistributionPoint; + at: (ASN1ObjectId fromString: '2.5.29.27') put: #BaseCRLNumber; + at: (ASN1ObjectId fromString: '2.5.29.21') put: #CRLReason; + at: (ASN1ObjectId fromString: '2.5.29.29') put: #CertificateIssuer; + at: (ASN1ObjectId fromString: '2.5.29.23') put: #HoldInstructionCode; + at: (ASN1ObjectId fromString: '2.5.29.24') put: #InvalidityDate; + yourself. + ^ map +] + +{ #category : #private } +X509CertificateExtension >> asn1TypeForExtension [ + " + id-ce = 2.5.29 + id-pe = 1.3.6.1.5.5.7.1 + id-qt = 1.3.6.1.5.5.7.2 + id-kp = 1.3.6.1.5.5.7.3 + id-ad = 1.3.6.1.5.5.7.48 + " + + | typeSymbol | + typeSymbol := self class objectIdToTypeSymbolMap at: self extnId ifAbsent: [^nil]. + ^ (ASN1Module name: #x509) find: typeSymbol. + +] + +{ #category : #private } +X509CertificateExtension >> decodeExtension [ + + | type ext | + type := self asn1TypeForExtension. + ext := [ASN1Stream decodeBytes: self extnValue withType: type] + on: Error + do: [:ex | ASN1Stream decodeBytes: self extnValue]. + self decodedExtension: ext. + +] + +{ #category : #accessing } +X509CertificateExtension >> decodedExtension [ + "Answer the value of decodedExtension" + + ^ decodedExtension +] + +{ #category : #accessing } +X509CertificateExtension >> decodedExtension: anObject [ + "Set the value of decodedExtension" + + decodedExtension := anObject +] + +{ #category : #accessing } +X509CertificateExtension >> extnCritical [ + "Answer the value of extnCritical" + + ^ extnCritical +] + +{ #category : #accessing } +X509CertificateExtension >> extnCritical: anObject [ + "Set the value of extnCritical" + + extnCritical := anObject +] + +{ #category : #accessing } +X509CertificateExtension >> extnId [ + "Answer the value of extnId" + + ^ extnId +] + +{ #category : #accessing } +X509CertificateExtension >> extnId: anObject [ + "Set the value of extnId" + + extnId := anObject +] + +{ #category : #accessing } +X509CertificateExtension >> extnValue [ + "Answer the value of extnValue" + + ^ extnValue +] + +{ #category : #accessing } +X509CertificateExtension >> extnValue: anObject [ + "Set the value of extnValue" + + extnValue := anObject. + self decodeExtension. +] diff --git a/source/X509/X509DistributionPoint.class.st b/source/X509/X509DistributionPoint.class.st new file mode 100644 index 0000000..b908f73 --- /dev/null +++ b/source/X509/X509DistributionPoint.class.st @@ -0,0 +1,52 @@ +Class { + #name : #X509DistributionPoint, + #superclass : #Object, + #instVars : [ + 'distributionPoint', + 'reasons', + 'cRLIssuer' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509DistributionPoint >> cRLIssuer [ + "Answer the value of cRLIssuer" + + ^ cRLIssuer +] + +{ #category : #accessing } +X509DistributionPoint >> cRLIssuer: anObject [ + "Set the value of cRLIssuer" + + cRLIssuer := anObject +] + +{ #category : #accessing } +X509DistributionPoint >> distributionPoint [ + "Answer the value of distributionPoint" + + ^ distributionPoint +] + +{ #category : #accessing } +X509DistributionPoint >> distributionPoint: anObject [ + "Set the value of distributionPoint" + + distributionPoint := anObject +] + +{ #category : #accessing } +X509DistributionPoint >> reasons [ + "Answer the value of reasons" + + ^ reasons +] + +{ #category : #accessing } +X509DistributionPoint >> reasons: anObject [ + "Set the value of reasons" + + reasons := anObject +] diff --git a/source/X509/X509EDIPartyName.class.st b/source/X509/X509EDIPartyName.class.st new file mode 100644 index 0000000..2148384 --- /dev/null +++ b/source/X509/X509EDIPartyName.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509EDIPartyName, + #superclass : #Object, + #instVars : [ + 'nameAssigner', + 'partyName' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509EDIPartyName >> nameAssigner [ + "Answer the value of nameAssigner" + + ^ nameAssigner +] + +{ #category : #accessing } +X509EDIPartyName >> nameAssigner: anObject [ + "Set the value of nameAssigner" + + nameAssigner := anObject +] + +{ #category : #accessing } +X509EDIPartyName >> partyName [ + "Answer the value of partyName" + + ^ partyName +] + +{ #category : #accessing } +X509EDIPartyName >> partyName: anObject [ + "Set the value of partyName" + + partyName := anObject +] diff --git a/source/X509/X509GeneralSubtree.class.st b/source/X509/X509GeneralSubtree.class.st new file mode 100644 index 0000000..020b24d --- /dev/null +++ b/source/X509/X509GeneralSubtree.class.st @@ -0,0 +1,52 @@ +Class { + #name : #X509GeneralSubtree, + #superclass : #Object, + #instVars : [ + 'base', + 'minimum', + 'maximum' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509GeneralSubtree >> base [ + "Answer the value of base" + + ^ base +] + +{ #category : #accessing } +X509GeneralSubtree >> base: anObject [ + "Set the value of base" + + base := anObject +] + +{ #category : #accessing } +X509GeneralSubtree >> maximum [ + "Answer the value of maximum" + + ^ maximum +] + +{ #category : #accessing } +X509GeneralSubtree >> maximum: anObject [ + "Set the value of maximum" + + maximum := anObject +] + +{ #category : #accessing } +X509GeneralSubtree >> minimum [ + "Answer the value of minimum" + + ^ minimum +] + +{ #category : #accessing } +X509GeneralSubtree >> minimum: anObject [ + "Set the value of minimum" + + minimum := anObject +] diff --git a/source/X509/X509IssuingDistributionPoint.class.st b/source/X509/X509IssuingDistributionPoint.class.st new file mode 100644 index 0000000..ff0c236 --- /dev/null +++ b/source/X509/X509IssuingDistributionPoint.class.st @@ -0,0 +1,97 @@ +Class { + #name : #X509IssuingDistributionPoint, + #superclass : #Object, + #instVars : [ + 'distributionPoint', + 'onlyContainsUserCerts', + 'onlyContainsCACerts', + 'onlySomeReasons', + 'indirectCRL', + 'onlyContainsAttributeCerts' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509IssuingDistributionPoint >> distributionPoint [ + "Answer the value of distributionPoint" + + ^ distributionPoint +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> distributionPoint: anObject [ + "Set the value of distributionPoint" + + distributionPoint := anObject +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> indirectCRL [ + "Answer the value of indirectCRL" + + ^ indirectCRL +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> indirectCRL: anObject [ + "Set the value of indirectCRL" + + indirectCRL := anObject +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlyContainsAttributeCerts [ + "Answer the value of onlyContainsAttributeCerts" + + ^ onlyContainsAttributeCerts +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlyContainsAttributeCerts: anObject [ + "Set the value of onlyContainsAttributeCerts" + + onlyContainsAttributeCerts := anObject +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlyContainsCACerts [ + "Answer the value of onlyContainsCACerts" + + ^ onlyContainsCACerts +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlyContainsCACerts: anObject [ + "Set the value of onlyContainsCACerts" + + onlyContainsCACerts := anObject +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlyContainsUserCerts [ + "Answer the value of onlyContainsUserCerts" + + ^ onlyContainsUserCerts +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlyContainsUserCerts: anObject [ + "Set the value of onlyContainsUserCerts" + + onlyContainsUserCerts := anObject +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlySomeReasons [ + "Answer the value of onlySomeReasons" + + ^ onlySomeReasons +] + +{ #category : #accessing } +X509IssuingDistributionPoint >> onlySomeReasons: anObject [ + "Set the value of onlySomeReasons" + + onlySomeReasons := anObject +] diff --git a/source/X509/X509NameConstraints.class.st b/source/X509/X509NameConstraints.class.st new file mode 100644 index 0000000..01e5656 --- /dev/null +++ b/source/X509/X509NameConstraints.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509NameConstraints, + #superclass : #Object, + #instVars : [ + 'permittedSubtrees', + 'excludedSubtrees' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509NameConstraints >> excludedSubtrees [ + "Answer the value of excludedSubtrees" + + ^ excludedSubtrees +] + +{ #category : #accessing } +X509NameConstraints >> excludedSubtrees: anObject [ + "Set the value of excludedSubtrees" + + excludedSubtrees := anObject +] + +{ #category : #accessing } +X509NameConstraints >> permittedSubtrees [ + "Answer the value of permittedSubtrees" + + ^ permittedSubtrees +] + +{ #category : #accessing } +X509NameConstraints >> permittedSubtrees: anObject [ + "Set the value of permittedSubtrees" + + permittedSubtrees := anObject +] diff --git a/source/X509/X509PolicyConstraints.class.st b/source/X509/X509PolicyConstraints.class.st new file mode 100644 index 0000000..ed7ae27 --- /dev/null +++ b/source/X509/X509PolicyConstraints.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509PolicyConstraints, + #superclass : #Object, + #instVars : [ + 'requireExplicitPolicy', + 'inhibitPolicyMapping' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509PolicyConstraints >> inhibitPolicyMapping [ + "Answer the value of inhibitPolicyMapping" + + ^ inhibitPolicyMapping +] + +{ #category : #accessing } +X509PolicyConstraints >> inhibitPolicyMapping: anObject [ + "Set the value of inhibitPolicyMapping" + + inhibitPolicyMapping := anObject +] + +{ #category : #accessing } +X509PolicyConstraints >> requireExplicitPolicy [ + "Answer the value of requireExplicitPolicy" + + ^ requireExplicitPolicy +] + +{ #category : #accessing } +X509PolicyConstraints >> requireExplicitPolicy: anObject [ + "Set the value of requireExplicitPolicy" + + requireExplicitPolicy := anObject +] diff --git a/source/X509/X509PolicyInformation.class.st b/source/X509/X509PolicyInformation.class.st new file mode 100644 index 0000000..27bb1b0 --- /dev/null +++ b/source/X509/X509PolicyInformation.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509PolicyInformation, + #superclass : #Object, + #instVars : [ + 'id', + 'qualifiers' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509PolicyInformation >> id [ + "Answer the value of id" + + ^ id +] + +{ #category : #accessing } +X509PolicyInformation >> id: anObject [ + "Set the value of id" + + id := anObject +] + +{ #category : #accessing } +X509PolicyInformation >> qualifiers [ + "Answer the value of qualifiers" + + ^ qualifiers +] + +{ #category : #accessing } +X509PolicyInformation >> qualifiers: anObject [ + "Set the value of qualifiers" + + qualifiers := anObject +] diff --git a/source/X509/X509PolicyMapping.class.st b/source/X509/X509PolicyMapping.class.st new file mode 100644 index 0000000..00c26b5 --- /dev/null +++ b/source/X509/X509PolicyMapping.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509PolicyMapping, + #superclass : #Object, + #instVars : [ + 'issuerDomainPolicy', + 'subjectDomainPolicy' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509PolicyMapping >> issuerDomainPolicy [ + "Answer the value of issuerDomainPolicy" + + ^ issuerDomainPolicy +] + +{ #category : #accessing } +X509PolicyMapping >> issuerDomainPolicy: anObject [ + "Set the value of issuerDomainPolicy" + + issuerDomainPolicy := anObject +] + +{ #category : #accessing } +X509PolicyMapping >> subjectDomainPolicy [ + "Answer the value of subjectDomainPolicy" + + ^ subjectDomainPolicy +] + +{ #category : #accessing } +X509PolicyMapping >> subjectDomainPolicy: anObject [ + "Set the value of subjectDomainPolicy" + + subjectDomainPolicy := anObject +] diff --git a/source/X509/X509PolicyQualifierInfo.class.st b/source/X509/X509PolicyQualifierInfo.class.st new file mode 100644 index 0000000..8904a0c --- /dev/null +++ b/source/X509/X509PolicyQualifierInfo.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509PolicyQualifierInfo, + #superclass : #Object, + #instVars : [ + 'id', + 'qualifier' + ], + #category : 'X509-Extensions' +} + +{ #category : #accessing } +X509PolicyQualifierInfo >> id [ + "Answer the value of id" + + ^ id +] + +{ #category : #accessing } +X509PolicyQualifierInfo >> id: anObject [ + "Set the value of id" + + id := anObject +] + +{ #category : #accessing } +X509PolicyQualifierInfo >> qualifier [ + "Answer the value of qualifier" + + ^ qualifier +] + +{ #category : #accessing } +X509PolicyQualifierInfo >> qualifier: anObject [ + "Set the value of qualifier" + + qualifier := anObject +] diff --git a/source/X509/X509SubjectPublicKeyInfo.class.st b/source/X509/X509SubjectPublicKeyInfo.class.st new file mode 100644 index 0000000..b5819e9 --- /dev/null +++ b/source/X509/X509SubjectPublicKeyInfo.class.st @@ -0,0 +1,71 @@ +Class { + #name : #X509SubjectPublicKeyInfo, + #superclass : #Object, + #instVars : [ + 'algorithm', + 'subjectPublicKey' + ], + #category : 'X509' +} + +{ #category : #accessing } +X509SubjectPublicKeyInfo >> algorithm [ + "Answer the value of algorithm" + + ^ algorithm +] + +{ #category : #accessing } +X509SubjectPublicKeyInfo >> algorithm: anObject [ + "Set the value of algorithm" + + algorithm := anObject +] + +{ #category : #private } +X509SubjectPublicKeyInfo >> asDSAPublicKey [ + + | params y | + params := self algorithm parameters. + y := self subjectPublicKeyDecoded. + ^ DSAPublicKey p: (params at: 1) q: (params at: 2) g: (params at: 3) y: y. + +] + +{ #category : #accessing } +X509SubjectPublicKeyInfo >> asPublicKey [ + + self algorithm isDSA ifTrue: [^ self asDSAPublicKey]. + self algorithm isRSA ifTrue: [^ self asRSAPublicKey]. + ^ nil +] + +{ #category : #private } +X509SubjectPublicKeyInfo >> asRSAPublicKey [ + + | keys | + keys := self subjectPublicKeyDecoded. + ^ (RSAPublicKey exponent: (keys at: 2) asInteger modulo: (keys at: 1) asInteger). + +] + +{ #category : #accessing } +X509SubjectPublicKeyInfo >> subjectPublicKey [ + "Answer the value of subjectPublicKey" + + ^ subjectPublicKey +] + +{ #category : #accessing } +X509SubjectPublicKeyInfo >> subjectPublicKey: anObject [ + "Set the value of subjectPublicKey" + + subjectPublicKey := anObject +] + +{ #category : #accessing } +X509SubjectPublicKeyInfo >> subjectPublicKeyDecoded [ + + ^ ASN1Stream decodeBytes: self subjectPublicKey bytes. + +] diff --git a/source/X509/X509TBSCertificate.class.st b/source/X509/X509TBSCertificate.class.st new file mode 100644 index 0000000..3fb3951 --- /dev/null +++ b/source/X509/X509TBSCertificate.class.st @@ -0,0 +1,148 @@ +Class { + #name : #X509TBSCertificate, + #superclass : #Object, + #instVars : [ + 'version', + 'serialNumber', + 'signature', + 'issuer', + 'validity', + 'subject', + 'subjectPublicKeyInfo', + 'extensions' + ], + #category : 'X509' +} + +{ #category : #'initialize-release' } +X509TBSCertificate >> asAsn1Bytes [ + + | type | + type := (ASN1Module name: #x509) find: #TBSCertificate. + ^ ASN1Stream encode: self withType: type + +] + +{ #category : #accessing } +X509TBSCertificate >> extensions [ + "Answer the value of extensions" + + ^ extensions +] + +{ #category : #accessing } +X509TBSCertificate >> extensions: anObject [ + "Set the value of extensions" + + extensions := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> issuer [ + "Answer the value of issuer" + + ^ issuer +] + +{ #category : #accessing } +X509TBSCertificate >> issuer: anObject [ + "Set the value of issuer" + + issuer := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> issuerUniqueID [ + + ^ nil +] + +{ #category : #accessing } +X509TBSCertificate >> serialNumber [ + "Answer the value of serialNumber" + + ^ serialNumber +] + +{ #category : #accessing } +X509TBSCertificate >> serialNumber: anObject [ + "Set the value of serialNumber" + + serialNumber := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> signature [ + "Answer the value of signature" + + ^ signature +] + +{ #category : #accessing } +X509TBSCertificate >> signature: anObject [ + "Set the value of signature" + + signature := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> subject [ + "Answer the value of subject" + + ^ subject +] + +{ #category : #accessing } +X509TBSCertificate >> subject: anObject [ + "Set the value of subject" + + subject := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> subjectPublicKeyInfo [ + "Answer the value of subjectPublicKeyInfo" + + ^ subjectPublicKeyInfo +] + +{ #category : #accessing } +X509TBSCertificate >> subjectPublicKeyInfo: anObject [ + "Set the value of subjectPublicKeyInfo" + + subjectPublicKeyInfo := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> subjectUniqueID [ + + ^ nil +] + +{ #category : #accessing } +X509TBSCertificate >> validity [ + "Answer the value of validity" + + ^ validity +] + +{ #category : #accessing } +X509TBSCertificate >> validity: anObject [ + "Set the value of validity" + + validity := anObject +] + +{ #category : #accessing } +X509TBSCertificate >> version [ + "Answer the value of version" + + ^ version +] + +{ #category : #accessing } +X509TBSCertificate >> version: anObject [ + "Set the value of version" + + version := anObject +] diff --git a/source/X509/X509Validity.class.st b/source/X509/X509Validity.class.st new file mode 100644 index 0000000..b4462e9 --- /dev/null +++ b/source/X509/X509Validity.class.st @@ -0,0 +1,37 @@ +Class { + #name : #X509Validity, + #superclass : #Object, + #instVars : [ + 'notBefore', + 'notAfter' + ], + #category : 'X509' +} + +{ #category : #accessing } +X509Validity >> notAfter [ + "Answer the value of notAfter" + + ^ notAfter +] + +{ #category : #accessing } +X509Validity >> notAfter: anObject [ + "Set the value of notAfter" + + notAfter := anObject +] + +{ #category : #accessing } +X509Validity >> notBefore [ + "Answer the value of notBefore" + + ^ notBefore +] + +{ #category : #accessing } +X509Validity >> notBefore: anObject [ + "Set the value of notBefore" + + notBefore := anObject +] diff --git a/source/X509/X520AbstractName.class.st b/source/X509/X520AbstractName.class.st new file mode 100644 index 0000000..5e09d22 --- /dev/null +++ b/source/X509/X520AbstractName.class.st @@ -0,0 +1,51 @@ +Class { + #name : #X520AbstractName, + #superclass : #Object, + #instVars : [ + 'string' + ], + #category : 'X509' +} + +{ #category : #comparing } +X520AbstractName >> = anotherName [ + + ^ self string = anotherName string + +] + +{ #category : #printing } +X520AbstractName >> displayName [ + + ^ 'A' +] + +{ #category : #comparing } +X520AbstractName >> hash [ + + ^ self string hash + +] + +{ #category : #printing } +X520AbstractName >> printOn: stream [ + + stream nextPutAll: self displayName. + stream nextPutAll: ' = '. + self string printOn: stream. + +] + +{ #category : #accessing } +X520AbstractName >> string [ + "Answer the value of string" + + ^ string +] + +{ #category : #accessing } +X520AbstractName >> string: anObject [ + "Set the value of string" + + string := anObject +] diff --git a/source/X509/X520Attribute.class.st b/source/X509/X520Attribute.class.st new file mode 100644 index 0000000..6c3a585 --- /dev/null +++ b/source/X509/X520Attribute.class.st @@ -0,0 +1,63 @@ +Class { + #name : #X520Attribute, + #superclass : #Object, + #instVars : [ + 'attrOid', + 'attrValue' + ], + #category : 'X509' +} + +{ #category : #comparing } +X520Attribute >> = attr [ + + ^ self attrOid = attr attrOid + and: [self attrValue = attr attrValue] +] + +{ #category : #accessing } +X520Attribute >> attrOid [ + "Answer the value of attrOid" + + ^ attrOid +] + +{ #category : #accessing } +X520Attribute >> attrOid: anObject [ + "Set the value of attrOid" + + attrOid := anObject +] + +{ #category : #accessing } +X520Attribute >> attrValue [ + "Answer the value of attrValue" + + ^ attrValue +] + +{ #category : #accessing } +X520Attribute >> attrValue: anObject [ + "Set the value of attrValue" + + attrValue := anObject +] + +{ #category : #comparing } +X520Attribute >> hash [ + + ^ self attrOid hash + self attrValue hash +] + +{ #category : #'initialize-release' } +X520Attribute >> printOn: stream [ + + stream nextPutAll: self attrValue asString. + +] + +{ #category : #accessing } +X520Attribute >> shortName [ + + ^ 'Attribute-', self attrOid oid +] diff --git a/source/X509/X520CommonName.class.st b/source/X509/X520CommonName.class.st new file mode 100644 index 0000000..d3c56a3 --- /dev/null +++ b/source/X509/X520CommonName.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520CommonName, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520CommonName >> displayName [ + + ^ 'CN' +] diff --git a/source/X509/X520CountryName.class.st b/source/X509/X520CountryName.class.st new file mode 100644 index 0000000..cf108c1 --- /dev/null +++ b/source/X509/X520CountryName.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520CountryName, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520CountryName >> displayName [ + + ^ 'C' +] diff --git a/source/X509/X520LocalityName.class.st b/source/X509/X520LocalityName.class.st new file mode 100644 index 0000000..dc9d8a7 --- /dev/null +++ b/source/X509/X520LocalityName.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520LocalityName, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520LocalityName >> displayName [ + + ^ 'L' +] diff --git a/source/X509/X520Name.class.st b/source/X509/X520Name.class.st new file mode 100644 index 0000000..122a872 --- /dev/null +++ b/source/X509/X520Name.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520Name, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520Name >> displayName [ + + ^ 'N' +] diff --git a/source/X509/X520OrganizationName.class.st b/source/X509/X520OrganizationName.class.st new file mode 100644 index 0000000..2887679 --- /dev/null +++ b/source/X509/X520OrganizationName.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520OrganizationName, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520OrganizationName >> displayName [ + + ^ 'O' +] diff --git a/source/X509/X520OrganizationalUnitName.class.st b/source/X509/X520OrganizationalUnitName.class.st new file mode 100644 index 0000000..14abb9e --- /dev/null +++ b/source/X509/X520OrganizationalUnitName.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520OrganizationalUnitName, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520OrganizationalUnitName >> displayName [ + + ^ 'OU' +] diff --git a/source/X509/X520Pkcs9EmailAddress.class.st b/source/X509/X520Pkcs9EmailAddress.class.st new file mode 100644 index 0000000..be2d7fd --- /dev/null +++ b/source/X509/X520Pkcs9EmailAddress.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520Pkcs9EmailAddress, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520Pkcs9EmailAddress >> displayName [ + + ^ 'E' +] diff --git a/source/X509/X520StateOrProvinceName.class.st b/source/X509/X520StateOrProvinceName.class.st new file mode 100644 index 0000000..754102f --- /dev/null +++ b/source/X509/X520StateOrProvinceName.class.st @@ -0,0 +1,11 @@ +Class { + #name : #X520StateOrProvinceName, + #superclass : #X520AbstractName, + #category : 'X509' +} + +{ #category : #printing } +X520StateOrProvinceName >> displayName [ + + ^ 'S' +] diff --git a/source/X509/package.st b/source/X509/package.st new file mode 100644 index 0000000..7a11d19 --- /dev/null +++ b/source/X509/package.st @@ -0,0 +1 @@ +Package { #name : #X509 }