Browse Source

Removing cruft from pre-Composer days

Curtis Farnham 7 years ago
parent
commit
a57ffe6014

+ 1 - 1
LICENSE

@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2013 Rob Napier, Guysung Kim, Curtis Farnham
+Copyright (c) 2013-2017 Rob Napier, Guysung Kim, Curtis Farnham
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 0 - 22
phpunit-coverage-html.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit bootstrap="tests/bootstrap.php"
-         colors="true" 
->
-    <testsuites>
-        <testsuite name="RNCryptor Test Suite">
-            <directory>tests/RNCryptor/</directory>
-        </testsuite>
-    </testsuites>
-
-    <filter>
-        <whitelist>
-            <directory suffix=".php">lib/RNCryptor/</directory>
-        </whitelist>
-    </filter>
-    
-    <logging>
-        <log type="coverage-html" target="./tests/coverage" charset="UTF-8"
-             yui="true" highlight="false" lowUpperBound="35" highLowerBound="70" />
-    </logging>
-</phpunit>

+ 2 - 2
phpunit.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<phpunit bootstrap="tests/bootstrap.php"
+<phpunit bootstrap="vendor/autoload.php"
          colors="true" 
 >
     <testsuites>
@@ -11,7 +11,7 @@
 
     <filter>
         <whitelist>
-            <directory suffix=".php">lib/RNCryptor/</directory>
+            <directory suffix=".php">src/RNCryptor/</directory>
         </whitelist>
     </filter>
 </phpunit>

+ 0 - 284
tests-xcode/testphp.xcodeproj/project.pbxproj

@@ -1,284 +0,0 @@
-// !$*UTF8*$!
-{
-	archiveVersion = 1;
-	classes = {
-	};
-	objectVersion = 46;
-	objects = {
-
-/* Begin PBXBuildFile section */
-		FBFBB5CC16B178DD002BA3EA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBFBB5CB16B178DD002BA3EA /* Foundation.framework */; };
-		FBFBB5CF16B178DD002BA3EA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FBFBB5CE16B178DD002BA3EA /* main.m */; };
-		FBFBB5E216B178FD002BA3EA /* RNCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = FBFBB5DA16B178FD002BA3EA /* RNCryptor.m */; };
-		FBFBB5E316B178FD002BA3EA /* RNCryptorEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = FBFBB5DD16B178FD002BA3EA /* RNCryptorEngine.m */; };
-		FBFBB5E416B178FD002BA3EA /* RNDecryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = FBFBB5DF16B178FD002BA3EA /* RNDecryptor.m */; };
-		FBFBB5E516B178FD002BA3EA /* RNEncryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = FBFBB5E116B178FD002BA3EA /* RNEncryptor.m */; };
-		FBFBB5E916B17931002BA3EA /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = FBFBB5E816B17931002BA3EA /* Base64.m */; };
-		FBFBB5EB16B179D3002BA3EA /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FBFBB5EA16B179D3002BA3EA /* Security.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-		FBFBB5C516B178DC002BA3EA /* CopyFiles */ = {
-			isa = PBXCopyFilesBuildPhase;
-			buildActionMask = 2147483647;
-			dstPath = /usr/share/man/man1/;
-			dstSubfolderSpec = 0;
-			files = (
-			);
-			runOnlyForDeploymentPostprocessing = 1;
-		};
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-		FBFBB5C716B178DD002BA3EA /* testphp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testphp; sourceTree = BUILT_PRODUCTS_DIR; };
-		FBFBB5CB16B178DD002BA3EA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
-		FBFBB5CE16B178DD002BA3EA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-		FBFBB5D116B178DD002BA3EA /* testphp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "testphp-Prefix.pch"; sourceTree = "<group>"; };
-		FBFBB5D916B178FD002BA3EA /* RNCryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCryptor.h; path = ../../../RNCryptor/RNCryptor.h; sourceTree = "<group>"; };
-		FBFBB5DA16B178FD002BA3EA /* RNCryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCryptor.m; path = ../../../RNCryptor/RNCryptor.m; sourceTree = "<group>"; };
-		FBFBB5DB16B178FD002BA3EA /* RNCryptor+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "RNCryptor+Private.h"; path = "../../../RNCryptor/RNCryptor+Private.h"; sourceTree = "<group>"; };
-		FBFBB5DC16B178FD002BA3EA /* RNCryptorEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNCryptorEngine.h; path = ../../../RNCryptor/RNCryptorEngine.h; sourceTree = "<group>"; };
-		FBFBB5DD16B178FD002BA3EA /* RNCryptorEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNCryptorEngine.m; path = ../../../RNCryptor/RNCryptorEngine.m; sourceTree = "<group>"; };
-		FBFBB5DE16B178FD002BA3EA /* RNDecryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNDecryptor.h; path = ../../../RNCryptor/RNDecryptor.h; sourceTree = "<group>"; };
-		FBFBB5DF16B178FD002BA3EA /* RNDecryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNDecryptor.m; path = ../../../RNCryptor/RNDecryptor.m; sourceTree = "<group>"; };
-		FBFBB5E016B178FD002BA3EA /* RNEncryptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNEncryptor.h; path = ../../../RNCryptor/RNEncryptor.h; sourceTree = "<group>"; };
-		FBFBB5E116B178FD002BA3EA /* RNEncryptor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNEncryptor.m; path = ../../../RNCryptor/RNEncryptor.m; sourceTree = "<group>"; };
-		FBFBB5E716B17931002BA3EA /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
-		FBFBB5E816B17931002BA3EA /* Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Base64.m; sourceTree = "<group>"; };
-		FBFBB5EA16B179D3002BA3EA /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-		FBFBB5C416B178DC002BA3EA /* Frameworks */ = {
-			isa = PBXFrameworksBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FBFBB5EB16B179D3002BA3EA /* Security.framework in Frameworks */,
-				FBFBB5CC16B178DD002BA3EA /* Foundation.framework in Frameworks */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-		FBFBB5BC16B178DC002BA3EA = {
-			isa = PBXGroup;
-			children = (
-				FBFBB5CD16B178DD002BA3EA /* testphp */,
-				FBFBB5CA16B178DD002BA3EA /* Frameworks */,
-				FBFBB5C816B178DD002BA3EA /* Products */,
-			);
-			sourceTree = "<group>";
-		};
-		FBFBB5C816B178DD002BA3EA /* Products */ = {
-			isa = PBXGroup;
-			children = (
-				FBFBB5C716B178DD002BA3EA /* testphp */,
-			);
-			name = Products;
-			sourceTree = "<group>";
-		};
-		FBFBB5CA16B178DD002BA3EA /* Frameworks */ = {
-			isa = PBXGroup;
-			children = (
-				FBFBB5EA16B179D3002BA3EA /* Security.framework */,
-				FBFBB5CB16B178DD002BA3EA /* Foundation.framework */,
-			);
-			name = Frameworks;
-			sourceTree = "<group>";
-		};
-		FBFBB5CD16B178DD002BA3EA /* testphp */ = {
-			isa = PBXGroup;
-			children = (
-				FBFBB5E716B17931002BA3EA /* Base64.h */,
-				FBFBB5E816B17931002BA3EA /* Base64.m */,
-				FBFBB5E616B1791C002BA3EA /* RNCryptor */,
-				FBFBB5CE16B178DD002BA3EA /* main.m */,
-				FBFBB5D016B178DD002BA3EA /* Supporting Files */,
-			);
-			path = testphp;
-			sourceTree = "<group>";
-		};
-		FBFBB5D016B178DD002BA3EA /* Supporting Files */ = {
-			isa = PBXGroup;
-			children = (
-				FBFBB5D116B178DD002BA3EA /* testphp-Prefix.pch */,
-			);
-			name = "Supporting Files";
-			sourceTree = "<group>";
-		};
-		FBFBB5E616B1791C002BA3EA /* RNCryptor */ = {
-			isa = PBXGroup;
-			children = (
-				FBFBB5D916B178FD002BA3EA /* RNCryptor.h */,
-				FBFBB5DA16B178FD002BA3EA /* RNCryptor.m */,
-				FBFBB5DB16B178FD002BA3EA /* RNCryptor+Private.h */,
-				FBFBB5DC16B178FD002BA3EA /* RNCryptorEngine.h */,
-				FBFBB5DD16B178FD002BA3EA /* RNCryptorEngine.m */,
-				FBFBB5DE16B178FD002BA3EA /* RNDecryptor.h */,
-				FBFBB5DF16B178FD002BA3EA /* RNDecryptor.m */,
-				FBFBB5E016B178FD002BA3EA /* RNEncryptor.h */,
-				FBFBB5E116B178FD002BA3EA /* RNEncryptor.m */,
-			);
-			name = RNCryptor;
-			sourceTree = "<group>";
-		};
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-		FBFBB5C616B178DC002BA3EA /* testphp */ = {
-			isa = PBXNativeTarget;
-			buildConfigurationList = FBFBB5D616B178DD002BA3EA /* Build configuration list for PBXNativeTarget "testphp" */;
-			buildPhases = (
-				FBFBB5C316B178DC002BA3EA /* Sources */,
-				FBFBB5C416B178DC002BA3EA /* Frameworks */,
-				FBFBB5C516B178DC002BA3EA /* CopyFiles */,
-			);
-			buildRules = (
-			);
-			dependencies = (
-			);
-			name = testphp;
-			productName = testphp;
-			productReference = FBFBB5C716B178DD002BA3EA /* testphp */;
-			productType = "com.apple.product-type.tool";
-		};
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-		FBFBB5BE16B178DC002BA3EA /* Project object */ = {
-			isa = PBXProject;
-			attributes = {
-				LastUpgradeCheck = 0450;
-				ORGANIZATIONNAME = "Rob Napier";
-			};
-			buildConfigurationList = FBFBB5C116B178DC002BA3EA /* Build configuration list for PBXProject "testphp" */;
-			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
-			hasScannedForEncodings = 0;
-			knownRegions = (
-				en,
-			);
-			mainGroup = FBFBB5BC16B178DC002BA3EA;
-			productRefGroup = FBFBB5C816B178DD002BA3EA /* Products */;
-			projectDirPath = "";
-			projectRoot = "";
-			targets = (
-				FBFBB5C616B178DC002BA3EA /* testphp */,
-			);
-		};
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
-		FBFBB5C316B178DC002BA3EA /* Sources */ = {
-			isa = PBXSourcesBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-				FBFBB5CF16B178DD002BA3EA /* main.m in Sources */,
-				FBFBB5E216B178FD002BA3EA /* RNCryptor.m in Sources */,
-				FBFBB5E316B178FD002BA3EA /* RNCryptorEngine.m in Sources */,
-				FBFBB5E416B178FD002BA3EA /* RNDecryptor.m in Sources */,
-				FBFBB5E516B178FD002BA3EA /* RNEncryptor.m in Sources */,
-				FBFBB5E916B17931002BA3EA /* Base64.m in Sources */,
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-		};
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
-		FBFBB5D416B178DD002BA3EA /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-				CLANG_CXX_LIBRARY = "libc++";
-				CLANG_ENABLE_OBJC_ARC = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = NO;
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_PREPROCESSOR_DEFINITIONS = (
-					"DEBUG=1",
-					"$(inherited)",
-				);
-				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.8;
-				ONLY_ACTIVE_ARCH = YES;
-				SDKROOT = macosx;
-			};
-			name = Debug;
-		};
-		FBFBB5D516B178DD002BA3EA /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
-				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-				CLANG_CXX_LIBRARY = "libc++";
-				CLANG_ENABLE_OBJC_ARC = YES;
-				CLANG_WARN_EMPTY_BODY = YES;
-				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_C_LANGUAGE_STANDARD = gnu99;
-				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNINITIALIZED_AUTOS = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				MACOSX_DEPLOYMENT_TARGET = 10.8;
-				SDKROOT = macosx;
-			};
-			name = Release;
-		};
-		FBFBB5D716B178DD002BA3EA /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "testphp/testphp-Prefix.pch";
-				PRODUCT_NAME = "$(TARGET_NAME)";
-			};
-			name = Debug;
-		};
-		FBFBB5D816B178DD002BA3EA /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				GCC_PRECOMPILE_PREFIX_HEADER = YES;
-				GCC_PREFIX_HEADER = "testphp/testphp-Prefix.pch";
-				PRODUCT_NAME = "$(TARGET_NAME)";
-			};
-			name = Release;
-		};
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-		FBFBB5C116B178DC002BA3EA /* Build configuration list for PBXProject "testphp" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FBFBB5D416B178DD002BA3EA /* Debug */,
-				FBFBB5D516B178DD002BA3EA /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-		FBFBB5D616B178DD002BA3EA /* Build configuration list for PBXNativeTarget "testphp" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				FBFBB5D716B178DD002BA3EA /* Debug */,
-				FBFBB5D816B178DD002BA3EA /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
-/* End XCConfigurationList section */
-	};
-	rootObject = FBFBB5BE16B178DC002BA3EA /* Project object */;
-}

+ 0 - 7
tests-xcode/testphp.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "self:testphp.xcodeproj">
-   </FileRef>
-</Workspace>

+ 0 - 53
tests-xcode/testphp/Base64.h

@@ -1,53 +0,0 @@
-//
-//  Base64.h
-//
-//  Version 1.1
-//
-//  Created by Nick Lockwood on 12/01/2012.
-//  Copyright (C) 2012 Charcoal Design
-//
-//  Distributed under the permissive zlib License
-//  Get the latest version from here:
-//
-//  https://github.com/nicklockwood/Base64
-//
-//  This software is provided 'as-is', without any express or implied
-//  warranty.  In no event will the authors be held liable for any damages
-//  arising from the use of this software.
-//
-//  Permission is granted to anyone to use this software for any purpose,
-//  including commercial applications, and to alter it and redistribute it
-//  freely, subject to the following restrictions:
-//
-//  1. The origin of this software must not be misrepresented; you must not
-//  claim that you wrote the original software. If you use this software
-//  in a product, an acknowledgment in the product documentation would be
-//  appreciated but is not required.
-//
-//  2. Altered source versions must be plainly marked as such, and must not be
-//  misrepresented as being the original software.
-//
-//  3. This notice may not be removed or altered from any source distribution.
-//
-
-#import <Foundation/Foundation.h>
-
-
-@interface NSData (Base64)
-
-+ (NSData *)dataWithBase64EncodedString:(NSString *)string;
-- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth;
-- (NSString *)base64EncodedString;
-
-@end
-
-
-@interface NSString (Base64)
-
-+ (NSString *)stringWithBase64EncodedString:(NSString *)string;
-- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth;
-- (NSString *)base64EncodedString;
-- (NSString *)base64DecodedString;
-- (NSData *)base64DecodedData;
-
-@end

+ 0 - 202
tests-xcode/testphp/Base64.m

@@ -1,202 +0,0 @@
-//
-//  Base64.m
-//
-//  Version 1.1
-//
-//  Created by Nick Lockwood on 12/01/2012.
-//  Copyright (C) 2012 Charcoal Design
-//
-//  Distributed under the permissive zlib License
-//  Get the latest version from here:
-//
-//  https://github.com/nicklockwood/Base64
-//
-//  This software is provided 'as-is', without any express or implied
-//  warranty.  In no event will the authors be held liable for any damages
-//  arising from the use of this software.
-//
-//  Permission is granted to anyone to use this software for any purpose,
-//  including commercial applications, and to alter it and redistribute it
-//  freely, subject to the following restrictions:
-//
-//  1. The origin of this software must not be misrepresented; you must not
-//  claim that you wrote the original software. If you use this software
-//  in a product, an acknowledgment in the product documentation would be
-//  appreciated but is not required.
-//
-//  2. Altered source versions must be plainly marked as such, and must not be
-//  misrepresented as being the original software.
-//
-//  3. This notice may not be removed or altered from any source distribution.
-//
-
-#import "Base64.h"
-
-
-#import <Availability.h>
-#if !__has_feature(objc_arc)
-#error This library requires automatic reference counting
-#endif
-
-
-@implementation NSData (Base64)
-
-+ (NSData *)dataWithBase64EncodedString:(NSString *)string
-{
-  const char lookup[] =
-  {
-    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
-    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 62, 99, 99, 99, 63,
-    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 99, 99, 99, 99, 99, 99,
-    99,  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, 99, 99, 99, 99, 99,
-    99, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 99, 99, 99, 99, 99
-  };
-
-  NSData *inputData = [string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
-  long long inputLength = [inputData length];
-  const unsigned char *inputBytes = [inputData bytes];
-
-  long long maxOutputLength = (inputLength / 4 + 1) * 3;
-  NSMutableData *outputData = [NSMutableData dataWithLength:maxOutputLength];
-  unsigned char *outputBytes = (unsigned char *)[outputData mutableBytes];
-
-  int accumulator = 0;
-  long long outputLength = 0;
-  unsigned char accumulated[] = {0, 0, 0, 0};
-  for (long long i = 0; i < inputLength; i++)
-  {
-    unsigned char decoded = lookup[inputBytes[i] & 0x7F];
-    if (decoded != 99)
-    {
-      accumulated[accumulator] = decoded;
-      if (accumulator == 3)
-      {
-        outputBytes[outputLength++] = (accumulated[0] << 2) | (accumulated[1] >> 4);
-        outputBytes[outputLength++] = (accumulated[1] << 4) | (accumulated[2] >> 2);
-        outputBytes[outputLength++] = (accumulated[2] << 6) | accumulated[3];
-      }
-      accumulator = (accumulator + 1) % 4;
-    }
-  }
-
-  //handle left-over data
-  if (accumulator > 0) outputBytes[outputLength] = (accumulated[0] << 2) | (accumulated[1] >> 4);
-  if (accumulator > 1) outputBytes[++outputLength] = (accumulated[1] << 4) | (accumulated[2] >> 2);
-  if (accumulator > 2) outputLength++;
-
-  //truncate data to match actual output length
-  outputData.length = outputLength;
-  return outputLength? outputData: nil;
-}
-
-- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth
-{
-  //ensure wrapWidth is a multiple of 4
-  wrapWidth = (wrapWidth / 4) * 4;
-
-  const char lookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-  long long inputLength = [self length];
-  const unsigned char *inputBytes = [self bytes];
-
-  long long maxOutputLength = (inputLength / 3 + 1) * 4;
-  maxOutputLength += wrapWidth? (maxOutputLength / wrapWidth) * 2: 0;
-  unsigned char *outputBytes = (unsigned char *)malloc(maxOutputLength);
-
-  long long i;
-  long long outputLength = 0;
-  for (i = 0; i < inputLength - 2; i += 3)
-  {
-    outputBytes[outputLength++] = lookup[(inputBytes[i] & 0xFC) >> 2];
-    outputBytes[outputLength++] = lookup[((inputBytes[i] & 0x03) << 4) | ((inputBytes[i + 1] & 0xF0) >> 4)];
-    outputBytes[outputLength++] = lookup[((inputBytes[i + 1] & 0x0F) << 2) | ((inputBytes[i + 2] & 0xC0) >> 6)];
-    outputBytes[outputLength++] = lookup[inputBytes[i + 2] & 0x3F];
-
-    //add line break
-    if (wrapWidth && (outputLength + 2) % (wrapWidth + 2) == 0)
-    {
-      outputBytes[outputLength++] = '\r';
-      outputBytes[outputLength++] = '\n';
-    }
-  }
-
-  //handle left-over data
-  if (i == inputLength - 2)
-  {
-    // = terminator
-    outputBytes[outputLength++] = lookup[(inputBytes[i] & 0xFC) >> 2];
-    outputBytes[outputLength++] = lookup[((inputBytes[i] & 0x03) << 4) | ((inputBytes[i + 1] & 0xF0) >> 4)];
-    outputBytes[outputLength++] = lookup[(inputBytes[i + 1] & 0x0F) << 2];
-    outputBytes[outputLength++] =   '=';
-  }
-  else if (i == inputLength - 1)
-  {
-    // == terminator
-    outputBytes[outputLength++] = lookup[(inputBytes[i] & 0xFC) >> 2];
-    outputBytes[outputLength++] = lookup[(inputBytes[i] & 0x03) << 4];
-    outputBytes[outputLength++] = '=';
-    outputBytes[outputLength++] = '=';
-  }
-
-  if (outputLength >= 4)
-  {
-    //truncate data to match actual output length
-    outputBytes = realloc(outputBytes, outputLength);
-    return [[NSString alloc] initWithBytesNoCopy:outputBytes
-                                          length:outputLength
-                                        encoding:NSASCIIStringEncoding
-                                    freeWhenDone:YES];
-  }
-  else if (outputBytes)
-  {
-    free(outputBytes);
-  }
-  return nil;
-}
-
-- (NSString *)base64EncodedString
-{
-  return [self base64EncodedStringWithWrapWidth:0];
-}
-
-@end
-
-
-@implementation NSString (Base64)
-
-+ (NSString *)stringWithBase64EncodedString:(NSString *)string
-{
-  NSData *data = [NSData dataWithBase64EncodedString:string];
-  if (data)
-  {
-    return [[self alloc] initWithData:data encoding:NSUTF8StringEncoding];
-  }
-  return nil;
-}
-
-- (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth
-{
-  NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
-  return [data base64EncodedStringWithWrapWidth:wrapWidth];
-}
-
-- (NSString *)base64EncodedString
-{
-  NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
-  return [data base64EncodedString];
-}
-
-- (NSString *)base64DecodedString
-{
-  return [NSString stringWithBase64EncodedString:self];
-}
-
-- (NSData *)base64DecodedData
-{
-  return [NSData dataWithBase64EncodedString:self];
-}
-
-@end

+ 0 - 30
tests-xcode/testphp/main.m

@@ -1,30 +0,0 @@
-//
-//  main.m
-//  testphp
-//
-//  Created by Rob Napier on 1/24/13.
-//  Copyright (c) 2013 Rob Napier. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "RNDecryptor.h"
-#import "Base64.h"
-
-int main(int argc, const char * argv[])
-{
-
-  @autoreleasepool {
-    NSError *decryptionError = nil;
-    // Output of encrypt.php
-    NSData *fromPHPData = [@"AgF12bfxXb0lpR5tJAWTNb9jRUyyhTS5A8GBu5M1qhwA7CV0NMqHYTsyEsDjSccQiohU+FV9wk+VzGDrRmEpoK6PnVKTmsmJpnlqftxOv9BXlkmHIiEBCXzTprhzv4lWQ2MiEKkx+zda9B4WEoBuMTPxdLwnAxek9baTgv9mDH64oPmhZZWtlG3s9gSEaA1Cu2uYScDOin3+T1sEOdVAbnJG" base64DecodedData];
-
-    NSData *fromPHPDecryptedData = [RNDecryptor decryptData:fromPHPData withPassword:@"myPassword" error:&decryptionError];
-
-    NSLog(@"decryptionError %@", decryptionError);
-    NSLog(@"Result = %@", fromPHPDecryptedData);
-    NSLog(@"Result = %@", [[NSString alloc] initWithData:fromPHPDecryptedData encoding:NSUTF8StringEncoding]);
-
-  }
-    return 0;
-}
-

+ 0 - 7
tests-xcode/testphp/testphp-Prefix.pch

@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'testphp' target in the 'testphp' project
-//
-
-#ifdef __OBJC__
-  #import <Foundation/Foundation.h>
-#endif

+ 0 - 8
tests/.gitignore

@@ -1,8 +0,0 @@
-
-# PEAR stuff, for running PHPUnit
-.pearrc
-pear
-
-# other stuff
-coverage
-

+ 0 - 13
tests/README

@@ -1,13 +0,0 @@
-RNCryptor PHP Tests
--------------------
-
-Unit tests use PHPUnit.  For convenience, a script is included to install a
-local copy of it from PEAR.  To install the local copy, run this:
-
-# ./install-local-phpunit.sh
-
-The file in this folder named "phpunit" is a symlink to the local
-installation's PHPUnit executable.  To run the tests, do this:
-
-# ./phpunit
-

+ 0 - 18
tests/bootstrap.php

@@ -1,18 +0,0 @@
-<?php
-
-/*
- * This file is part of the RNCryptor package.
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-if (file_exists(__DIR__.'/../vendor/autoload.php')) {
-    require __DIR__.'/../vendor/autoload.php';
-
-} else if (@include('RNCryptor/Autoloader.php')) {
-    RNCryptor\Autoloader::register();
-
-} else {
-    die('ERROR: Unable to find a suitable mean to register RNCryptor\Autoloader.');
-}

+ 0 - 16
tests/functions.php

@@ -1,16 +0,0 @@
-<?php
-
-if (!function_exists('hex2bin')) {
-
-	/**
-	 * If the PHP version being used is earlier than 5.4.0, we need to
-	 * make up for the lack of a hex2bin() function.
-	 */
-	function hex2bin($data) {
-		$bin = '';
-		foreach (str_split($data, 2) as $pair) {
-			$bin .= chr(hexdec($pair));
-		}
-		return $bin;
-	}
-}

+ 0 - 29
tests/install-local-phpunit.sh

@@ -1,29 +0,0 @@
-#!/bin/bash
-
-echo "Starting to install dependencies"
-echo
-
-PEAR_CONFIG_FILE=".pearrc"
-
-# clean up prior installation
-rm -rf pear $PEAR_CONFIG_FILE || exit 1
-
-# make new local config
-pear config-create $(pwd)/ $PEAR_CONFIG_FILE || exit 1
-pear -c $PEAR_CONFIG_FILE config-set auto_discover 1 || exit 1
-
-pear -c $PEAR_CONFIG_FILE channel-discover pear.phpunit.de || exit 1
-pear -c $PEAR_CONFIG_FILE install phpunit/PHPUnit || exit 1
-
-# patch PHP's include_path in phpunit script
-PEAR_DIR=$(pwd)/pear
-sed '2a\
-set_include_path(dirname(__FILE__) . "/php" . PATH_SEPARATOR . get_include_path());
-' $PEAR_DIR/phpunit > $PEAR_DIR/phpunit2 || exit 1
-mv $PEAR_DIR/phpunit2 $PEAR_DIR/phpunit || exit 1
-chmod 755 $PEAR_DIR/phpunit || exit 1
-
-cd $ORIG_DIR
-
-echo
-echo "Done installing dependencies"