maamin1 преди 7 години
родител
ревизия
21e013ae36
променени са 100 файла, в които са добавени 3 реда и са изтрити 9385 реда
  1. 0 33
      ccb_fund_trusteeship/.classpath
  2. 0 1
      ccb_fund_trusteeship/.gitignore
  3. 0 37
      ccb_fund_trusteeship/.project
  4. 0 13
      ccb_fund_trusteeship/.settings/.jsdtscope
  5. 0 4
      ccb_fund_trusteeship/.settings/org.eclipse.core.resources.prefs
  6. 0 13
      ccb_fund_trusteeship/.settings/org.eclipse.jdt.core.prefs
  7. 0 4
      ccb_fund_trusteeship/.settings/org.eclipse.m2e.core.prefs
  8. 0 10
      ccb_fund_trusteeship/.settings/org.eclipse.wst.common.component
  9. 0 7
      ccb_fund_trusteeship/.settings/org.eclipse.wst.common.project.facet.core.xml
  10. 0 1
      ccb_fund_trusteeship/.settings/org.eclipse.wst.jsdt.ui.superType.container
  11. 0 1
      ccb_fund_trusteeship/.settings/org.eclipse.wst.jsdt.ui.superType.name
  12. 0 2
      ccb_fund_trusteeship/.settings/org.eclipse.wst.validation.prefs
  13. 3 0
      ccb_fund_trusteeship/WebContent/META-INF/MANIFEST.MF
  14. 0 15
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/BattleResult.java
  15. 0 24
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/HintMSG.java
  16. 0 42
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/OperationTypeId.java
  17. 0 31
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Permission.java
  18. 0 38
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Role.java
  19. 0 38
      ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/StatusId.java
  20. 0 46
      ccb_fund_trusteeship/src/main/java/com/fuzamei/cros/CORSFilter.java
  21. 0 39
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountMaintenanceDao.java
  22. 0 68
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountOpenDao.java
  23. 0 24
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AttachmentDao.java
  24. 0 80
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/BusinessDeclareDao.java
  25. 0 87
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/CapitalTransferDao.java
  26. 0 74
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ContractManagementDao.java
  27. 0 29
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/OperationHistoryDao.java
  28. 0 43
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ProjectFileDao.java
  29. 0 35
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/PromptLetterDao.java
  30. 0 19
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/TrueFalseSelectDao.java
  31. 0 26
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/UserAuthoricationDao.java
  32. 0 128
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/UserDao.java
  33. 0 70
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ValuationAccountingDao.java
  34. 0 147
      ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/test.java
  35. 0 479
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAEngine.java
  36. 0 32
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAKey.java
  37. 0 339
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAPrivateKey.java
  38. 0 276
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAPublicKey.java
  39. 0 59
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSASecurityProvider.java
  40. 0 76
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/KeyFactory.java
  41. 0 100
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/KeyPairGenerator.java
  42. 0 103
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/Utils.java
  43. 0 23
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Constants.java
  44. 0 100
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Curve.java
  45. 0 54
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Encoding.java
  46. 0 99
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Field.java
  47. 0 76
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/FieldElement.java
  48. 0 1034
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/GroupElement.java
  49. 0 34
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ScalarOps.java
  50. 0 132
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/bigint/BigIntegerFieldElement.java
  51. 0 103
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/bigint/BigIntegerLittleEndianEncoding.java
  52. 0 38
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/bigint/BigIntegerScalarOps.java
  53. 0 988
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ed25519/Ed25519FieldElement.java
  54. 0 256
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java
  55. 0 693
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ed25519/Ed25519ScalarOps.java
  56. 0 33
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAGenParameterSpec.java
  57. 0 36
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSANamedCurveSpec.java
  58. 0 70
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSANamedCurveTable.java
  59. 0 96
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAParameterSpec.java
  60. 0 134
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAPrivateKeySpec.java
  61. 0 61
      ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAPublicKeySpec.java
  62. 0 45
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/AccountInfo.java
  63. 0 119
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/AccountOpeningRecord.java
  64. 0 47
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/Attachment.java
  65. 0 58
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/BusinessCheck.java
  66. 0 110
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/BusinessDeclare.java
  67. 0 126
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransfer.java
  68. 0 75
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransferCheck.java
  69. 0 113
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ContractRecord.java
  70. 0 67
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ContractStatusTracking.java
  71. 0 61
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/OperationHistory.java
  72. 0 123
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/OperationHistoryBO.java
  73. 0 49
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ProjectFile.java
  74. 0 102
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/PromptLetter.java
  75. 0 30
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/Role.java
  76. 0 30
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/Token.java
  77. 0 182
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/User.java
  78. 0 21
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/UserAccount.java
  79. 0 112
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/UserDetail.java
  80. 0 122
      ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ValuationAccount.java
  81. 0 414
      ccb_fund_trusteeship/src/main/java/com/fuzamei/http/Gwjf.java
  82. 0 128
      ccb_fund_trusteeship/src/main/java/com/fuzamei/http/HttpRequest.java
  83. 0 103
      ccb_fund_trusteeship/src/main/java/com/fuzamei/http/HttpsRequest.java
  84. 0 6
      ccb_fund_trusteeship/src/main/java/com/fuzamei/http/Request.java
  85. 0 14
      ccb_fund_trusteeship/src/main/java/com/fuzamei/http/RequestFactory.java
  86. 0 84
      ccb_fund_trusteeship/src/main/java/com/fuzamei/interceptor/TokenInterceptor.java
  87. 0 20
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountInfoInterface.java
  88. 0 15
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountMaintenanceMapper.java
  89. 0 26
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountOpenMapper.java
  90. 0 13
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AttachmentMapper.java
  91. 0 41
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/BusinessDeclareMapper.java
  92. 0 38
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/CapitalTransferMapper.java
  93. 0 41
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/ContractManagementMapper.java
  94. 0 15
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/OperationHistoryMapper.java
  95. 0 22
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/ProjectFileMapper.java
  96. 0 17
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/PromptLetterMapper.java
  97. 0 12
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/RoleInterface.java
  98. 0 14
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/TokenInterface.java
  99. 0 7
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/TrueFalseSelectMapper.java
  100. 0 10
      ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/UserAccountInterface.java

+ 0 - 33
ccb_fund_trusteeship/.classpath

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" output="target/classes" path="src/main/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
-		<attributes>
-			<attribute name="owner.project.facets" value="java"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>

+ 0 - 1
ccb_fund_trusteeship/.gitignore

@@ -1 +0,0 @@
-/target/

+ 0 - 37
ccb_fund_trusteeship/.project

@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ccb_fund_trusteeship</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.wst.common.project.facet.core.builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.m2e.core.maven2Builder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.wst.validation.validationbuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
-		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.m2e.core.maven2Nature</nature>
-		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
-		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
-	</natures>
-</projectDescription>

+ 0 - 13
ccb_fund_trusteeship/.settings/.jsdtscope

@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
-	<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
-	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
-		<attributes>
-			<attribute name="hide" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
-	<classpathentry kind="output" path=""/>
-</classpath>

+ 0 - 4
ccb_fund_trusteeship/.settings/org.eclipse.core.resources.prefs

@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/main/resources/conf.properties=UTF-8
-encoding//src/main/resources/messages.properties=UTF-8
-encoding/<project>=UTF-8

+ 0 - 13
ccb_fund_trusteeship/.settings/org.eclipse.jdt.core.prefs

@@ -1,13 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.8

+ 0 - 4
ccb_fund_trusteeship/.settings/org.eclipse.m2e.core.prefs

@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1

+ 0 - 10
ccb_fund_trusteeship/.settings/org.eclipse.wst.common.component

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
-    <wb-module deploy-name="ccb_fund_trusteeship">
-        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
-        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
-        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
-        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
-        <property name="context-root" value="ccb_fund_trusteeship"/>
-        <property name="java-output-path" value="/ccb_fund_trusteeship/target/classes"/>
-    </wb-module>
-</project-modules>

+ 0 - 7
ccb_fund_trusteeship/.settings/org.eclipse.wst.common.project.facet.core.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<faceted-project>
-  <fixed facet="wst.jsdt.web"/>
-  <installed facet="jst.web" version="2.3"/>
-  <installed facet="wst.jsdt.web" version="1.0"/>
-  <installed facet="java" version="1.8"/>
-</faceted-project>

+ 0 - 1
ccb_fund_trusteeship/.settings/org.eclipse.wst.jsdt.ui.superType.container

@@ -1 +0,0 @@
-org.eclipse.wst.jsdt.launching.baseBrowserLibrary

+ 0 - 1
ccb_fund_trusteeship/.settings/org.eclipse.wst.jsdt.ui.superType.name

@@ -1 +0,0 @@
-Window

+ 0 - 2
ccb_fund_trusteeship/.settings/org.eclipse.wst.validation.prefs

@@ -1,2 +0,0 @@
-disabled=06target
-eclipse.preferences.version=1

+ 3 - 0
ccb_fund_trusteeship/WebContent/META-INF/MANIFEST.MF

@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

+ 0 - 15
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/BattleResult.java

@@ -1,15 +0,0 @@
-package com.fuzamei.constant;
-/**
- * 
- * @author ylx
- * @describe 估值核算表中
- *
- */
-public class BattleResult {
-	private BattleResult() {
-		throw new AssertionError("禁止实例化");
-	}
-	public static final String TO_BE_MATCHED = "待对账";
-	public static final String CONSISTENT = "估值一致";
-	public static final String INCONSISTENT = "估值不一致";
-}

+ 0 - 24
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/HintMSG.java

@@ -1,24 +0,0 @@
-package com.fuzamei.constant;
-
-/**
- * 
- * @author ylx
- * @descibe: 提示信息的类
- */
-public class HintMSG {
-	private HintMSG() {
-		throw new AssertionError("禁止实例化");
-	}
-	public static final String DOWNLOAD_SUCCESS="文件下载成功";
-	public static final String DOWNLOAD_FAIL="文件下载失败";
-	public static final String UPLOAD_SUCCESS="文件上传成功";
-	public static final String UPLOAD_FAIL="文件上传失败";
-	public static final String QUERY_SUCCESS="查询成功";
-	public static final String QUERY_FAIL="查询失败";
-	public static final String CHECK_SUCCESS="查看成功";
-	public static final String CHECK_FAIL="查看失败";
-	public static final String FILE_NOT_FOUND="文件不存在";
-	public static final String FILE_CANT_BE_NULL="文件不能为空";
-	public static final String OPERATION_SUCCESS="操作成功";
-	public static final String OPERATION_FAIL="操作失败";
-}

+ 0 - 42
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/OperationTypeId.java

@@ -1,42 +0,0 @@
-package com.fuzamei.constant;
-/**
- * 
- * @author ylx
- * @describe: 操作类型id号
- */
-public class OperationTypeId {
-	private OperationTypeId() {
-		throw new AssertionError("禁止实例化");
-	}
-	public static final Integer BUSINESS_APPLY =1001;								//业务申报
-	public static final Integer BUSINESS_FIRST_TRIAL_AGREED =1002;					//业务初审通过
-	public static final Integer BUSINESS_REEXAMINE_REJECTED =1003;					//业务复审拒绝
-	public static final Integer CONTRACT_UPLOAD =1004;								//合同上传
-	public static final Integer CONTRACT_CONFIRM =1005;								//合同确认
-	public static final Integer CAPITAL_TRANSFER_FIRST_TRIAL =1006;					//资金划转初审
-	public static final Integer CAPITAL_TRANSFER_REEXAMINE =1007;					//资金划转复审
-	public static final Integer CAPITAL_TRANSFER_REEXAMINE_REJECTED =1008;			//资金划转复审拒绝
-	public static final Integer CAPITAL_TRANSFER_FINAL_JUDGE =1009;					//资金划转终审
-	public static final Integer UPLOAD_VALUATION_CHECK =1010;						//上传估值核算表
-	public static final Integer UPLOAD_PROJECT_FILE =1011;							//上传项目文档
-	public static final Integer BUSINESS_FIRST_TRIAL_REJECTED =1012;				//业务初审拒绝
-	public static final Integer BUSINESS_REEXAMINE_AGREED =1013;					//业务复审通过
-	
-	public static final Integer CAPITAL_TRANSFER_REEXAMINE_REJECTED_NO =1014;       //资金划转终身拒绝
-	public static final Integer INSTRUCT_BUSINESS_ACCOUNTING =1015;      			//待指令业务岗审核
-	public static final Integer INSTRUCT_BUSINESS_ACCOUNTING_NO =1016;    			//指令业务岗审核不通过
-	public static final Integer CHECK_BUSINESS_ACCOUNTING =1017;        			//待核算业务岗岗审核
-	public static final Integer INSTRUCT_BUSINESS_ACCOUNTING_YES=1029;         //指令业务岗通过
-	public static final Integer CHECK_BUSINESS_ACCOUNTING_PASS =1024;               //核算业务岗通过
-	public static final Integer CHECK_BUSINESS_ACCOUNTING_REJECT =1025;             //核算业务岗拒绝
-	public static final Integer CHECK_BUSINESS_ACCOUNTING_MAIN_REJECT =1026;        //核算主管岗拒绝
-	public static final Integer ADMIN_LAUNCHING=1027;                               //管理人   发起
-	public static final Integer CHECK_BUSINESS_ACCOUNTING_REJECT_MAIN =1028;        //指令业务岗拒绝  
-	public static final Integer CHECK_BUSINESS_ACCOUNTING_NO =1018;      			//核算业务岗审核不通过
-	public static final Integer CHARGE_BUSINESS_ACCOUNTING =1019;        			//待核算主管岗审核
-	public static final Integer CHARGE_BUSINESS_ACCOUNTING_YES =1020;     			//核算主管岗通过
-	public static final Integer CHARGE_BUSINESS_ACCOUNTING_NO =1021;      			//核算主管岗审核不通过
-	public static final Integer CHECK_TRUE_OR_FALSE =1022;      					//真伪查询
-	public static final Integer UPLOAD_PROMPT_LETTER =1023;      					//上传提示函
-	
-}

+ 0 - 31
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Permission.java

@@ -1,31 +0,0 @@
-package com.fuzamei.constant;
-
-/**
- * 
- * @author ylx
- * @describe: 权限名称常量表
- * @date: 2017-12-28 10:12 am
- */
-public class Permission {
-	private Permission() {
-		throw new AssertionError("禁止实例化");
-	}
-	public static final String ADD="添加";
-	public static final String FIRST_TRIAL="初审";
-	public static final String REEXAMINE="复审";
-	public static final String UPLOAD_CONTRACT="上传合同";
-	public static final String MODIFY_CONTRACT="修订合同";
-	public static final String CONFIRM_CONTRACT="确认合同";
-	public static final String SEND_TRANSFER_ORDER="发出划款指令";
-	public static final String UPLOAD_VALUATION_REPORT="上传估值报表";
-	public static final String OPEN_ACCOUNT="开立账户";
-	public static final String CHECK_ACCOUNT_INFO="查看账户信息";
-	public static final String FIRST_TRIAL_OF_TRANSFER_ORDER="初审划款指令";
-	public static final String REEXAMINE_OF_TRANSFER_ORDER="复审划款指令";
-	public static final String FINAL_CHECK_OF_TRANSFER_ORDER="划款指令";
-	public static final String UPLOAD_PROJECT_FILE="上传项目文档";
-	public static final String CHECK_PROJECT_FILE="查看项目文档";
-	public static final String CHECK_INNER_CETIFICATION_FILE="验证文件是否是内部认证文档";
-	public static final String SEND_VENTURE_LETTER="发风险提示函";
-	public static final String CHECK_OUT="查看";
-}

+ 0 - 38
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/Role.java

@@ -1,38 +0,0 @@
-package com.fuzamei.constant;
-
-/**
- * 
- * @author ylx
- * @DESCRIBE: 角色名称常量表
- * @Date:2017-12-28 10:08 am
- */
-public class Role {
-	private Role() {
-		throw new AssertionError("禁止实例化");
-	}
-	//TRAN is abbreviation of transactor
-	public static final String TRAN_BRANCH_BANK = "经办支行";
-	//SEC is abbreviation of secondary
-	public static final String SEC_BRANCH_BANK = "二级分行";
-	//PBB is abbreviation of provincial branch bank
-	public static final String BUSINESS_DEP_OF_PBB = "省分行业务部门";
-	public static final String ADMIN = "管理人";
-	public static final String BUSINESS_CHIEF_DEP_OF_PBB = "省分行业务主管部门";
-	public static final String LAW_DEP_OF_PBB = "省分行法律部";
-	//POS is abbreviation of position
-	//PBBTBC is abbreviation of provincial branch bank trusteeship branch center
-	public static final String ACCOUNT_MAINTAIN_POS_OF_PBBTBC = "省分行托管分中心账户维护岗";
-	public static final String ACCOUNT_MANAGE_POS_OF_PBBTBC = "省分行托管分中心账户管理岗";
-	public static final String BUSINESS_TRAN_POS_OF_PBBTBC = "省分行托管中心指令业务岗";
-	public static final String BUSINESS_CHECK_POS_OF_PBBTBC = "省分行托管分中心核算业务岗";
-	public static final String BUSINESS_CHIEF_POS_OF_PBBTBC = "省分行托管中心核算主管岗";
-	//TBC is abbreviation of trusteeship branch center
-	public static final String ACCOUNTING_POS_OF_TBC = "托管分中心核算岗";
-	public static final String ARCHIVE_KEEPING_POS_OF_PBBTBC = "省分行托管分中心档案保管岗";
-	public static final String SUPERVISION_AGENCY = "监管机构";
-	public static final String OUTERS_OF_BANK = "银行内外部人员";
-	public static final String VENTURE_MANAGEMENT_POS = "风管岗";
-	public static final String OTHER_POS = "其余岗";
-	public static final String INNERS_OF_BANK = "银行内部人员";
-	public static final String AUDITOR = "总审计";
-}

+ 0 - 38
ccb_fund_trusteeship/src/main/java/com/fuzamei/constant/StatusId.java

@@ -1,38 +0,0 @@
-package com.fuzamei.constant;
-
-/**
- * 
- * @author ylx
- * @describe: 对应状态id号
- */
-public class StatusId {
-	private StatusId() {
-		throw new AssertionError("禁止实例化");
-	}
-	public static final Integer TO_BE_CHECKED_BY_SECONDARY_BRANCH_BANK = 1;	//待二级分行审核
-	public static final Integer REJECTED_BY_SECONDARY_BRANCH_BANK = 2;		//二级分行审核不通过
-	public static final Integer TO_BE_CHECKED_BY_PROVINCIAL_BRANCH_BANK = 3;//待省分行业务部门审核
-	public static final Integer REJECTED_BY_PROVINCIAL_BRANCH_BANK = 4;		//省分行业务部门审核不通过
-	public static final Integer AGREE = 5;									//通过
-	public static final Integer REJECTED = 6;								//不通过
-	public static final Integer MODIFYING = 7;								//修订中
-	public static final Integer CONFIRMED = 8;								//已确认
-	public static final Integer FINISHED = 9;								//已完成
-	public static final Integer LAUNCHING = 10;								//发起
-	public static final Integer CHECKING = 11;                            	//审核
-
-	public static final Integer INSTRUCT_BUSINESS_ACCOUNTING =12;     		//待指令业务岗审核
-	public static final Integer INSTRUCT_BUSINESS_ACCOUNTING_NO =13;    	//指令业务岗审核不通过
-	public static final Integer CHECK_BUSINESS_ACCOUNTING =14;        		//待核算业务岗岗审核
-	public static final Integer CHECK_BUSINESS_ACCOUNTING_NO =15;     		//核算业务岗审核不通过
-	public static final Integer CHARGE_BUSINESS_ACCOUNTING =16;        		//待核算主管岗审核
-	public static final Integer CHARGE_BUSINESS_ACCOUNTING_YES =17;     	//核算主管岗通过
-	public static final Integer CHARGE_BUSINESS_ACCOUNTING_NO =18;      	//核算主管岗审核不通过 
-	public static final Integer INVALID =19;      							//未生效 
-	public static final Integer VALID =20;      							//已生效 
-	public static final Integer DUMPED =21;      							//作废
-	
-	
-	
-	
-}

+ 0 - 46
ccb_fund_trusteeship/src/main/java/com/fuzamei/cros/CORSFilter.java

@@ -1,46 +0,0 @@
-/**  
- * @Title: CORSFilter.java
- * @Package: com.fuzamei.cros
- * @Description: TODO 
- * @author: Ma Amin
- * @date: 2017-10-13 下午2:33:06
- */
-package com.fuzamei.cros;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @file_name: CORSFilter.java
- * @Description: TODO
- * @author: Ma Amin
- * @date: 2017-10-13 下午2:33:06
- * @version 1.0.0
- */
-public class CORSFilter implements Filter {
-	public void doFilter(ServletRequest req, ServletResponse res,
-			FilterChain chain) throws IOException, ServletException {
-		HttpServletResponse response = (HttpServletResponse) res;
-		response.setHeader("Access-Control-Allow-Origin", "*");
-		response.setHeader("Access-Control-Allow-Methods",
-				"GET, HEAD, OPTIONS, POST, PUT, DELETE");
-		response.setHeader("Access-Control-Max-Age", "3600");
-		response.addHeader("Access-Control-Allow-Headers",
-				"Authorization, Content-Type, X-Requested-With");
-		response.addHeader("Access-Control-Allow-Credentials", "true");
-		chain.doFilter(req, res);
-	}
-
-	public void init(FilterConfig filterConfig) {
-	}
-
-	public void destroy() {
-	}
-}

+ 0 - 39
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountMaintenanceDao.java

@@ -1,39 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.AccountOpeningRecord;
-import com.fuzamei.mapperInterface.AccountMaintenanceMapper;
-@Repository
-public class AccountMaintenanceDao {
-	@Autowired
-	private AccountMaintenanceMapper accountMaintenanceMapper;
-	
-	
-	public  void  insertIntoAccountMaintenanceInfo(Map<String, Object> map) {
-		accountMaintenanceMapper.insertIntoAccountMaintenanceInfo(map);
-	}
-	public  void  insertAccountMaintenanceInfoFuJianBiao(Map<String, Object> map) {
-		accountMaintenanceMapper.insertAccountMaintenanceInfoFuJianBiao(map);
-	}
-	public  void  insertAccountMaintenanceInfoOperationHistory(Map<String, Object> map) {
-		accountMaintenanceMapper.insertAccountMaintenanceInfoOperationHistory(map);
-	}
-	public List<AccountOpeningRecord> selectAccountMaintenanceInfo(Map<String, Object> map){
-		return accountMaintenanceMapper.selectAccountMaintenanceInfo(map);
-	}
-	public  int selectCountAccountMaintenancePage(Map<String, Object> map) {
-		return accountMaintenanceMapper.selectCountAccountMaintenancePage(map);
-	}
-	public List<AccountOpeningRecord> selectAccountMaintenanceNoPage(Map<String, Object> map){
-		return accountMaintenanceMapper.selectAccountMaintenanceNoPage(map);
-	}
-	
-	
-	
-	
-}

+ 0 - 68
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AccountOpenDao.java

@@ -1,68 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.AccountOpeningRecord;
-import com.fuzamei.entity.PromptLetter;
-import com.fuzamei.entity.User;
-import com.fuzamei.mapperInterface.AccountOpenMapper;
-@Repository
-public class AccountOpenDao {
-	@Autowired
-	private AccountOpenMapper mapperDao;
- 
-		public List<AccountOpeningRecord> queryAllAccountOpening(Map<String, Object> map){//查询账户开立列表
-			return  mapperDao.queryAllAccountOpening(map);		
-         }
-		public  int  serchCountPage(){//总页数
-			return  mapperDao.serchCountPage();
-		}
-		public List<PromptLetter> selectPromptLetter(Map<String, Object> map){//查询风险提示函  管理人接收人
-			return mapperDao.selectPromptLetter(map);
-		}
-		public  int  serchCountPage2(){//总页
-			return  mapperDao.serchCountPage2();
-		}
-		public void insertTiShiHanOrUserOrOtherTable(Map<String, Object> map) {//插入管理人账号 还要往附件表,提示函表,操作记录表里也要加数据
-			mapperDao.insertTiShiHanOrUserOrOtherTable(map);
-		}
-		public void insertOperationHistory(Map<String, Object> map) {//插入到操作记录表     公共用
-			mapperDao.insertOperationHistory(map);
-		}
-		public List<PromptLetter> selectTishihan(Map<String, Object> map){//查询风险提示函3   发送人
-			return mapperDao.selectTishihan(map);
-		}
-		public void insertTrueFalseSelect(Map<String, Object> map) {//真伪查询   记录插入到附件表
-			mapperDao.insertAccountUploadFileFuJianBiao(map);
-		}
-		public void insertAccountUploadFile(Map<String, Object> map) {//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称 -->
-			mapperDao.insertAccountUploadFile(map);
-		}
-		public void insertPromptLetterTable(Map<String, Object> map) {//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称    到附件表-->
-			mapperDao.insertAccountUploadFileFuJianBiao(map);
-		}
-		public void insertAccountUploadFileFuJianBiao(Map<String, Object> map) {
-			mapperDao.insertAccountUploadFileFuJianBiao(map);
-		}
-		
-		public void insertIntoPromptLetterTable(Map<String, Object> map) {//数据往提示函插入99
-			mapperDao.insertIntoPromptLetterTable(map);
-		}
-		public void insertIntoAttachmentTable(Map<String, Object> map) {//提示函数据在往附件表也插入99
-			mapperDao.insertIntoAttachmentTable(map);
-		}
-		public List<AccountOpeningRecord> selectAccountopenNoPage(Map<String, Object> map){////账户开立 通过点击查看  供应下载页面  
-			return  mapperDao.selectAccountopenNoPage(map);		
-         }
-		////////////////////////////////////////////////////////////////////////////////////////////////
-		
-		
-		
-		
-		
-		
-}

+ 0 - 24
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/AttachmentDao.java

@@ -1,24 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.Set;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.mapperInterface.AttachmentMapper;
-
-@Repository
-public class AttachmentDao {
-	
-	@Autowired
-	private AttachmentMapper attachmentMapper;
-
-	public int queryIfHasTheSameAttachmentId(Integer attachmentId) {
-		return attachmentMapper.queryIfHasTheSameAttachmentId(attachmentId);
-	}
-
-	public int queryIfHasTheSameAttachmentIdS(Set<Integer> set) {
-		return attachmentMapper.queryIfHasTheSameAttachmentIdS(set);
-	}
-
-}

+ 0 - 80
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/BusinessDeclareDao.java

@@ -1,80 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.BusinessCheck;
-import com.fuzamei.entity.BusinessDeclare;
-import com.fuzamei.mapperInterface.BusinessDeclareMapper;
-
-@Repository
-public class BusinessDeclareDao {
-
-	@Autowired
-	private BusinessDeclareMapper businessDeclareMapper;
-
-	public void insertBusinessDeclareInformationToDaoByBranchBank(Map<String, Object> map) {
-		businessDeclareMapper.insertBusinessDeclareInformationToDaoByBranchBank(map);
-	}
-
-	public void insertAttachmentInformationToDaoByBranchBank(Map<String, Object> map) {
-		businessDeclareMapper.insertAttachmentInformationToDaoByBranchBank(map);
-	}
-
-	public int findAllInfromations(Map<String, Object> map) {
-		return businessDeclareMapper.findAllInfromations(map);
-	}
-
-	public List<BusinessDeclare> queryBusinessDeclareInformation(Map<String, Object> map) {
-		return businessDeclareMapper.queryBusinessDeclareInformation(map);
-	}
-
-	public List<BusinessCheck> queryBusinessCheckInformation(Map<String, Object> map) {
-		return businessDeclareMapper.queryBusinessCheckInformation(map);
-	}
-
-	public void businessDeclareCheckedBy(Map<String, Object> map) {
-		businessDeclareMapper.businessDeclareCheckedBy(map);
-	}
-
-	public void updateBusinessDeclareStatus(Map<String, Object> map) {
-		businessDeclareMapper.updateBusinessDeclareStatus(map);
-	}
-
-	public void insertContractInformationToContractRecord(Map<String, Object> map) {
-		businessDeclareMapper.insertContractInformationToContractRecord(map);
-	}
-
-	public void insertContractInformationToContractStatusTracking(Map<String, Object> map) {
-		businessDeclareMapper.insertContractInformationToContractStatusTracking(map);
-	}
-
-	public void insertContractInformationToAttachment(Map<String, Object> map) {
-		businessDeclareMapper.insertContractInformationToAttachment(map);
-	}
-
-	public void insertOperationHistoryInformationToDaoByBranchBank(Map<String, Object> map) {
-		businessDeclareMapper.insertOperationHistoryInformationToDaoByBranchBank(map);
-	}
-
-	public int queryIfHasTheSameBusinessId(Integer businessId) {
-		return businessDeclareMapper.queryIfHasTheSameBusinessId(businessId);
-	}
-
-	public List<BusinessDeclare> queryBusinessDeclareInformationByPBB(Map<String, Object> map) {
-		return businessDeclareMapper.queryBusinessDeclareInformationByPBB(map);
-	}
-
-	public int findAllInfromationsByPBB(Map<String, Object> map) {
-		return businessDeclareMapper.findAllInfromationsByPBB(map);
-	}
-
-	public Integer getStatusIdByBusinessId(Integer businessId) {
-		return businessDeclareMapper.getStatusIdByBusinessId(businessId);
-	}
-	
-	
-}

+ 0 - 87
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/CapitalTransferDao.java

@@ -1,87 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.AccountInfo;
-import com.fuzamei.entity.CapitalTransfer;
-import com.fuzamei.entity.CapitalTransferCheck;
-import com.fuzamei.entity.User;
-import com.fuzamei.entity.UserAccount;
-import com.fuzamei.mapperInterface.CapitalTransferMapper;
-
-@Repository
-public class CapitalTransferDao {
-	@Autowired
-    private CapitalTransferMapper  capitalTransferMapper;
-	
-	
-	public List<CapitalTransfer> selectCapitalTransferTable(Map<String, Object> map){//查询资金划转列表    指令业务岗和管理人能查看列表
-		return capitalTransferMapper.selectCapitalTransferTable(map);
-	}
-	public List<CapitalTransfer> selectCapitalTransferTable2(Map<String, Object> map){//查询资金划转列表       指令业务岗审核通过后  核算业务岗才能看到列表里之前的审核信息
-		return capitalTransferMapper.selectCapitalTransferTable2(map);
-	}
-	public List<CapitalTransfer> selectCapitalTransferTable3(Map<String, Object> map){//查询资金划转列表      指令业务岗和核算业务岗审核同过后 核算主管岗才能看到之前2级的审核信息
-		return capitalTransferMapper.selectCapitalTransferTable3(map);
-	}
-	
-	public int  selectCapitalTransferPage(Map<String, Object> map) {//查询资金划转表  总页数    指令业务岗和管理人能查看列表
-		return  capitalTransferMapper.selectCapitalTransferPage(map) ;
-	}
-	public int  selectCapitalTransferPage2(Map<String, Object> map) {//查询资金划转表  总页数    指令业务岗审核通过后  核算业务岗才能看到列表里之前的审核信息
-		return  capitalTransferMapper.selectCapitalTransferPage2(map) ;
-	}
-	public int  selectCapitalTransferPage3(Map<String, Object> map) {//查询资金划转表  总页数   指令业务岗和核算业务岗审核同过后 核算主管岗才能看到之前2级的审核信息
-		return  capitalTransferMapper.selectCapitalTransferPage3(map) ;
-	}
-	
-	
-	public  List<CapitalTransfer> selectChaKanZiJinHuaZhuan(Map<String, Object> map){//资金划转    查看详情
-		return capitalTransferMapper.selectChaKanZiJinHuaZhuan(map);
-	}
-	public  List<CapitalTransferCheck> selectCapitalTransferRecord(Map<String, Object> map){//资金划转 里审核记录   查看详情
-		return capitalTransferMapper.selectCapitalTransferRecord(map);
-	}
-	
-	public void insertCapitalTransfer(Map<String, Object> map) {//管理人  发起  划款资金
-		capitalTransferMapper.insertCapitalTransfer(map);
-	}
-	
-	public void insertCheckTransfer(Map<String, Object> map) {//将划转资金审核的意见插入到(划转资金审核表里)
-		capitalTransferMapper.insertCheckTransfer(map);
-	}
-	public void updatecapitaltransferStatus(Map<String, Object> map) {//将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id 在修改指定的业务 
-		capitalTransferMapper.updateCapitaltransferStatus(map);
-	}
-	public List<CapitalTransferCheck> queryCapitalTransferCheckInformation(Map<String, Object> map){// 根据资金划转id查询资金审核状态id值 
-		return capitalTransferMapper.queryCapitalTransferCheckInformation(map);
-		
-	}
-	public Integer getStatusIdByCapitalId(Integer fund_id) {
-		return capitalTransferMapper.getStatusIdByCapitalId(fund_id);
-		
-	}
-	public void updateCapitaltransferStatus(Map<String, Object> map) {
-		capitalTransferMapper.updateCapitaltransferStatus(map);
-	}
-	public void insertOperationHistory(Map<String, Object> map) {//往操作记录表插入
-		capitalTransferMapper.insertOperationHistory(map);
-	}	
-	public void insertAttachmentInfo(Map<String, Object> map) {//往附件表插入
-		 capitalTransferMapper.insertAttachmentInfo(map);
-	 }	
-	public void updateTUserAccountBalance(Map<String, Object> map) {//划转资金后  修改账户里的余额
-		capitalTransferMapper.updateTUserAccountBalance(map);
-	}
-	public void updateAccountMoney(Map<String, Object> map) {//划转资金后要把账户表里的账户钱修改(加起来)
-		capitalTransferMapper.updateAccountMoney(map);
-	}
-	public List<AccountInfo> queryAccountWhereUserId(int user_id){//	<!--查询所有(账户名称)  返给前端    -->
-		return capitalTransferMapper.queryAccountWhereUserId(user_id);	
-	}
-  
-}

+ 0 - 74
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ContractManagementDao.java

@@ -1,74 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.ContractRecord;
-import com.fuzamei.entity.ContractStatusTracking;
-import com.fuzamei.mapperInterface.ContractManagementMapper;
-
-@Repository
-public class ContractManagementDao {
-	
-	@Autowired
-	private ContractManagementMapper contractManagementMapper;
-
-	public List<ContractStatusTracking> queryContractStatusTracking(Map<String, Object> map) {
-		return contractManagementMapper.queryContractStatusTracking(map);
-	}
-
-	public int findAllContractStatusTrackingInformation(Map<String, Object> map) {
-		return contractManagementMapper.findAllContractStatusTrackingInformation(map);
-	}
-
-	public List<ContractRecord> queryContractRecord(Map<String, Object> map) {
-		return contractManagementMapper.queryContractRecord(map);
-	}
-
-	public int findAllContractRecordInformation(Map<String, Object> map) {
-		return contractManagementMapper.findAllContractRecordInformation(map);
-	}
-
-	public ContractStatusTracking getContractStatusTrackingByBusinessId(Integer businessId) {
-		return contractManagementMapper.getContractStatusTrackingByBusinessId(businessId);
-	}
-
-	public void insertInformationToAttachment(Map<String, Object> map) {
-		contractManagementMapper.insertInformationToAttachment(map);
-	}
-
-	public void insertInformationToOperationHistory(Map<String, Object> map) {
-		contractManagementMapper.insertInformationToOperationHistory(map);
-	}
-
-	public ContractRecord getLatestContractRecordByBusinessId(Integer businessId) {
-		return contractManagementMapper.getLatestContractRecordByBusinessId(businessId);
-	}
-
-	public void insertInformationToContractRecord(Map<String, Object> map) {
-		contractManagementMapper.insertInformationToContractRecord(map);
-	}
-
-	public void updateContractStatusTracking(Map<String, Object> map) {
-		contractManagementMapper.updateContractStatusTracking(map);
-	}
-
-	public ContractRecord getCurrentContractRecordByBusinessId(Integer businessId, Integer version) {
-		return contractManagementMapper.getCurrentContractRecordByBusinessId(businessId,version);
-	}
-
-	public void updateContractRecord(Map<String, Object> map) {
-		contractManagementMapper.updateContractRecord(map);
-	}
-
-	public void updateOtherContractRecord(Map<String, Object> map) {
-		contractManagementMapper.updateOtherContractRecord(map);
-	}
-
-	public void updateContractStatusTrackingStatusAndContractId(Map<String, Object> map) {
-		contractManagementMapper.updateContractStatusTrackingStatusAndContractId(map);
-	}
-}

+ 0 - 29
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/OperationHistoryDao.java

@@ -1,29 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.OperationHistory;
-import com.fuzamei.mapperInterface.OperationHistoryMapper;
-
-@Repository
-public class OperationHistoryDao {
-	
-	@Autowired
-	private OperationHistoryMapper dao;
-	
-	public List<OperationHistory> queryOperationHistoryInformation(Map<String, Object> map){
-		return dao.queryOperationHistoryInformation(map);
-	}
-	
-	public int findAllInformation(Map<String, Object> map){
-		return dao.findAllInformation(map);
-	}
-
-	public List<OperationHistory> queryOperationHistoryInformationByUser(Map<String, Object> map) {
-		return dao.queryOperationHistoryInformationByUser(map);
-	}
-}

+ 0 - 43
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ProjectFileDao.java

@@ -1,43 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.ProjectFile;
-import com.fuzamei.mapperInterface.ProjectFileMapper;
-
-@Repository
-public class ProjectFileDao {
-
-	@Autowired
-	private ProjectFileMapper projectFileMapper;
-
-	public int findAllInformation(Map<String, Object> map) {
-		return projectFileMapper.findAllInformation(map);
-	}
-
-	public List<ProjectFile> queryProjectFileInformation(Map<String, Object> mapToDao) {
-
-		return projectFileMapper.queryProjectFileInformation(mapToDao);
-	}
-
-	public List<ProjectFile> checkoutProjectFiles(Map<String, Object> mapToDao) {
-		return projectFileMapper.checkoutProjectFiles(mapToDao);
-	}
-
-	public void insertInformationIntoTable(Map<String, Object> mapToDao) {
-		projectFileMapper.insertInformationIntoTable(mapToDao);
-	}
-
-	public void insertOperationHistoryInformationToDao(Map<String, Object> map) {
-		projectFileMapper.insertOperationHistoryInformationToDao(map);
-	}
-
-	public void insertInformationToAttachment(Map<String, Object> map) {
-		projectFileMapper.insertInformationToAttachment(map);
-	}
-
-}

+ 0 - 35
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/PromptLetterDao.java

@@ -1,35 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.PromptLetter;
-import com.fuzamei.mapperInterface.PromptLetterMapper;
-
-@Repository
-public class PromptLetterDao {
-	@Autowired
-	private PromptLetterMapper  promptLetterMapper;
-	public List<PromptLetter> queryPromptLetterByAdmin(Map<String, Object> map){//查询风险提示函  管理人接收人
-		return promptLetterMapper.queryPromptLetterByAdmin(map);
-	}
-	public void insertIntoPromptLetterTable(Map<String, Object> map) {//数据往提示函插入
-		promptLetterMapper.insertIntoPromptLetterTable(map);
-	}
-	public void insertIntoAttachmentTable(Map<String, Object> map) {//提示函 在往附件表也插入数据
-		promptLetterMapper.insertIntoAttachmentTable(map);
-	}
-	public void insertOperationHistory(Map<String, Object> map) {//也插入一条数据到操作记录表   
-		promptLetterMapper.insertOperationHistory(map);
-	}
-	public int findAllInformation(Map<String, Object> map) {
-		return promptLetterMapper.findAllInformation(map);
-	}
-	public List<PromptLetter> queryPromptLetterByVenture(Map<String, Object> map) {
-		return promptLetterMapper.queryPromptLetterByVenture(map);
-	}
-	
-}

+ 0 - 19
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/TrueFalseSelectDao.java

@@ -1,19 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.mapperInterface.TrueFalseSelectMapper;
-
-@Repository
-public class TrueFalseSelectDao {
-	@Autowired
-	private TrueFalseSelectMapper trueFalseSelectMapper;
-	
-	public void insertOperationHistory(Map<String, Object> map) {// 真为查询 插入到操作记录表    
-		trueFalseSelectMapper.insertOperationHistory(map);
-	}
-	
-}

+ 0 - 26
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/UserAuthoricationDao.java

@@ -1,26 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.UserDetail;
-import com.fuzamei.mapperInterface.UserAuthoricationMapper;
-
-/**
- * 
- * @author ylx
- * @describe 用于查询用户的信息的dao层类
- */
-@Repository
-public class UserAuthoricationDao {
-	
-	@Autowired
-	private UserAuthoricationMapper userAuthoricationMapper;
-	
-	//根据id号查询用户全部的信息
-	public UserDetail queryUserDetailInformation(int userId) {
-		return userAuthoricationMapper.queryUserDetailInformation(userId);
-	}
-}

+ 0 - 128
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/UserDao.java

@@ -1,128 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.AccountInfo;
-import com.fuzamei.entity.Role;
-import com.fuzamei.entity.Token;
-import com.fuzamei.entity.User;
-import com.fuzamei.mapperInterface.AccountInfoInterface;
-import com.fuzamei.mapperInterface.RoleInterface;
-import com.fuzamei.mapperInterface.TokenInterface;
-import com.fuzamei.mapperInterface.UserAccountInterface;
-import com.fuzamei.mapperInterface.UserInterface;
-import com.fuzamei.utils.PageDTO;
-
-@Repository(value = "userDao")
-public class UserDao {
-	@Autowired
-	private UserInterface userMapper;
-	@Autowired
-	private AccountInfoInterface accountInfoInterface;
-	@Autowired
-	private UserAccountInterface userAccountInterface;
-	@Autowired
-	private RoleInterface roleInterface;
-	@Autowired
-	private TokenInterface tokenInterface;
-	public List<User> getUserCount(User user) {
-		// TODO 获取该用户的count
-		return userMapper.getUserCount(user);
-	}
-	public int insertUsers(List<User> listUsers) {
-		// TODO Auto-generated method stub
-		return userMapper.insertUsers(listUsers);
-	}
-	public int addUserToUser(User user) {
-		// TODO Auto-generated method stub
-		return userMapper.addUserToUser(user);
-	}
-	public int addUserToUserRole(User user) {
-		// TODO Auto-generated method stub
-		return userMapper.addUserToUserRole(user);
-	}
-	public int updateUserById(User user) {
-		// TODO Auto-generated method stub
-		return userMapper.updateUserById(user);
-	}
-	public int updataRoleById(User user) {
-		// TODO Auto-generated method stub
-		return userMapper.updataRoleById(user);
-	}
-	public PageDTO getUsers(User user,int page,int rows) {
-		// TODO Auto-generated method stub
-		PageDTO pageDTO = new PageDTO();
-		int count = 0;
-		List<User> users = new ArrayList<User>();
-		int startNum = (page-1)*rows;
-		Map<String,Object> mapParam = new HashMap<String,Object>();
-		mapParam.put("role_name", user.getRole_name());
-		mapParam.put("account", user.getAccount());
-		mapParam.put("person_name", user.getPerson_name());
-		mapParam.put("startNum", startNum);
-		mapParam.put("endNum", rows);
-//		return userMapper.getUsers(user);
-		try{
-			users =  userMapper.getUsersByPage(mapParam);
-			count = userMapper.getUsers(mapParam);
-		}catch (Exception e) {
-			// TODO: handle exception
-			e.printStackTrace();
-		}
-		pageDTO.setTotal(count);
-		pageDTO.setRows(users);
-		return pageDTO;
-	}
-	public User findUserById(User user) {
-		// TODO Auto-generated method stub
-		return userMapper.findUserById(user);
-	}
-	public List<AccountInfo> getAllAccount() {
-		// TODO Auto-generated method stub
-		return accountInfoInterface.getAllAccount();
-	}
-	public int insertAccountInfo(List<Map<String, Object>> accountList) {
-		// TODO Auto-generated method stub
-		return accountInfoInterface.insertAccountInfo(accountList);
-	}
-	public int insertUserAccount(List<Map<String, Object>> accountList) {
-		// TODO Auto-generated method stub
-		return userAccountInterface.insertUserAccount(accountList);
-	}
-	public List<Role> getAllRoles() {
-		// TODO Auto-generated method stub
-		return roleInterface.getAllRoles();
-	}
-	public User findUserById(String userId) {
-		// TODO Auto-generated method stub
-		return userMapper.findUserById1(userId);
-	}
-	public Token getTokenById(Token token) {
-		// TODO Auto-generated method stub
-		return tokenInterface.getTokenById(token);
-	}
-	public int insertToken(Token token) {
-		// TODO Auto-generated method stub
-		return tokenInterface.insertToken(token);
-	}
-	public int updateToken(Token token) {
-		// TODO Auto-generated method stub
-		return tokenInterface.updateToken(token);
-	}
-	public List<AccountInfo> getAccountInfoByUser(String userId) {
-		// TODO Auto-generated method stub
-		return accountInfoInterface.getAccountInfoByUser(userId);
-	}
-	public int updateBatchAccountById(Map<String, Map<String, Object>> parameter, List<String> cloumn) {
-		// TODO Auto-generated method stub
-		return accountInfoInterface.updateBatchAccountById(parameter, cloumn);
-	}
-	
-
-}

+ 0 - 70
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/ValuationAccountingDao.java

@@ -1,70 +0,0 @@
-package com.fuzamei.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Repository;
-
-import com.fuzamei.entity.ValuationAccount;
-import com.fuzamei.mapperInterface.ValuationAccountingMapper;
-
-@Repository
-public class ValuationAccountingDao {
-	
-	@Autowired
-	private ValuationAccountingMapper valuationAccountingMapper;
-
-	public int findAllInformations(Map<String, Object> map) {
-		return valuationAccountingMapper.findAllInformations(map);
-	}
-
-	public List<ValuationAccount> queryValuationAccountingInformation(Map<String, Object> map) {
-		return valuationAccountingMapper.queryValuationAccountingInformation(map);
-	}
-
-	public void insertInformationIntoTableByAdmin(Map<String, Object> map) {
-		valuationAccountingMapper.insertInformationIntoTableByAdmin(map);
-	}
-
-	public void updateInformationByBank(Map<String, Object> map) {
-		valuationAccountingMapper.updateInformationByBank(map);
-	}
-
-	public void insertOperationHistoryInformationToDao(Map<String, Object> map) {
-		valuationAccountingMapper.insertOperationHistoryInformationToDao(map);
-	}
-
-	public void insertInformationToAttachment(Map<String, Object> map) {
-		valuationAccountingMapper.insertInformationToAttachment(map);
-	}
-
-	public List<ValuationAccount> checkoutDownloadInformation(int fundId) {
-		return valuationAccountingMapper.checkoutDownloadInformation(fundId);
-	}
-
-	public int queryIfHasTheSameFundId(Integer fundId) {
-		return valuationAccountingMapper.queryIfHasTheSameFundId(fundId);
-	}
-
-	public ValuationAccount checkIfFundExists(Integer fundId, String fundName) {
-		return valuationAccountingMapper.checkIfFundExists(fundId,fundName);
-	}
-
-	public void updateInformationByAdmin(Map<String, Object> map) {
-		valuationAccountingMapper.updateInformationByAdmin(map);
-	}
-
-	public void updateAttachmentInformationByAdmin(Map<String, Object> map) {
-		valuationAccountingMapper.updateAttachmentInformationByAdmin(map);
-	}
-
-	public void updateAttachmentInformationByBank(Map<String, Object> map) {
-		valuationAccountingMapper.updateAttachmentInformationByBank(map);
-	}
-
-	public int queryIfHasTheSameFundName(String fundName) {
-		return valuationAccountingMapper.queryIfHasTheSameFundName(fundName);
-	}
-
-}

+ 0 - 147
ccb_fund_trusteeship/src/main/java/com/fuzamei/dao/test.java

@@ -1,147 +0,0 @@
-package com.fuzamei.dao;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-public class test {
-/*public static void main(String[] args) {
-	System.out.println(Math.round(Math.random()*8999+1000));
-}*/
-
-public static void main(String[] args) throws MalformedURLException  {
-	/*SimpleDateFormat sdf=new SimpleDateFormat("MMddHHmmss");
-	String str=sdf.format(new Date()).substring(6)+Math.round(Math.random()*8999+1000);
-	System.out.println(str);
-	System.out.println("201712"+Math.round(Math.random()*8999+100));*/
-   /* String number= new String("0000");
-	String length=String.valueOf(businessOrder.getId());
-	String before=number.substring(length.length());
-	String rear=before+businessOrder.getId();
-	String orderNo=dateFormat.format(now)+rear;*/
-	/*  SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
-		    String ss=  df.format(new Date());
-	System.out.println(ss+"哈jhvbebhvbhvhvb");
-	System.out.println( System.currentTimeMillis()+"eeeeee");*/
-
-	/*  String photoUrl = "https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png";                                      
-	  String fileName = photoUrl.substring(photoUrl.lastIndexOf("/"));   
-      //System.out.println("fileName---->"+fileName);  
-      String filePath = "D:\\picture";    
-      File file = saveUrlAs(photoUrl, filePath + fileName,"GET");    
-      System.out.println("zzz" + file);*/  
-      //System.out.println(Math.round(Math.random()*8999+100));
-/*	SimpleDateFormat sdf=new SimpleDateFormat("MMddHHmmss");
-	String str=sdf.format(new Date()).substring(6)+Math.round(Math.random()*8999+100);
-	System.out.println(str+"随机数是");
-	 SimpleDateFormat df = new SimpleDateFormat("yyyyMMHHmmss");
-	    String ss=  df.format(new Date());
-	    System.out.println(ss+"shijian ");*/
-	  double n = 12303333.555;
-	  boolean flag = judge(n);
-	  System.out.println(flag);
-	  
-	  String str = "22";
-	  System.out.println(judge(str));
-	
-	    
-    }   
-//校验前端传来的是double还是字符  类型
-private static boolean judge(Object obj){
-	if (obj instanceof Integer) {
-		return true;
-	} else if(obj instanceof Double ){
-		return true;
-	}else if(obj instanceof String){
-		try{
-		Double.valueOf(obj.toString().trim());
-		return true;
-		}catch(Exception e){
-		  return false;
-		}
-		} 
-	else {
-		return false;
-	}
-  }
-}
-	//////////////////////////////////////////////////////////////////////////////////////////////////////////
-  /*public static File saveUrlAs(String url,String filePath,String method){  
-    //System.out.println("fileName---->"+filePath);  
-    //创建不同的文件夹目录  
-    File file=new File(filePath);  
-    //判断文件夹是否存在  
-    if (!file.exists())  
-   {  
-       //如果文件夹不存在,则创建新的的文件夹  
-        file.mkdirs();  
-   }  
-    FileOutputStream fileOut = null;  
-    HttpURLConnection conn = null;  
-    InputStream inputStream = null;  
-    try  
-   {  
-        // 建立链接  
-        URL httpUrl=new URL(url);  
-        conn=(HttpURLConnection) httpUrl.openConnection();  
-        //以Post方式提交表单,默认get方式  
-        conn.setRequestMethod(method);  
-        conn.setDoInput(true);    
-        conn.setDoOutput(true);  
-        // post方式不能使用缓存   
-        conn.setUseCaches(false);  
-        //连接指定的资源   
-        conn.connect();  
-        //获取网络输入流  
-        inputStream=conn.getInputStream();  
-        BufferedInputStream bis = new BufferedInputStream(inputStream);  
-        //判断文件的保存路径后面是否以/结尾  
-        if (!filePath.endsWith("/")) {  
-            filePath += "/";  
-            }  
-        //写入到文件(注意文件保存路径的后面一定要加上文件的名称)  
-        fileOut = new FileOutputStream(filePath+"123.png");  
-        BufferedOutputStream bos = new BufferedOutputStream(fileOut);  
-          
-        byte[] buf = new byte[4096];  
-        int length = bis.read(buf);  
-        //保存文件  
-        while(length != -1)  
-        {  
-            bos.write(buf, 0, length);  
-            length = bis.read(buf);  
-        }  
-        bos.close();  
-        bis.close();  
-        conn.disconnect();  
-   } catch (Exception e)  
-   {  
-        e.printStackTrace();  
-        System.out.println("抛出异常!!");  
-   }  
-      
-    return file;  
-      
-}  //检验long
-public static boolean isValidLong(String str){
-	   try{
-	       long _v = Long.parseLong(str);
-	       return true;
-	   }catch(NumberFormatException e){
-	     return false;
-	   }
-	}
-*/
-
-
-
-

+ 0 - 479
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAEngine.java

@@ -1,479 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-import java.io.ByteArrayOutputStream;
-
-import java.nio.ByteBuffer;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidKeyException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.Arrays;
-
-import com.fuzamei.eddsa.math.Curve;
-import com.fuzamei.eddsa.math.GroupElement;
-import com.fuzamei.eddsa.math.ScalarOps;
-
-/**
- * Signing and verification for EdDSA.
- *<p>
- * The EdDSA sign and verify algorithms do not interact well with
- * the Java Signature API, as one or more update() methods must be
- * called before sign() or verify(). Using the standard API,
- * this implementation must copy and buffer all data passed in
- * via update().
- *</p><p>
- * This implementation offers two ways to avoid this copying,
- * but only if all data to be signed or verified is available
- * in a single byte array.
- *</p><p>
- *Option 1:
- *</p><ol>
- *<li>Call initSign() or initVerify() as usual.
- *</li><li>Call setParameter(ONE_SHOT_MODE)
- *</li><li>Call update(byte[]) or update(byte[], int, int) exactly once
- *</li><li>Call sign() or verify() as usual.
- *</li><li>If doing additional one-shot signs or verifies with this object, you must
- *         call setParameter(ONE_SHOT_MODE) each time
- *</li></ol>
- *
- *<p>
- *Option 2:
- *</p><ol>
- *<li>Call initSign() or initVerify() as usual.
- *</li><li>Call one of the signOneShot() or verifyOneShot() methods.
- *</li><li>If doing additional one-shot signs or verifies with this object,
- *         just call signOneShot() or verifyOneShot() again.
- *</li></ol>
- *
- * @author str4d
- *
- */
-public final class EdDSAEngine extends Signature {
-    public static final String SIGNATURE_ALGORITHM = "NONEwithEdDSA";
-
-    private MessageDigest digest;
-    private ByteArrayOutputStream baos;
-    private EdDSAKey key;
-    private boolean oneShotMode;
-    private byte[] oneShotBytes;
-    private int oneShotOffset;
-    private int oneShotLength;
-
-    /**
-     *  To efficiently sign or verify data in one shot, pass this to setParameters()
-     *  after initSign() or initVerify() but BEFORE THE FIRST AND ONLY
-     *  update(data) or update(data, off, len). The data reference will be saved
-     *  and then used in sign() or verify() without copying the data.
-     *  Violate these rules and you will get a SignatureException.
-     */
-    public static final AlgorithmParameterSpec ONE_SHOT_MODE = new OneShotSpec();
-
-    private static class OneShotSpec implements AlgorithmParameterSpec {}
-
-    /**
-     * No specific EdDSA-internal hash requested, allows any EdDSA key.
-     */
-    public EdDSAEngine() {
-        super(SIGNATURE_ALGORITHM);
-    }
-
-    /**
-     * Specific EdDSA-internal hash requested, only matching keys will be allowed.
-     * @param digest the hash algorithm that keys must have to sign or verify.
-     */
-    public EdDSAEngine(MessageDigest digest) {
-        this();
-        this.digest = digest;
-    }
-
-    private void reset() {
-        if (digest != null)
-            digest.reset();
-        if (baos != null)
-            baos.reset();
-        oneShotMode = false;
-        oneShotBytes = null;
-    }
-
-    @Override
-    protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException {
-        reset();
-        if (privateKey instanceof EdDSAPrivateKey) {
-            EdDSAPrivateKey privKey = (EdDSAPrivateKey) privateKey;
-            key = privKey;
-
-            if (digest == null) {
-                // Instantiate the digest from the key parameters
-                try {
-                    digest = MessageDigest.getInstance(key.getParams().getHashAlgorithm());
-                } catch (NoSuchAlgorithmException e) {
-                    throw new InvalidKeyException("cannot get required digest " + key.getParams().getHashAlgorithm() + " for private key.");
-                }
-            } else if (!key.getParams().getHashAlgorithm().equals(digest.getAlgorithm()))
-                throw new InvalidKeyException("Key hash algorithm does not match chosen digest");
-            digestInitSign(privKey);
-        } else {
-            throw new InvalidKeyException("cannot identify EdDSA private key: " + privateKey.getClass());
-        }
-    }
-
-    private void digestInitSign(EdDSAPrivateKey privKey) {
-        // Preparing for hash
-        // r = H(h_b,...,h_2b-1,M)
-        int b = privKey.getParams().getCurve().getField().getb();
-        digest.update(privKey.getH(), b/8, b/4 - b/8);
-    }
-
-    @Override
-    protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException {
-        reset();
-        if (publicKey instanceof EdDSAPublicKey) {
-            key = (EdDSAPublicKey) publicKey;
-
-            if (digest == null) {
-                // Instantiate the digest from the key parameters
-                try {
-                    digest = MessageDigest.getInstance(key.getParams().getHashAlgorithm());
-                } catch (NoSuchAlgorithmException e) {
-                    throw new InvalidKeyException("cannot get required digest " + key.getParams().getHashAlgorithm() + " for private key.");
-                }
-            } else if (!key.getParams().getHashAlgorithm().equals(digest.getAlgorithm()))
-                throw new InvalidKeyException("Key hash algorithm does not match chosen digest");
-        } else {
-            throw new InvalidKeyException("cannot identify EdDSA public key: " + publicKey.getClass());
-        }
-    }
-
-    /**
-     * @throws SignatureException if in one-shot mode
-     */
-    @Override
-    protected void engineUpdate(byte b) throws SignatureException {
-        if (oneShotMode)
-            throw new SignatureException("unsupported in one-shot mode");
-        if (baos == null)
-            baos = new ByteArrayOutputStream(256);
-        baos.write(b);
-    }
-
-    /**
-     * @throws SignatureException if one-shot rules are violated
-     */
-    @Override
-    protected void engineUpdate(byte[] b, int off, int len)
-            throws SignatureException {
-        if (oneShotMode) {
-            if (oneShotBytes != null)
-                throw new SignatureException("update() already called");
-            oneShotBytes = b;
-            oneShotOffset = off;
-            oneShotLength = len;
-        } else {
-            if (baos == null)
-                baos = new ByteArrayOutputStream(256);
-            baos.write(b, off, len);
-        }
-    }
-
-    @Override
-    protected byte[] engineSign() throws SignatureException {
-        try {
-            return x_engineSign();
-        } finally {
-            reset();
-            // must leave the object ready to sign again with
-            // the same key, as required by the API
-            EdDSAPrivateKey privKey = (EdDSAPrivateKey) key;
-            digestInitSign(privKey);
-        }
-    }
-
-    private byte[] x_engineSign() throws SignatureException {
-        Curve curve = key.getParams().getCurve();
-        ScalarOps sc = key.getParams().getScalarOps();
-        byte[] a = ((EdDSAPrivateKey) key).geta();
-
-        byte[] message;
-        int offset, length;
-        if (oneShotMode) {
-            if (oneShotBytes == null)
-                throw new SignatureException("update() not called first");
-            message = oneShotBytes;
-            offset = oneShotOffset;
-            length = oneShotLength;
-        } else {
-            if (baos == null)
-                message = new byte[0];
-            else
-                message = baos.toByteArray();
-            offset = 0;
-            length = message.length;
-        }
-        // r = H(h_b,...,h_2b-1,M)
-        digest.update(message, offset, length);
-        byte[] r = digest.digest();
-
-        // r mod l
-        // Reduces r from 64 bytes to 32 bytes
-        r = sc.reduce(r);
-
-        // R = rB
-        GroupElement R = key.getParams().getB().scalarMultiply(r);
-        byte[] Rbyte = R.toByteArray();
-
-        // S = (r + H(Rbar,Abar,M)*a) mod l
-        digest.update(Rbyte);
-        digest.update(((EdDSAPrivateKey) key).getAbyte());
-        digest.update(message, offset, length);
-        byte[] h = digest.digest();
-        h = sc.reduce(h);
-        byte[] S = sc.multiplyAndAdd(h, a, r);
-
-        // R+S
-        int b = curve.getField().getb();
-        ByteBuffer out = ByteBuffer.allocate(b/4);
-        out.put(Rbyte).put(S);
-        return out.array();
-    }
-
-    @Override
-    protected boolean engineVerify(byte[] sigBytes) throws SignatureException {
-        try {
-            return x_engineVerify(sigBytes);
-        } finally {
-            reset();
-        }
-    }
-
-    private boolean x_engineVerify(byte[] sigBytes) throws SignatureException {
-        Curve curve = key.getParams().getCurve();
-        int b = curve.getField().getb();
-        if (sigBytes.length != b/4)
-            throw new SignatureException("signature length is wrong");
-
-        // R is first b/8 bytes of sigBytes, S is second b/8 bytes
-        digest.update(sigBytes, 0, b/8);
-        digest.update(((EdDSAPublicKey) key).getAbyte());
-        // h = H(Rbar,Abar,M)
-        byte[] message;
-        int offset, length;
-        if (oneShotMode) {
-            if (oneShotBytes == null)
-                throw new SignatureException("update() not called first");
-            message = oneShotBytes;
-            offset = oneShotOffset;
-            length = oneShotLength;
-        } else {
-            if (baos == null)
-                message = new byte[0];
-            else
-                message = baos.toByteArray();
-            offset = 0;
-            length = message.length;
-        }
-        digest.update(message, offset, length);
-        byte[] h = digest.digest();
-
-        // h mod l
-        h = key.getParams().getScalarOps().reduce(h);
-
-        byte[] Sbyte = Arrays.copyOfRange(sigBytes, b/8, b/4);
-        // R = SB - H(Rbar,Abar,M)A
-        GroupElement R = key.getParams().getB().doubleScalarMultiplyVariableTime(
-                ((EdDSAPublicKey) key).getNegativeA(), h, Sbyte);
-
-        // Variable time. This should be okay, because there are no secret
-        // values used anywhere in verification.
-        byte[] Rcalc = R.toByteArray();
-        for (int i = 0; i < Rcalc.length; i++) {
-            if (Rcalc[i] != sigBytes[i])
-                return false;
-        }
-        return true;
-    }
-
-    /**
-     *  To efficiently sign all the data in one shot, if it is available,
-     *  use this method, which will avoid copying the data.
-     *
-     * Same as:
-     *<pre>
-     *  setParameter(ONE_SHOT_MODE)
-     *  update(data)
-     *  sig = sign()
-     *</pre>
-     *
-     * @param data the message to be signed
-     * @return the signature
-     * @throws SignatureException if update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    public byte[] signOneShot(byte[] data) throws SignatureException {
-        return signOneShot(data, 0, data.length);
-    }
-
-    /**
-     *  To efficiently sign all the data in one shot, if it is available,
-     *  use this method, which will avoid copying the data.
-     *
-     * Same as:
-     *<pre>
-     *  setParameter(ONE_SHOT_MODE)
-     *  update(data, off, len)
-     *  sig = sign()
-     *</pre>
-     *
-     * @param data byte array containing the message to be signed
-     * @param off the start of the message inside data
-     * @param len the length of the message
-     * @return the signature
-     * @throws SignatureException if update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    public byte[] signOneShot(byte[] data, int off, int len) throws SignatureException {
-        oneShotMode = true;
-        update(data, off, len);
-        return sign();
-    }
-
-    /**
-     *  To efficiently verify all the data in one shot, if it is available,
-     *  use this method, which will avoid copying the data.
-     *
-     * Same as:
-     *<pre>
-     *  setParameter(ONE_SHOT_MODE)
-     *  update(data)
-     *  ok = verify(signature)
-     *</pre>
-     *
-     * @param data the message that was signed
-     * @param signature of the message
-     * @return true if the signature is valid, false otherwise
-     * @throws SignatureException if update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    public boolean verifyOneShot(byte[] data, byte[] signature) throws SignatureException {
-        return verifyOneShot(data, 0, data.length, signature, 0, signature.length);
-    }
-
-    /**
-     *  To efficiently verify all the data in one shot, if it is available,
-     *  use this method, which will avoid copying the data.
-     *
-     * Same as:
-     *<pre>
-     *  setParameter(ONE_SHOT_MODE)
-     *  update(data, off, len)
-     *  ok = verify(signature)
-     *</pre>
-     *
-     * @param data byte array containing the message that was signed
-     * @param off the start of the message inside data
-     * @param len the length of the message
-     * @param signature of the message
-     * @return true if the signature is valid, false otherwise
-     * @throws SignatureException if update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    public boolean verifyOneShot(byte[] data, int off, int len, byte[] signature) throws SignatureException {
-        return verifyOneShot(data, off, len, signature, 0, signature.length);
-    }
-
-    /**
-     *  To efficiently verify all the data in one shot, if it is available,
-     *  use this method, which will avoid copying the data.
-     *
-     * Same as:
-     *<pre>
-     *  setParameter(ONE_SHOT_MODE)
-     *  update(data)
-     *  ok = verify(signature, sigoff, siglen)
-     *</pre>
-     *
-     * @param data the message that was signed
-     * @param signature byte array containing the signature
-     * @param sigoff the start of the signature
-     * @param siglen the length of the signature
-     * @return true if the signature is valid, false otherwise
-     * @throws SignatureException if update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    public boolean verifyOneShot(byte[] data, byte[] signature, int sigoff, int siglen) throws SignatureException {
-        return verifyOneShot(data, 0, data.length, signature, sigoff, siglen);
-    }
-
-    /**
-     *  To efficiently verify all the data in one shot, if it is available,
-     *  use this method, which will avoid copying the data.
-     *
-     * Same as:
-     *<pre>
-     *  setParameter(ONE_SHOT_MODE)
-     *  update(data, off, len)
-     *  ok = verify(signature, sigoff, siglen)
-     *</pre>
-     *
-     * @param data byte array containing the message that was signed
-     * @param off the start of the message inside data
-     * @param len the length of the message
-     * @param signature byte array containing the signature
-     * @param sigoff the start of the signature
-     * @param siglen the length of the signature
-     * @return true if the signature is valid, false otherwise
-     * @throws SignatureException if update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    public boolean verifyOneShot(byte[] data, int off, int len, byte[] signature, int sigoff, int siglen) throws SignatureException {
-        oneShotMode = true;
-        update(data, off, len);
-        return verify(signature, sigoff, siglen);
-    }
-
-    /**
-     * @throws InvalidAlgorithmParameterException if spec is ONE_SHOT_MODE and update() already called
-     * @see #ONE_SHOT_MODE
-     */
-    @Override
-    protected void engineSetParameter(AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException {
-        if (spec.equals(ONE_SHOT_MODE)) {
-            if (oneShotBytes != null || (baos != null && baos.size() > 0))
-                throw new InvalidAlgorithmParameterException("update() already called");
-            oneShotMode = true;
-        } else {
-            super.engineSetParameter(spec);
-        }
-    }
-
-    /**
-     * @deprecated
-     */
-    @Override
-    protected void engineSetParameter(String param, Object value) {
-        throw new UnsupportedOperationException("engineSetParameter unsupported");
-    }
-
-    /**
-     * @deprecated
-     */
-    @Override
-    protected Object engineGetParameter(String param) {
-        throw new UnsupportedOperationException("engineSetParameter unsupported");
-    }
-}

+ 0 - 32
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAKey.java

@@ -1,32 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-import com.fuzamei.eddsa.spec.EdDSAParameterSpec;
-
-
-/**
- * Common interface for all EdDSA keys.
- * @author str4d
- */
-public interface EdDSAKey {
-    /**
-     * The reported key algorithm for all EdDSA keys
-     */
-    String KEY_ALGORITHM = "EdDSA";
-
-    /**
-     * @return a parameter specification representing the EdDSA domain
-     *         parameters for the key.
-     */
-    EdDSAParameterSpec getParams();
-}

+ 0 - 339
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAPrivateKey.java

@@ -1,339 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-
-import java.security.PrivateKey;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.util.Arrays;
-
-import com.fuzamei.eddsa.math.GroupElement;
-import com.fuzamei.eddsa.spec.EdDSANamedCurveTable;
-import com.fuzamei.eddsa.spec.EdDSAParameterSpec;
-import com.fuzamei.eddsa.spec.EdDSAPrivateKeySpec;
-
-/**
- * An EdDSA private key.
- *<p>
- * Warning: Private key encoding is based on the current curdle WG draft,
- * and is subject to change. See getEncoded().
- *</p><p>
- * For compatibility with older releases, decoding supports both the old and new
- * draft specifications. See decode().
- *</p><p>
- * Ref: https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
- *</p><p>
- * Old Ref: https://tools.ietf.org/html/draft-josefsson-pkix-eddsa-04
- *</p>
- * @author str4d
- *
- */
-public class EdDSAPrivateKey implements EdDSAKey, PrivateKey {
-    private static final long serialVersionUID = 23495873459878957L;
-    private final byte[] seed;
-    private final byte[] h;
-    private final byte[] a;
-    private final GroupElement A;
-    private final byte[] Abyte;
-    private final EdDSAParameterSpec edDsaSpec;
-
-    // OID 1.3.101.xxx
-    private static final int OID_OLD = 100;
-    private static final int OID_ED25519 = 112;
-    private static final int OID_BYTE = 11;
-    private static final int IDLEN_BYTE = 6;
-
-    public EdDSAPrivateKey(EdDSAPrivateKeySpec spec) {
-        this.seed = spec.getSeed();
-        this.h = spec.getH();
-        this.a = spec.geta();
-        this.A = spec.getA();
-        this.Abyte = this.A.toByteArray();
-        this.edDsaSpec = spec.getParams();
-    }
-
-    public EdDSAPrivateKey(PKCS8EncodedKeySpec spec) throws InvalidKeySpecException {
-        this(new EdDSAPrivateKeySpec(decode(spec.getEncoded()),
-                                     EdDSANamedCurveTable.getByName("Ed25519")));
-    }
-
-    @Override
-    public String getAlgorithm() {
-        return KEY_ALGORITHM;
-    }
-
-    @Override
-    public String getFormat() {
-        return "PKCS#8";
-    }
-
-    /**
-     * Returns the public key in its canonical encoding.
-     *<p>
-     * This implements the following specs:
-     *<ul><li>
-     * General encoding: https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
-     *</li></li>
-     * Key encoding: https://tools.ietf.org/html/rfc8032
-     *</li></ul>
-     *</p><p>
-     * This encodes the seed. It will return null if constructed from
-     * a spec which was directly constructed from H, in which case seed is null.
-     *</p><p>
-     * For keys in older formats, decoding and then re-encoding is sufficient to
-     * migrate them to the canonical encoding.
-     *</p>
-     * Relevant spec quotes:
-     *<pre>
-     *  OneAsymmetricKey ::= SEQUENCE {
-     *    version Version,
-     *    privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
-     *    privateKey PrivateKey,
-     *    attributes [0] Attributes OPTIONAL,
-     *    ...,
-     *    [[2: publicKey [1] PublicKey OPTIONAL ]],
-     *    ...
-     *  }
-     *
-     *  Version ::= INTEGER
-     *  PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
-     *  PrivateKey ::= OCTET STRING
-     *  PublicKey ::= OCTET STRING
-     *  Attributes ::= SET OF Attribute
-     *</pre>
-     *
-     *<pre>
-     *  ... when encoding a OneAsymmetricKey object, the private key is wrapped
-     *  in a CurvePrivateKey object and wrapped by the OCTET STRING of the
-     *  'privateKey' field.
-     *
-     *  CurvePrivateKey ::= OCTET STRING
-     *</pre>
-     *
-     *<pre>
-     *  AlgorithmIdentifier  ::=  SEQUENCE  {
-     *    algorithm   OBJECT IDENTIFIER,
-     *    parameters  ANY DEFINED BY algorithm OPTIONAL
-     *  }
-     *
-     *  For all of the OIDs, the parameters MUST be absent.
-     *</pre>
-     *
-     *<pre>
-     *  id-Ed25519   OBJECT IDENTIFIER ::= { 1 3 101 112 }
-     *</pre>
-     *
-     * @return 48 bytes for Ed25519, null for other curves
-     */
-    @Override
-    public byte[] getEncoded() {
-        if (!edDsaSpec.equals(EdDSANamedCurveTable.getByName("Ed25519")))
-            return null;
-        if (seed == null)
-            return null;
-        int totlen = 16 + seed.length;
-        byte[] rv = new byte[totlen];
-        int idx = 0;
-        // sequence
-        rv[idx++] = 0x30;
-        rv[idx++] = (byte) (totlen - 2);
-        // version
-        rv[idx++] = 0x02;
-        rv[idx++] = 1;
-        // v1 - no public key included
-        rv[idx++] = 0;
-        // Algorithm Identifier
-        // sequence
-        rv[idx++] = 0x30;
-        rv[idx++] = 5;
-        // OID
-        // https://msdn.microsoft.com/en-us/library/windows/desktop/bb540809%28v=vs.85%29.aspx
-        rv[idx++] = 0x06;
-        rv[idx++] = 3;
-        rv[idx++] = (1 * 40) + 3;
-        rv[idx++] = 101;
-        rv[idx++] = (byte) OID_ED25519;
-        // params - absent
-        // PrivateKey
-        rv[idx++] = 0x04;  // octet string
-        rv[idx++] = (byte) (2 + seed.length);
-        // CurvePrivateKey
-        rv[idx++] = 0x04;  // octet string
-        rv[idx++] = (byte) seed.length;
-        // the key
-        System.arraycopy(seed, 0, rv, idx, seed.length);
-        return rv;
-    }
-
-    /**
-     * Extracts the private key bytes from the provided encoding.
-     *<p>
-     * This will decode data conforming to the current spec at
-     * https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
-     * or as inferred from the old spec at
-     * https://tools.ietf.org/html/draft-josefsson-pkix-eddsa-04.
-     *</p><p>
-     * Contrary to draft-ietf-curdle-pkix-04, it WILL accept a parameter value
-     * of NULL, as it is required for interoperability with the default Java
-     * keystore. Other implementations MUST NOT copy this behaviour from here
-     * unless they also need to read keys from the default Java keystore.
-     *</p><p>
-     * This is really dumb for now. It does not use a general-purpose ASN.1 decoder.
-     * See also getEncoded().
-     *
-     * @return 32 bytes for Ed25519, throws for other curves
-     */
-    public static byte[] decode(byte[] d) throws InvalidKeySpecException {
-        try {
-            //
-            // Setup and OID check
-            //
-            int totlen = 48;
-            int idlen = 5;
-            int doid = d[OID_BYTE];
-            if (doid == OID_OLD) {
-                totlen = 49;
-                idlen = 8;
-            } else if (doid == OID_ED25519) {
-                // Detect parameter value of NULL
-                if (d[IDLEN_BYTE] == 7) {
-                    totlen = 50;
-                    idlen = 7;
-                }
-            } else {
-                throw new InvalidKeySpecException("unsupported key spec");
-            }
-
-            //
-            // Pre-decoding check
-            //
-            if (d.length != totlen) {
-                throw new InvalidKeySpecException("invalid key spec length");
-            }
-
-            //
-            // Decoding
-            //
-            int idx = 0;
-            if (d[idx++] != 0x30 ||
-                d[idx++] != (totlen - 2) ||
-                d[idx++] != 0x02 ||
-                d[idx++] != 1 ||
-                d[idx++] != 0 ||
-                d[idx++] != 0x30 ||
-                d[idx++] != idlen ||
-                d[idx++] != 0x06 ||
-                d[idx++] != 3 ||
-                d[idx++] != (1 * 40) + 3 ||
-                d[idx++] != 101) {
-                throw new InvalidKeySpecException("unsupported key spec");
-            }
-            idx++; // OID, checked above
-            // parameters only with old OID
-            if (doid == OID_OLD) {
-                if (d[idx++] != 0x0a ||
-                    d[idx++] != 1 ||
-                    d[idx++] != 1) {
-                    throw new InvalidKeySpecException("unsupported key spec");
-                }
-            } else {
-                // Handle parameter value of NULL
-                //
-                // Quote https://tools.ietf.org/html/draft-ietf-curdle-pkix-04 :
-                //   For all of the OIDs, the parameters MUST be absent.
-                //   Regardless of the defect in the original 1997 syntax,
-                //   implementations MUST NOT accept a parameters value of NULL.
-                //
-                // But Java's default keystore puts it in (when decoding as
-                // PKCS8 and then re-encoding to pass on), so we must accept it.
-                if (idlen == 7) {
-                    if (d[idx++] != 0x05 ||
-                        d[idx++] != 0) {
-                        throw new InvalidKeySpecException("unsupported key spec");
-                    }
-                }
-                // PrivateKey wrapping the CurvePrivateKey
-                if (d[idx++] != 0x04 ||
-                    d[idx++] != 34) {
-                    throw new InvalidKeySpecException("unsupported key spec");
-                }
-            }
-            if (d[idx++] != 0x04 ||
-                d[idx++] != 32) {
-                throw new InvalidKeySpecException("unsupported key spec");
-            }
-            byte[] rv = new byte[32];
-            System.arraycopy(d, idx, rv, 0, 32);
-            return rv;
-        } catch (IndexOutOfBoundsException ioobe) {
-            throw new InvalidKeySpecException(ioobe);
-        }
-    }
-
-    @Override
-    public EdDSAParameterSpec getParams() {
-        return edDsaSpec;
-    }
-
-    /**
-     *  @return will be null if constructed from a spec which was
-     *          directly constructed from H
-     */
-    public byte[] getSeed() {
-        return seed;
-    }
-
-    /**
-     *  @return the hash of the seed
-     */
-    public byte[] getH() {
-        return h;
-    }
-
-    /**
-     *  @return the private key
-     */
-    public byte[] geta() {
-        return a;
-    }
-
-    /**
-     *  @return the public key
-     */
-    public GroupElement getA() {
-        return A;
-    }
-
-    /**
-     *  @return the public key
-     */
-    public byte[] getAbyte() {
-        return Abyte;
-    }
-
-    @Override
-    public int hashCode() {
-        return Arrays.hashCode(seed);
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this)
-            return true;
-        if (!(o instanceof EdDSAPrivateKey))
-            return false;
-        EdDSAPrivateKey pk = (EdDSAPrivateKey) o;
-        return Arrays.equals(seed, pk.getSeed()) &&
-               edDsaSpec.equals(pk.getParams());
-    }
-}

+ 0 - 276
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSAPublicKey.java

@@ -1,276 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-import java.security.PublicKey;
-
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.Arrays;
-
-import com.fuzamei.eddsa.math.GroupElement;
-import com.fuzamei.eddsa.spec.EdDSANamedCurveTable;
-import com.fuzamei.eddsa.spec.EdDSAParameterSpec;
-import com.fuzamei.eddsa.spec.EdDSAPublicKeySpec;
-
-/**
- * An EdDSA public key.
- *<p>
- * Warning: Public key encoding is is based on the current curdle WG draft,
- * and is subject to change. See getEncoded().
- *</p><p>
- * For compatibility with older releases, decoding supports both the old and new
- * draft specifications. See decode().
- *</p><p>
- * Ref: https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
- *</p><p>
- * Old Ref: https://tools.ietf.org/html/draft-josefsson-pkix-eddsa-04
- *</p>
- * @author str4d
- *
- */
-public class EdDSAPublicKey implements EdDSAKey, PublicKey {
-    private static final long serialVersionUID = 9837459837498475L;
-    private final GroupElement A;
-    private final GroupElement Aneg;
-    private final byte[] Abyte;
-    private final EdDSAParameterSpec edDsaSpec;
-
-    // OID 1.3.101.xxx
-    private static final int OID_OLD = 100;
-    private static final int OID_ED25519 = 112;
-    private static final int OID_BYTE = 8;
-    private static final int IDLEN_BYTE = 3;
-
-    public EdDSAPublicKey(EdDSAPublicKeySpec spec) {
-        this.A = spec.getA();
-        this.Aneg = spec.getNegativeA();
-        this.Abyte = this.A.toByteArray();
-        this.edDsaSpec = spec.getParams();
-    }
-
-    public EdDSAPublicKey(X509EncodedKeySpec spec) throws InvalidKeySpecException {
-        this(new EdDSAPublicKeySpec(decode(spec.getEncoded()),
-                                    EdDSANamedCurveTable.getByName("Ed25519")));
-    }
-
-    @Override
-    public String getAlgorithm() {
-        return KEY_ALGORITHM;
-    }
-
-    @Override
-    public String getFormat() {
-        return "X.509";
-    }
-
-    /**
-     * Returns the public key in its canonical encoding.
-     *<p>
-     * This implements the following specs:
-     *<ul><li>
-     * General encoding: https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
-     *</li></li>
-     * Key encoding: https://tools.ietf.org/html/rfc8032
-     *</li></ul>
-     *</p><p>
-     * For keys in older formats, decoding and then re-encoding is sufficient to
-     * migrate them to the canonical encoding.
-     *</p>
-     * Relevant spec quotes:
-     *<pre>
-     *  In the X.509 certificate, the subjectPublicKeyInfo field has the
-     *  SubjectPublicKeyInfo type, which has the following ASN.1 syntax:
-     *
-     *  SubjectPublicKeyInfo  ::=  SEQUENCE  {
-     *    algorithm         AlgorithmIdentifier,
-     *    subjectPublicKey  BIT STRING
-     *  }
-     *</pre>
-     *
-     *<pre>
-     *  AlgorithmIdentifier  ::=  SEQUENCE  {
-     *    algorithm   OBJECT IDENTIFIER,
-     *    parameters  ANY DEFINED BY algorithm OPTIONAL
-     *  }
-     *
-     *  For all of the OIDs, the parameters MUST be absent.
-     *</pre>
-     *
-     *<pre>
-     *  id-Ed25519   OBJECT IDENTIFIER ::= { 1 3 101 112 }
-     *</pre>
-     *
-     * @return 44 bytes for Ed25519, null for other curves
-     */
-    @Override
-    public byte[] getEncoded() {
-        if (!edDsaSpec.equals(EdDSANamedCurveTable.getByName("Ed25519")))
-            return null;
-        int totlen = 12 + Abyte.length;
-        byte[] rv = new byte[totlen];
-        int idx = 0;
-        // sequence
-        rv[idx++] = 0x30;
-        rv[idx++] = (byte) (totlen - 2);
-        // Algorithm Identifier
-        // sequence
-        rv[idx++] = 0x30;
-        rv[idx++] = 5;
-        // OID
-        // https://msdn.microsoft.com/en-us/library/windows/desktop/bb540809%28v=vs.85%29.aspx
-        rv[idx++] = 0x06;
-        rv[idx++] = 3;
-        rv[idx++] = (1 * 40) + 3;
-        rv[idx++] = 101;
-        rv[idx++] = (byte) OID_ED25519;
-        // params - absent
-        // the key
-        rv[idx++] = 0x03; // bit string
-        rv[idx++] = (byte) (1 + Abyte.length);
-        rv[idx++] = 0; // number of trailing unused bits
-        System.arraycopy(Abyte, 0, rv, idx, Abyte.length);
-        return rv;
-    }
-
-    /**
-     * Extracts the public key bytes from the provided encoding.
-     *<p>
-     * This will decode data conforming to the current spec at
-     * https://tools.ietf.org/html/draft-ietf-curdle-pkix-04
-     * or the old spec at
-     * https://tools.ietf.org/html/draft-josefsson-pkix-eddsa-04.
-     *</p><p>
-     * Contrary to draft-ietf-curdle-pkix-04, it WILL accept a parameter value
-     * of NULL, as it is required for interoperability with the default Java
-     * keystore. Other implementations MUST NOT copy this behaviour from here
-     * unless they also need to read keys from the default Java keystore.
-     *</p><p>
-     * This is really dumb for now. It does not use a general-purpose ASN.1 decoder.
-     * See also getEncoded().
-     *</p>
-     *
-     * @return 32 bytes for Ed25519, throws for other curves
-     */
-    private static byte[] decode(byte[] d) throws InvalidKeySpecException {
-        try {
-            //
-            // Setup and OID check
-            //
-            int totlen = 44;
-            int idlen = 5;
-            int doid = d[OID_BYTE];
-            if (doid == OID_OLD) {
-                totlen = 47;
-                idlen = 8;
-            } else if (doid == OID_ED25519) {
-                // Detect parameter value of NULL
-                if (d[IDLEN_BYTE] == 7) {
-                    totlen = 46;
-                    idlen = 7;
-                }
-            } else {
-                throw new InvalidKeySpecException("unsupported key spec");
-            }
-
-            //
-            // Pre-decoding check
-            //
-            if (d.length != totlen) {
-                throw new InvalidKeySpecException("invalid key spec length");
-            }
-
-            //
-            // Decoding
-            //
-            int idx = 0;
-            if (d[idx++] != 0x30 ||
-                d[idx++] != (totlen - 2) ||
-                d[idx++] != 0x30 ||
-                d[idx++] != idlen ||
-                d[idx++] != 0x06 ||
-                d[idx++] != 3 ||
-                d[idx++] != (1 * 40) + 3 ||
-                d[idx++] != 101) {
-                throw new InvalidKeySpecException("unsupported key spec");
-            }
-            idx++; // OID, checked above
-            // parameters only with old OID
-            if (doid == OID_OLD) {
-                if (d[idx++] != 0x0a ||
-                    d[idx++] != 1 ||
-                    d[idx++] != 1) {
-                    throw new InvalidKeySpecException("unsupported key spec");
-                }
-            } else {
-                // Handle parameter value of NULL
-                //
-                // Quote https://tools.ietf.org/html/draft-ietf-curdle-pkix-04 :
-                //   For all of the OIDs, the parameters MUST be absent.
-                //   Regardless of the defect in the original 1997 syntax,
-                //   implementations MUST NOT accept a parameters value of NULL.
-                //
-                // But Java's default keystore puts it in (when decoding as
-                // PKCS8 and then re-encoding to pass on), so we must accept it.
-                if (idlen == 7) {
-                    if (d[idx++] != 0x05 ||
-                        d[idx++] != 0) {
-                        throw new InvalidKeySpecException("unsupported key spec");
-                    }
-                }
-            }
-            if (d[idx++] != 0x03 ||
-                d[idx++] != 33 ||
-                d[idx++] != 0) {
-                throw new InvalidKeySpecException("unsupported key spec");
-            }
-            byte[] rv = new byte[32];
-            System.arraycopy(d, idx, rv, 0, 32);
-            return rv;
-        } catch (IndexOutOfBoundsException ioobe) {
-            throw new InvalidKeySpecException(ioobe);
-        }
-    }
-
-    @Override
-    public EdDSAParameterSpec getParams() {
-        return edDsaSpec;
-    }
-
-    public GroupElement getA() {
-        return A;
-    }
-
-    public GroupElement getNegativeA() {
-        return Aneg;
-    }
-
-    public byte[] getAbyte() {
-        return Abyte;
-    }
-
-    @Override
-    public int hashCode() {
-        return Arrays.hashCode(Abyte);
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this)
-            return true;
-        if (!(o instanceof EdDSAPublicKey))
-            return false;
-        EdDSAPublicKey pk = (EdDSAPublicKey) o;
-        return Arrays.equals(Abyte, pk.getAbyte()) &&
-               edDsaSpec.equals(pk.getParams());
-    }
-}

+ 0 - 59
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/EdDSASecurityProvider.java

@@ -1,59 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.Provider;
-import java.security.Security;
-
-/**
- * A security {@link Provider} that can be registered via {@link Security#addProvider(Provider)}
- *
- * @author str4d
- */
-public class EdDSASecurityProvider extends Provider {
-    private static final long serialVersionUID = 1210027906682292307L;
-    public static final String PROVIDER_NAME = "EdDSA";
-
-    public EdDSASecurityProvider() {
-        super(PROVIDER_NAME, 0.2 /* should match POM major.minor version */, "str4d " + PROVIDER_NAME + " security provider wrapper");
-
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-            @Override
-            public Object run() {
-                setup();
-                return null;
-            }
-        });
-    }
-
-    protected void setup() {
-        // See https://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/HowToImplAProvider.html
-        put("KeyFactory." + EdDSAKey.KEY_ALGORITHM, "net.i2p.crypto.eddsa.KeyFactory");
-        put("KeyPairGenerator." + EdDSAKey.KEY_ALGORITHM, "net.i2p.crypto.eddsa.KeyPairGenerator");
-        put("Signature." + EdDSAEngine.SIGNATURE_ALGORITHM, "net.i2p.crypto.eddsa.EdDSAEngine");
-
-        // OID Mappings
-        // See section "Mapping from OID to name".
-        // The Key* -> OID mappings correspond to the default algorithm in KeyPairGenerator.
-        //
-        // From draft-ieft-curdle-pkix-04:
-        //   id-Ed25519   OBJECT IDENTIFIER ::= { 1 3 101 112 }
-        put("Alg.Alias.KeyFactory.1.3.101.112", EdDSAKey.KEY_ALGORITHM);
-        put("Alg.Alias.KeyFactory.OID.1.3.101.112", EdDSAKey.KEY_ALGORITHM);
-        put("Alg.Alias.KeyPairGenerator.1.3.101.112", EdDSAKey.KEY_ALGORITHM);
-        put("Alg.Alias.KeyPairGenerator.OID.1.3.101.112", EdDSAKey.KEY_ALGORITHM);
-        put("Alg.Alias.Signature.1.3.101.112", EdDSAEngine.SIGNATURE_ALGORITHM);
-        put("Alg.Alias.Signature.OID.1.3.101.112", EdDSAEngine.SIGNATURE_ALGORITHM);
-    }
-}

+ 0 - 76
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/KeyFactory.java

@@ -1,76 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-import java.security.InvalidKeyException;
-
-import java.security.Key;
-import java.security.KeyFactorySpi;
-import java.security.PrivateKey;
-import java.security.PublicKey;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.KeySpec;
-import java.security.spec.PKCS8EncodedKeySpec;
-import java.security.spec.X509EncodedKeySpec;
-
-import com.fuzamei.eddsa.spec.EdDSAPrivateKeySpec;
-import com.fuzamei.eddsa.spec.EdDSAPublicKeySpec;
-
-/**
- * @author str4d
- *
- */
-public final class KeyFactory extends KeyFactorySpi {
-
-    protected PrivateKey engineGeneratePrivate(KeySpec keySpec)
-            throws InvalidKeySpecException {
-        if (keySpec instanceof EdDSAPrivateKeySpec) {
-            return new EdDSAPrivateKey((EdDSAPrivateKeySpec) keySpec);
-        }
-        if (keySpec instanceof PKCS8EncodedKeySpec) {
-            return new EdDSAPrivateKey((PKCS8EncodedKeySpec) keySpec);
-        }
-        throw new InvalidKeySpecException("key spec not recognised: " + keySpec.getClass());
-    }
-
-    protected PublicKey engineGeneratePublic(KeySpec keySpec)
-            throws InvalidKeySpecException {
-        if (keySpec instanceof EdDSAPublicKeySpec) {
-            return new EdDSAPublicKey((EdDSAPublicKeySpec) keySpec);
-        }
-        if (keySpec instanceof X509EncodedKeySpec) {
-            return new EdDSAPublicKey((X509EncodedKeySpec) keySpec);
-        }
-        throw new InvalidKeySpecException("key spec not recognised: " + keySpec.getClass());
-    }
-
-    @SuppressWarnings("unchecked")
-    protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec)
-            throws InvalidKeySpecException {
-        if (keySpec.isAssignableFrom(EdDSAPublicKeySpec.class) && key instanceof EdDSAPublicKey) {
-            EdDSAPublicKey k = (EdDSAPublicKey) key;
-            if (k.getParams() != null) {
-                return (T) new EdDSAPublicKeySpec(k.getA(), k.getParams());
-            }
-        } else if (keySpec.isAssignableFrom(EdDSAPrivateKeySpec.class) && key instanceof EdDSAPrivateKey) {
-            EdDSAPrivateKey k = (EdDSAPrivateKey) key;
-            if (k.getParams() != null) {
-                return (T) new EdDSAPrivateKeySpec(k.getSeed(), k.getH(), k.geta(), k.getA(), k.getParams());
-            }
-        }
-        throw new InvalidKeySpecException("not implemented yet " + key + " " + keySpec);
-    }
-
-    protected Key engineTranslateKey(Key key) throws InvalidKeyException {
-        throw new InvalidKeyException("No other EdDSA key providers known");
-    }
-}

+ 0 - 100
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/KeyPairGenerator.java

@@ -1,100 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-import java.security.InvalidAlgorithmParameterException;
-import java.security.InvalidParameterException;
-import java.security.KeyPair;
-import java.security.KeyPairGeneratorSpi;
-import java.security.SecureRandom;
-import java.security.spec.AlgorithmParameterSpec;
-import java.util.Hashtable;
-
-import com.fuzamei.eddsa.spec.EdDSAGenParameterSpec;
-import com.fuzamei.eddsa.spec.EdDSANamedCurveSpec;
-import com.fuzamei.eddsa.spec.EdDSANamedCurveTable;
-import com.fuzamei.eddsa.spec.EdDSAParameterSpec;
-import com.fuzamei.eddsa.spec.EdDSAPrivateKeySpec;
-import com.fuzamei.eddsa.spec.EdDSAPublicKeySpec;
-
-
-
-
-/**
- *  Default keysize is 256 (Ed25519)
- */
-public final class KeyPairGenerator extends KeyPairGeneratorSpi {
-    private static final int DEFAULT_KEYSIZE = 256;
-    private EdDSAParameterSpec edParams;
-    private SecureRandom random;
-    private boolean initialized;
-
-    private static final Hashtable<Integer, AlgorithmParameterSpec> edParameters;
-
-    static {
-        edParameters = new Hashtable<Integer, AlgorithmParameterSpec>();
-
-        edParameters.put(Integer.valueOf(256), new EdDSAGenParameterSpec("Ed25519"));
-    }
-
-    public void initialize(int keysize, SecureRandom random) {
-        AlgorithmParameterSpec edParams = edParameters.get(Integer.valueOf(keysize));
-        if (edParams == null)
-            throw new InvalidParameterException("unknown key type.");
-        try {
-            initialize(edParams, random);
-        } catch (InvalidAlgorithmParameterException e) {
-            throw new InvalidParameterException("key type not configurable.");
-        }
-    }
-
-    @Override
-    public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException {
-        if (params instanceof EdDSAParameterSpec) {
-            edParams = (EdDSAParameterSpec) params;
-        } else if (params instanceof EdDSAGenParameterSpec) {
-            edParams = createNamedCurveSpec(((EdDSAGenParameterSpec) params).getName());
-        } else
-            throw new InvalidAlgorithmParameterException("parameter object not a EdDSAParameterSpec");
-
-        this.random = random;
-        initialized = true;
-    }
-
-    public KeyPair generateKeyPair() {
-        if (!initialized)
-            initialize(DEFAULT_KEYSIZE, new SecureRandom());
-
-        byte[] seed = new byte[edParams.getCurve().getField().getb()/8];
-        random.nextBytes(seed);
-
-        EdDSAPrivateKeySpec privKey = new EdDSAPrivateKeySpec(seed, edParams);
-        EdDSAPublicKeySpec pubKey = new EdDSAPublicKeySpec(privKey.getA(), edParams);
-
-        return new KeyPair(new EdDSAPublicKey(pubKey), new EdDSAPrivateKey(privKey));
-    }
-
-    /**
-     * Create an EdDSANamedCurveSpec from the provided curve name. The current
-     * implementation fetches the pre-created curve spec from a table.
-     * @param curveName the EdDSA named curve.
-     * @return the specification for the named curve.
-     * @throws InvalidAlgorithmParameterException if the named curve is unknown.
-     */
-    protected EdDSANamedCurveSpec createNamedCurveSpec(String curveName) throws InvalidAlgorithmParameterException {
-        EdDSANamedCurveSpec spec = EdDSANamedCurveTable.getByName(curveName);
-        if (spec == null) {
-            throw new InvalidAlgorithmParameterException("unknown curve name: " + curveName);
-        }
-        return spec;
-    }
-}

+ 0 - 103
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/Utils.java

@@ -1,103 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa;
-
-/**
- * Basic utilities for EdDSA.
- * Not for external use, not maintained as a public API.
- *
- * @author str4d
- *
- */
-public class Utils {
-    /**
-     * Constant-time byte comparison.
-     * @param b a byte
-     * @param c a byte
-     * @return 1 if b and c are equal, 0 otherwise.
-     */
-    public static int equal(int b, int c) {
-        int result = 0;
-        int xor = b ^ c;
-        for (int i = 0; i < 8; i++) {
-            result |= xor >> i;
-        }
-        return (result ^ 0x01) & 0x01;
-    }
-
-    /**
-     * Constant-time byte[] comparison.
-     * @param b a byte[]
-     * @param c a byte[]
-     * @return 1 if b and c are equal, 0 otherwise.
-     */
-    public static int equal(byte[] b, byte[] c) {
-        int result = 0;
-        for (int i = 0; i < 32; i++) {
-            result |= b[i] ^ c[i];
-        }
-
-        return equal(result, 0);
-    }
-
-    /**
-     * Constant-time determine if byte is negative.
-     * @param b the byte to check.
-     * @return 1 if the byte is negative, 0 otherwise.
-     */
-    public static int negative(int b) {
-        return (b >> 8) & 1;
-    }
-
-    /**
-     * Get the i'th bit of a byte array.
-     * @param h the byte array.
-     * @param i the bit index.
-     * @return 0 or 1, the value of the i'th bit in h
-     */
-    public static int bit(byte[] h, int i) {
-        return (h[i >> 3] >> (i & 7)) & 1;
-    }
-
-    /**
-     * Converts a hex string to bytes.
-     * @param s the hex string to be converted.
-     * @return the byte[]
-     */
-    public static byte[] hexToBytes(String s) {
-        int len = s.length();
-        byte[] data = new byte[len / 2];
-        for (int i = 0; i < len; i += 2) {
-            data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
-                    + Character.digit(s.charAt(i+1), 16));
-        }
-        return data;
-    }
-
-    /**
-     * Converts bytes to a hex string.
-     * @param raw the byte[] to be converted.
-     * @return the hex representation as a string.
-     */
-    public static String bytesToHex(byte[] raw) {
-        if ( raw == null ) {
-            return null;
-        }
-        final StringBuilder hex = new StringBuilder(2 * raw.length);
-        for (final byte b : raw) {
-            hex.append(Character.forDigit((b & 0xF0) >> 4, 16))
-            .append(Character.forDigit((b & 0x0F), 16));
-        }
-        return hex.toString();
-    }
-
-}

+ 0 - 23
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Constants.java

@@ -1,23 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-import com.fuzamei.eddsa.Utils;
-
-final class Constants {
-    public static final byte[] ZERO = Utils.hexToBytes("0000000000000000000000000000000000000000000000000000000000000000");
-    public static final byte[] ONE = Utils.hexToBytes("0100000000000000000000000000000000000000000000000000000000000000");
-    public static final byte[] TWO = Utils.hexToBytes("0200000000000000000000000000000000000000000000000000000000000000");
-    public static final byte[] FOUR = Utils.hexToBytes("0400000000000000000000000000000000000000000000000000000000000000");
-    public static final byte[] FIVE = Utils.hexToBytes("0500000000000000000000000000000000000000000000000000000000000000");
-    public static final byte[] EIGHT = Utils.hexToBytes("0800000000000000000000000000000000000000000000000000000000000000");
-}

+ 0 - 100
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Curve.java

@@ -1,100 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-import java.io.Serializable;
-
-/**
- * A twisted Edwards curve.
- * Points on the curve satisfy $-x^2 + y^2 = 1 + d x^2y^2$
- * @author str4d
- *
- */
-public class Curve implements Serializable {
-    private static final long serialVersionUID = 4578920872509827L;
-    private final Field f;
-    private final FieldElement d;
-    private final FieldElement d2;
-    private final FieldElement I;
-
-    private final GroupElement zeroP2;
-    private final GroupElement zeroP3;
-    private final GroupElement zeroPrecomp;
-
-    public Curve(Field f, byte[] d, FieldElement I) {
-        this.f = f;
-        this.d = f.fromByteArray(d);
-        this.d2 = this.d.add(this.d);
-        this.I = I;
-
-        FieldElement zero = f.ZERO;
-        FieldElement one = f.ONE;
-        zeroP2 = GroupElement.p2(this, zero, one, one);
-        zeroP3 = GroupElement.p3(this, zero, one, one, zero);
-        zeroPrecomp = GroupElement.precomp(this, one, one, zero);
-    }
-
-    public Field getField() {
-        return f;
-    }
-
-    public FieldElement getD() {
-        return d;
-    }
-
-    public FieldElement get2D() {
-        return d2;
-    }
-
-    public FieldElement getI() {
-        return I;
-    }
-
-    public GroupElement getZero(GroupElement.Representation repr) {
-        switch (repr) {
-        case P2:
-            return zeroP2;
-        case P3:
-            return zeroP3;
-        case PRECOMP:
-            return zeroPrecomp;
-        default:
-            return null;
-        }
-    }
-
-    public GroupElement createPoint(byte[] P, boolean precompute) {
-        GroupElement ge = new GroupElement(this, P);
-        if (precompute)
-            ge.precompute(true);
-        return ge;
-    }
-
-    @Override
-    public int hashCode() {
-        return f.hashCode() ^
-               d.hashCode() ^
-               I.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this)
-            return true;
-        if (!(o instanceof Curve))
-            return false;
-        Curve c = (Curve) o;
-        return f.equals(c.getField()) &&
-               d.equals(c.getD()) &&
-               I.equals(c.getI());
-    }
-}

+ 0 - 54
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Encoding.java

@@ -1,54 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-/**
- * Common interface for all $(b-1)$-bit encodings of elements
- * of EdDSA finite fields.
- * @author str4d
- *
- */
-public abstract class Encoding {
-    protected Field f;
-
-    public synchronized void setField(Field f) {
-        if (this.f != null)
-            throw new IllegalStateException("already set");
-        this.f = f;
-    }
-
-    /**
-     * Encode a FieldElement in its $(b-1)$-bit encoding.
-     * @param x the FieldElement to encode
-     * @return the $(b-1)$-bit encoding of this FieldElement.
-     */
-    public abstract byte[] encode(FieldElement x);
-
-    /**
-     * Decode a FieldElement from its $(b-1)$-bit encoding.
-     * The highest bit is masked out.
-     * @param in the $(b-1)$-bit encoding of a FieldElement.
-     * @return the FieldElement represented by 'val'.
-     */
-    public abstract FieldElement decode(byte[] in);
-
-    /**
-     * From the Ed25519 paper:<br>
-     * $x$ is negative if the $(b-1)$-bit encoding of $x$ is lexicographically larger
-     * than the $(b-1)$-bit encoding of -x. If $q$ is an odd prime and the encoding
-     * is the little-endian representation of $\{0, 1,\dots, q-1\}$ then the negative
-     * elements of $F_q$ are $\{1, 3, 5,\dots, q-2\}$.
-     * @param x the FieldElement to check
-     * @return true if negative
-     */
-    public abstract boolean isNegative(FieldElement x);
-}

+ 0 - 99
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/Field.java

@@ -1,99 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-import java.io.Serializable;
-
-/**
- * An EdDSA finite field. Includes several pre-computed values.
- * @author str4d
- *
- */
-public class Field implements Serializable {
-    private static final long serialVersionUID = 8746587465875676L;
-
-    public final FieldElement ZERO;
-    public final FieldElement ONE;
-    public final FieldElement TWO;
-    public final FieldElement FOUR;
-    public final FieldElement FIVE;
-    public final FieldElement EIGHT;
-
-    private final int b;
-    private final FieldElement q;
-    /**
-     * q-2
-     */
-    private final FieldElement qm2;
-    /**
-     * (q-5) / 8
-     */
-    private final FieldElement qm5d8;
-    private final Encoding enc;
-
-    public Field(int b, byte[] q, Encoding enc) {
-        this.b = b;
-        this.enc = enc;
-        this.enc.setField(this);
-
-        this.q = fromByteArray(q);
-
-        // Set up constants
-        ZERO = fromByteArray(Constants.ZERO);
-        ONE = fromByteArray(Constants.ONE);
-        TWO = fromByteArray(Constants.TWO);
-        FOUR = fromByteArray(Constants.FOUR);
-        FIVE = fromByteArray(Constants.FIVE);
-        EIGHT = fromByteArray(Constants.EIGHT);
-
-        // Precompute values
-        qm2 = this.q.subtract(TWO);
-        qm5d8 = this.q.subtract(FIVE).divide(EIGHT);
-    }
-
-    public FieldElement fromByteArray(byte[] x) {
-        return enc.decode(x);
-    }
-
-    public int getb() {
-        return b;
-    }
-
-    public FieldElement getQ() {
-        return q;
-    }
-
-    public FieldElement getQm2() {
-        return qm2;
-    }
-
-    public FieldElement getQm5d8() {
-        return qm5d8;
-    }
-
-    public Encoding getEncoding(){
-        return enc;
-    }
-
-    @Override
-    public int hashCode() {
-        return q.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof Field))
-            return false;
-        Field f = (Field) obj;
-        return b == f.b && q.equals(f.q);
-    }
-}

+ 0 - 76
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/FieldElement.java

@@ -1,76 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-import java.io.Serializable;
-
-/**
- * Note: concrete subclasses must implement hashCode() and equals()
- */
-public abstract class FieldElement implements Serializable {
-    private static final long serialVersionUID = 1239527465875676L;
-
-    protected final Field f;
-
-    public FieldElement(Field f) {
-        if (null == f) {
-            throw new IllegalArgumentException("field cannot be null");
-        }
-        this.f = f;
-    }
-
-    /**
-     * Encode a FieldElement in its $(b-1)$-bit encoding.
-     * @return the $(b-1)$-bit encoding of this FieldElement.
-     */
-    public byte[] toByteArray() {
-        return f.getEncoding().encode(this);
-    }
-
-    public abstract boolean isNonZero();
-
-    public boolean isNegative() {
-        return f.getEncoding().isNegative(this);
-    }
-
-    public abstract FieldElement add(FieldElement val);
-
-    public FieldElement addOne() {
-        return add(f.ONE);
-    }
-
-    public abstract FieldElement subtract(FieldElement val);
-
-    public FieldElement subtractOne() {
-        return subtract(f.ONE);
-    }
-
-    public abstract FieldElement negate();
-
-    public FieldElement divide(FieldElement val) {
-        return multiply(val.invert());
-    }
-
-    public abstract FieldElement multiply(FieldElement val);
-
-    public abstract FieldElement square();
-
-    public abstract FieldElement squareAndDouble();
-
-    public abstract FieldElement invert();
-
-    public abstract FieldElement pow22523();
-
-    public abstract FieldElement cmov(FieldElement val, final int b);
-
-    // Note: concrete subclasses must implement hashCode() and equals()
-}

+ 0 - 1034
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/GroupElement.java

@@ -1,1034 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-import com.fuzamei.eddsa.Utils;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-/**
- * A point $(x,y)$ on an EdDSA curve.
- * <p>
- * Reviewed/commented by Bloody Rookie (nemproject@gmx.de)
- * <p>
- * Literature:<br>
- * [1] Daniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe and Bo-Yin Yang : High-speed high-security signatures<br>
- * [2] Huseyin Hisil, Kenneth Koon-Ho Wong, Gary Carter, Ed Dawson: Twisted Edwards Curves Revisited<br>
- * [3] Daniel J. Bernsteina, Tanja Lange: A complete set of addition laws for incomplete Edwards curves<br>
- * [4] Daniel J. Bernstein, Peter Birkner, Marc Joye, Tanja Lange and Christiane Peters: Twisted Edwards Curves<br>
- * [5] Christiane Pascale Peters: Curves, Codes, and Cryptography (PhD thesis)<br>
- * [6] Daniel J. Bernstein, Peter Birkner, Tanja Lange and Christiane Peters: Optimizing double-base elliptic-curve single-scalar multiplication<br>
- *
- * @author str4d
- */
-public class GroupElement implements Serializable {
-    private static final long serialVersionUID = 2395879087349587L;
-
-    /**
-     * Available representations for a group element.
-     * <ul>
-     * <li>P2: Projective representation $(X:Y:Z)$ satisfying $x=X/Z, y=Y/Z$.
-     * <li>P3: Extended projective representation $(X:Y:Z:T)$ satisfying $x=X/Z, y=Y/Z, XY=ZT$.
-     * <li>P1P1: Completed representation $((X:Z), (Y:T))$ satisfying $x=X/Z, y=Y/T$.
-     * <li>PRECOMP: Precomputed representation $(y+x, y-x, 2dxy)$.
-     * <li>CACHED: Cached representation $(Y+X, Y-X, Z, 2dT)$
-     * </ul>
-     */
-    public enum Representation {
-        /** Projective ($P^2$): $(X:Y:Z)$ satisfying $x=X/Z, y=Y/Z$ */
-        P2,
-        /** Extended ($P^3$): $(X:Y:Z:T)$ satisfying $x=X/Z, y=Y/Z, XY=ZT$ */
-        P3,
-        /** Completed ($P \times P$): $((X:Z),(Y:T))$ satisfying $x=X/Z, y=Y/T$ */
-        P1P1,
-        /** Precomputed (Duif): $(y+x,y-x,2dxy)$ */
-        PRECOMP,
-        /** Cached: $(Y+X,Y-X,Z,2dT)$ */
-        CACHED
-    }
-
-    /**
-     * Creates a new group element in P2 representation.
-     *
-     * @param curve The curve.
-     * @param X The $X$ coordinate.
-     * @param Y The $Y$ coordinate.
-     * @param Z The $Z$ coordinate.
-     * @return The group element in P2 representation.
-     */
-    public static GroupElement p2(
-            final Curve curve,
-            final FieldElement X,
-            final FieldElement Y,
-            final FieldElement Z) {
-        return new GroupElement(curve, Representation.P2, X, Y, Z, null);
-    }
-
-    /**
-     * Creates a new group element in P3 representation.
-     *
-     * @param curve The curve.
-     * @param X The $X$ coordinate.
-     * @param Y The $Y$ coordinate.
-     * @param Z The $Z$ coordinate.
-     * @param T The $T$ coordinate.
-     * @return The group element in P3 representation.
-     */
-    public static GroupElement p3(
-            final Curve curve,
-            final FieldElement X,
-            final FieldElement Y,
-            final FieldElement Z,
-            final FieldElement T) {
-        return new GroupElement(curve, Representation.P3, X, Y, Z, T);
-    }
-
-    /**
-     * Creates a new group element in P1P1 representation.
-     *
-     * @param curve The curve.
-     * @param X The $X$ coordinate.
-     * @param Y The $Y$ coordinate.
-     * @param Z The $Z$ coordinate.
-     * @param T The $T$ coordinate.
-     * @return The group element in P1P1 representation.
-     */
-    public static GroupElement p1p1(
-            final Curve curve,
-            final FieldElement X,
-            final FieldElement Y,
-            final FieldElement Z,
-            final FieldElement T) {
-        return new GroupElement(curve, Representation.P1P1, X, Y, Z, T);
-    }
-
-    /**
-     * Creates a new group element in PRECOMP representation.
-     *
-     * @param curve The curve.
-     * @param ypx The $y + x$ value.
-     * @param ymx The $y - x$ value.
-     * @param xy2d The $2 * d * x * y$ value.
-     * @return The group element in PRECOMP representation.
-     */
-    public static GroupElement precomp(
-            final Curve curve,
-            final FieldElement ypx,
-            final FieldElement ymx,
-            final FieldElement xy2d) {
-        return new GroupElement(curve, Representation.PRECOMP, ypx, ymx, xy2d, null);
-    }
-
-    /**
-     * Creates a new group element in CACHED representation.
-     *
-     * @param curve The curve.
-     * @param YpX The $Y + X$ value.
-     * @param YmX The $Y - X$ value.
-     * @param Z The $Z$ coordinate.
-     * @param T2d The $2 * d * T$ value.
-     * @return The group element in CACHED representation.
-     */
-    public static GroupElement cached(
-            final Curve curve,
-            final FieldElement YpX,
-            final FieldElement YmX,
-            final FieldElement Z,
-            final FieldElement T2d) {
-        return new GroupElement(curve, Representation.CACHED, YpX, YmX, Z, T2d);
-    }
-
-    /**
-     * Variable is package private only so that tests run.
-     */
-    final Curve curve;
-
-    /**
-     * Variable is package private only so that tests run.
-     */
-    final Representation repr;
-
-    /**
-     * Variable is package private only so that tests run.
-     */
-    final FieldElement X;
-
-    /**
-     * Variable is package private only so that tests run.
-     */
-    final FieldElement Y;
-
-    /**
-     * Variable is package private only so that tests run.
-     */
-    final FieldElement Z;
-
-    /**
-     * Variable is package private only so that tests run.
-     */
-    final FieldElement T;
-
-    /**
-     * Precomputed table for {@link #scalarMultiply(byte[])},
-     * filled if necessary.
-     * <p>
-     * Variable is package private only so that tests run.
-     */
-    GroupElement[][] precmp;
-
-    /**
-     * Precomputed table for {@link #doubleScalarMultiplyVariableTime(GroupElement, byte[], byte[])},
-     * filled if necessary.
-     * <p>
-     * Variable is package private only so that tests run.
-     */
-    GroupElement[] dblPrecmp;
-
-    /**
-     * Creates a group element for a curve.
-     *
-     * @param curve The curve.
-     * @param repr The representation used to represent the group element.
-     * @param X The $X$ coordinate.
-     * @param Y The $Y$ coordinate.
-     * @param Z The $Z$ coordinate.
-     * @param T The $T$ coordinate.
-     */
-    public GroupElement(
-            final Curve curve,
-            final Representation repr,
-            final FieldElement X,
-            final FieldElement Y,
-            final FieldElement Z,
-            final FieldElement T) {
-        this.curve = curve;
-        this.repr = repr;
-        this.X = X;
-        this.Y = Y;
-        this.Z = Z;
-        this.T = T;
-    }
-
-    /**
-     * Creates a group element for a curve from a given encoded point.
-     * <p>
-     * A point $(x,y)$ is encoded by storing $y$ in bit 0 to bit 254 and the sign of $x$ in bit 255.
-     * $x$ is recovered in the following way:
-     * </p><ul>
-     * <li>$x = sign(x) * \sqrt{(y^2 - 1) / (d * y^2 + 1)} = sign(x) * \sqrt{u / v}$ with $u = y^2 - 1$ and $v = d * y^2 + 1$.
-     * <li>Setting $β = (u * v^3) * (u * v^7)^{((q - 5) / 8)}$ one has $β^2 = \pm(u / v)$.
-     * <li>If $v * β = -u$ multiply $β$ with $i=\sqrt{-1}$.
-     * <li>Set $x := β$.
-     * <li>If $sign(x) \ne$ bit 255 of $s$ then negate $x$.
-     * </ul>
-     *
-     * @param curve The curve.
-     * @param s The encoded point.
-     */
-    public GroupElement(final Curve curve, final byte[] s) {
-        FieldElement x, y, yy, u, v, v3, vxx, check;
-        y = curve.getField().fromByteArray(s);
-        yy = y.square();
-
-        // u = y^2-1
-        u = yy.subtractOne();
-
-        // v = dy^2+1
-        v = yy.multiply(curve.getD()).addOne();
-
-        // v3 = v^3
-        v3 = v.square().multiply(v);
-
-        // x = (v3^2)vu, aka x = uv^7
-        x = v3.square().multiply(v).multiply(u);
-
-        //  x = (uv^7)^((q-5)/8)
-        x = x.pow22523();
-
-        // x = uv^3(uv^7)^((q-5)/8)
-        x = v3.multiply(u).multiply(x);
-
-        vxx = x.square().multiply(v);
-        check = vxx.subtract(u);            // vx^2-u
-        if (check.isNonZero()) {
-            check = vxx.add(u);             // vx^2+u
-
-            if (check.isNonZero())
-                throw new IllegalArgumentException("not a valid GroupElement");
-            x = x.multiply(curve.getI());
-        }
-
-        if ((x.isNegative() ? 1 : 0) != Utils.bit(s, curve.getField().getb()-1)) {
-            x = x.negate();
-        }
-
-        this.curve = curve;
-        this.repr = Representation.P3;
-        this.X = x;
-        this.Y = y;
-        this.Z = curve.getField().ONE;
-        this.T = this.X.multiply(this.Y);
-    }
-
-    /**
-     * Gets the curve of the group element.
-     *
-     * @return The curve.
-     */
-    public Curve getCurve() {
-        return this.curve;
-    }
-
-    /**
-     * Gets the representation of the group element.
-     *
-     * @return The representation.
-     */
-    public Representation getRepresentation() {
-        return this.repr;
-    }
-
-    /**
-     * Gets the $X$ value of the group element.
-     * This is for most representation the projective $X$ coordinate.
-     *
-     * @return The $X$ value.
-     */
-    public FieldElement getX() {
-        return this.X;
-    }
-
-    /**
-     * Gets the $Y$ value of the group element.
-     * This is for most representation the projective $Y$ coordinate.
-     *
-     * @return The $Y$ value.
-     */
-    public FieldElement getY() {
-        return this.Y;
-    }
-
-    /**
-     * Gets the $Z$ value of the group element.
-     * This is for most representation the projective $Z$ coordinate.
-     *
-     * @return The $Z$ value.
-     */
-    public FieldElement getZ() {
-        return this.Z;
-    }
-
-    /**
-     * Gets the $T$ value of the group element.
-     * This is for most representation the projective $T$ coordinate.
-     *
-     * @return The $T$ value.
-     */
-    public FieldElement getT() {
-        return this.T;
-    }
-
-    /**
-     * Converts the group element to an encoded point on the curve.
-     *
-     * @return The encoded point as byte array.
-     */
-    public byte[] toByteArray() {
-        switch (this.repr) {
-            case P2:
-            case P3:
-                FieldElement recip = Z.invert();
-                FieldElement x = X.multiply(recip);
-                FieldElement y = Y.multiply(recip);
-                byte[] s = y.toByteArray();
-                s[s.length-1] |= (x.isNegative() ? (byte) 0x80 : 0);
-                return s;
-            default:
-                return toP2().toByteArray();
-        }
-    }
-
-    /**
-     * Converts the group element to the P2 representation.
-     *
-     * @return The group element in the P2 representation.
-     */
-    public GroupElement toP2() {
-        return toRep(Representation.P2);
-    }
-
-    /**
-     * Converts the group element to the P3 representation.
-     *
-     * @return The group element in the P3 representation.
-     */
-    public GroupElement toP3() {
-        return toRep(Representation.P3);
-    }
-
-    /**
-     * Converts the group element to the CACHED representation.
-     *
-     * @return The group element in the CACHED representation.
-     */
-    public GroupElement toCached() {
-        return toRep(Representation.CACHED);
-    }
-
-    /**
-     * Convert a GroupElement from one Representation to another.
-     * TODO-CR: Add additional conversion?
-     * $r = p$
-     * <p>
-     * Supported conversions:
-     * <p><ul>
-     * <li>P3 $\rightarrow$ P2
-     * <li>P3 $\rightarrow$ CACHED (1 multiply, 1 add, 1 subtract)
-     * <li>P1P1 $\rightarrow$ P2 (3 multiply)
-     * <li>P1P1 $\rightarrow$ P3 (4 multiply)
-     *
-     * @param repr The representation to convert to.
-     * @return A new group element in the given representation.
-     */
-    private GroupElement toRep(final Representation repr) {
-        switch (this.repr) {
-            case P2:
-                switch (repr) {
-                    case P2:
-                        return p2(this.curve, this.X, this.Y, this.Z);
-                    default:
-                        throw new IllegalArgumentException();
-                }
-            case P3:
-                switch (repr) {
-                    case P2:
-                        return p2(this.curve, this.X, this.Y, this.Z);
-                    case P3:
-                        return p3(this.curve, this.X, this.Y, this.Z, this.T);
-                    case CACHED:
-                        return cached(this.curve, this.Y.add(this.X), this.Y.subtract(this.X), this.Z, this.T.multiply(this.curve.get2D()));
-                    default:
-                        throw new IllegalArgumentException();
-                }
-            case P1P1:
-                switch (repr) {
-                    case P2:
-                        return p2(this.curve, this.X.multiply(this.T), Y.multiply(this.Z), this.Z.multiply(this.T));
-                    case P3:
-                        return p3(this.curve, this.X.multiply(this.T), Y.multiply(this.Z), this.Z.multiply(this.T), this.X.multiply(this.Y));
-                    case P1P1:
-                        return p1p1(this.curve, this.X, this.Y, this.Z, this.T);
-                    default:
-                        throw new IllegalArgumentException();
-                }
-            case PRECOMP:
-                switch (repr) {
-                    case PRECOMP:
-                        return precomp(this.curve, this.X, this.Y, this.Z);
-                    default:
-                        throw new IllegalArgumentException();
-                }
-            case CACHED:
-                switch (repr) {
-                    case CACHED:
-                        return cached(this.curve, this.X, this.Y, this.Z, this.T);
-                    default:
-                        throw new IllegalArgumentException();
-                }
-            default:
-                throw new UnsupportedOperationException();
-        }
-    }
-
-    /**
-     * Precomputes several tables.
-     * <p>
-     * The precomputed tables are used for {@link #scalarMultiply(byte[])}
-     * and {@link #doubleScalarMultiplyVariableTime(GroupElement, byte[], byte[])}.
-     *
-     * @param precomputeSingle should the matrix for scalarMultiply() be precomputed?
-     */
-    public synchronized void precompute(final boolean precomputeSingle) {
-        GroupElement Bi;
-
-        if (precomputeSingle && this.precmp == null) {
-            // Precomputation for single scalar multiplication.
-            this.precmp = new GroupElement[32][8];
-            // TODO-CR BR: check that this == base point when the method is called.
-            Bi = this;
-            for (int i = 0; i < 32; i++) {
-                GroupElement Bij = Bi;
-                for (int j = 0; j < 8; j++) {
-                    final FieldElement recip = Bij.Z.invert();
-                    final FieldElement x = Bij.X.multiply(recip);
-                    final FieldElement y = Bij.Y.multiply(recip);
-                    this.precmp[i][j] = precomp(this.curve, y.add(x), y.subtract(x), x.multiply(y).multiply(this.curve.get2D()));
-                    Bij = Bij.add(Bi.toCached()).toP3();
-                }
-                // Only every second summand is precomputed (16^2 = 256)
-                for (int k = 0; k < 8; k++) {
-                    Bi = Bi.add(Bi.toCached()).toP3();
-                }
-            }
-        }
-
-        // Precomputation for double scalar multiplication.
-        // P,3P,5P,7P,9P,11P,13P,15P
-        if (this.dblPrecmp != null)
-            return;
-        this.dblPrecmp = new GroupElement[8];
-        Bi = this;
-        for (int i = 0; i < 8; i++) {
-            final FieldElement recip = Bi.Z.invert();
-            final FieldElement x = Bi.X.multiply(recip);
-            final FieldElement y = Bi.Y.multiply(recip);
-            this.dblPrecmp[i] = precomp(this.curve, y.add(x), y.subtract(x), x.multiply(y).multiply(this.curve.get2D()));
-            // Bi = edwards(B,edwards(B,Bi))
-            Bi = this.add(this.add(Bi.toCached()).toP3().toCached()).toP3();
-        }
-    }
-
-    /**
-     * Doubles a given group element $p$ in $P^2$ or $P^3$ representation and returns the result in $P \times P$ representation.
-     * $r = 2 * p$ where $p = (X : Y : Z)$ or $p = (X : Y : Z : T)$
-     * <p>
-     * $r$ in $P \times P$ representation:
-     * <p>
-     * $r = ((X' : Z'), (Y' : T'))$ where
-     * </p><ul>
-     * <li>$X' = (X + Y)^2 - (Y^2 + X^2)$
-     * <li>$Y' = Y^2 + X^2$
-     * <li>$Z' = y^2 - X^2$
-     * <li>$T' = 2 * Z^2 - (y^2 - X^2)$
-     * </ul><p>
-     * $r$ converted from $P \times P$ to $P^2$ representation:
-     * <p>
-     * $r = (X'' : Y'' : Z'')$ where
-     * </p><ul>
-     * <li>$X'' = X' * Z' = ((X + Y)^2 - Y^2 - X^2) * (2 * Z^2 - (y^2 - X^2))$
-     * <li>$Y'' = Y' * T' = (Y^2 + X^2) * (2 * Z^2 - (y^2 - X^2))$
-     * <li>$Z'' = Z' * T' = (y^2 - X^2) * (2 * Z^2 - (y^2 - X^2))$
-     * </ul><p>
-     * Formula for the $P^2$ representation is in agreement with the formula given in [4] page 12 (with $a = -1$)
-     * up to a common factor -1 which does not matter:
-     * <p>
-     * $$
-     * B = (X + Y)^2; C = X^2; D = Y^2; E = -C = -X^2; F := E + D = Y^2 - X^2; H = Z^2; J = F − 2 * H; \\
-     * X3 = (B − C − D) · J = X' * (-T'); \\
-     * Y3 = F · (E − D) = Z' * (-Y'); \\
-     * Z3 = F · J = Z' * (-T').
-     * $$
-     *
-     * @return The P1P1 representation
-     */
-    public GroupElement dbl() {
-        switch (this.repr) {
-        case P2:
-        case P3: // Ignore T for P3 representation
-            FieldElement XX, YY, B, A, AA, Yn, Zn;
-            XX = this.X.square();
-            YY = this.Y.square();
-            B = this.Z.squareAndDouble();
-            A = this.X.add(this.Y);
-            AA = A.square();
-            Yn = YY.add(XX);
-            Zn = YY.subtract(XX);
-            return p1p1(this.curve, AA.subtract(Yn), Yn, Zn, B.subtract(Zn));
-        default:
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    /**
-     * GroupElement addition using the twisted Edwards addition law with
-     * extended coordinates (Hisil2008).
-     * <p>
-     * this must be in $P^3$ representation and $q$ in PRECOMP representation.
-     * $r = p + q$ where $p = this = (X1 : Y1 : Z1 : T1), q = (q.X, q.Y, q.Z) = (Y2/Z2 + X2/Z2, Y2/Z2 - X2/Z2, 2 * d * X2/Z2 * Y2/Z2)$
-     * <p>
-     * $r$ in $P \times P$ representation:
-     * <p>
-     * $r = ((X' : Z'), (Y' : T'))$ where
-     * <p><ul>
-     * <li>$X' = (Y1 + X1) * q.X - (Y1 - X1) * q.Y = ((Y1 + X1) * (Y2 + X2) - (Y1 - X1) * (Y2 - X2)) * 1/Z2$
-     * <li>$Y' = (Y1 + X1) * q.X + (Y1 - X1) * q.Y = ((Y1 + X1) * (Y2 + X2) + (Y1 - X1) * (Y2 - X2)) * 1/Z2$
-     * <li>$Z' = 2 * Z1 + T1 * q.Z = 2 * Z1 + T1 * 2 * d * X2 * Y2 * 1/Z2^2 = (2 * Z1 * Z2 + 2 * d * T1 * T2) * 1/Z2$
-     * <li>$T' = 2 * Z1 - T1 * q.Z = 2 * Z1 - T1 * 2 * d * X2 * Y2 * 1/Z2^2 = (2 * Z1 * Z2 - 2 * d * T1 * T2) * 1/Z2$
-     * </ul><p>
-     * Setting $A = (Y1 - X1) * (Y2 - X2), B = (Y1 + X1) * (Y2 + X2), C = 2 * d * T1 * T2, D = 2 * Z1 * Z2$ we get
-     * <p><ul>
-     * <li>$X' = (B - A) * 1/Z2$
-     * <li>$Y' = (B + A) * 1/Z2$
-     * <li>$Z' = (D + C) * 1/Z2$
-     * <li>$T' = (D - C) * 1/Z2$
-     * </ul><p>
-     * $r$ converted from $P \times P$ to $P^2$ representation:
-     * <p>
-     * $r = (X'' : Y'' : Z'' : T'')$ where
-     * <p><ul>
-     * <li>$X'' = X' * Z' = (B - A) * (D + C) * 1/Z2^2$
-     * <li>$Y'' = Y' * T' = (B + A) * (D - C) * 1/Z2^2$
-     * <li>$Z'' = Z' * T' = (D + C) * (D - C) * 1/Z2^2$
-     * <li>$T'' = X' * Y' = (B - A) * (B + A) * 1/Z2^2$
-     * </ul><p>
-     * TODO-CR BR: Formula for the $P^2$ representation is not in agreement with the formula given in [2] page 6<br>
-     * TODO-CR BR: (the common factor $1/Z2^2$ does not matter):<br>
-     * $$
-     * E = B - A, F = D - C, G = D + C, H = B + A \\
-     * X3 = E * F = (B - A) * (D - C); \\
-     * Y3 = G * H = (D + C) * (B + A); \\
-     * Z3 = F * G = (D - C) * (D + C); \\
-     * T3 = E * H = (B - A) * (B + A);
-     * $$
-     *
-     * @param q the PRECOMP representation of the GroupElement to add.
-     * @return the P1P1 representation of the result.
-     */
-    private GroupElement madd(GroupElement q) {
-        if (this.repr != Representation.P3)
-            throw new UnsupportedOperationException();
-        if (q.repr != Representation.PRECOMP)
-            throw new IllegalArgumentException();
-
-        FieldElement YpX, YmX, A, B, C, D;
-        YpX = this.Y.add(this.X);
-        YmX = this.Y.subtract(this.X);
-        A = YpX.multiply(q.X); // q->y+x
-        B = YmX.multiply(q.Y); // q->y-x
-        C = q.Z.multiply(this.T); // q->2dxy
-        D = this.Z.add(this.Z);
-        return p1p1(this.curve, A.subtract(B), A.add(B), D.add(C), D.subtract(C));
-    }
-
-    /**
-     * GroupElement subtraction using the twisted Edwards addition law with
-     * extended coordinates (Hisil2008).
-     * <p>
-     * this must be in $P^3$ representation and $q$ in PRECOMP representation.
-     * $r = p - q$ where $p = this = (X1 : Y1 : Z1 : T1), q = (q.X, q.Y, q.Z) = (Y2/Z2 + X2/Z2, Y2/Z2 - X2/Z2, 2 * d * X2/Z2 * Y2/Z2)$
-     * <p>
-     * Negating $q$ means negating the value of $X2$ and $T2$ (the latter is irrelevant here).
-     * The formula is in accordance to {@link #madd the above addition}.
-     *
-     * @param q the PRECOMP representation of the GroupElement to subtract.
-     * @return the P1P1 representation of the result.
-     */
-    private GroupElement msub(GroupElement q) {
-        if (this.repr != Representation.P3)
-            throw new UnsupportedOperationException();
-        if (q.repr != Representation.PRECOMP)
-            throw new IllegalArgumentException();
-
-        FieldElement YpX, YmX, A, B, C, D;
-        YpX = this.Y.add(this.X);
-        YmX = this.Y.subtract(this.X);
-        A = YpX.multiply(q.Y); // q->y-x
-        B = YmX.multiply(q.X); // q->y+x
-        C = q.Z.multiply(this.T); // q->2dxy
-        D = this.Z.add(this.Z);
-        return p1p1(this.curve, A.subtract(B), A.add(B), D.subtract(C), D.add(C));
-    }
-
-    /**
-     * GroupElement addition using the twisted Edwards addition law with
-     * extended coordinates (Hisil2008).
-     * <p>
-     * this must be in $P^3$ representation and $q$ in CACHED representation.
-     * $r = p + q$ where $p = this = (X1 : Y1 : Z1 : T1), q = (q.X, q.Y, q.Z, q.T) = (Y2 + X2, Y2 - X2, Z2, 2 * d * T2)$
-     * <p>
-     * $r$ in $P \times P$ representation:
-     * </p><ul>
-     * <li>$X' = (Y1 + X1) * (Y2 + X2) - (Y1 - X1) * (Y2 - X2)$
-     * <li>$Y' = (Y1 + X1) * (Y2 + X2) + (Y1 - X1) * (Y2 - X2)$
-     * <li>$Z' = 2 * Z1 * Z2 + 2 * d * T1 * T2$
-     * <li>$T' = 2 * Z1 * T2 - 2 * d * T1 * T2$
-     * </ul><p>
-     * Setting $A = (Y1 - X1) * (Y2 - X2), B = (Y1 + X1) * (Y2 + X2), C = 2 * d * T1 * T2, D = 2 * Z1 * Z2$ we get
-     * </p><ul>
-     * <li>$X' = (B - A)$
-     * <li>$Y' = (B + A)$
-     * <li>$Z' = (D + C)$
-     * <li>$T' = (D - C)$
-     * </ul><p>
-     * Same result as in {@link #madd} (up to a common factor which does not matter).
-     *
-     * @param q the CACHED representation of the GroupElement to add.
-     * @return the P1P1 representation of the result.
-     */
-    public GroupElement add(GroupElement q) {
-        if (this.repr != Representation.P3)
-            throw new UnsupportedOperationException();
-        if (q.repr != Representation.CACHED)
-            throw new IllegalArgumentException();
-
-        FieldElement YpX, YmX, A, B, C, ZZ, D;
-        YpX = this.Y.add(this.X);
-        YmX = this.Y.subtract(this.X);
-        A = YpX.multiply(q.X); // q->Y+X
-        B = YmX.multiply(q.Y); // q->Y-X
-        C = q.T.multiply(this.T); // q->2dT
-        ZZ = this.Z.multiply(q.Z);
-        D = ZZ.add(ZZ);
-        return p1p1(this.curve, A.subtract(B), A.add(B), D.add(C), D.subtract(C));
-    }
-
-    /**
-     * GroupElement subtraction using the twisted Edwards addition law with
-     * extended coordinates (Hisil2008).
-     * <p>
-     * $r = p - q$
-     * <p>
-     * Negating $q$ means negating the value of the coordinate $X2$ and $T2$.
-     * The formula is in accordance to {@link #add the above addition}.
-     *
-     * @param q the PRECOMP representation of the GroupElement to subtract.
-     * @return the P1P1 representation of the result.
-     */
-    public GroupElement sub(GroupElement q) {
-        if (this.repr != Representation.P3)
-            throw new UnsupportedOperationException();
-        if (q.repr != Representation.CACHED)
-            throw new IllegalArgumentException();
-
-        FieldElement YpX, YmX, A, B, C, ZZ, D;
-        YpX = Y.add(X);
-        YmX = Y.subtract(X);
-        A = YpX.multiply(q.Y); // q->Y-X
-        B = YmX.multiply(q.X); // q->Y+X
-        C = q.T.multiply(T); // q->2dT
-        ZZ = Z.multiply(q.Z);
-        D = ZZ.add(ZZ);
-        return p1p1(curve, A.subtract(B), A.add(B), D.subtract(C), D.add(C));
-    }
-
-    /**
-     * Negates this group element by subtracting it from the neutral group element.
-     * <p>
-     * TODO-CR BR: why not simply negate the coordinates $X$ and $T$?
-     *
-     * @return The negative of this group element.
-     */
-    public GroupElement negate() {
-        if (this.repr != Representation.P3)
-            throw new UnsupportedOperationException();
-        return this.curve.getZero(Representation.P3).sub(toCached()).toP3();
-    }
-
-    @Override
-    public int hashCode() {
-        return Arrays.hashCode(this.toByteArray());
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == this)
-            return true;
-        if (!(obj instanceof GroupElement))
-            return false;
-        GroupElement ge = (GroupElement) obj;
-        if (!this.repr.equals(ge.repr)) {
-            try {
-                ge = ge.toRep(this.repr);
-            } catch (RuntimeException e) {
-                return false;
-            }
-        }
-        switch (this.repr) {
-            case P2:
-            case P3:
-                // Try easy way first
-                if (this.Z.equals(ge.Z))
-                    return this.X.equals(ge.X) && this.Y.equals(ge.Y);
-                // X1/Z1 = X2/Z2 --> X1*Z2 = X2*Z1
-                final FieldElement x1 = this.X.multiply(ge.Z);
-                final FieldElement y1 = this.Y.multiply(ge.Z);
-                final FieldElement x2 = ge.X.multiply(this.Z);
-                final FieldElement y2 = ge.Y.multiply(this.Z);
-                return x1.equals(x2) && y1.equals(y2);
-            case P1P1:
-                return toP2().equals(ge);
-            case PRECOMP:
-                // Compare directly, PRECOMP is derived directly from x and y
-                return this.X.equals(ge.X) && this.Y.equals(ge.Y) && this.Z.equals(ge.Z);
-            case CACHED:
-                // Try easy way first
-                if (this.Z.equals(ge.Z))
-                    return this.X.equals(ge.X) && this.Y.equals(ge.Y) && this.T.equals(ge.T);
-                // (Y+X)/Z = y+x etc.
-                final FieldElement x3 = this.X.multiply(ge.Z);
-                final FieldElement y3 = this.Y.multiply(ge.Z);
-                final FieldElement t3 = this.T.multiply(ge.Z);
-                final FieldElement x4 = ge.X.multiply(this.Z);
-                final FieldElement y4 = ge.Y.multiply(this.Z);
-                final FieldElement t4 = ge.T.multiply(this.Z);
-                return x3.equals(x4) && y3.equals(y4) && t3.equals(t4);
-            default:
-                return false;
-        }
-    }
-
-    /**
-     * Convert a to radix 16.
-     * <p>
-     * Method is package private only so that tests run.
-     *
-     * @param a $= a[0]+256*a[1]+...+256^{31} a[31]$
-     * @return 64 bytes, each between -8 and 7
-     */
-    static byte[] toRadix16(final byte[] a) {
-        final byte[] e = new byte[64];
-        int i;
-        // Radix 16 notation
-        for (i = 0; i < 32; i++) {
-            e[2*i+0] = (byte) (a[i] & 15);
-            e[2*i+1] = (byte) ((a[i] >> 4) & 15);
-        }
-        /* each e[i] is between 0 and 15 */
-        /* e[63] is between 0 and 7 */
-        int carry = 0;
-        for (i = 0; i < 63; i++) {
-            e[i] += carry;
-            carry = e[i] + 8;
-            carry >>= 4;
-            e[i] -= carry << 4;
-        }
-        e[63] += carry;
-        /* each e[i] is between -8 and 7 */
-        return e;
-    }
-
-    /**
-     * Constant-time conditional move.
-     * <p>
-     * Replaces this with $u$ if $b == 1$.<br>
-     * Replaces this with this if $b == 0$.
-     * <p>
-     * Method is package private only so that tests run.
-     *
-     * @param u The group element to return if $b == 1$.
-     * @param b in $\{0, 1\}$
-     * @return $u$ if $b == 1$; this if $b == 0$. Results undefined if $b$ is not in $\{0, 1\}$.
-     */
-    GroupElement cmov(final GroupElement u, final int b) {
-        return precomp(curve, X.cmov(u.X, b), Y.cmov(u.Y, b), Z.cmov(u.Z, b));
-    }
-
-    /**
-     * Look up $16^i r_i B$ in the precomputed table.
-     * <p>
-     * No secret array indices, no secret branching.
-     * Constant time.
-     * <p>
-     * Must have previously precomputed.
-     * <p>
-     * Method is package private only so that tests run.
-     *
-     * @param pos $= i/2$ for $i$ in $\{0, 2, 4,..., 62\}$
-     * @param b $= r_i$
-     * @return the GroupElement
-     */
-    GroupElement select(final int pos, final int b) {
-        // Is r_i negative?
-        final int bnegative = Utils.negative(b);
-        // |r_i|
-        final int babs = b - (((-bnegative) & b) << 1);
-
-        // 16^i |r_i| B
-        final GroupElement t = this.curve.getZero(Representation.PRECOMP)
-                .cmov(this.precmp[pos][0], Utils.equal(babs, 1))
-                .cmov(this.precmp[pos][1], Utils.equal(babs, 2))
-                .cmov(this.precmp[pos][2], Utils.equal(babs, 3))
-                .cmov(this.precmp[pos][3], Utils.equal(babs, 4))
-                .cmov(this.precmp[pos][4], Utils.equal(babs, 5))
-                .cmov(this.precmp[pos][5], Utils.equal(babs, 6))
-                .cmov(this.precmp[pos][6], Utils.equal(babs, 7))
-                .cmov(this.precmp[pos][7], Utils.equal(babs, 8));
-        // -16^i |r_i| B
-        final GroupElement tminus = precomp(curve, t.Y, t.X, t.Z.negate());
-        // 16^i r_i B
-        return t.cmov(tminus, bnegative);
-    }
-
-    /**
-     * $h = a * B$ where $a = a[0]+256*a[1]+\dots+256^{31} a[31]$ and
-     * $B$ is this point. If its lookup table has not been precomputed, it
-     * will be at the start of the method (and cached for later calls).
-     * Constant time.
-     * <p>
-     * Preconditions: (TODO: Check this applies here)
-     *   $a[31] \le 127$
-     * @param a $= a[0]+256*a[1]+\dots+256^{31} a[31]$
-     * @return the GroupElement
-     */
-    public GroupElement scalarMultiply(final byte[] a) {
-        GroupElement t;
-        int i;
-
-        final byte[] e = toRadix16(a);
-
-        GroupElement h = this.curve.getZero(Representation.P3);
-        synchronized(this) {
-            // TODO: Get opinion from a crypto professional.
-            // This should in practice never be necessary, the only point that
-            // this should get called on is EdDSA's B.
-            //precompute();
-            for (i = 1; i < 64; i += 2) {
-                t = select(i/2, e[i]);
-                h = h.madd(t).toP3();
-            }
-
-            h = h.dbl().toP2().dbl().toP2().dbl().toP2().dbl().toP3();
-
-            for (i = 0; i < 64; i += 2) {
-                t = select(i/2, e[i]);
-                h = h.madd(t).toP3();
-            }
-        }
-
-        return h;
-    }
-
-    /**
-     * Calculates a sliding-windows base 2 representation for a given value $a$.
-     * To learn more about it see [6] page 8.
-     * <p>
-     * Output: $r$ which satisfies
-     * $a = r0 * 2^0 + r1 * 2^1 + \dots + r255 * 2^{255}$ with $ri$ in $\{-15, -13, -11, -9, -7, -5, -3, -1, 0, 1, 3, 5, 7, 9, 11, 13, 15\}$
-     * <p>
-     * Method is package private only so that tests run.
-     *
-     * @param a $= a[0]+256*a[1]+\dots+256^{31} a[31]$.
-     * @return The byte array $r$ in the above described form.
-     */
-    static byte[] slide(final byte[] a) {
-        byte[] r = new byte[256];
-
-        // Put each bit of 'a' into a separate byte, 0 or 1
-        for (int i = 0; i < 256; ++i) {
-            r[i] = (byte) (1 & (a[i >> 3] >> (i & 7)));
-        }
-
-        // Note: r[i] will always be odd.
-        for (int i = 0; i < 256; ++i) {
-            if (r[i] != 0) {
-                for (int b = 1; b <= 6 && i + b < 256; ++b) {
-                    // Accumulate bits if possible
-                    if (r[i + b] != 0) {
-                        if (r[i] + (r[i + b] << b) <= 15) {
-                            r[i] += r[i + b] << b;
-                            r[i + b] = 0;
-                        } else if (r[i] - (r[i + b] << b) >= -15) {
-                            r[i] -= r[i + b] << b;
-                            for (int k = i + b; k < 256; ++k) {
-                                if (r[k] == 0) {
-                                    r[k] = 1;
-                                    break;
-                                }
-                                r[k] = 0;
-                            }
-                        } else
-                            break;
-                    }
-                }
-            }
-        }
-
-        return r;
-    }
-
-    /**
-     * $r = a * A + b * B$ where $a = a[0]+256*a[1]+\dots+256^{31} a[31]$,
-     * $b = b[0]+256*b[1]+\dots+256^{31} b[31]$ and $B$ is this point.
-     * <p>
-     * $A$ must have been previously precomputed.
-     *
-     * @param A in P3 representation.
-     * @param a $= a[0]+256*a[1]+\dots+256^{31} a[31]$
-     * @param b $= b[0]+256*b[1]+\dots+256^{31} b[31]$
-     * @return the GroupElement
-     */
-    public GroupElement doubleScalarMultiplyVariableTime(final GroupElement A, final byte[] a, final byte[] b) {
-        // TODO-CR BR: A check that this is the base point is needed.
-        final byte[] aslide = slide(a);
-        final byte[] bslide = slide(b);
-
-        GroupElement r = this.curve.getZero(Representation.P2);
-
-        int i;
-        for (i = 255; i >= 0; --i) {
-            if (aslide[i] != 0 || bslide[i] != 0) break;
-        }
-
-        synchronized(this) {
-            // TODO-CR BR strange comment below.
-            // TODO: Get opinion from a crypto professional.
-            // This should in practice never be necessary, the only point that
-            // this should get called on is EdDSA's B.
-            //precompute();
-            for (; i >= 0; --i) {
-                GroupElement t = r.dbl();
-
-                if (aslide[i] > 0) {
-                    t = t.toP3().madd(A.dblPrecmp[aslide[i]/2]);
-                } else if(aslide[i] < 0) {
-                    t = t.toP3().msub(A.dblPrecmp[(-aslide[i])/2]);
-                }
-
-                if (bslide[i] > 0) {
-                    t = t.toP3().madd(this.dblPrecmp[bslide[i]/2]);
-                } else if(bslide[i] < 0) {
-                    t = t.toP3().msub(this.dblPrecmp[(-bslide[i])/2]);
-                }
-
-                r = t.toP2();
-            }
-        }
-
-        return r;
-    }
-
-    /**
-     * Verify that a point is on its curve.
-     * @return true if the point lies on its curve.
-     */
-    public boolean isOnCurve() {
-        return isOnCurve(curve);
-    }
-
-    /**
-     * Verify that a point is on the curve.
-     * @param curve The curve to check.
-     * @return true if the point lies on the curve.
-     */
-    public boolean isOnCurve(Curve curve) {
-        switch (repr) {
-        case P2:
-        case P3:
-            FieldElement recip = Z.invert();
-            FieldElement x = X.multiply(recip);
-            FieldElement y = Y.multiply(recip);
-            FieldElement xx = x.square();
-            FieldElement yy = y.square();
-            FieldElement dxxyy = curve.getD().multiply(xx).multiply(yy);
-            return curve.getField().ONE.add(dxxyy).add(xx).equals(yy);
-
-        default:
-            return toP2().isOnCurve(curve);
-        }
-    }
-
-    @Override
-    public String toString() {
-        return "[GroupElement\nX="+X+"\nY="+Y+"\nZ="+Z+"\nT="+T+"\n]";
-    }
-}

+ 0 - 34
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ScalarOps.java

@@ -1,34 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math;
-
-public interface ScalarOps {
-    /**
-     * Reduce the given scalar mod $l$.
-     * <p>
-     * From the Ed25519 paper:<br>
-     * Here we interpret $2b$-bit strings in little-endian form as integers in
-     * $\{0, 1,..., 2^{(2b)}-1\}$.
-     * @param s the scalar to reduce
-     * @return $s \bmod l$
-     */
-    public byte[] reduce(byte[] s);
-
-    /**
-     * $r = (a * b + c) \bmod l$
-     * @param a a scalar
-     * @param b a scalar
-     * @param c a scalar
-     * @return $(a*b + c) \bmod l$
-     */
-    public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c);
-}

+ 0 - 132
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/bigint/BigIntegerFieldElement.java

@@ -1,132 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math.bigint;
-
-import java.io.Serializable;
-
-import java.math.BigInteger;
-
-import com.fuzamei.eddsa.math.Field;
-import com.fuzamei.eddsa.math.FieldElement;
-
-/**
- * A particular element of the field \Z/(2^255-19).
- * @author str4d
- *
- */
-public class BigIntegerFieldElement extends FieldElement implements Serializable {
-    private static final long serialVersionUID = 4890398908392808L;
-    /**
-     * Variable is package private for encoding.
-     */
-    final BigInteger bi;
-
-    public BigIntegerFieldElement(Field f, BigInteger bi) {
-        super(f);
-        this.bi = bi;
-    }
-
-    public boolean isNonZero() {
-        return !bi.equals(BigInteger.ZERO);
-    }
-
-    public FieldElement add(FieldElement val) {
-        return new BigIntegerFieldElement(f, bi.add(((BigIntegerFieldElement)val).bi)).mod(f.getQ());
-    }
-
-    @Override
-    public FieldElement addOne() {
-        return new BigIntegerFieldElement(f, bi.add(BigInteger.ONE)).mod(f.getQ());
-    }
-
-    public FieldElement subtract(FieldElement val) {
-        return new BigIntegerFieldElement(f, bi.subtract(((BigIntegerFieldElement)val).bi)).mod(f.getQ());
-    }
-
-    @Override
-    public FieldElement subtractOne() {
-        return new BigIntegerFieldElement(f, bi.subtract(BigInteger.ONE)).mod(f.getQ());
-    }
-
-    public FieldElement negate() {
-        return f.getQ().subtract(this);
-    }
-
-    @Override
-    public FieldElement divide(FieldElement val) {
-        return divide(((BigIntegerFieldElement)val).bi);
-    }
-
-    public FieldElement divide(BigInteger val) {
-        return new BigIntegerFieldElement(f, bi.divide(val)).mod(f.getQ());
-    }
-
-    public FieldElement multiply(FieldElement val) {
-        return new BigIntegerFieldElement(f, bi.multiply(((BigIntegerFieldElement)val).bi)).mod(f.getQ());
-    }
-
-    public FieldElement square() {
-        return multiply(this);
-    }
-
-    public FieldElement squareAndDouble() {
-        FieldElement sq = square();
-        return sq.add(sq);
-    }
-
-    public FieldElement invert() {
-        // Euler's theorem
-        //return modPow(f.getQm2(), f.getQ());
-        return new BigIntegerFieldElement(f, bi.modInverse(((BigIntegerFieldElement)f.getQ()).bi));
-    }
-
-    public FieldElement mod(FieldElement m) {
-        return new BigIntegerFieldElement(f, bi.mod(((BigIntegerFieldElement)m).bi));
-    }
-
-    public FieldElement modPow(FieldElement e, FieldElement m) {
-        return new BigIntegerFieldElement(f, bi.modPow(((BigIntegerFieldElement)e).bi, ((BigIntegerFieldElement)m).bi));
-    }
-
-    public FieldElement pow(FieldElement e){
-        return modPow(e, f.getQ());
-    }
-
-    public FieldElement pow22523(){
-        return pow(f.getQm5d8());
-    }
-
-    @Override
-    public FieldElement cmov(FieldElement val, int b) {
-        // Not constant-time, but it doesn't really matter because none of the underlying BigInteger operations
-        // are either, so there's not much point in trying hard here ...
-        return b == 0 ? this : val;
-    }
-
-    @Override
-    public int hashCode() {
-        return bi.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof BigIntegerFieldElement))
-            return false;
-        BigIntegerFieldElement fe = (BigIntegerFieldElement) obj;
-        return bi.equals(fe.bi);
-    }
-
-    @Override
-    public String toString() {
-        return "[BigIntegerFieldElement val="+bi+"]";
-    }
-}

+ 0 - 103
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/bigint/BigIntegerLittleEndianEncoding.java

@@ -1,103 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math.bigint;
-
-import java.io.Serializable;
-
-import java.math.BigInteger;
-
-import com.fuzamei.eddsa.math.Encoding;
-import com.fuzamei.eddsa.math.Field;
-import com.fuzamei.eddsa.math.FieldElement;
-
-public class BigIntegerLittleEndianEncoding extends Encoding implements Serializable {
-    private static final long serialVersionUID = 3984579843759837L;
-    /**
-     * Mask where only the first b-1 bits are set.
-     */
-    private BigInteger mask;
-
-    @Override
-    public synchronized void setField(Field f) {
-        super.setField(f);
-        mask = BigInteger.ONE.shiftLeft(f.getb()-1).subtract(BigInteger.ONE);
-    }
-
-    public byte[] encode(FieldElement x) {
-        return encode(((BigIntegerFieldElement)x).bi.and(mask));
-    }
-
-    /**
-     *  Convert $x$ to little endian.
-     *  Constant time.
-     *
-     *  @param x the BigInteger value to encode
-     *  @return array of length $b/8$
-     *  @throws IllegalStateException if field not set
-     */
-    public byte[] encode(BigInteger x) {
-        if (f == null)
-            throw new IllegalStateException("field not set");
-        byte[] in = x.toByteArray();
-        byte[] out = new byte[f.getb()/8];
-        for (int i = 0; i < in.length; i++) {
-            out[i] = in[in.length-1-i];
-        }
-        for (int i = in.length; i < out.length; i++) {
-            out[i] = 0;
-        }
-        return out;
-    }
-
-    /**
-     *  Decode a FieldElement from its $(b-1)$-bit encoding.
-     *  The highest bit is masked out.
-     *
-     *  @param in the $(b-1)$-bit encoding of a FieldElement.
-     *  @return the FieldElement represented by 'val'.
-     *  @throws IllegalStateException if field not set
-     *  @throws IllegalArgumentException if encoding is invalid
-     */
-    public FieldElement decode(byte[] in) {
-        if (f == null)
-            throw new IllegalStateException("field not set");
-        if (in.length != f.getb()/8)
-            throw new IllegalArgumentException("Not a valid encoding");
-        return new BigIntegerFieldElement(f, toBigInteger(in).and(mask));
-    }
-
-    /**
-     *  Convert in to big endian
-     *
-     *  @param in the $(b-1)$-bit encoding of a FieldElement.
-     *  @return the decoded value as a BigInteger
-     */
-    public BigInteger toBigInteger(byte[] in) {
-        byte[] out = new byte[in.length];
-        for (int i = 0; i < in.length; i++) {
-            out[i] = in[in.length-1-i];
-        }
-        return new BigInteger(1, out);
-    }
-
-    /**
-     * From the Ed25519 paper:<br>
-     * $x$ is negative if the $(b-1)$-bit encoding of $x$ is lexicographically larger
-     * than the $(b-1)$-bit encoding of $-x$. If $q$ is an odd prime and the encoding
-     * is the little-endian representation of $\{0, 1,\dots, q-1\}$ then the negative
-     * elements of $F_q$ are $\{1, 3, 5,\dots, q-2\}$.
-     * @return true if negative
-     */
-    public boolean isNegative(FieldElement x) {
-        return ((BigIntegerFieldElement)x).bi.testBit(0);
-    }
-}

+ 0 - 38
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/bigint/BigIntegerScalarOps.java

@@ -1,38 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math.bigint;
-
-import java.math.BigInteger;
-
-
-import com.fuzamei.eddsa.math.Field;
-import com.fuzamei.eddsa.math.ScalarOps;
-
-public class BigIntegerScalarOps implements ScalarOps {
-    private final BigInteger l;
-    private final BigIntegerLittleEndianEncoding enc;
-
-    public BigIntegerScalarOps(Field f, BigInteger l) {
-        this.l = l;
-        enc = new BigIntegerLittleEndianEncoding();
-        enc.setField(f);
-    }
-
-    public byte[] reduce(byte[] s) {
-        return enc.encode(enc.toBigInteger(s).mod(l));
-    }
-
-    public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c) {
-        return enc.encode(enc.toBigInteger(a).multiply(enc.toBigInteger(b)).add(enc.toBigInteger(c)).mod(l));
-    }
-
-}

+ 0 - 988
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ed25519/Ed25519FieldElement.java

@@ -1,988 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math.ed25519;
-
-import com.fuzamei.eddsa.Utils;
-import com.fuzamei.eddsa.math.*;
-
-import java.util.Arrays;
-
-/**
- * Class to represent a field element of the finite field $p = 2^{255} - 19$ elements.
- * <p>
- * An element $t$, entries $t[0] \dots t[9]$, represents the integer
- * $t[0]+2^{26} t[1]+2^{51} t[2]+2^{77} t[3]+2^{102} t[4]+\dots+2^{230} t[9]$.
- * Bounds on each $t[i]$ vary depending on context.
- * <p>
- * Reviewed/commented by Bloody Rookie (nemproject@gmx.de)
- */
-public class Ed25519FieldElement extends FieldElement {
-    /**
-     * Variable is package private for encoding.
-     */
-    final int[] t;
-
-    /**
-     * Creates a field element.
-     *
-     * @param f The underlying field, must be the finite field with $p = 2^{255} - 19$ elements
-     * @param t The $2^{25.5}$ bit representation of the field element.
-     */
-    public Ed25519FieldElement(Field f, int[] t) {
-        super(f);
-        if (t.length != 10)
-            throw new IllegalArgumentException("Invalid radix-2^51 representation");
-        this.t = t;
-    }
-
-    private static final byte[] ZERO = new byte[32];
-
-    /**
-     * Gets a value indicating whether or not the field element is non-zero.
-     *
-     * @return 1 if it is non-zero, 0 otherwise.
-     */
-    public boolean isNonZero() {
-        final byte[] s = toByteArray();
-        return Utils.equal(s, ZERO) == 0;
-    }
-
-    /**
-     * $h = f + g$
-     * <p>
-     * TODO-CR BR: $h$ is allocated via new, probably not a good idea. Do we need the copying into temp variables if we do that?
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|f|$ bounded by $1.1*2^{25},1.1*2^{24},1.1*2^{25},1.1*2^{24},$ etc.
-     * <li>$|g|$ bounded by $1.1*2^{25},1.1*2^{24},1.1*2^{25},1.1*2^{24},$ etc.
-     * </ul><p>
-     * Postconditions:
-     * </p><ul>
-     * <li>$|h|$ bounded by $1.1*2^{26},1.1*2^{25},1.1*2^{26},1.1*2^{25},$ etc.
-     * </ul>
-     *
-     * @param val The field element to add.
-     * @return The field element this + val.
-     */
-    public FieldElement add(FieldElement val) {
-        int[] g = ((Ed25519FieldElement)val).t;
-        int[] h = new int[10];
-        for (int i = 0; i < 10; i++) {
-            h[i] = t[i] + g[i];
-        }
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * $h = f - g$
-     * <p>
-     * Can overlap $h$ with $f$ or $g$.
-     * <p>
-     * TODO-CR BR: See above.
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|f|$ bounded by $1.1*2^{25},1.1*2^{24},1.1*2^{25},1.1*2^{24},$ etc.
-     * <li>$|g|$ bounded by $1.1*2^{25},1.1*2^{24},1.1*2^{25},1.1*2^{24},$ etc.
-     * </ul><p>
-     * Postconditions:
-     * </p><ul>
-     * <li>$|h|$ bounded by $1.1*2^{26},1.1*2^{25},1.1*2^{26},1.1*2^{25},$ etc.
-     * </ul>
-     *
-     * @param val The field element to subtract.
-     * @return The field element this - val.
-     **/
-    public FieldElement subtract(FieldElement val) {
-        int[] g = ((Ed25519FieldElement)val).t;
-        int[] h = new int[10];
-        for (int i = 0; i < 10; i++) {
-            h[i] = t[i] - g[i];
-        }
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * $h = -f$
-     * <p>
-     * TODO-CR BR: see above.
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|f|$ bounded by $1.1*2^{25},1.1*2^{24},1.1*2^{25},1.1*2^{24},$ etc.
-     * </ul><p>
-     * Postconditions:
-     * </p><ul>
-     * <li>$|h|$ bounded by $1.1*2^{25},1.1*2^{24},1.1*2^{25},1.1*2^{24},$ etc.
-     * </ul>
-     *
-     * @return The field element (-1) * this.
-     */
-    public FieldElement negate() {
-        int[] h = new int[10];
-        for (int i = 0; i < 10; i++) {
-            h[i] = - t[i];
-        }
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * $h = f * g$
-     * <p>
-     * Can overlap $h$ with $f$ or $g$.
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|f|$ bounded by
-     * $1.65*2^{26},1.65*2^{25},1.65*2^{26},1.65*2^{25},$ etc.
-     * <li>$|g|$ bounded by
-     * $1.65*2^{26},1.65*2^{25},1.65*2^{26},1.65*2^{25},$ etc.
-     * </ul><p>
-     * Postconditions:
-     * </p><ul>
-     * <li>$|h|$ bounded by
-     * $1.01*2^{25},1.01*2^{24},1.01*2^{25},1.01*2^{24},$ etc.
-     * </ul><p>
-     * Notes on implementation strategy:
-     * <p>
-     * Using schoolbook multiplication. Karatsuba would save a little in some
-     * cost models.
-     * <p>
-     * Most multiplications by 2 and 19 are 32-bit precomputations; cheaper than
-     * 64-bit postcomputations.
-     * <p>
-     * There is one remaining multiplication by 19 in the carry chain; one *19
-     * precomputation can be merged into this, but the resulting data flow is
-     * considerably less clean.
-     * <p>
-     * There are 12 carries below. 10 of them are 2-way parallelizable and
-     * vectorizable. Can get away with 11 carries, but then data flow is much
-     * deeper.
-     * <p>
-     * With tighter constraints on inputs can squeeze carries into int32.
-     *
-     * @param val The field element to multiply.
-     * @return The (reasonably reduced) field element this * val.
-     */
-    public FieldElement multiply(FieldElement val) {
-        int[] g = ((Ed25519FieldElement)val).t;
-        int g1_19 = 19 * g[1]; /* 1.959375*2^29 */
-        int g2_19 = 19 * g[2]; /* 1.959375*2^30; still ok */
-        int g3_19 = 19 * g[3];
-        int g4_19 = 19 * g[4];
-        int g5_19 = 19 * g[5];
-        int g6_19 = 19 * g[6];
-        int g7_19 = 19 * g[7];
-        int g8_19 = 19 * g[8];
-        int g9_19 = 19 * g[9];
-        int f1_2 = 2 * t[1];
-        int f3_2 = 2 * t[3];
-        int f5_2 = 2 * t[5];
-        int f7_2 = 2 * t[7];
-        int f9_2 = 2 * t[9];
-        long f0g0    = t[0] * (long) g[0];
-        long f0g1    = t[0] * (long) g[1];
-        long f0g2    = t[0] * (long) g[2];
-        long f0g3    = t[0] * (long) g[3];
-        long f0g4    = t[0] * (long) g[4];
-        long f0g5    = t[0] * (long) g[5];
-        long f0g6    = t[0] * (long) g[6];
-        long f0g7    = t[0] * (long) g[7];
-        long f0g8    = t[0] * (long) g[8];
-        long f0g9    = t[0] * (long) g[9];
-        long f1g0    = t[1] * (long) g[0];
-        long f1g1_2  = f1_2 * (long) g[1];
-        long f1g2    = t[1] * (long) g[2];
-        long f1g3_2  = f1_2 * (long) g[3];
-        long f1g4    = t[1] * (long) g[4];
-        long f1g5_2  = f1_2 * (long) g[5];
-        long f1g6    = t[1] * (long) g[6];
-        long f1g7_2  = f1_2 * (long) g[7];
-        long f1g8    = t[1] * (long) g[8];
-        long f1g9_38 = f1_2 * (long) g9_19;
-        long f2g0    = t[2] * (long) g[0];
-        long f2g1    = t[2] * (long) g[1];
-        long f2g2    = t[2] * (long) g[2];
-        long f2g3    = t[2] * (long) g[3];
-        long f2g4    = t[2] * (long) g[4];
-        long f2g5    = t[2] * (long) g[5];
-        long f2g6    = t[2] * (long) g[6];
-        long f2g7    = t[2] * (long) g[7];
-        long f2g8_19 = t[2] * (long) g8_19;
-        long f2g9_19 = t[2] * (long) g9_19;
-        long f3g0    = t[3] * (long) g[0];
-        long f3g1_2  = f3_2 * (long) g[1];
-        long f3g2    = t[3] * (long) g[2];
-        long f3g3_2  = f3_2 * (long) g[3];
-        long f3g4    = t[3] * (long) g[4];
-        long f3g5_2  = f3_2 * (long) g[5];
-        long f3g6    = t[3] * (long) g[6];
-        long f3g7_38 = f3_2 * (long) g7_19;
-        long f3g8_19 = t[3] * (long) g8_19;
-        long f3g9_38 = f3_2 * (long) g9_19;
-        long f4g0    = t[4] * (long) g[0];
-        long f4g1    = t[4] * (long) g[1];
-        long f4g2    = t[4] * (long) g[2];
-        long f4g3    = t[4] * (long) g[3];
-        long f4g4    = t[4] * (long) g[4];
-        long f4g5    = t[4] * (long) g[5];
-        long f4g6_19 = t[4] * (long) g6_19;
-        long f4g7_19 = t[4] * (long) g7_19;
-        long f4g8_19 = t[4] * (long) g8_19;
-        long f4g9_19 = t[4] * (long) g9_19;
-        long f5g0    = t[5] * (long) g[0];
-        long f5g1_2  = f5_2 * (long) g[1];
-        long f5g2    = t[5] * (long) g[2];
-        long f5g3_2  = f5_2 * (long) g[3];
-        long f5g4    = t[5] * (long) g[4];
-        long f5g5_38 = f5_2 * (long) g5_19;
-        long f5g6_19 = t[5] * (long) g6_19;
-        long f5g7_38 = f5_2 * (long) g7_19;
-        long f5g8_19 = t[5] * (long) g8_19;
-        long f5g9_38 = f5_2 * (long) g9_19;
-        long f6g0    = t[6] * (long) g[0];
-        long f6g1    = t[6] * (long) g[1];
-        long f6g2    = t[6] * (long) g[2];
-        long f6g3    = t[6] * (long) g[3];
-        long f6g4_19 = t[6] * (long) g4_19;
-        long f6g5_19 = t[6] * (long) g5_19;
-        long f6g6_19 = t[6] * (long) g6_19;
-        long f6g7_19 = t[6] * (long) g7_19;
-        long f6g8_19 = t[6] * (long) g8_19;
-        long f6g9_19 = t[6] * (long) g9_19;
-        long f7g0    = t[7] * (long) g[0];
-        long f7g1_2  = f7_2 * (long) g[1];
-        long f7g2    = t[7] * (long) g[2];
-        long f7g3_38 = f7_2 * (long) g3_19;
-        long f7g4_19 = t[7] * (long) g4_19;
-        long f7g5_38 = f7_2 * (long) g5_19;
-        long f7g6_19 = t[7] * (long) g6_19;
-        long f7g7_38 = f7_2 * (long) g7_19;
-        long f7g8_19 = t[7] * (long) g8_19;
-        long f7g9_38 = f7_2 * (long) g9_19;
-        long f8g0    = t[8] * (long) g[0];
-        long f8g1    = t[8] * (long) g[1];
-        long f8g2_19 = t[8] * (long) g2_19;
-        long f8g3_19 = t[8] * (long) g3_19;
-        long f8g4_19 = t[8] * (long) g4_19;
-        long f8g5_19 = t[8] * (long) g5_19;
-        long f8g6_19 = t[8] * (long) g6_19;
-        long f8g7_19 = t[8] * (long) g7_19;
-        long f8g8_19 = t[8] * (long) g8_19;
-        long f8g9_19 = t[8] * (long) g9_19;
-        long f9g0    = t[9] * (long) g[0];
-        long f9g1_38 = f9_2 * (long) g1_19;
-        long f9g2_19 = t[9] * (long) g2_19;
-        long f9g3_38 = f9_2 * (long) g3_19;
-        long f9g4_19 = t[9] * (long) g4_19;
-        long f9g5_38 = f9_2 * (long) g5_19;
-        long f9g6_19 = t[9] * (long) g6_19;
-        long f9g7_38 = f9_2 * (long) g7_19;
-        long f9g8_19 = t[9] * (long) g8_19;
-        long f9g9_38 = f9_2 * (long) g9_19;
-
-        /**
-         * Remember: 2^255 congruent 19 modulo p.
-         * h = h0 * 2^0 + h1 * 2^26 + h2 * 2^(26+25) + h3 * 2^(26+25+26) + ... + h9 * 2^(5*26+5*25).
-         * So to get the real number we would have to multiply the coefficients with the corresponding powers of 2.
-         * To get an idea what is going on below, look at the calculation of h0:
-         * h0 is the coefficient to the power 2^0 so it collects (sums) all products that have the power 2^0.
-         * f0 * g0 really is f0 * 2^0 * g0 * 2^0 = (f0 * g0) * 2^0.
-         * f1 * g9 really is f1 * 2^26 * g9 * 2^230 = f1 * g9 * 2^256 = 2 * f1 * g9 * 2^255 congruent 2 * 19 * f1 * g9 * 2^0 modulo p.
-         * f2 * g8 really is f2 * 2^51 * g8 * 2^204 = f2 * g8 * 2^255 congruent 19 * f2 * g8 * 2^0 modulo p.
-         * and so on...
-         */
-        long h0 = f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38;
-        long h1 = f0g1 + f1g0    + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19;
-        long h2 = f0g2 + f1g1_2  + f2g0    + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38;
-        long h3 = f0g3 + f1g2    + f2g1    + f3g0    + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19;
-        long h4 = f0g4 + f1g3_2  + f2g2    + f3g1_2  + f4g0    + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38;
-        long h5 = f0g5 + f1g4    + f2g3    + f3g2    + f4g1    + f5g0    + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19;
-        long h6 = f0g6 + f1g5_2  + f2g4    + f3g3_2  + f4g2    + f5g1_2  + f6g0    + f7g9_38 + f8g8_19 + f9g7_38;
-        long h7 = f0g7 + f1g6    + f2g5    + f3g4    + f4g3    + f5g2    + f6g1    + f7g0    + f8g9_19 + f9g8_19;
-        long h8 = f0g8 + f1g7_2  + f2g6    + f3g5_2  + f4g4    + f5g3_2  + f6g2    + f7g1_2  + f8g0    + f9g9_38;
-        long h9 = f0g9 + f1g8    + f2g7    + f3g6    + f4g5    + f5g4    + f6g3    + f7g2    + f8g1    + f9g0;
-        long carry0;
-        long carry1;
-        long carry2;
-        long carry3;
-        long carry4;
-        long carry5;
-        long carry6;
-        long carry7;
-        long carry8;
-        long carry9;
-
-        /*
-        |h0| <= (1.65*1.65*2^52*(1+19+19+19+19)+1.65*1.65*2^50*(38+38+38+38+38))
-          i.e. |h0| <= 1.4*2^60; narrower ranges for h2, h4, h6, h8
-        |h1| <= (1.65*1.65*2^51*(1+1+19+19+19+19+19+19+19+19))
-          i.e. |h1| <= 1.7*2^59; narrower ranges for h3, h5, h7, h9
-        */
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-        /* |h0| <= 2^25 */
-        /* |h4| <= 2^25 */
-        /* |h1| <= 1.71*2^59 */
-        /* |h5| <= 1.71*2^59 */
-
-        carry1 = (h1 + (long) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25;
-        carry5 = (h5 + (long) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25;
-        /* |h1| <= 2^24; from now on fits into int32 */
-        /* |h5| <= 2^24; from now on fits into int32 */
-        /* |h2| <= 1.41*2^60 */
-        /* |h6| <= 1.41*2^60 */
-
-        carry2 = (h2 + (long) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26;
-        carry6 = (h6 + (long) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
-        /* |h2| <= 2^25; from now on fits into int32 unchanged */
-        /* |h6| <= 2^25; from now on fits into int32 unchanged */
-        /* |h3| <= 1.71*2^59 */
-        /* |h7| <= 1.71*2^59 */
-
-        carry3 = (h3 + (long) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25;
-        carry7 = (h7 + (long) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25;
-        /* |h3| <= 2^24; from now on fits into int32 unchanged */
-        /* |h7| <= 2^24; from now on fits into int32 unchanged */
-        /* |h4| <= 1.72*2^34 */
-        /* |h8| <= 1.41*2^60 */
-
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-        carry8 = (h8 + (long) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26;
-        /* |h4| <= 2^25; from now on fits into int32 unchanged */
-        /* |h8| <= 2^25; from now on fits into int32 unchanged */
-        /* |h5| <= 1.01*2^24 */
-        /* |h9| <= 1.71*2^59 */
-
-        carry9 = (h9 + (long) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25;
-        /* |h9| <= 2^24; from now on fits into int32 unchanged */
-        /* |h0| <= 1.1*2^39 */
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-        /* |h0| <= 2^25; from now on fits into int32 unchanged */
-        /* |h1| <= 1.01*2^24 */
-
-        int[] h = new int[10];
-        h[0] = (int) h0;
-        h[1] = (int) h1;
-        h[2] = (int) h2;
-        h[3] = (int) h3;
-        h[4] = (int) h4;
-        h[5] = (int) h5;
-        h[6] = (int) h6;
-        h[7] = (int) h7;
-        h[8] = (int) h8;
-        h[9] = (int) h9;
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * $h = f * f$
-     * <p>
-     * Can overlap $h$ with $f$.
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|f|$ bounded by $1.65*2^{26},1.65*2^{25},1.65*2^{26},1.65*2^{25},$ etc.
-     * </ul><p>
-     * Postconditions:
-     * </p><ul>
-     * <li>$|h|$ bounded by $1.01*2^{25},1.01*2^{24},1.01*2^{25},1.01*2^{24},$ etc.
-     * </ul><p>
-     * See {@link #multiply(FieldElement)} for discussion
-     * of implementation strategy.
-     *
-     * @return The (reasonably reduced) square of this field element.
-     */
-    public FieldElement square() {
-        int f0 = t[0];
-        int f1 = t[1];
-        int f2 = t[2];
-        int f3 = t[3];
-        int f4 = t[4];
-        int f5 = t[5];
-        int f6 = t[6];
-        int f7 = t[7];
-        int f8 = t[8];
-        int f9 = t[9];
-        int f0_2 = 2 * f0;
-        int f1_2 = 2 * f1;
-        int f2_2 = 2 * f2;
-        int f3_2 = 2 * f3;
-        int f4_2 = 2 * f4;
-        int f5_2 = 2 * f5;
-        int f6_2 = 2 * f6;
-        int f7_2 = 2 * f7;
-        int f5_38 = 38 * f5; /* 1.959375*2^30 */
-        int f6_19 = 19 * f6; /* 1.959375*2^30 */
-        int f7_38 = 38 * f7; /* 1.959375*2^30 */
-        int f8_19 = 19 * f8; /* 1.959375*2^30 */
-        int f9_38 = 38 * f9; /* 1.959375*2^30 */
-        long f0f0    = f0   * (long) f0;
-        long f0f1_2  = f0_2 * (long) f1;
-        long f0f2_2  = f0_2 * (long) f2;
-        long f0f3_2  = f0_2 * (long) f3;
-        long f0f4_2  = f0_2 * (long) f4;
-        long f0f5_2  = f0_2 * (long) f5;
-        long f0f6_2  = f0_2 * (long) f6;
-        long f0f7_2  = f0_2 * (long) f7;
-        long f0f8_2  = f0_2 * (long) f8;
-        long f0f9_2  = f0_2 * (long) f9;
-        long f1f1_2  = f1_2 * (long) f1;
-        long f1f2_2  = f1_2 * (long) f2;
-        long f1f3_4  = f1_2 * (long) f3_2;
-        long f1f4_2  = f1_2 * (long) f4;
-        long f1f5_4  = f1_2 * (long) f5_2;
-        long f1f6_2  = f1_2 * (long) f6;
-        long f1f7_4  = f1_2 * (long) f7_2;
-        long f1f8_2  = f1_2 * (long) f8;
-        long f1f9_76 = f1_2 * (long) f9_38;
-        long f2f2    = f2   * (long) f2;
-        long f2f3_2  = f2_2 * (long) f3;
-        long f2f4_2  = f2_2 * (long) f4;
-        long f2f5_2  = f2_2 * (long) f5;
-        long f2f6_2  = f2_2 * (long) f6;
-        long f2f7_2  = f2_2 * (long) f7;
-        long f2f8_38 = f2_2 * (long) f8_19;
-        long f2f9_38 = f2   * (long) f9_38;
-        long f3f3_2  = f3_2 * (long) f3;
-        long f3f4_2  = f3_2 * (long) f4;
-        long f3f5_4  = f3_2 * (long) f5_2;
-        long f3f6_2  = f3_2 * (long) f6;
-        long f3f7_76 = f3_2 * (long) f7_38;
-        long f3f8_38 = f3_2 * (long) f8_19;
-        long f3f9_76 = f3_2 * (long) f9_38;
-        long f4f4    = f4   * (long) f4;
-        long f4f5_2  = f4_2 * (long) f5;
-        long f4f6_38 = f4_2 * (long) f6_19;
-        long f4f7_38 = f4   * (long) f7_38;
-        long f4f8_38 = f4_2 * (long) f8_19;
-        long f4f9_38 = f4   * (long) f9_38;
-        long f5f5_38 = f5   * (long) f5_38;
-        long f5f6_38 = f5_2 * (long) f6_19;
-        long f5f7_76 = f5_2 * (long) f7_38;
-        long f5f8_38 = f5_2 * (long) f8_19;
-        long f5f9_76 = f5_2 * (long) f9_38;
-        long f6f6_19 = f6   * (long) f6_19;
-        long f6f7_38 = f6   * (long) f7_38;
-        long f6f8_38 = f6_2 * (long) f8_19;
-        long f6f9_38 = f6   * (long) f9_38;
-        long f7f7_38 = f7   * (long) f7_38;
-        long f7f8_38 = f7_2 * (long) f8_19;
-        long f7f9_76 = f7_2 * (long) f9_38;
-        long f8f8_19 = f8   * (long) f8_19;
-        long f8f9_38 = f8   * (long) f9_38;
-        long f9f9_38 = f9   * (long) f9_38;
-
-        /**
-         * Same procedure as in multiply, but this time we have a higher symmetry leading to less summands.
-         * e.g. f1f9_76 really stands for f1 * 2^26 * f9 * 2^230 + f9 * 2^230 + f1 * 2^26 congruent 2 * 2 * 19 * f1 * f9  2^0 modulo p.
-         */
-        long h0 = f0f0   + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
-        long h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
-        long h2 = f0f2_2 + f1f1_2  + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
-        long h3 = f0f3_2 + f1f2_2  + f4f9_38 + f5f8_38 + f6f7_38;
-        long h4 = f0f4_2 + f1f3_4  + f2f2    + f5f9_76 + f6f8_38 + f7f7_38;
-        long h5 = f0f5_2 + f1f4_2  + f2f3_2  + f6f9_38 + f7f8_38;
-        long h6 = f0f6_2 + f1f5_4  + f2f4_2  + f3f3_2  + f7f9_76 + f8f8_19;
-        long h7 = f0f7_2 + f1f6_2  + f2f5_2  + f3f4_2  + f8f9_38;
-        long h8 = f0f8_2 + f1f7_4  + f2f6_2  + f3f5_4  + f4f4    + f9f9_38;
-        long h9 = f0f9_2 + f1f8_2  + f2f7_2  + f3f6_2  + f4f5_2;
-        long carry0;
-        long carry1;
-        long carry2;
-        long carry3;
-        long carry4;
-        long carry5;
-        long carry6;
-        long carry7;
-        long carry8;
-        long carry9;
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-
-        carry1 = (h1 + (long) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25;
-        carry5 = (h5 + (long) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25;
-
-        carry2 = (h2 + (long) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26;
-        carry6 = (h6 + (long) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
-
-        carry3 = (h3 + (long) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25;
-        carry7 = (h7 + (long) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25;
-
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-        carry8 = (h8 + (long) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26;
-
-        carry9 = (h9 + (long) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25;
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-
-        int[] h = new int[10];
-        h[0] = (int) h0;
-        h[1] = (int) h1;
-        h[2] = (int) h2;
-        h[3] = (int) h3;
-        h[4] = (int) h4;
-        h[5] = (int) h5;
-        h[6] = (int) h6;
-        h[7] = (int) h7;
-        h[8] = (int) h8;
-        h[9] = (int) h9;
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * $h = 2 * f * f$
-     * <p>
-     * Can overlap $h$ with $f$.
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|f|$ bounded by $1.65*2^{26},1.65*2^{25},1.65*2^{26},1.65*2^{25},$ etc.
-     * </ul><p>
-     * Postconditions:
-     * </p><ul>
-     * <li>$|h|$ bounded by $1.01*2^{25},1.01*2^{24},1.01*2^{25},1.01*2^{24},$ etc.
-     * </ul><p>
-     * See {@link #multiply(FieldElement)} for discussion
-     * of implementation strategy.
-     *
-     * @return The (reasonably reduced) square of this field element times 2.
-     */
-    public FieldElement squareAndDouble() {
-        int f0 = t[0];
-        int f1 = t[1];
-        int f2 = t[2];
-        int f3 = t[3];
-        int f4 = t[4];
-        int f5 = t[5];
-        int f6 = t[6];
-        int f7 = t[7];
-        int f8 = t[8];
-        int f9 = t[9];
-        int f0_2 = 2 * f0;
-        int f1_2 = 2 * f1;
-        int f2_2 = 2 * f2;
-        int f3_2 = 2 * f3;
-        int f4_2 = 2 * f4;
-        int f5_2 = 2 * f5;
-        int f6_2 = 2 * f6;
-        int f7_2 = 2 * f7;
-        int f5_38 = 38 * f5; /* 1.959375*2^30 */
-        int f6_19 = 19 * f6; /* 1.959375*2^30 */
-        int f7_38 = 38 * f7; /* 1.959375*2^30 */
-        int f8_19 = 19 * f8; /* 1.959375*2^30 */
-        int f9_38 = 38 * f9; /* 1.959375*2^30 */
-        long f0f0    = f0   * (long) f0;
-        long f0f1_2  = f0_2 * (long) f1;
-        long f0f2_2  = f0_2 * (long) f2;
-        long f0f3_2  = f0_2 * (long) f3;
-        long f0f4_2  = f0_2 * (long) f4;
-        long f0f5_2  = f0_2 * (long) f5;
-        long f0f6_2  = f0_2 * (long) f6;
-        long f0f7_2  = f0_2 * (long) f7;
-        long f0f8_2  = f0_2 * (long) f8;
-        long f0f9_2  = f0_2 * (long) f9;
-        long f1f1_2  = f1_2 * (long) f1;
-        long f1f2_2  = f1_2 * (long) f2;
-        long f1f3_4  = f1_2 * (long) f3_2;
-        long f1f4_2  = f1_2 * (long) f4;
-        long f1f5_4  = f1_2 * (long) f5_2;
-        long f1f6_2  = f1_2 * (long) f6;
-        long f1f7_4  = f1_2 * (long) f7_2;
-        long f1f8_2  = f1_2 * (long) f8;
-        long f1f9_76 = f1_2 * (long) f9_38;
-        long f2f2    = f2   * (long) f2;
-        long f2f3_2  = f2_2 * (long) f3;
-        long f2f4_2  = f2_2 * (long) f4;
-        long f2f5_2  = f2_2 * (long) f5;
-        long f2f6_2  = f2_2 * (long) f6;
-        long f2f7_2  = f2_2 * (long) f7;
-        long f2f8_38 = f2_2 * (long) f8_19;
-        long f2f9_38 = f2   * (long) f9_38;
-        long f3f3_2  = f3_2 * (long) f3;
-        long f3f4_2  = f3_2 * (long) f4;
-        long f3f5_4  = f3_2 * (long) f5_2;
-        long f3f6_2  = f3_2 * (long) f6;
-        long f3f7_76 = f3_2 * (long) f7_38;
-        long f3f8_38 = f3_2 * (long) f8_19;
-        long f3f9_76 = f3_2 * (long) f9_38;
-        long f4f4    = f4   * (long) f4;
-        long f4f5_2  = f4_2 * (long) f5;
-        long f4f6_38 = f4_2 * (long) f6_19;
-        long f4f7_38 = f4   * (long) f7_38;
-        long f4f8_38 = f4_2 * (long) f8_19;
-        long f4f9_38 = f4   * (long) f9_38;
-        long f5f5_38 = f5   * (long) f5_38;
-        long f5f6_38 = f5_2 * (long) f6_19;
-        long f5f7_76 = f5_2 * (long) f7_38;
-        long f5f8_38 = f5_2 * (long) f8_19;
-        long f5f9_76 = f5_2 * (long) f9_38;
-        long f6f6_19 = f6   * (long) f6_19;
-        long f6f7_38 = f6   * (long) f7_38;
-        long f6f8_38 = f6_2 * (long) f8_19;
-        long f6f9_38 = f6   * (long) f9_38;
-        long f7f7_38 = f7   * (long) f7_38;
-        long f7f8_38 = f7_2 * (long) f8_19;
-        long f7f9_76 = f7_2 * (long) f9_38;
-        long f8f8_19 = f8   * (long) f8_19;
-        long f8f9_38 = f8   * (long) f9_38;
-        long f9f9_38 = f9   * (long) f9_38;
-        long h0 = f0f0   + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38;
-        long h1 = f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38;
-        long h2 = f0f2_2 + f1f1_2  + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19;
-        long h3 = f0f3_2 + f1f2_2  + f4f9_38 + f5f8_38 + f6f7_38;
-        long h4 = f0f4_2 + f1f3_4  + f2f2    + f5f9_76 + f6f8_38 + f7f7_38;
-        long h5 = f0f5_2 + f1f4_2  + f2f3_2  + f6f9_38 + f7f8_38;
-        long h6 = f0f6_2 + f1f5_4  + f2f4_2  + f3f3_2  + f7f9_76 + f8f8_19;
-        long h7 = f0f7_2 + f1f6_2  + f2f5_2  + f3f4_2  + f8f9_38;
-        long h8 = f0f8_2 + f1f7_4  + f2f6_2  + f3f5_4  + f4f4    + f9f9_38;
-        long h9 = f0f9_2 + f1f8_2  + f2f7_2  + f3f6_2  + f4f5_2;
-        long carry0;
-        long carry1;
-        long carry2;
-        long carry3;
-        long carry4;
-        long carry5;
-        long carry6;
-        long carry7;
-        long carry8;
-        long carry9;
-
-        h0 += h0;
-        h1 += h1;
-        h2 += h2;
-        h3 += h3;
-        h4 += h4;
-        h5 += h5;
-        h6 += h6;
-        h7 += h7;
-        h8 += h8;
-        h9 += h9;
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-
-        carry1 = (h1 + (long) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25;
-        carry5 = (h5 + (long) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25;
-
-        carry2 = (h2 + (long) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26;
-        carry6 = (h6 + (long) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
-
-        carry3 = (h3 + (long) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25;
-        carry7 = (h7 + (long) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25;
-
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-        carry8 = (h8 + (long) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26;
-
-        carry9 = (h9 + (long) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25;
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-
-        int[] h = new int[10];
-        h[0] = (int) h0;
-        h[1] = (int) h1;
-        h[2] = (int) h2;
-        h[3] = (int) h3;
-        h[4] = (int) h4;
-        h[5] = (int) h5;
-        h[6] = (int) h6;
-        h[7] = (int) h7;
-        h[8] = (int) h8;
-        h[9] = (int) h9;
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * Invert this field element.
-     * <p>
-     * The inverse is found via Fermat's little theorem:<br>
-     * $a^p \cong a \mod p$ and therefore $a^{(p-2)} \cong a^{-1} \mod p$
-     *
-     * @return The inverse of this field element.
-     */
-    public FieldElement invert() {
-        FieldElement t0, t1, t2, t3;
-
-        // 2 == 2 * 1
-        t0 = square();
-
-        // 4 == 2 * 2
-        t1 = t0.square();
-
-        // 8 == 2 * 4
-        t1 = t1.square();
-
-        // 9 == 8 + 1
-        t1 = multiply(t1);
-
-        // 11 == 9 + 2
-        t0 = t0.multiply(t1);
-
-        // 22 == 2 * 11
-        t2 = t0.square();
-
-        // 31 == 22 + 9
-        t1 = t1.multiply(t2);
-
-        // 2^6 - 2^1
-        t2 = t1.square();
-
-        // 2^10 - 2^5
-        for (int i = 1; i < 5; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^10 - 2^0
-        t1 = t2.multiply(t1);
-
-        // 2^11 - 2^1
-        t2 = t1.square();
-
-        // 2^20 - 2^10
-        for (int i = 1; i < 10; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^20 - 2^0
-        t2 = t2.multiply(t1);
-
-        // 2^21 - 2^1
-        t3 = t2.square();
-
-        // 2^40 - 2^20
-        for (int i = 1; i < 20; ++i) {
-            t3 = t3.square();
-        }
-
-        // 2^40 - 2^0
-        t2 = t3.multiply(t2);
-
-        // 2^41 - 2^1
-        t2 = t2.square();
-
-        // 2^50 - 2^10
-        for (int i = 1; i < 10; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^50 - 2^0
-        t1 = t2.multiply(t1);
-
-        // 2^51 - 2^1
-        t2 = t1.square();
-
-        // 2^100 - 2^50
-        for (int i = 1; i < 50; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^100 - 2^0
-        t2 = t2.multiply(t1);
-
-        // 2^101 - 2^1
-        t3 = t2.square();
-
-        // 2^200 - 2^100
-        for (int i = 1; i < 100; ++i) {
-            t3 = t3.square();
-        }
-
-        // 2^200 - 2^0
-        t2 = t3.multiply(t2);
-
-        // 2^201 - 2^1
-        t2 = t2.square();
-
-        // 2^250 - 2^50
-        for (int i = 1; i < 50; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^250 - 2^0
-        t1 = t2.multiply(t1);
-
-        // 2^251 - 2^1
-        t1 = t1.square();
-
-        // 2^255 - 2^5
-        for (int i = 1; i < 5; ++i) {
-            t1 = t1.square();
-        }
-
-        // 2^255 - 21
-        return t1.multiply(t0);
-    }
-
-    /**
-     * Gets this field element to the power of $(2^{252} - 3)$.
-     * This is a helper function for calculating the square root.
-     * <p>
-     * TODO-CR BR: I think it makes sense to have a sqrt function.
-     *
-     * @return This field element to the power of $(2^{252} - 3)$.
-     */
-    public FieldElement pow22523() {
-        FieldElement t0, t1, t2;
-
-        // 2 == 2 * 1
-        t0 = square();
-
-        // 4 == 2 * 2
-        t1 = t0.square();
-
-        // 8 == 2 * 4
-        t1 = t1.square();
-
-        // z9 = z1*z8
-        t1 = multiply(t1);
-
-        // 11 == 9 + 2
-        t0 = t0.multiply(t1);
-
-        // 22 == 2 * 11
-        t0 = t0.square();
-
-        // 31 == 22 + 9
-        t0 = t1.multiply(t0);
-
-        // 2^6 - 2^1
-        t1 = t0.square();
-
-        // 2^10 - 2^5
-        for (int i = 1; i < 5; ++i) {
-            t1 = t1.square();
-        }
-
-        // 2^10 - 2^0
-        t0 = t1.multiply(t0);
-
-        // 2^11 - 2^1
-        t1 = t0.square();
-
-        // 2^20 - 2^10
-        for (int i = 1; i < 10; ++i) {
-            t1 = t1.square();
-        }
-
-        // 2^20 - 2^0
-        t1 = t1.multiply(t0);
-
-        // 2^21 - 2^1
-        t2 = t1.square();
-
-        // 2^40 - 2^20
-        for (int i = 1; i < 20; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^40 - 2^0
-        t1 = t2.multiply(t1);
-
-        // 2^41 - 2^1
-        t1 = t1.square();
-
-        // 2^50 - 2^10
-        for (int i = 1; i < 10; ++i) {
-            t1 = t1.square();
-        }
-
-        // 2^50 - 2^0
-        t0 = t1.multiply(t0);
-
-        // 2^51 - 2^1
-        t1 = t0.square();
-
-        // 2^100 - 2^50
-        for (int i = 1; i < 50; ++i) {
-            t1 = t1.square();
-        }
-
-        // 2^100 - 2^0
-        t1 = t1.multiply(t0);
-
-        // 2^101 - 2^1
-        t2 = t1.square();
-
-        // 2^200 - 2^100
-        for (int i = 1; i < 100; ++i) {
-            t2 = t2.square();
-        }
-
-        // 2^200 - 2^0
-        t1 = t2.multiply(t1);
-
-        // 2^201 - 2^1
-        t1 = t1.square();
-
-        // 2^250 - 2^50
-        for (int i = 1; i < 50; ++i) {
-            t1 = t1.square();
-        }
-
-        // 2^250 - 2^0
-        t0 = t1.multiply(t0);
-
-        // 2^251 - 2^1
-        t0 = t0.square();
-
-        // 2^252 - 2^2
-        t0 = t0.square();
-
-        // 2^252 - 3
-        return multiply(t0);
-    }
-
-    /**
-     * Constant-time conditional move. Well, actually it is a conditional copy.
-     * Logic is inspired by the SUPERCOP implementation at:
-     *   https://github.com/floodyberry/supercop/blob/master/crypto_sign/ed25519/ref10/fe_cmov.c
-     *
-     * @param val the other field element.
-     * @param b must be 0 or 1, otherwise results are undefined.
-     * @return a copy of this if $b == 0$, or a copy of val if $b == 1$.
-     */
-    @Override
-    public FieldElement cmov(FieldElement val, int b) {
-        Ed25519FieldElement that = (Ed25519FieldElement) val;
-        b = -b;
-        int[] result = new int[10];
-        for (int i = 0; i < 10; i++) {
-            result[i] = this.t[i];
-            int x = this.t[i] ^ that.t[i];
-            x &= b;
-            result[i] ^= x;
-        }
-        return new Ed25519FieldElement(this.f, result);
-    }
-
-    @Override
-    public int hashCode() {
-        return Arrays.hashCode(t);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof Ed25519FieldElement))
-            return false;
-        Ed25519FieldElement fe = (Ed25519FieldElement) obj;
-        return 1==Utils.equal(toByteArray(), fe.toByteArray());
-    }
-
-    @Override
-    public String toString() {
-        return "[Ed25519FieldElement val="+Utils.bytesToHex(toByteArray())+"]";
-    }
-}

+ 0 - 256
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java

@@ -1,256 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math.ed25519;
-
-import com.fuzamei.eddsa.math.*;
-
-/**
- * Helper class for encoding/decoding from/to the 32 byte representation.
- * <p>
- * Reviewed/commented by Bloody Rookie (nemproject@gmx.de)
- */
-public class Ed25519LittleEndianEncoding extends Encoding {
-    /**
-     * Encodes a given field element in its 32 byte representation. This is done in two steps:
-     * <ol>
-     * <li>Reduce the value of the field element modulo $p$.
-     * <li>Convert the field element to the 32 byte representation.
-     * </ol><p>
-     * The idea for the modulo $p$ reduction algorithm is as follows:
-     * </p>
-     * <h2>Assumption:</h2>
-     * <ul>
-     * <li>$p = 2^{255} - 19$
-     * <li>$h = h_0 + 2^{25} * h_1 + 2^{(26+25)} * h_2 + \dots + 2^{230} * h_9$ where $0 \le |h_i| \lt 2^{27}$ for all $i=0,\dots,9$.
-     * <li>$h \cong r \mod p$, i.e. $h = r + q * p$ for some suitable $0 \le r \lt p$ and an integer $q$.
-     * </ul><p>
-     * Then $q = [2^{-255} * (h + 19 * 2^{-25} * h_9 + 1/2)]$ where $[x] = floor(x)$.
-     * </p>
-     * <h2>Proof:</h2>
-     * <p>
-     * We begin with some very raw estimation for the bounds of some expressions:
-     * <p>
-     * $$
-     * \begin{equation}
-     * |h| \lt 2^{230} * 2^{30} = 2^{260} \Rightarrow |r + q * p| \lt 2^{260} \Rightarrow |q| \lt 2^{10}. \\
-     * \Rightarrow -1/4 \le a := 19^2 * 2^{-255} * q \lt 1/4. \\
-     * |h - 2^{230} * h_9| = |h_0 + \dots + 2^{204} * h_8| \lt 2^{204} * 2^{30} = 2^{234}. \\
-     * \Rightarrow -1/4 \le b := 19 * 2^{-255} * (h - 2^{230} * h_9) \lt 1/4
-     * \end{equation}
-     * $$
-     * <p>
-     * Therefore $0 \lt 1/2 - a - b \lt 1$.
-     * <p>
-     * Set $x := r + 19 * 2^{-255} * r + 1/2 - a - b$. Then:
-     * <p>
-     * $$
-     * 0 \le x \lt 255 - 20 + 19 + 1 = 2^{255} \\
-     * \Rightarrow 0 \le 2^{-255} * x \lt 1.
-     * $$
-     * <p>
-     * Since $q$ is an integer we have
-     * <p>
-     * $$
-     * [q + 2^{-255} * x] = q \quad (1)
-     * $$
-     * <p>
-     * Have a closer look at $x$:
-     * <p>
-     * $$
-     * \begin{align}
-     * x &amp;= h - q * (2^{255} - 19) + 19 * 2^{-255} * (h - q * (2^{255} - 19)) + 1/2 - 19^2 * 2^{-255} * q - 19 * 2^{-255} * (h - 2^{230} * h_9) \\
-     *   &amp;= h - q * 2^{255} + 19 * q + 19 * 2^{-255} * h - 19 * q + 19^2 * 2^{-255} * q + 1/2 - 19^2 * 2^{-255} * q - 19 * 2^{-255} * h + 19 * 2^{-25} * h_9 \\
-     *   &amp;= h + 19 * 2^{-25} * h_9 + 1/2 - q^{255}.
-     * \end{align}
-     * $$
-     * <p>
-     * Inserting the expression for $x$ into $(1)$ we get the desired expression for $q$.
-     */
-    public byte[] encode(FieldElement x) {
-        int[] h = ((Ed25519FieldElement)x).t;
-        int h0 = h[0];
-        int h1 = h[1];
-        int h2 = h[2];
-        int h3 = h[3];
-        int h4 = h[4];
-        int h5 = h[5];
-        int h6 = h[6];
-        int h7 = h[7];
-        int h8 = h[8];
-        int h9 = h[9];
-        int q;
-        int carry0;
-        int carry1;
-        int carry2;
-        int carry3;
-        int carry4;
-        int carry5;
-        int carry6;
-        int carry7;
-        int carry8;
-        int carry9;
-
-        // Step 1:
-        // Calculate q
-        q = (19 * h9 + (1 << 24)) >> 25;
-        q = (h0 + q) >> 26;
-        q = (h1 + q) >> 25;
-        q = (h2 + q) >> 26;
-        q = (h3 + q) >> 25;
-        q = (h4 + q) >> 26;
-        q = (h5 + q) >> 25;
-        q = (h6 + q) >> 26;
-        q = (h7 + q) >> 25;
-        q = (h8 + q) >> 26;
-        q = (h9 + q) >> 25;
-
-        // r = h - q * p = h - 2^255 * q + 19 * q
-        // First add 19 * q then discard the bit 255
-        h0 += 19 * q;
-
-        carry0 = h0 >> 26; h1 += carry0; h0 -= carry0 << 26;
-        carry1 = h1 >> 25; h2 += carry1; h1 -= carry1 << 25;
-        carry2 = h2 >> 26; h3 += carry2; h2 -= carry2 << 26;
-        carry3 = h3 >> 25; h4 += carry3; h3 -= carry3 << 25;
-        carry4 = h4 >> 26; h5 += carry4; h4 -= carry4 << 26;
-        carry5 = h5 >> 25; h6 += carry5; h5 -= carry5 << 25;
-        carry6 = h6 >> 26; h7 += carry6; h6 -= carry6 << 26;
-        carry7 = h7 >> 25; h8 += carry7; h7 -= carry7 << 25;
-        carry8 = h8 >> 26; h9 += carry8; h8 -= carry8 << 26;
-        carry9 = h9 >> 25;               h9 -= carry9 << 25;
-
-        // Step 2 (straight forward conversion):
-        byte[] s = new byte[32];
-        s[0] = (byte) h0;
-        s[1] = (byte) (h0 >> 8);
-        s[2] = (byte) (h0 >> 16);
-        s[3] = (byte) ((h0 >> 24) | (h1 << 2));
-        s[4] = (byte) (h1 >> 6);
-        s[5] = (byte) (h1 >> 14);
-        s[6] = (byte) ((h1 >> 22) | (h2 << 3));
-        s[7] = (byte) (h2 >> 5);
-        s[8] = (byte) (h2 >> 13);
-        s[9] = (byte) ((h2 >> 21) | (h3 << 5));
-        s[10] = (byte) (h3 >> 3);
-        s[11] = (byte) (h3 >> 11);
-        s[12] = (byte) ((h3 >> 19) | (h4 << 6));
-        s[13] = (byte) (h4 >> 2);
-        s[14] = (byte) (h4 >> 10);
-        s[15] = (byte) (h4 >> 18);
-        s[16] = (byte) h5;
-        s[17] = (byte) (h5 >> 8);
-        s[18] = (byte) (h5 >> 16);
-        s[19] = (byte) ((h5 >> 24) | (h6 << 1));
-        s[20] = (byte) (h6 >> 7);
-        s[21] = (byte) (h6 >> 15);
-        s[22] = (byte) ((h6 >> 23) | (h7 << 3));
-        s[23] = (byte) (h7 >> 5);
-        s[24] = (byte) (h7 >> 13);
-        s[25] = (byte) ((h7 >> 21) | (h8 << 4));
-        s[26] = (byte) (h8 >> 4);
-        s[27] = (byte) (h8 >> 12);
-        s[28] = (byte) ((h8 >> 20) | (h9 << 6));
-        s[29] = (byte) (h9 >> 2);
-        s[30] = (byte) (h9 >> 10);
-        s[31] = (byte) (h9 >> 18);
-        return s;
-    }
-
-    static int load_3(byte[] in, int offset) {
-        int result = in[offset++] & 0xff;
-        result |= (in[offset++] & 0xff) << 8;
-        result |= (in[offset] & 0xff) << 16;
-        return result;
-    }
-
-    static long load_4(byte[] in, int offset) {
-        int result = in[offset++] & 0xff;
-        result |= (in[offset++] & 0xff) << 8;
-        result |= (in[offset++] & 0xff) << 16;
-        result |= in[offset] << 24;
-        return ((long)result) & 0xffffffffL;
-    }
-
-    /**
-     * Decodes a given field element in its 10 byte $2^{25.5}$ representation.
-     *
-     * @param in The 32 byte representation.
-     * @return The field element in its $2^{25.5}$ bit representation.
-     */
-    public FieldElement decode(byte[] in) {
-        long h0 = load_4(in, 0);
-        long h1 = load_3(in, 4) << 6;
-        long h2 = load_3(in, 7) << 5;
-        long h3 = load_3(in, 10) << 3;
-        long h4 = load_3(in, 13) << 2;
-        long h5 = load_4(in, 16);
-        long h6 = load_3(in, 20) << 7;
-        long h7 = load_3(in, 23) << 5;
-        long h8 = load_3(in, 26) << 4;
-        long h9 = (load_3(in, 29) & 0x7FFFFF) << 2;
-        long carry0;
-        long carry1;
-        long carry2;
-        long carry3;
-        long carry4;
-        long carry5;
-        long carry6;
-        long carry7;
-        long carry8;
-        long carry9;
-
-        // Remember: 2^255 congruent 19 modulo p
-        carry9 = (h9 + (long) (1<<24)) >> 25; h0 += carry9 * 19; h9 -= carry9 << 25;
-        carry1 = (h1 + (long) (1<<24)) >> 25; h2 += carry1; h1 -= carry1 << 25;
-        carry3 = (h3 + (long) (1<<24)) >> 25; h4 += carry3; h3 -= carry3 << 25;
-        carry5 = (h5 + (long) (1<<24)) >> 25; h6 += carry5; h5 -= carry5 << 25;
-        carry7 = (h7 + (long) (1<<24)) >> 25; h8 += carry7; h7 -= carry7 << 25;
-
-        carry0 = (h0 + (long) (1<<25)) >> 26; h1 += carry0; h0 -= carry0 << 26;
-        carry2 = (h2 + (long) (1<<25)) >> 26; h3 += carry2; h2 -= carry2 << 26;
-        carry4 = (h4 + (long) (1<<25)) >> 26; h5 += carry4; h4 -= carry4 << 26;
-        carry6 = (h6 + (long) (1<<25)) >> 26; h7 += carry6; h6 -= carry6 << 26;
-        carry8 = (h8 + (long) (1<<25)) >> 26; h9 += carry8; h8 -= carry8 << 26;
-
-        int[] h = new int[10];
-        h[0] = (int) h0;
-        h[1] = (int) h1;
-        h[2] = (int) h2;
-        h[3] = (int) h3;
-        h[4] = (int) h4;
-        h[5] = (int) h5;
-        h[6] = (int) h6;
-        h[7] = (int) h7;
-        h[8] = (int) h8;
-        h[9] = (int) h9;
-        return new Ed25519FieldElement(f, h);
-    }
-
-    /**
-     * Is the FieldElement negative in this encoding?
-     * <p>
-     * Return true if $x$ is in $\{1,3,5,\dots,q-2\}$<br>
-     * Return false if $x$ is in $\{0,2,4,\dots,q-1\}$
-     * <p>
-     * Preconditions:
-     * </p><ul>
-     * <li>$|x|$ bounded by $1.1*2^{26},1.1*2^{25},1.1*2^{26},1.1*2^{25}$, etc.
-     * </ul>
-     *
-     * @return true if $x$ is in $\{1,3,5,\dots,q-2\}$, false otherwise.
-     */
-    public boolean isNegative(FieldElement x) {
-        byte[] s = encode(x);
-        return (s[0] & 1) != 0;
-    }
-
-}

+ 0 - 693
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/math/ed25519/Ed25519ScalarOps.java

@@ -1,693 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.math.ed25519;
-
-import com.fuzamei.eddsa.math.ScalarOps;
-import static com.fuzamei.eddsa.math.ed25519.Ed25519LittleEndianEncoding.load_3;
-import static com.fuzamei.eddsa.math.ed25519.Ed25519LittleEndianEncoding.load_4;
-
-/**
- * Class for reducing a huge integer modulo the group order q and
- * doing a combined multiply plus add plus reduce operation.
- * <p>
- * $q = 2^{252} + 27742317777372353535851937790883648493$.
- * <p>
- * Reviewed/commented by Bloody Rookie (nemproject@gmx.de)
- */
-public class Ed25519ScalarOps implements ScalarOps {
-
-    /**
-     * Reduction modulo the group order $q$.
-     * <p>
-     * Input:
-     *   $s[0]+256*s[1]+\dots+256^{63}*s[63] = s$
-     * <p>
-     * Output:
-     *   $s[0]+256*s[1]+\dots+256^{31}*s[31] = s \bmod q$
-     *   where $q = 2^{252} + 27742317777372353535851937790883648493$.
-     */
-    public byte[] reduce(byte[] s) {
-        // s0,..., s22 have 21 bits, s23 has 29 bits
-        long s0 = 0x1FFFFF & load_3(s, 0);
-        long s1 = 0x1FFFFF & (load_4(s, 2) >> 5);
-        long s2 = 0x1FFFFF & (load_3(s, 5) >> 2);
-        long s3 = 0x1FFFFF & (load_4(s, 7) >> 7);
-        long s4 = 0x1FFFFF & (load_4(s, 10) >> 4);
-        long s5 = 0x1FFFFF & (load_3(s, 13) >> 1);
-        long s6 = 0x1FFFFF & (load_4(s, 15) >> 6);
-        long s7 = 0x1FFFFF & (load_3(s, 18) >> 3);
-        long s8 = 0x1FFFFF & load_3(s, 21);
-        long s9 = 0x1FFFFF & (load_4(s, 23) >> 5);
-        long s10 = 0x1FFFFF & (load_3(s, 26) >> 2);
-        long s11 = 0x1FFFFF & (load_4(s, 28) >> 7);
-        long s12 = 0x1FFFFF & (load_4(s, 31) >> 4);
-        long s13 = 0x1FFFFF & (load_3(s, 34) >> 1);
-        long s14 = 0x1FFFFF & (load_4(s, 36) >> 6);
-        long s15 = 0x1FFFFF & (load_3(s, 39) >> 3);
-        long s16 = 0x1FFFFF & load_3(s, 42);
-        long s17 = 0x1FFFFF & (load_4(s, 44) >> 5);
-        long s18 = 0x1FFFFF & (load_3(s, 47) >> 2);
-        long s19 = 0x1FFFFF & (load_4(s, 49) >> 7);
-        long s20 = 0x1FFFFF & (load_4(s, 52) >> 4);
-        long s21 = 0x1FFFFF & (load_3(s, 55) >> 1);
-        long s22 = 0x1FFFFF & (load_4(s, 57) >> 6);
-        long s23 = (load_4(s, 60) >> 3);
-        long carry0;
-        long carry1;
-        long carry2;
-        long carry3;
-        long carry4;
-        long carry5;
-        long carry6;
-        long carry7;
-        long carry8;
-        long carry9;
-        long carry10;
-        long carry11;
-        long carry12;
-        long carry13;
-        long carry14;
-        long carry15;
-        long carry16;
-
-        /**
-         * Lots of magic numbers :)
-         * To understand what's going on below, note that
-         *
-         * (1) q = 2^252 + q0 where q0 = 27742317777372353535851937790883648493.
-         * (2) s11 is the coefficient of 2^(11*21), s23 is the coefficient of 2^(^23*21) and 2^252 = 2^((23-11) * 21)).
-         * (3) 2^252 congruent -q0 modulo q.
-         * (4) -q0 = 666643 * 2^0 + 470296 * 2^21 + 654183 * 2^(2*21) - 997805 * 2^(3*21) + 136657 * 2^(4*21) - 683901 * 2^(5*21)
-         *
-         * Thus
-         * s23 * 2^(23*11) = s23 * 2^(12*21) * 2^(11*21) = s3 * 2^252 * 2^(11*21) congruent
-         * s23 * (666643 * 2^0 + 470296 * 2^21 + 654183 * 2^(2*21) - 997805 * 2^(3*21) + 136657 * 2^(4*21) - 683901 * 2^(5*21)) * 2^(11*21) modulo q =
-         * s23 * (666643 * 2^(11*21) + 470296 * 2^(12*21) + 654183 * 2^(13*21) - 997805 * 2^(14*21) + 136657 * 2^(15*21) - 683901 * 2^(16*21)).
-         *
-         * The same procedure is then applied for s22,...,s18.
-         */
-        s11 += s23 * 666643;
-        s12 += s23 * 470296;
-        s13 += s23 * 654183;
-        s14 -= s23 * 997805;
-        s15 += s23 * 136657;
-        s16 -= s23 * 683901;
-        // not used again
-        //s23 = 0;
-
-        s10 += s22 * 666643;
-        s11 += s22 * 470296;
-        s12 += s22 * 654183;
-        s13 -= s22 * 997805;
-        s14 += s22 * 136657;
-        s15 -= s22 * 683901;
-        // not used again
-        //s22 = 0;
-
-        s9 += s21 * 666643;
-        s10 += s21 * 470296;
-        s11 += s21 * 654183;
-        s12 -= s21 * 997805;
-        s13 += s21 * 136657;
-        s14 -= s21 * 683901;
-        // not used again
-        //s21 = 0;
-
-        s8 += s20 * 666643;
-        s9 += s20 * 470296;
-        s10 += s20 * 654183;
-        s11 -= s20 * 997805;
-        s12 += s20 * 136657;
-        s13 -= s20 * 683901;
-        // not used again
-        //s20 = 0;
-
-        s7 += s19 * 666643;
-        s8 += s19 * 470296;
-        s9 += s19 * 654183;
-        s10 -= s19 * 997805;
-        s11 += s19 * 136657;
-        s12 -= s19 * 683901;
-        // not used again
-        //s19 = 0;
-
-        s6 += s18 * 666643;
-        s7 += s18 * 470296;
-        s8 += s18 * 654183;
-        s9 -= s18 * 997805;
-        s10 += s18 * 136657;
-        s11 -= s18 * 683901;
-        // not used again
-        //s18 = 0;
-
-        /**
-         * Time to reduce the coefficient in order not to get an overflow.
-         */
-        carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
-        carry12 = (s12 + (1<<20)) >> 21; s13 += carry12; s12 -= carry12 << 21;
-        carry14 = (s14 + (1<<20)) >> 21; s15 += carry14; s14 -= carry14 << 21;
-        carry16 = (s16 + (1<<20)) >> 21; s17 += carry16; s16 -= carry16 << 21;
-
-        carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry13 = (s13 + (1<<20)) >> 21; s14 += carry13; s13 -= carry13 << 21;
-        carry15 = (s15 + (1<<20)) >> 21; s16 += carry15; s15 -= carry15 << 21;
-
-        /**
-         * Continue with above procedure.
-         */
-        s5 += s17 * 666643;
-        s6 += s17 * 470296;
-        s7 += s17 * 654183;
-        s8 -= s17 * 997805;
-        s9 += s17 * 136657;
-        s10 -= s17 * 683901;
-        // not used again
-        //s17 = 0;
-
-        s4 += s16 * 666643;
-        s5 += s16 * 470296;
-        s6 += s16 * 654183;
-        s7 -= s16 * 997805;
-        s8 += s16 * 136657;
-        s9 -= s16 * 683901;
-        // not used again
-        //s16 = 0;
-
-        s3 += s15 * 666643;
-        s4 += s15 * 470296;
-        s5 += s15 * 654183;
-        s6 -= s15 * 997805;
-        s7 += s15 * 136657;
-        s8 -= s15 * 683901;
-        // not used again
-        //s15 = 0;
-
-        s2 += s14 * 666643;
-        s3 += s14 * 470296;
-        s4 += s14 * 654183;
-        s5 -= s14 * 997805;
-        s6 += s14 * 136657;
-        s7 -= s14 * 683901;
-        // not used again
-        //s14 = 0;
-
-        s1 += s13 * 666643;
-        s2 += s13 * 470296;
-        s3 += s13 * 654183;
-        s4 -= s13 * 997805;
-        s5 += s13 * 136657;
-        s6 -= s13 * 683901;
-        // not used again
-        //s13 = 0;
-
-        s0 += s12 * 666643;
-        s1 += s12 * 470296;
-        s2 += s12 * 654183;
-        s3 -= s12 * 997805;
-        s4 += s12 * 136657;
-        s5 -= s12 * 683901;
-        // set below
-        //s12 = 0;
-
-        /**
-         * Reduce coefficients again.
-         */
-        carry0 = (s0 + (1<<20)) >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry2 = (s2 + (1<<20)) >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry4 = (s4 + (1<<20)) >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
-
-        carry1 = (s1 + (1<<20)) >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry3 = (s3 + (1<<20)) >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry5 = (s5 + (1<<20)) >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
-        //carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry11 = (s11 + (1<<20)) >> 21; s12 = carry11; s11 -= carry11 << 21;
-
-        s0 += s12 * 666643;
-        s1 += s12 * 470296;
-        s2 += s12 * 654183;
-        s3 -= s12 * 997805;
-        s4 += s12 * 136657;
-        s5 -= s12 * 683901;
-        // set below
-        //s12 = 0;
-
-        carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 << 21;
-        //carry11 = s11 >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry11 = s11 >> 21; s12 = carry11; s11 -= carry11 << 21;
-
-        // TODO-CR BR: Is it really needed to do it TWO times? (it doesn't hurt, just a question).
-        s0 += s12 * 666643;
-        s1 += s12 * 470296;
-        s2 += s12 * 654183;
-        s3 -= s12 * 997805;
-        s4 += s12 * 136657;
-        s5 -= s12 * 683901;
-        // not used again
-        //s12 = 0;
-
-        carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 << 21;
-
-        // s0, ..., s11 got 21 bits each.
-        byte[] result = new byte[32];
-        result[0] = (byte) s0;
-        result[1] = (byte) (s0 >> 8);
-        result[2] = (byte) ((s0 >> 16) | (s1 << 5));
-        result[3] = (byte) (s1 >> 3);
-        result[4] = (byte) (s1 >> 11);
-        result[5] = (byte) ((s1 >> 19) | (s2 << 2));
-        result[6] = (byte) (s2 >> 6);
-        result[7] = (byte) ((s2 >> 14) | (s3 << 7));
-        result[8] = (byte) (s3 >> 1);
-        result[9] = (byte) (s3 >> 9);
-        result[10] = (byte) ((s3 >> 17) | (s4 << 4));
-        result[11] = (byte) (s4 >> 4);
-        result[12] = (byte) (s4 >> 12);
-        result[13] = (byte) ((s4 >> 20) | (s5 << 1));
-        result[14] = (byte) (s5 >> 7);
-        result[15] = (byte) ((s5 >> 15) | (s6 << 6));
-        result[16] = (byte) (s6 >> 2);
-        result[17] = (byte) (s6 >> 10);
-        result[18] = (byte) ((s6 >> 18) | (s7 << 3));
-        result[19] = (byte) (s7 >> 5);
-        result[20] = (byte) (s7 >> 13);
-        result[21] = (byte) s8;
-        result[22] = (byte) (s8 >> 8);
-        result[23] = (byte) ((s8 >> 16) | (s9 << 5));
-        result[24] = (byte) (s9 >> 3);
-        result[25] = (byte) (s9 >> 11);
-        result[26] = (byte) ((s9 >> 19) | (s10 << 2));
-        result[27] = (byte) (s10 >> 6);
-        result[28] = (byte) ((s10 >> 14) | (s11 << 7));
-        result[29] = (byte) (s11 >> 1);
-        result[30] = (byte) (s11 >> 9);
-        result[31] = (byte) (s11 >> 17);
-        return result;
-    }
-
-
-    /**
-     * $(ab+c) \bmod q$
-     * <p>
-     * Input:
-     * </p><ul>
-     * <li>$a[0]+256*a[1]+\dots+256^{31}*a[31] = a$
-     * <li>$b[0]+256*b[1]+\dots+256^{31}*b[31] = b$
-     * <li>$c[0]+256*c[1]+\dots+256^{31}*c[31] = c$
-     * </ul><p>
-     * Output:
-     *   $result[0]+256*result[1]+\dots+256^{31}*result[31] = (ab+c) \bmod q$
-     *   where $q = 2^{252} + 27742317777372353535851937790883648493$.
-     * <p>
-     * See the comments in {@link #reduce(byte[])} for an explanation of the algorithm.
-     */
-    public byte[] multiplyAndAdd(byte[] a, byte[] b, byte[] c) {
-        long a0 = 0x1FFFFF & load_3(a, 0);
-        long a1 = 0x1FFFFF & (load_4(a, 2) >> 5);
-        long a2 = 0x1FFFFF & (load_3(a, 5) >> 2);
-        long a3 = 0x1FFFFF & (load_4(a, 7) >> 7);
-        long a4 = 0x1FFFFF & (load_4(a, 10) >> 4);
-        long a5 = 0x1FFFFF & (load_3(a, 13) >> 1);
-        long a6 = 0x1FFFFF & (load_4(a, 15) >> 6);
-        long a7 = 0x1FFFFF & (load_3(a, 18) >> 3);
-        long a8 = 0x1FFFFF & load_3(a, 21);
-        long a9 = 0x1FFFFF & (load_4(a, 23) >> 5);
-        long a10 = 0x1FFFFF & (load_3(a, 26) >> 2);
-        long a11 = (load_4(a, 28) >> 7);
-        long b0 = 0x1FFFFF & load_3(b, 0);
-        long b1 = 0x1FFFFF & (load_4(b, 2) >> 5);
-        long b2 = 0x1FFFFF & (load_3(b, 5) >> 2);
-        long b3 = 0x1FFFFF & (load_4(b, 7) >> 7);
-        long b4 = 0x1FFFFF & (load_4(b, 10) >> 4);
-        long b5 = 0x1FFFFF & (load_3(b, 13) >> 1);
-        long b6 = 0x1FFFFF & (load_4(b, 15) >> 6);
-        long b7 = 0x1FFFFF & (load_3(b, 18) >> 3);
-        long b8 = 0x1FFFFF & load_3(b, 21);
-        long b9 = 0x1FFFFF & (load_4(b, 23) >> 5);
-        long b10 = 0x1FFFFF & (load_3(b, 26) >> 2);
-        long b11 = (load_4(b, 28) >> 7);
-        long c0 = 0x1FFFFF & load_3(c, 0);
-        long c1 = 0x1FFFFF & (load_4(c, 2) >> 5);
-        long c2 = 0x1FFFFF & (load_3(c, 5) >> 2);
-        long c3 = 0x1FFFFF & (load_4(c, 7) >> 7);
-        long c4 = 0x1FFFFF & (load_4(c, 10) >> 4);
-        long c5 = 0x1FFFFF & (load_3(c, 13) >> 1);
-        long c6 = 0x1FFFFF & (load_4(c, 15) >> 6);
-        long c7 = 0x1FFFFF & (load_3(c, 18) >> 3);
-        long c8 = 0x1FFFFF & load_3(c, 21);
-        long c9 = 0x1FFFFF & (load_4(c, 23) >> 5);
-        long c10 = 0x1FFFFF & (load_3(c, 26) >> 2);
-        long c11 = (load_4(c, 28) >> 7);
-        long s0;
-        long s1;
-        long s2;
-        long s3;
-        long s4;
-        long s5;
-        long s6;
-        long s7;
-        long s8;
-        long s9;
-        long s10;
-        long s11;
-        long s12;
-        long s13;
-        long s14;
-        long s15;
-        long s16;
-        long s17;
-        long s18;
-        long s19;
-        long s20;
-        long s21;
-        long s22;
-        long s23;
-        long carry0;
-        long carry1;
-        long carry2;
-        long carry3;
-        long carry4;
-        long carry5;
-        long carry6;
-        long carry7;
-        long carry8;
-        long carry9;
-        long carry10;
-        long carry11;
-        long carry12;
-        long carry13;
-        long carry14;
-        long carry15;
-        long carry16;
-        long carry17;
-        long carry18;
-        long carry19;
-        long carry20;
-        long carry21;
-        long carry22;
-
-        s0 = c0 + a0*b0;
-        s1 = c1 + a0*b1 + a1*b0;
-        s2 = c2 + a0*b2 + a1*b1 + a2*b0;
-        s3 = c3 + a0*b3 + a1*b2 + a2*b1 + a3*b0;
-        s4 = c4 + a0*b4 + a1*b3 + a2*b2 + a3*b1 + a4*b0;
-        s5 = c5 + a0*b5 + a1*b4 + a2*b3 + a3*b2 + a4*b1 + a5*b0;
-        s6 = c6 + a0*b6 + a1*b5 + a2*b4 + a3*b3 + a4*b2 + a5*b1 + a6*b0;
-        s7 = c7 + a0*b7 + a1*b6 + a2*b5 + a3*b4 + a4*b3 + a5*b2 + a6*b1 + a7*b0;
-        s8 = c8 + a0*b8 + a1*b7 + a2*b6 + a3*b5 + a4*b4 + a5*b3 + a6*b2 + a7*b1 + a8*b0;
-        s9 = c9 + a0*b9 + a1*b8 + a2*b7 + a3*b6 + a4*b5 + a5*b4 + a6*b3 + a7*b2 + a8*b1 + a9*b0;
-        s10 = c10 + a0*b10 + a1*b9 + a2*b8 + a3*b7 + a4*b6 + a5*b5 + a6*b4 + a7*b3 + a8*b2 + a9*b1 + a10*b0;
-        s11 = c11 + a0*b11 + a1*b10 + a2*b9 + a3*b8 + a4*b7 + a5*b6 + a6*b5 + a7*b4 + a8*b3 + a9*b2 + a10*b1 + a11*b0;
-        s12 = a1*b11 + a2*b10 + a3*b9 + a4*b8 + a5*b7 + a6*b6 + a7*b5 + a8*b4 + a9*b3 + a10*b2 + a11*b1;
-        s13 = a2*b11 + a3*b10 + a4*b9 + a5*b8 + a6*b7 + a7*b6 + a8*b5 + a9*b4 + a10*b3 + a11*b2;
-        s14 = a3*b11 + a4*b10 + a5*b9 + a6*b8 + a7*b7 + a8*b6 + a9*b5 + a10*b4 + a11*b3;
-        s15 = a4*b11 + a5*b10 + a6*b9 + a7*b8 + a8*b7 + a9*b6 + a10*b5 + a11*b4;
-        s16 = a5*b11 + a6*b10 + a7*b9 + a8*b8 + a9*b7 + a10*b6 + a11*b5;
-        s17 = a6*b11 + a7*b10 + a8*b9 + a9*b8 + a10*b7 + a11*b6;
-        s18 = a7*b11 + a8*b10 + a9*b9 + a10*b8 + a11*b7;
-        s19 = a8*b11 + a9*b10 + a10*b9 + a11*b8;
-        s20 = a9*b11 + a10*b10 + a11*b9;
-        s21 = a10*b11 + a11*b10;
-        s22 = a11*b11;
-        // set below
-        //s23 = 0;
-
-        carry0 = (s0 + (1<<20)) >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry2 = (s2 + (1<<20)) >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry4 = (s4 + (1<<20)) >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
-        carry12 = (s12 + (1<<20)) >> 21; s13 += carry12; s12 -= carry12 << 21;
-        carry14 = (s14 + (1<<20)) >> 21; s15 += carry14; s14 -= carry14 << 21;
-        carry16 = (s16 + (1<<20)) >> 21; s17 += carry16; s16 -= carry16 << 21;
-        carry18 = (s18 + (1<<20)) >> 21; s19 += carry18; s18 -= carry18 << 21;
-        carry20 = (s20 + (1<<20)) >> 21; s21 += carry20; s20 -= carry20 << 21;
-        //carry22 = (s22 + (1<<20)) >> 21; s23 += carry22; s22 -= carry22 << 21;
-        carry22 = (s22 + (1<<20)) >> 21; s23 = carry22; s22 -= carry22 << 21;
-
-        carry1 = (s1 + (1<<20)) >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry3 = (s3 + (1<<20)) >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry5 = (s5 + (1<<20)) >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry13 = (s13 + (1<<20)) >> 21; s14 += carry13; s13 -= carry13 << 21;
-        carry15 = (s15 + (1<<20)) >> 21; s16 += carry15; s15 -= carry15 << 21;
-        carry17 = (s17 + (1<<20)) >> 21; s18 += carry17; s17 -= carry17 << 21;
-        carry19 = (s19 + (1<<20)) >> 21; s20 += carry19; s19 -= carry19 << 21;
-        carry21 = (s21 + (1<<20)) >> 21; s22 += carry21; s21 -= carry21 << 21;
-
-        s11 += s23 * 666643;
-        s12 += s23 * 470296;
-        s13 += s23 * 654183;
-        s14 -= s23 * 997805;
-        s15 += s23 * 136657;
-        s16 -= s23 * 683901;
-        // not used again
-        //s23 = 0;
-
-        s10 += s22 * 666643;
-        s11 += s22 * 470296;
-        s12 += s22 * 654183;
-        s13 -= s22 * 997805;
-        s14 += s22 * 136657;
-        s15 -= s22 * 683901;
-        // not used again
-        //s22 = 0;
-
-        s9 += s21 * 666643;
-        s10 += s21 * 470296;
-        s11 += s21 * 654183;
-        s12 -= s21 * 997805;
-        s13 += s21 * 136657;
-        s14 -= s21 * 683901;
-        // not used again
-        //s21 = 0;
-
-        s8 += s20 * 666643;
-        s9 += s20 * 470296;
-        s10 += s20 * 654183;
-        s11 -= s20 * 997805;
-        s12 += s20 * 136657;
-        s13 -= s20 * 683901;
-        // not used again
-        //s20 = 0;
-
-        s7 += s19 * 666643;
-        s8 += s19 * 470296;
-        s9 += s19 * 654183;
-        s10 -= s19 * 997805;
-        s11 += s19 * 136657;
-        s12 -= s19 * 683901;
-        // not used again
-        //s19 = 0;
-
-        s6 += s18 * 666643;
-        s7 += s18 * 470296;
-        s8 += s18 * 654183;
-        s9 -= s18 * 997805;
-        s10 += s18 * 136657;
-        s11 -= s18 * 683901;
-        // not used again
-        //s18 = 0;
-
-        carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
-        carry12 = (s12 + (1<<20)) >> 21; s13 += carry12; s12 -= carry12 << 21;
-        carry14 = (s14 + (1<<20)) >> 21; s15 += carry14; s14 -= carry14 << 21;
-        carry16 = (s16 + (1<<20)) >> 21; s17 += carry16; s16 -= carry16 << 21;
-
-        carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry13 = (s13 + (1<<20)) >> 21; s14 += carry13; s13 -= carry13 << 21;
-        carry15 = (s15 + (1<<20)) >> 21; s16 += carry15; s15 -= carry15 << 21;
-
-        s5 += s17 * 666643;
-        s6 += s17 * 470296;
-        s7 += s17 * 654183;
-        s8 -= s17 * 997805;
-        s9 += s17 * 136657;
-        s10 -= s17 * 683901;
-        // not used again
-        //s17 = 0;
-
-        s4 += s16 * 666643;
-        s5 += s16 * 470296;
-        s6 += s16 * 654183;
-        s7 -= s16 * 997805;
-        s8 += s16 * 136657;
-        s9 -= s16 * 683901;
-        // not used again
-        //s16 = 0;
-
-        s3 += s15 * 666643;
-        s4 += s15 * 470296;
-        s5 += s15 * 654183;
-        s6 -= s15 * 997805;
-        s7 += s15 * 136657;
-        s8 -= s15 * 683901;
-        // not used again
-        //s15 = 0;
-
-        s2 += s14 * 666643;
-        s3 += s14 * 470296;
-        s4 += s14 * 654183;
-        s5 -= s14 * 997805;
-        s6 += s14 * 136657;
-        s7 -= s14 * 683901;
-        // not used again
-        //s14 = 0;
-
-        s1 += s13 * 666643;
-        s2 += s13 * 470296;
-        s3 += s13 * 654183;
-        s4 -= s13 * 997805;
-        s5 += s13 * 136657;
-        s6 -= s13 * 683901;
-        // not used again
-        //s13 = 0;
-
-        s0 += s12 * 666643;
-        s1 += s12 * 470296;
-        s2 += s12 * 654183;
-        s3 -= s12 * 997805;
-        s4 += s12 * 136657;
-        s5 -= s12 * 683901;
-        // set below
-        //s12 = 0;
-
-        carry0 = (s0 + (1<<20)) >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry2 = (s2 + (1<<20)) >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry4 = (s4 + (1<<20)) >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry6 = (s6 + (1<<20)) >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry8 = (s8 + (1<<20)) >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry10 = (s10 + (1<<20)) >> 21; s11 += carry10; s10 -= carry10 << 21;
-
-        carry1 = (s1 + (1<<20)) >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry3 = (s3 + (1<<20)) >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry5 = (s5 + (1<<20)) >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry7 = (s7 + (1<<20)) >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry9 = (s9 + (1<<20)) >> 21; s10 += carry9; s9 -= carry9 << 21;
-        //carry11 = (s11 + (1<<20)) >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry11 = (s11 + (1<<20)) >> 21; s12 = carry11; s11 -= carry11 << 21;
-
-        s0 += s12 * 666643;
-        s1 += s12 * 470296;
-        s2 += s12 * 654183;
-        s3 -= s12 * 997805;
-        s4 += s12 * 136657;
-        s5 -= s12 * 683901;
-        // set below
-        //s12 = 0;
-
-        carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 << 21;
-        //carry11 = s11 >> 21; s12 += carry11; s11 -= carry11 << 21;
-        carry11 = s11 >> 21; s12 = carry11; s11 -= carry11 << 21;
-
-        s0 += s12 * 666643;
-        s1 += s12 * 470296;
-        s2 += s12 * 654183;
-        s3 -= s12 * 997805;
-        s4 += s12 * 136657;
-        s5 -= s12 * 683901;
-        // not used again
-        //s12 = 0;
-
-        carry0 = s0 >> 21; s1 += carry0; s0 -= carry0 << 21;
-        carry1 = s1 >> 21; s2 += carry1; s1 -= carry1 << 21;
-        carry2 = s2 >> 21; s3 += carry2; s2 -= carry2 << 21;
-        carry3 = s3 >> 21; s4 += carry3; s3 -= carry3 << 21;
-        carry4 = s4 >> 21; s5 += carry4; s4 -= carry4 << 21;
-        carry5 = s5 >> 21; s6 += carry5; s5 -= carry5 << 21;
-        carry6 = s6 >> 21; s7 += carry6; s6 -= carry6 << 21;
-        carry7 = s7 >> 21; s8 += carry7; s7 -= carry7 << 21;
-        carry8 = s8 >> 21; s9 += carry8; s8 -= carry8 << 21;
-        carry9 = s9 >> 21; s10 += carry9; s9 -= carry9 << 21;
-        carry10 = s10 >> 21; s11 += carry10; s10 -= carry10 << 21;
-
-        byte[] result = new byte[32];
-        result[0] = (byte) s0;
-        result[1] = (byte) (s0 >> 8);
-        result[2] = (byte) ((s0 >> 16) | (s1 << 5));
-        result[3] = (byte) (s1 >> 3);
-        result[4] = (byte) (s1 >> 11);
-        result[5] = (byte) ((s1 >> 19) | (s2 << 2));
-        result[6] = (byte) (s2 >> 6);
-        result[7] = (byte) ((s2 >> 14) | (s3 << 7));
-        result[8] = (byte) (s3 >> 1);
-        result[9] = (byte) (s3 >> 9);
-        result[10] = (byte) ((s3 >> 17) | (s4 << 4));
-        result[11] = (byte) (s4 >> 4);
-        result[12] = (byte) (s4 >> 12);
-        result[13] = (byte) ((s4 >> 20) | (s5 << 1));
-        result[14] = (byte) (s5 >> 7);
-        result[15] = (byte) ((s5 >> 15) | (s6 << 6));
-        result[16] = (byte) (s6 >> 2);
-        result[17] = (byte) (s6 >> 10);
-        result[18] = (byte) ((s6 >> 18) | (s7 << 3));
-        result[19] = (byte) (s7 >> 5);
-        result[20] = (byte) (s7 >> 13);
-        result[21] = (byte) s8;
-        result[22] = (byte) (s8 >> 8);
-        result[23] = (byte) ((s8 >> 16) | (s9 << 5));
-        result[24] = (byte) (s9 >> 3);
-        result[25] = (byte) (s9 >> 11);
-        result[26] = (byte) ((s9 >> 19) | (s10 << 2));
-        result[27] = (byte) (s10 >> 6);
-        result[28] = (byte) ((s10 >> 14) | (s11 << 7));
-        result[29] = (byte) (s11 >> 1);
-        result[30] = (byte) (s11 >> 9);
-        result[31] = (byte) (s11 >> 17);
-        return result;
-    }
-}

+ 0 - 33
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAGenParameterSpec.java

@@ -1,33 +0,0 @@
-/**
- * EdDSA-Java by str4d
-
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.spec;
-
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * Implementation of AlgorithmParameterSpec that holds the name of a named
- * EdDSA curve specification.
- * @author str4d
- *
- */
-public class EdDSAGenParameterSpec implements AlgorithmParameterSpec {
-    private final String name;
-
-    public EdDSAGenParameterSpec(String stdName) {
-        name = stdName;
-    }
-
-    public String getName() {
-        return name;
-    }
-}

+ 0 - 36
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSANamedCurveSpec.java

@@ -1,36 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.spec;
-
-import com.fuzamei.eddsa.math.Curve;
-import com.fuzamei.eddsa.math.GroupElement;
-import com.fuzamei.eddsa.math.ScalarOps;
-
-
-/**
- * EdDSA Curve specification that can also be referred to by name.
- * @author str4d
- *
- */
-public class EdDSANamedCurveSpec extends EdDSAParameterSpec {
-    private final String name;
-
-    public EdDSANamedCurveSpec(String name, Curve curve,
-            String hashAlgo, ScalarOps sc, GroupElement B) {
-        super(curve, hashAlgo, sc, B);
-        this.name = name;
-    }
-
-    public String getName() {
-        return name;
-    }
-}

+ 0 - 70
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSANamedCurveTable.java

@@ -1,70 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.spec;
-
-import java.util.Hashtable;
-
-import java.util.Locale;
-
-import com.fuzamei.eddsa.Utils;
-import com.fuzamei.eddsa.math.Curve;
-import com.fuzamei.eddsa.math.Field;
-import com.fuzamei.eddsa.math.ed25519.Ed25519LittleEndianEncoding;
-import com.fuzamei.eddsa.math.ed25519.Ed25519ScalarOps;
-
-/**
- * The named EdDSA curves.
- * @author str4d
- *
- */
-public class EdDSANamedCurveTable {
-    private static final Field ed25519field = new Field(
-                    256, // b
-                    Utils.hexToBytes("edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f"), // q
-                    new Ed25519LittleEndianEncoding());
-
-    private static final Curve ed25519curve = new Curve(ed25519field,
-            Utils.hexToBytes("a3785913ca4deb75abd841414d0a700098e879777940c78c73fe6f2bee6c0352"), // d
-            ed25519field.fromByteArray(Utils.hexToBytes("b0a00e4a271beec478e42fad0618432fa7d7fb3d99004d2b0bdfc14f8024832b"))); // I
-
-    private static final EdDSANamedCurveSpec ed25519 = new EdDSANamedCurveSpec(
-            "Ed25519",
-            ed25519curve,
-            "SHA-512", // H
-            new Ed25519ScalarOps(), // l
-            ed25519curve.createPoint( // B
-                    Utils.hexToBytes("5866666666666666666666666666666666666666666666666666666666666666"),
-                    true)); // Precompute tables for B
-
-    private static final Hashtable<String, EdDSANamedCurveSpec> curves = new Hashtable<String, EdDSANamedCurveSpec>();
-
-    public static void defineCurve(EdDSANamedCurveSpec curve) {
-        curves.put(curve.getName().toLowerCase(Locale.ENGLISH), curve);
-    }
-
-    static void defineCurveAlias(String name, String alias) {
-        EdDSANamedCurveSpec curve = curves.get(name.toLowerCase(Locale.ENGLISH));
-        if (curve == null) {
-            throw new IllegalStateException();
-        }
-        curves.put(alias.toLowerCase(Locale.ENGLISH), curve);
-    }
-
-    static {
-        // RFC 8032
-        defineCurve(ed25519);
-    }
-
-    public static EdDSANamedCurveSpec getByName(String name) {
-        return curves.get(name.toLowerCase(Locale.ENGLISH));
-    }
-}

+ 0 - 96
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAParameterSpec.java

@@ -1,96 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.spec;
-
-import com.fuzamei.eddsa.math.Curve;
-import com.fuzamei.eddsa.math.GroupElement;
-import com.fuzamei.eddsa.math.ScalarOps;
-
-import java.io.Serializable;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.AlgorithmParameterSpec;
-
-/**
- * Parameter specification for an EdDSA algorithm.
- * @author str4d
- *
- */
-public class EdDSAParameterSpec implements AlgorithmParameterSpec, Serializable {
-    private static final long serialVersionUID = 8274987108472012L;
-    private final Curve curve;
-    private final String hashAlgo;
-    private final ScalarOps sc;
-    private final GroupElement B;
-
-    /**
-     * @param curve the curve
-     * @param hashAlgo the JCA string for the hash algorithm
-     * @param sc the parameter L represented as ScalarOps
-     * @param B the parameter B
-     * @throws IllegalArgumentException if hash algorithm is unsupported or length is wrong
-     */
-    public EdDSAParameterSpec(Curve curve, String hashAlgo,
-            ScalarOps sc, GroupElement B) {
-        try {
-            MessageDigest hash = MessageDigest.getInstance(hashAlgo);
-            // EdDSA hash function must produce 2b-bit output
-            if (curve.getField().getb()/4 != hash.getDigestLength())
-                throw new IllegalArgumentException("Hash output is not 2b-bit");
-        } catch (NoSuchAlgorithmException e) {
-            throw new IllegalArgumentException("Unsupported hash algorithm");
-        }
-
-        this.curve = curve;
-        this.hashAlgo = hashAlgo;
-        this.sc = sc;
-        this.B = B;
-    }
-
-    public Curve getCurve() {
-        return curve;
-    }
-
-    public String getHashAlgorithm() {
-        return hashAlgo;
-    }
-
-    public ScalarOps getScalarOps() {
-        return sc;
-    }
-
-    /**
-     *  @return the base (generator)
-     */
-    public GroupElement getB() {
-        return B;
-    }
-
-    @Override
-    public int hashCode() {
-        return hashAlgo.hashCode() ^
-               curve.hashCode() ^
-               B.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this)
-            return true;
-        if (!(o instanceof EdDSAParameterSpec))
-            return false;
-        EdDSAParameterSpec s = (EdDSAParameterSpec) o;
-        return hashAlgo.equals(s.getHashAlgorithm()) &&
-               curve.equals(s.getCurve()) &&
-               B.equals(s.getB());
-    }
-}

+ 0 - 134
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAPrivateKeySpec.java

@@ -1,134 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.spec;
-
-import java.security.MessageDigest;
-
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.KeySpec;
-import java.util.Arrays;
-
-import com.fuzamei.eddsa.math.GroupElement;
-
-/**
- * @author str4d
- *
- */
-public class EdDSAPrivateKeySpec implements KeySpec {
-    private final byte[] seed;
-    private final byte[] h;
-    private final byte[] a;
-    private final GroupElement A;
-    private final EdDSAParameterSpec spec;
-
-    /**
-     *  @param seed the private key
-     *  @param spec the parameter specification for this key
-     *  @throws IllegalArgumentException if seed length is wrong or hash algorithm is unsupported
-     */
-    public EdDSAPrivateKeySpec(byte[] seed, EdDSAParameterSpec spec) {
-        if (seed.length != spec.getCurve().getField().getb()/8)
-            throw new IllegalArgumentException("seed length is wrong");
-
-        this.spec = spec;
-        this.seed = seed;
-
-        try {
-            MessageDigest hash = MessageDigest.getInstance(spec.getHashAlgorithm());
-            int b = spec.getCurve().getField().getb();
-
-            // H(k)
-            h = hash.digest(seed);
-
-            /*a = BigInteger.valueOf(2).pow(b-2);
-            for (int i=3;i<(b-2);i++) {
-                a = a.add(BigInteger.valueOf(2).pow(i).multiply(BigInteger.valueOf(Utils.bit(h,i))));
-            }*/
-            // Saves ~0.4ms per key when running signing tests.
-            // TODO: are these bitflips the same for any hash function?
-            h[0] &= 248;
-            h[(b/8)-1] &= 63;
-            h[(b/8)-1] |= 64;
-            a = Arrays.copyOfRange(h, 0, b/8);
-
-            A = spec.getB().scalarMultiply(a);
-        } catch (NoSuchAlgorithmException e) {
-            throw new IllegalArgumentException("Unsupported hash algorithm");
-        }
-    }
-
-    /**
-     *  Initialize directly from the hash.
-     *  getSeed() will return null if this constructor is used.
-     *
-     *  @param spec the parameter specification for this key
-     *  @param h the private key
-     *  @throws IllegalArgumentException if hash length is wrong
-     *  @since 0.1.1
-     */
-    public EdDSAPrivateKeySpec(EdDSAParameterSpec spec, byte[] h) {
-        if (h.length != spec.getCurve().getField().getb()/4)
-            throw new IllegalArgumentException("hash length is wrong");
-
-	this.seed = null;
-	this.h = h;
-	this.spec = spec;
-	int b = spec.getCurve().getField().getb();
-
-        h[0] &= 248;
-        h[(b/8)-1] &= 63;
-        h[(b/8)-1] |= 64;
-        a = Arrays.copyOfRange(h, 0, b/8);
-
-        A = spec.getB().scalarMultiply(a);
-    }
-
-    public EdDSAPrivateKeySpec(byte[] seed, byte[] h, byte[] a, GroupElement A, EdDSAParameterSpec spec) {
-        this.seed = seed;
-        this.h = h;
-        this.a = a;
-        this.A = A;
-        this.spec = spec;
-    }
-
-    /**
-     *  @return will be null if constructed directly from the private key
-     */
-    public byte[] getSeed() {
-        return seed;
-    }
-
-    /**
-     *  @return the hash
-     */
-    public byte[] getH() {
-        return h;
-    }
-
-    /**
-     *  @return the private key
-     */
-    public byte[] geta() {
-        return a;
-    }
-
-    /**
-     *  @return the public key
-     */
-    public GroupElement getA() {
-        return A;
-    }
-
-    public EdDSAParameterSpec getParams() {
-        return spec;
-    }
-}

+ 0 - 61
ccb_fund_trusteeship/src/main/java/com/fuzamei/eddsa/spec/EdDSAPublicKeySpec.java

@@ -1,61 +0,0 @@
-/**
- * EdDSA-Java by str4d
- *
- * To the extent possible under law, the person who associated CC0 with
- * EdDSA-Java has waived all copyright and related or neighboring rights
- * to EdDSA-Java.
- *
- * You should have received a copy of the CC0 legalcode along with this
- * work. If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
- *
- */
-package com.fuzamei.eddsa.spec;
-
-import com.fuzamei.eddsa.math.GroupElement;
-
-import java.security.spec.KeySpec;
-
-/**
- * @author str4d
- *
- */
-public class EdDSAPublicKeySpec implements KeySpec {
-    private final GroupElement A;
-    private final GroupElement Aneg;
-    private final EdDSAParameterSpec spec;
-
-    /**
-     * @param pk the public key
-     * @param spec the parameter specification for this key
-     * @throws IllegalArgumentException if key length is wrong
-     */
-    public EdDSAPublicKeySpec(byte[] pk, EdDSAParameterSpec spec) {
-        if (pk.length != spec.getCurve().getField().getb()/8)
-            throw new IllegalArgumentException("public-key length is wrong");
-
-        this.A = new GroupElement(spec.getCurve(), pk);
-        // Precompute -A for use in verification.
-        this.Aneg = A.negate();
-        Aneg.precompute(false);
-        this.spec = spec;
-    }
-
-    public EdDSAPublicKeySpec(GroupElement A, EdDSAParameterSpec spec) {
-        this.A = A;
-        this.Aneg = A.negate();
-        Aneg.precompute(false);
-        this.spec = spec;
-    }
-
-    public GroupElement getA() {
-        return A;
-    }
-
-    public GroupElement getNegativeA() {
-        return Aneg;
-    }
-
-    public EdDSAParameterSpec getParams() {
-        return spec;
-    }
-}

+ 0 - 45
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/AccountInfo.java

@@ -1,45 +0,0 @@
-package com.fuzamei.entity;
-
-public class AccountInfo {
-	private Integer id;					//主键 id
-	private Integer account_id;			//账户id
-	private String account_name;		//账户名称
-	private String account_type;		//账户类型
-	private Double money;				//钱
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getAccount_id() {
-		return account_id;
-	}
-	public void setAccount_id(Integer account_id) {
-		this.account_id = account_id;
-	}
-	public String getAccount_name() {
-		return account_name;
-	}
-	public void setAccount_name(String account_name) {
-		this.account_name = account_name;
-	}
-	public String getAccount_type() {
-		return account_type;
-	}
-	public void setAccount_type(String account_type) {
-		this.account_type = account_type;
-	}
-	public Double getMoney() {
-		return money;
-	}
-	public void setMoney(Double money) {
-		this.money = money;
-	}
-	@Override
-	public String toString() {
-		return "AccountInfo [id=" + id + ", account_id=" + account_id + ", account_name=" + account_name
-				+ ", account_type=" + account_type + ", money=" + money + "]";
-	}
-	
-}

+ 0 - 119
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/AccountOpeningRecord.java

@@ -1,119 +0,0 @@
-package com.fuzamei.entity;
-
-import java.util.Date;
-//开户记录表
-public class AccountOpeningRecord {
-	
-	private int  id;//主键id
-	private int customer_id;//客户编号
-	private String customer_name;//客户名称
-	private String bank_account;//银行账号
-	private String letter_of_commitment_id;//账户承诺书id
-	private String letterUrl;//账户承诺书url
-	private String application_id;//开户申请书id
-	private String applicationUrl;//开户申请url
-	private String basic_data_id;//其他凭证id
-	private String basicUrl;//其他凭证url
-	private long update_time;//更新时间
-	private int  status_id;//状态id
-	private String status_name;//状态名称
-	private String hash;//哈希码
-	
-	
-	public String getLetterUrl() {
-		return letterUrl;
-	}
-	public void setLetterUrl(String letterUrl) {
-		this.letterUrl = letterUrl;
-	}
-	public String getApplicationUrl() {
-		return applicationUrl;
-	}
-	public void setApplicationUrl(String applicationUrl) {
-		this.applicationUrl = applicationUrl;
-	}
-	public String getBasicUrl() {
-		return basicUrl;
-	}
-	public void setBasicUrl(String basicUrl) {
-		this.basicUrl = basicUrl;
-	}
-	public String getStatus_name() {
-		return status_name;
-	}
-	public void setStatus_name(String status_name) {
-		this.status_name = status_name;
-	}
-	
-	
-	
-	public int getId() {
-		return id;
-	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	public int getCustomer_id() {
-		return customer_id;
-	}
-	public void setCustomer_id(int customer_id) {
-		this.customer_id = customer_id;
-	}
-	public String getCustomer_name() {
-		return customer_name;
-	}
-	public void setCustomer_name(String customer_name) {
-		this.customer_name = customer_name;
-	}
-	public String getBank_account() {
-		return bank_account;
-	}
-	public void setBank_account(String bank_account) {
-		this.bank_account = bank_account;
-	}
-
-	public String getBasic_data_id() {
-		return basic_data_id;
-	}
-	public void setBasic_data_id(String basic_data_id) {
-		this.basic_data_id = basic_data_id;
-	}
-	public String getLetter_of_commitment_id() {
-		return letter_of_commitment_id;
-	}
-	public void setLetter_of_commitment_id(String letter_of_commitment_id) {
-		this.letter_of_commitment_id = letter_of_commitment_id;
-	}
-	public String getApplication_id() {
-		return application_id;
-	}
-	public void setApplication_id(String application_id) {
-		this.application_id = application_id;
-	}
-	public long getUpdate_time() {
-		return update_time;
-	}
-	public void setUpdate_time(long update_time) {
-		this.update_time = update_time;
-	}
-	public int getStatus_id() {
-		return status_id;
-	}
-	public void setStatus_id(int status_id) {
-		this.status_id = status_id;
-	}
-	public String getHash() {
-		return hash;
-	}
-	public void setHash(String hash) {
-		this.hash = hash;
-	}
-	@Override
-	public String toString() {
-		return "AccountOpeningRecord [id=" + id + ", customer_id=" + customer_id + ", customer_name=" + customer_name
-				+ ", bank_account=" + bank_account + ", basic_data_id=" + basic_data_id + ", letter_of_commitment_id="
-				+ letter_of_commitment_id + ", application_id=" + application_id + ", update_time=" + update_time
-				+ ", status_id=" + status_id + ", hash=" + hash + "]";
-	}
-	
-}

+ 0 - 47
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/Attachment.java

@@ -1,47 +0,0 @@
-package com.fuzamei.entity;
-
-public class Attachment {
-	private Integer id;						//主键id
-	private Integer attachment_id;			//附件id
-	private String attachment_name;			//附件名
-	private String url;						//附件url地址
-	private Integer upload_person_id;		//上传人userId
-	private Long create_time;				//创建时间
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getAttachment_id() {
-		return attachment_id;
-	}
-	public void setAttachment_id(Integer attachment_id) {
-		this.attachment_id = attachment_id;
-	}
-	public String getAttachment_name() {
-		return attachment_name;
-	}
-	public void setAttachment_name(String attachment_name) {
-		this.attachment_name = attachment_name;
-	}
-	public String getUrl() {
-		return url;
-	}
-	public void setUrl(String url) {
-		this.url = url;
-	}
-	public Integer getUpload_person_id() {
-		return upload_person_id;
-	}
-	public void setUpload_person_id(Integer upload_person_id) {
-		this.upload_person_id = upload_person_id;
-	}
-	public Long getCreate_time() {
-		return create_time;
-	}
-	public void setCreate_time(Long create_time) {
-		this.create_time = create_time;
-	}
-	
-}

+ 0 - 58
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/BusinessCheck.java

@@ -1,58 +0,0 @@
-package com.fuzamei.entity;
-
-public class BusinessCheck {
-	private String check_department;		//审核部门
-	private String check_person;			//审核人员
-	private Integer check_business_id;		//被审核的业务id号,也就是业务id号,根据这个进行条件关联
-	private String check_opinion;			//审核意见
-	private Long check_time;				//审核时间
-	private String result;					//审核结果,需要关联状态表查询出状态的status_name------>varchar类型
-	
-	private String task;					//llx给添加的任务栏,审核记录表中多加一个任务栏,经办支行写成发起,其它都是审核状态
-	
-	
-	public String getTask() {
-		return task;
-	}
-	public void setTask(String task) {
-		this.task = task;
-	}
-	public String getCheck_department() {
-		return check_department;
-	}
-	public void setCheck_department(String check_department) {
-		this.check_department = check_department;
-	}
-	public String getCheck_person() {
-		return check_person;
-	}
-	public void setCheck_person(String check_person) {
-		this.check_person = check_person;
-	}
-	public Integer getCheck_business_id() {
-		return check_business_id;
-	}
-	public void setCheck_business_id(Integer check_business_id) {
-		this.check_business_id = check_business_id;
-	}
-	public String getCheck_opinion() {
-		return check_opinion;
-	}
-	public void setCheck_opinion(String check_opinion) {
-		this.check_opinion = check_opinion;
-	}
-	public Long getCheck_time() {
-		return check_time;
-	}
-	public void setCheck_time(Long check_time) {
-		this.check_time = check_time;
-	}
-	public String getResult() {
-		return result;
-	}
-	public void setResult(String result) {
-		this.result = result;
-	}
-	
-	
-}	

+ 0 - 110
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/BusinessDeclare.java

@@ -1,110 +0,0 @@
-package com.fuzamei.entity;
-
-public class BusinessDeclare {
-	private Integer business_id;					//业务申报的id号
-	private String bank_id;							//实际是银行名字吧
-	private String business_name;					//业务名称
-	private String business_approval_name;			//业务核准表名字
-	private String business_approval_url;			//业务核准表url
-	private String responsible_investigation_name; 	//尽职调查报告名
-	private String responsible_investigation_url; 	//尽职调查报告url
-	private String product_approval_name;			//产品核准表名字
-	private String product_approval_url;			//产品核准表url
-	private String basic_data_name;					//基础性资料名
-	private String basic_data_url;					//基础性资料url
-	private Long declare_time;						//申报时间
-	private String status_name;						//状态名称
-	private Integer status_id;						//状态id号
-	private String hash;							//hash值
-	public Integer getBusiness_id() {
-		return business_id;
-	}
-	public void setBusiness_id(Integer business_id) {
-		this.business_id = business_id;
-	}
-	public String getBank_id() {
-		return bank_id;
-	}
-	public void setBank_id(String bank_id) {
-		this.bank_id = bank_id;
-	}
-	public String getBusiness_name() {
-		return business_name;
-	}
-	public void setBusiness_name(String business_name) {
-		this.business_name = business_name;
-	}
-	public String getBusiness_approval_name() {
-		return business_approval_name;
-	}
-	public void setBusiness_approval_name(String business_approval_name) {
-		this.business_approval_name = business_approval_name;
-	}
-	public String getBusiness_approval_url() {
-		return business_approval_url;
-	}
-	public void setBusiness_approval_url(String business_approval_url) {
-		this.business_approval_url = business_approval_url;
-	}
-	public String getResponsible_investigation_name() {
-		return responsible_investigation_name;
-	}
-	public void setResponsible_investigation_name(String responsible_investigation_name) {
-		this.responsible_investigation_name = responsible_investigation_name;
-	}
-	public String getResponsible_investigation_url() {
-		return responsible_investigation_url;
-	}
-	public void setResponsible_investigation_url(String responsible_investigation_url) {
-		this.responsible_investigation_url = responsible_investigation_url;
-	}
-	public String getProduct_approval_name() {
-		return product_approval_name;
-	}
-	public void setProduct_approval_name(String product_approval_name) {
-		this.product_approval_name = product_approval_name;
-	}
-	public String getProduct_approval_url() {
-		return product_approval_url;
-	}
-	public void setProduct_approval_url(String product_approval_url) {
-		this.product_approval_url = product_approval_url;
-	}
-	public String getBasic_data_name() {
-		return basic_data_name;
-	}
-	public void setBasic_data_name(String basic_data_name) {
-		this.basic_data_name = basic_data_name;
-	}
-	public String getBasic_data_url() {
-		return basic_data_url;
-	}
-	public void setBasic_data_url(String basic_data_url) {
-		this.basic_data_url = basic_data_url;
-	}
-	public Long getDeclare_time() {
-		return declare_time;
-	}
-	public void setDeclare_time(Long declare_time) {
-		this.declare_time = declare_time;
-	}
-	public String getStatus_name() {
-		return status_name;
-	}
-	public void setStatus_name(String status_name) {
-		this.status_name = status_name;
-	}
-	public Integer getStatus_id() {
-		return status_id;
-	}
-	public void setStatus_id(Integer status_id) {
-		this.status_id = status_id;
-	}
-	public String getHash() {
-		return hash;
-	}
-	public void setHash(String hash) {
-		this.hash = hash;
-	}
-	
-}

+ 0 - 126
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransfer.java

@@ -1,126 +0,0 @@
-package com.fuzamei.entity;
-
-//资金划转表
-public class CapitalTransfer {
-	private Integer id;//主键id
-	private Integer fund_id;//基金id
-	private Integer custodian;//管理人
-	private String  fund_name;//基金名称
-	//private double account_balance;//账户余额   去掉 放到用户表里
-	private Double sum_of_money;//划款金额
-	private Integer  basis_of_payment;//划款依据
-	//private String drawing_account;//划款账户  去掉 放到用户表里
-	private Long apply_time;//申请时间
-	private Long handle_time;//处理时间
-	
-	private Integer  status_id;//状态id
-    private String status_name;//得显示状态得名称
-    
-	private String  person_name;//用户表   管理人写死的
-	private String  attachment_name;//附件表的 附件名称
-	private String url;        //划款依据的url
-	
-	private String drawing_account;// 用户表  账户余额
-	private double account_balance;// 用户表  划款账户
-
-	
-	public String getStatus_name() {
-		return status_name;
-	}
-	public void setStatus_name(String status_name) {
-		this.status_name = status_name;
-	}
-	public int getStatus_id() {
-		return status_id;
-	}
-	public void setStatus_id(int status_id) {
-		this.status_id = status_id;
-	}
-	public String getDrawing_account() {
-		return drawing_account;
-	}
-	public void setDrawing_account(String drawing_account) {
-		this.drawing_account = drawing_account;
-	}
-	public double getAccount_balance() {
-		return account_balance;
-	}
-	public void setAccount_balance(double account_balance) {
-		this.account_balance = account_balance;
-	}
-
-	public String getPerson_name() {
-		return person_name;
-	}
-	public void setPerson_name(String person_name) {
-		this.person_name = person_name;
-	}
-	public String getAttachment_name() {
-		return attachment_name;
-	}
-	public void setAttachment_name(String attachment_name) {
-		this.attachment_name = attachment_name;
-	}
-	public String getUrl() {
-		return url;
-	}
-	public void setUrl(String url) {
-		this.url = url;
-	}
-	public int getId() {
-		return id;
-	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	public int getFund_id() {
-		return fund_id;
-	}
-	public void setFund_id(int fund_id) {
-		this.fund_id = fund_id;
-	}
-	public int getCustodian() {
-		return custodian;
-	}
-	public void setCustodian(int custodian) {
-		this.custodian = custodian;
-	}
-	public long getApply_time() {
-		return apply_time;
-	}
-	public String getFund_name() {
-		return fund_name;
-	}
-	public void setFund_name(String fund_name) {
-		this.fund_name = fund_name;
-	}
-	public double getSum_of_money() {
-		return sum_of_money;
-	}
-	public void setSum_of_money(double sum_of_money) {
-		this.sum_of_money = sum_of_money;
-	}
-	public int getBasis_of_payment() {
-		return basis_of_payment;
-	}
-	public void setBasis_of_payment(int basis_of_payment) {
-		this.basis_of_payment = basis_of_payment;
-	}
-	public long getHandle_time() {
-		return handle_time;
-	}
-	public void setHandle_time(long handle_time) {
-		this.handle_time = handle_time;
-	}
-	public void setApply_time(long apply_time) {
-		this.apply_time = apply_time;
-	}
-
-	
-	
-	
-	
-	
-	
-	
-}

+ 0 - 75
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/CapitalTransferCheck.java

@@ -1,75 +0,0 @@
-package com.fuzamei.entity;
-
-
-//划转资金审核表
-public class CapitalTransferCheck {
-	private int id;//主键id
-	private int fund_id;//基金id
-	private String check_department;//审核部门
-	private String check_person;//审核人员
-	private String check_opinion;//审核意见
-	private long check_time;//审核时间
-	private String check_result;//结果       改String
-	private  String relation;//发起or审核//llx给添加的任务栏,审核记录表中多加一个任务栏,管理人写成发起,其它都是审核状态
-	
-
-	
-	public String getRelation() {
-		return relation;
-	}
-	public void setRelation(String relation) {
-		this.relation = relation;
-	}
-	public int getId() {
-		return id;
-	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	public int getFund_id() {
-		return fund_id;
-	}
-	public void setFund_id(int fund_id) {
-		this.fund_id = fund_id;
-	}
-	public String getCheck_department() {
-		return check_department;
-	}
-	public void setCheck_department(String check_department) {
-		this.check_department = check_department;
-	}
-	public String getCheck_person() {
-		return check_person;
-	}
-	public void setCheck_person(String check_person) {
-		this.check_person = check_person;
-	}
-	public String getCheck_opinion() {
-		return check_opinion;
-	}
-	public void setCheck_opinion(String check_opinion) {
-		this.check_opinion = check_opinion;
-	}
-	public long getCheck_time() {
-		return check_time;
-	}
-	public void setCheck_time(long check_time) {
-		this.check_time = check_time;
-	}
-/*	public int getCheck_result() {
-		return check_result;
-	}
-	public void setCheck_result(int check_result) {
-		this.check_result = check_result;
-	}*/
-	public String getCheck_result() {
-		return check_result;
-	}
-	public void setCheck_result(String check_result) {
-		this.check_result = check_result;
-	}
-	
-	
-	
-	
-}

+ 0 - 113
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ContractRecord.java

@@ -1,113 +0,0 @@
-package com.fuzamei.entity;
-
-public class ContractRecord {
-	private Integer id;					//主键id号
-	private Integer business_id;		//合同对应的业务id号
-	private Integer contract_id;		//合同附件的id号
-	private String contract_name;		//合同名称?================>>就是文件名
-	private Integer version;			//版本信息?格式是v1.0这样?我再数据库改成了int字段了
-	private String contract_party;		//签约方名字
-	private String upload_department;	//上传部门
-	private String upload_person;		//上传人
-	private String modify_opinion;		//修改意见
-	private String unconfirm_department;//待确认部门(初始状态肯定是三个部门--->省分行业务部门&管理人&省分行法律部门)
-	private Integer status_id;			//状态id号
-	private String status_name;			//状态名称
-	private Long commit_time;			//更新时间,提交时间
-	private String hash;				//hash值?
-	
-	private Boolean ifChecked;			//用于前端进行确认按钮的返回,默认false(显示确认按钮),如果true(表示已经确认过了,变成已确认按钮置灰)♥,如果是null(表示全部要失效)
-	
-	
-	public Boolean getIfChecked() {
-		return ifChecked;
-	}
-	public void setIfChecked(Boolean ifChecked) {
-		this.ifChecked = ifChecked;
-	}
-	public String getStatus_name() {
-		return status_name;
-	}
-	public void setStatus_name(String status_name) {
-		this.status_name = status_name;
-	}
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getBusiness_id() {
-		return business_id;
-	}
-	public void setBusiness_id(Integer business_id) {
-		this.business_id = business_id;
-	}
-	public Integer getContract_id() {
-		return contract_id;
-	}
-	public void setContract_id(Integer contract_id) {
-		this.contract_id = contract_id;
-	}
-	public String getContract_name() {
-		return contract_name;
-	}
-	public void setContract_name(String contract_name) {
-		this.contract_name = contract_name;
-	}
-	public Integer getVersion() {
-		return version;
-	}
-	public void setVersion(Integer version) {
-		this.version = version;
-	}
-	public String getContract_party() {
-		return contract_party;
-	}
-	public void setContract_party(String contract_party) {
-		this.contract_party = contract_party;
-	}
-	public String getUpload_department() {
-		return upload_department;
-	}
-	public void setUpload_department(String upload_department) {
-		this.upload_department = upload_department;
-	}
-	public String getUpload_person() {
-		return upload_person;
-	}
-	public void setUpload_person(String upload_person) {
-		this.upload_person = upload_person;
-	}
-	public String getModify_opinion() {
-		return modify_opinion;
-	}
-	public void setModify_opinion(String modify_opinion) {
-		this.modify_opinion = modify_opinion;
-	}
-	public String getUnconfirm_department() {
-		return unconfirm_department;
-	}
-	public void setUnconfirm_department(String unconfirm_department) {
-		this.unconfirm_department = unconfirm_department;
-	}
-	public Integer getStatus_id() {
-		return status_id;
-	}
-	public void setStatus_id(Integer status_id) {
-		this.status_id = status_id;
-	}
-	public Long getCommit_time() {
-		return commit_time;
-	}
-	public void setCommit_time(Long commit_time) {
-		this.commit_time = commit_time;
-	}
-	public String getHash() {
-		return hash;
-	}
-	public void setHash(String hash) {
-		this.hash = hash;
-	}
-	
-}

+ 0 - 67
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ContractStatusTracking.java

@@ -1,67 +0,0 @@
-package com.fuzamei.entity;
-
-public class ContractStatusTracking {
-	private Integer id;						//主键id
-	private Integer business_id;			//合同对应的业务id号
-	private Integer contract_id;			//合同id号
-	private String contract_name;			//合同名称(通过附件名获取)
-	private String url;						//合同下载地址
-	private String contract_party;			//签约方
-	private Long update_time;				//更新时间
-	private Integer status_id;				//状态id号
-	private String status_name;				//状态名
-	public String getUrl() {
-		return url;
-	}
-	public void setUrl(String url) {
-		this.url = url;
-	}
-	public Integer getContract_id() {
-		return contract_id;
-	}
-	public void setContract_id(Integer contract_id) {
-		this.contract_id = contract_id;
-	}
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getBusiness_id() {
-		return business_id;
-	}
-	public void setBusiness_id(Integer business_id) {
-		this.business_id = business_id;
-	}
-	public String getContract_name() {
-		return contract_name;
-	}
-	public void setContract_name(String contract_name) {
-		this.contract_name = contract_name;
-	}
-	public String getContract_party() {
-		return contract_party;
-	}
-	public void setContract_party(String contract_party) {
-		this.contract_party = contract_party;
-	}
-	public Integer getStatus_id() {
-		return status_id;
-	}
-	public void setStatus_id(Integer status_id) {
-		this.status_id = status_id;
-	}
-	public String getStatus_name() {
-		return status_name;
-	}
-	public void setStatus_name(String status_name) {
-		this.status_name = status_name;
-	}
-	public Long getUpdate_time() {
-		return update_time;
-	}
-	public void setUpdate_time(Long update_time) {
-		this.update_time = update_time;
-	}
-}

+ 0 - 61
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/OperationHistory.java

@@ -1,61 +0,0 @@
-package com.fuzamei.entity;
-
-public class OperationHistory {
-	private Integer id;
-	private Integer operator_type_id;
-	private String operator_name;
-	private String operator_account;
-	private String operator_role;
-	private String operator_person;
-	private String operator_time;
-	private String hash;
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getOperator_type_id() {
-		return operator_type_id;
-	}
-	public void setOperator_type_id(Integer operator_type_id) {
-		this.operator_type_id = operator_type_id;
-	}
-	public String getOperator_name() {
-		return operator_name;
-	}
-	public void setOperator_name(String operator_name) {
-		this.operator_name = operator_name;
-	}
-	public String getOperator_account() {
-		return operator_account;
-	}
-	public void setOperator_account(String operator_account) {
-		this.operator_account = operator_account;
-	}
-	public String getOperator_role() {
-		return operator_role;
-	}
-	public void setOperator_role(String operator_role) {
-		this.operator_role = operator_role;
-	}
-	public String getOperator_person() {
-		return operator_person;
-	}
-	public void setOperator_person(String operator_person) {
-		this.operator_person = operator_person;
-	}
-	public String getOperator_time() {
-		return operator_time;
-	}
-	public void setOperator_time(String operator_time) {
-		this.operator_time = operator_time;
-	}
-	public String getHash() {
-		return hash;
-	}
-	public void setHash(String hash) {
-		this.hash = hash;
-	}
-	
-}

+ 0 - 123
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/OperationHistoryBO.java

@@ -1,123 +0,0 @@
-package com.fuzamei.entity;
-
-import javax.validation.constraints.Digits;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-
-import org.hibernate.validator.constraints.NotEmpty;
-import org.hibernate.validator.constraints.Range;
-/**
-5      * Bean Validation 中内置的 constraint       
-6      * @Null   被注释的元素必须为 null       
-7      * @NotNull    被注释的元素必须不为 null       
-8      * @AssertTrue     被注释的元素必须为 true       
-9      * @AssertFalse    被注释的元素必须为 false       
-10      * @Min(value)     被注释的元素必须是一个数字,其值必须大于等于指定的最小值       
-11      * @Max(value)     被注释的元素必须是一个数字,其值必须小于等于指定的最大值       
-12      * @DecimalMin(value)  被注释的元素必须是一个数字,其值必须大于等于指定的最小值       
-13      * @DecimalMax(value)  被注释的元素必须是一个数字,其值必须小于等于指定的最大值       
-14      * @Size(max=, min=)   被注释的元素的大小必须在指定的范围内       
-15      * @Digits (integer, fraction)     被注释的元素必须是一个数字,其值必须在可接受的范围内       
-16      * @Past   被注释的元素必须是一个过去的日期       
-17      * @Future     被注释的元素必须是一个将来的日期       
-18      * @Pattern(regex=,flag=)  被注释的元素必须符合指定的正则表达式       
-19      * Hibernate Validator 附加的 constraint       
-20      * @NotBlank(message =)   验证字符串非null,且长度必须大于0       
-21      * @Email  被注释的元素必须是电子邮箱地址       
-22      * @Length(min=,max=)  被注释的字符串的大小必须在指定的范围内       
-23      * @NotEmpty   被注释的字符串的必须非空       
-24      * @Range(min=,max=,message=)  被注释的元素必须在合适的范围内 
-25      */
-/*@NotNull 和 @NotEmpty  和@NotBlank 区别
-@NotEmpty 用在集合类上面
-@NotBlank 用在String上面
-@NotNull    用在基本类型上
-如果在基本类型上面用NotEmpty或者NotBlank 会出现上面的错*/
-/**
- * 
- * @author ylx
- * @version 1.0
- * @descible 操作记录模块中查询的操作接受的实体类信息
- */
-public class OperationHistoryBO {
-	@NotNull(message="用户id号不能为空")
-	@Min(value=0,message="必须是一个大于0的数字")
-	private Integer userId;
-	
-	@NotNull(message="页数不能为空")
-	@Range(min=1,max=Integer.MAX_VALUE,message="页数最小值应该为1")
-	private Integer page;
-	
-	private String account;
-	
-	private String role;
-	
-	private String type;
-	
-	private Long startTime;
-	
-	private Long endTime;
-
-	public Integer getUserId() {
-		return userId;
-	}
-
-	public void setUserId(Integer userId) {
-		this.userId = userId;
-	}
-
-	public Integer getPage() {
-		return page;
-	}
-
-	public void setPage(Integer page) {
-		this.page = page;
-	}
-
-	public String getAccount() {
-		return account;
-	}
-
-	public void setAccount(String account) {
-		this.account = account;
-	}
-
-	public String getRole() {
-		return role;
-	}
-
-	public void setRole(String role) {
-		this.role = role;
-	}
-
-	public String getType() {
-		return type;
-	}
-
-	public void setType(String type) {
-		this.type = type;
-	}
-
-	public Long getStartTime() {
-		return startTime;
-	}
-
-	public void setStartTime(Long startTime) {
-		this.startTime = startTime;
-	}
-
-	public Long getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(Long endTime) {
-		this.endTime = endTime;
-	}
-
-	@Override
-	public String toString() {
-		return "OperationHistoryBO [userId=" + userId + ", page=" + page + ", account=" + account + ", role=" + role
-				+ ", type=" + type + ", startTime=" + startTime + ", endTime=" + endTime + "]";
-	}
-	
-}

+ 0 - 49
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ProjectFile.java

@@ -1,49 +0,0 @@
-package com.fuzamei.entity;
-
-import java.util.List;
-
-/**
- * 查询项目文档的实体类
- * 
- * @author ylx
- *
- */
-public class ProjectFile {
-	private Integer id;						//主键id
-	private Integer project_id;				//项目id号
-	private String project_name;			//项目名称
-	private String update_time;				//更新时间
-	private List<Attachment> attachments;	//附件集合
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getProject_id() {
-		return project_id;
-	}
-	public void setProject_id(Integer project_id) {
-		this.project_id = project_id;
-	}
-	public String getProject_name() {
-		return project_name;
-	}
-	public void setProject_name(String project_name) {
-		this.project_name = project_name;
-	}
-	public String getUpdate_time() {
-		return update_time;
-	}
-	public void setUpdate_time(String update_time) {
-		this.update_time = update_time;
-	}
-	public List<Attachment> getAttachments() {
-		return attachments;
-	}
-	public void setAttachments(List<Attachment> attachments) {
-		this.attachments = attachments;
-	}
-	
-	
-}

+ 0 - 102
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/PromptLetter.java

@@ -1,102 +0,0 @@
-package com.fuzamei.entity;
-
-import java.util.Date;
-//提示函表
-public class PromptLetter {
-	private Integer id;//主键id
-	private Integer prompt_letter_id;//提示函id
-	private String prompt_letter_name;//提示函名称
-	private String send_person;//发送人
-	private String receive_person;//接收人
-	private Long send_time;//发送时间
-	private Long receive_time;//接收时间
-	private String hash;//哈希码
-	
-	private String attachment_name;/**附件表账号名称**/
-	private String url;
-	private String person_name;/**用户表管理人名字**/
-
-	public String getUrl() {
-		return url;
-	}
-	public void setUrl(String url) {
-		this.url = url;
-	}
-	public String getPerson_name() {
-		return person_name;
-	}
-	public void setPerson_name(String person_name) {
-		this.person_name = person_name;
-	}
-
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getId() {
-		return id;
-	}
-
-	public Integer getPrompt_letter_id() {
-		return prompt_letter_id;
-	}
-	public void setPrompt_letter_id(Integer prompt_letter_id) {
-		this.prompt_letter_id = prompt_letter_id;
-	}
-
-	public String getPrompt_letter_name() {
-		return prompt_letter_name;
-	}
-
-	public void setPrompt_letter_name(String prompt_letter_name) {
-		this.prompt_letter_name = prompt_letter_name;
-	}
-
-	public String getSend_person() {
-		return send_person;
-	}
-
-	public void setSend_person(String send_person) {
-		this.send_person = send_person;
-	}
-
-	public String getReceive_person() {
-		return receive_person;
-	}
-
-	public void setReceive_person(String receive_person) {
-		this.receive_person = receive_person;
-	}
-
-	public Long getSend_time() {
-		return send_time;
-	}
-
-	public void setSend_time(Long send_time) {
-		this.send_time = send_time;
-	}
-
-	public Long getReceive_time() {
-		return receive_time;
-	}
-
-	public void setReceive_time(Long receive_time) {
-		this.receive_time = receive_time;
-	}
-
-	public String getHash() {
-		return hash;
-	}
-
-	public void setHash(String hash) {
-		this.hash = hash;
-	}
-
-	public String getAttachment_name() {
-		return attachment_name;
-	}
-
-	public void setAttachment_name(String attachment_name) {
-		this.attachment_name = attachment_name;
-	}
-	
-}

+ 0 - 30
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/Role.java

@@ -1,30 +0,0 @@
-package com.fuzamei.entity;
-
-public class Role {
-	private int id;
-	private int roleId;
-	private String roleName;
-	public int getId() {
-		return id;
-	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	public int getRoleId() {
-		return roleId;
-	}
-	public void setRoleId(int roleId) {
-		this.roleId = roleId;
-	}
-	public String getRoleName() {
-		return roleName;
-	}
-	public void setRoleName(String roleName) {
-		this.roleName = roleName;
-	}
-	@Override
-	public String toString() {
-		return "Role [id=" + id + ", roleId=" + roleId + ", roleName=" + roleName + "]";
-	}
-	
-}

+ 0 - 30
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/Token.java

@@ -1,30 +0,0 @@
-package com.fuzamei.entity;
-
-public class Token {
-	private int id;
-	private int userId;
-	private String token;
-	public int getId() {
-		return id;
-	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	public int getUserId() {
-		return userId;
-	}
-	public void setUserId(int userId) {
-		this.userId = userId;
-	}
-	public String getToken() {
-		return token;
-	}
-	public void setToken(String token) {
-		this.token = token;
-	}
-	@Override
-	public String toString() {
-		return "Token [id=" + id + ", userId=" + userId + ", token=" + token + "]";
-	}
-	
-}

+ 0 - 182
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/User.java

@@ -1,182 +0,0 @@
-package com.fuzamei.entity;
-
-
-
-import java.util.List;
-
-import javax.validation.GroupSequence;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-
-import org.hibernate.validator.constraints.NotBlank;
-
-
-
-public class User{
-	private int id;	//主键
-	@NotNull(message = "用户编号不能为空字符串或者null",groups = {USERID.class})
-	private int user_id;	//用户id
-	@NotBlank(message = "用户名不能为空字符串或者null",groups = {ACCOUNT.class})
-	private String account;	//用户名称
-	@Size(min = 6,max = 8,message = "密码必须为6到10位",groups = {PASSWORD.class})
-	private String password;	//用户密码
-	@NotBlank(message = "随机数不能为空字符串或者null",groups = {RANDOM.class})
-	private String random;		//随机数
-	private String public_key;	//公钥
-	private String private_key;	//私钥
-	private String organization_name;	//机构名称
-	@NotBlank(message = "用户名称不能为空字符串或者null",groups = {PERSONNAME.class})
-	private String person_name;			//人员名称
-	@NotNull(message = "用户角色id不能为空字符串或者null",groups = {ROLEID.class})
-	private int role_id;				//角色id
-	@NotBlank(message = "用户角色名称不能为空字符串或者null",groups = {ROLENAME.class})
-	@NotNull(message = "用户角色名称不能为空字符串或者null",groups = {ROLENAMEA.class})
-	private String role_name;			//角色名称
-	@NotBlank(message = "签名不能为空字符串或者null",groups = {SIGN.class})
-	private String sign;			//注册时候的签名
-	@NotNull(message = "用户添加时间不能为空字符串或者null",groups = {CREATETIME.class})
-	private long create_time;		//创建时间
-	@NotNull(message = "用户更新时间不能为空字符串或者null",groups = {UPDATETIME.class})
-	private long update_time;		//更新时间
-	
-	private double account_balance;//账户余额
-	private String drawing_account;//划款账户
-	private List<Object> drawing_accountList;
-	
-	
-	public double getAccount_balance() {
-		return account_balance;
-	}
-	public void setAccount_balance(double account_balance) {
-		this.account_balance = account_balance;
-	}
-	public String getDrawing_account() {
-		return drawing_account;
-	}
-	public void setDrawing_account(String drawing_account) {
-		this.drawing_account = drawing_account;
-	}
-	public int getId() {
-		return id;
-	}
-	public void setId(int id) {
-		this.id = id;
-	}
-	public int getUser_id() {
-		return user_id;
-	}
-	public void setUser_id(int user_id) {
-		this.user_id = user_id;
-	}
-	public String getAccount() {
-		return account;
-	}
-	public void setAccount(String account) {
-		this.account = account;
-	}
-	public String getPassword() {
-		return password;
-	}
-	public void setPassword(String password) {
-		this.password = password;
-	}
-	public String getRandom() {
-		return random;
-	}
-	public void setRandom(String random) {
-		this.random = random;
-	}
-	public String getPublic_key() {
-		return public_key;
-	}
-	public void setPublic_key(String public_key) {
-		this.public_key = public_key;
-	}
-	public String getPrivate_key() {
-		return private_key;
-	}
-	public void setPrivate_key(String private_key) {
-		this.private_key = private_key;
-	}
-	public String getOrganization_name() {
-		return organization_name;
-	}
-	public void setOrganization_name(String organization_name) {
-		this.organization_name = organization_name;
-	}
-	public String getPerson_name() {
-		return person_name;
-	}
-	public void setPerson_name(String person_name) {
-		this.person_name = person_name;
-	}
-	public int getRole_id() {
-		return role_id;
-	}
-	public void setRole_id(int role_id) {
-		this.role_id = role_id;
-	}
-	public String getRole_name() {
-		return role_name;
-	}
-	public void setRole_name(String role_name) {
-		this.role_name = role_name;
-	}
-	public String getSign() {
-		return sign;
-	}
-	public void setSign(String sign) {
-		this.sign = sign;
-	}
-	
-
-	public long getCreate_time() {
-		return create_time;
-	}
-	public void setCreate_time(long create_time) {
-		this.create_time = create_time;
-	}
-	public long getUpdate_time() {
-		return update_time;
-	}
-	public void setUpdate_time(long update_time) {
-		this.update_time = update_time;
-	}
-	
-	public List<Object> getDrawing_accountList() {
-		return drawing_accountList;
-	}
-	public void setDrawing_accountList(List<Object> drawing_accountList) {
-		this.drawing_accountList = drawing_accountList;
-	}
-	
-	@Override
-	public String toString() {
-		return "User [id=" + id + ", user_id=" + user_id + ", account=" + account + ", password=" + password
-				+ ", random=" + random + ", public_key=" + public_key + ", private_key=" + private_key
-				+ ", organization_name=" + organization_name + ", person_name=" + person_name + ", role_id=" + role_id
-				+ ", role_name=" + role_name + ", sign=" + sign + ", create_time=" + create_time + ", update_time="
-				+ update_time + ", account_balance=" + account_balance + ", drawing_account=" + drawing_account
-				+ ", drawing_accountList=" + drawing_accountList + "]";
-	}
-
-	//顺序控制
-	public interface USERID{};
-	public interface ACCOUNT{};
-	public interface PASSWORD{};
-	public interface RANDOM{};
-	public interface PERSONNAME{};
-	public interface ROLEID{};
-	public interface ROLENAME{};
-	public interface SIGN{};
-	public interface ROLENAMEA{};
-	public interface CREATETIME{};
-	public interface UPDATETIME{};
-	//该组用于用户登录
-	@GroupSequence({USERID.class,ACCOUNT.class, PASSWORD.class}) 
-	public interface GroupA{}
-	//该组用于添加用户
-	@GroupSequence({USERID.class, ROLEID.class,ROLENAME.class,ACCOUNT.class,PASSWORD.class,PERSONNAME.class,RANDOM.class,SIGN.class,CREATETIME.class,UPDATETIME.class}) 
-	public interface GroupB{};
-	
-}

+ 0 - 21
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/UserAccount.java

@@ -1,21 +0,0 @@
-package com.fuzamei.entity;
-//用户表和账户表的中间表
-public class UserAccount {
-	private Integer user_id;//用户id
-	private Integer account_id;//账户id
-	public Integer getUser_id() {
-		return user_id;
-	}
-	public void setUser_id(Integer user_id) {
-		this.user_id = user_id;
-	}
-	public Integer getAccount_id() {
-		return account_id;
-	}
-	public void setAccount_id(Integer account_id) {
-		this.account_id = account_id;
-	}
-	
-	
-	
-}

+ 0 - 112
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/UserDetail.java

@@ -1,112 +0,0 @@
-package com.fuzamei.entity;
-
-import java.util.List;
-
-public class UserDetail {
-	private Integer id;							//用户表主键
-	private Integer user_id;					//用户id
-	private String account;						//用户账号名称
-	private String password;					//用户密码
-	private String random;						//随机数
-	private String public_key;					//公钥
-	private String private_key;					//私钥
-	private String organization_name;			//机构名称
-	private String person_name;					//人员名称
-	private List<String> role_name;				//角色名称(多对多)
-	private List<String> authority_name;		//权限名称(多对多)
-	private Double account_balance;				//账户余额
-	private Long create_time;					//账户创建时间
-	private Long update_time;					//账户修改时间
-	private List<AccountInfo> account_info_list;//账户信息(一对多)		
-	public Integer getId() {
-		return id;
-	}
-	public void setId(Integer id) {
-		this.id = id;
-	}
-	public Integer getUser_id() {
-		return user_id;
-	}
-	public void setUser_id(Integer user_id) {
-		this.user_id = user_id;
-	}
-	public String getAccount() {
-		return account;
-	}
-	public void setAccount(String account) {
-		this.account = account;
-	}
-	public String getPassword() {
-		return password;
-	}
-	public void setPassword(String password) {
-		this.password = password;
-	}
-	public String getRandom() {
-		return random;
-	}
-	public void setRandom(String random) {
-		this.random = random;
-	}
-	public String getPublic_key() {
-		return public_key;
-	}
-	public void setPublic_key(String public_key) {
-		this.public_key = public_key;
-	}
-	public String getPrivate_key() {
-		return private_key;
-	}
-	public void setPrivate_key(String private_key) {
-		this.private_key = private_key;
-	}
-	public String getOrganization_name() {
-		return organization_name;
-	}
-	public void setOrganization_name(String organization_name) {
-		this.organization_name = organization_name;
-	}
-	public String getPerson_name() {
-		return person_name;
-	}
-	public void setPerson_name(String person_name) {
-		this.person_name = person_name;
-	}
-	public List<String> getRole_name() {
-		return role_name;
-	}
-	public void setRole_name(List<String> role_name) {
-		this.role_name = role_name;
-	}
-	public List<String> getAuthority_name() {
-		return authority_name;
-	}
-	public void setAuthority_name(List<String> authority_name) {
-		this.authority_name = authority_name;
-	}
-	public Double getAccount_balance() {
-		return account_balance;
-	}
-	public void setAccount_balance(Double account_balance) {
-		this.account_balance = account_balance;
-	}
-	public Long getCreate_time() {
-		return create_time;
-	}
-	public void setCreate_time(Long create_time) {
-		this.create_time = create_time;
-	}
-	public Long getUpdate_time() {
-		return update_time;
-	}
-	public void setUpdate_time(Long update_time) {
-		this.update_time = update_time;
-	}
-	public List<AccountInfo> getAccount_info_list() {
-		return account_info_list;
-	}
-	public void setAccount_info_list(List<AccountInfo> account_info_list) {
-		this.account_info_list = account_info_list;
-	}
-	
-}

+ 0 - 122
ccb_fund_trusteeship/src/main/java/com/fuzamei/entity/ValuationAccount.java

@@ -1,122 +0,0 @@
-package com.fuzamei.entity;
-
-public class ValuationAccount {
-	
-	private Integer fund_id;					//基金id号,但是这里和项目文档的id号好像是一样的。。。。。????
-	private String fund_name;					//基金名称
-	private String assets_under_custody;		//托管资产
-	private Integer custodian_valuation_id;		//管理人估值报表id号,关联附件表的附件名
-	private Integer bank_valuation_id;			//银行股指报表id号,关联附件表的附件名
-	private Long update_time;					//文件更新时间。。。。。暂时理解为文件创建时间????
-	private String battle_result;				//比对结果
-	
-	private Integer attachment_id_of_custodian;				//管理员上传的附件id号
-	private Integer attachment_id_of_bank;					//银行上传的附件id号
-	
-	private String attachment_name_of_custodian;				//附件名称--------->>管理人估值报表名称
-	private String attachment_name_of_bank;				//附件名称----------->>银行估值报表名称
-	
-	private String url_of_custodian;							//下载和上传通用的url地址----------->>管理人估值报表下载和上传链接
-	private String url_of_bank;							//下载和上传通用的url地址----------->>银行估值报表下载和上传链接
-	
-	
-	private Integer upload_person_id;			//上传人用户的id号
-	private String create_time;					//附件的创建时间,暂时理解为和文件更新时间????
-	public Integer getFund_id() {
-		return fund_id;
-	}
-	
-	public Integer getAttachment_id_of_custodian() {
-		return attachment_id_of_custodian;
-	}
-
-	public void setAttachment_id_of_custodian(Integer attachment_id_of_custodian) {
-		this.attachment_id_of_custodian = attachment_id_of_custodian;
-	}
-
-	public Integer getAttachment_id_of_bank() {
-		return attachment_id_of_bank;
-	}
-
-	public void setAttachment_id_of_bank(Integer attachment_id_of_bank) {
-		this.attachment_id_of_bank = attachment_id_of_bank;
-	}
-
-	public void setFund_id(Integer fund_id) {
-		this.fund_id = fund_id;
-	}
-	public String getFund_name() {
-		return fund_name;
-	}
-	public void setFund_name(String fund_name) {
-		this.fund_name = fund_name;
-	}
-	public String getAssets_under_custody() {
-		return assets_under_custody;
-	}
-	public void setAssets_under_custody(String assets_under_custody) {
-		this.assets_under_custody = assets_under_custody;
-	}
-	public Integer getCustodian_valuation_id() {
-		return custodian_valuation_id;
-	}
-	public void setCustodian_valuation_id(Integer custodian_valuation_id) {
-		this.custodian_valuation_id = custodian_valuation_id;
-	}
-	public Integer getBank_valuation_id() {
-		return bank_valuation_id;
-	}
-	public void setBank_valuation_id(Integer bank_valuation_id) {
-		this.bank_valuation_id = bank_valuation_id;
-	}
-	public Long getUpdate_time() {
-		return update_time;
-	}
-	public void setUpdate_time(Long update_time) {
-		this.update_time = update_time;
-	}
-	public String getBattle_result() {
-		return battle_result;
-	}
-	public void setBattle_result(String battle_result) {
-		this.battle_result = battle_result;
-	}
-	public String getAttachment_name_of_custodian() {
-		return attachment_name_of_custodian;
-	}
-	public void setAttachment_name_of_custodian(String attachment_name_of_custodian) {
-		this.attachment_name_of_custodian = attachment_name_of_custodian;
-	}
-	public String getAttachment_name_of_bank() {
-		return attachment_name_of_bank;
-	}
-	public void setAttachment_name_of_bank(String attachment_name_of_bank) {
-		this.attachment_name_of_bank = attachment_name_of_bank;
-	}
-	public String getUrl_of_custodian() {
-		return url_of_custodian;
-	}
-	public void setUrl_of_custodian(String url_of_custodian) {
-		this.url_of_custodian = url_of_custodian;
-	}
-	public String getUrl_of_bank() {
-		return url_of_bank;
-	}
-	public void setUrl_of_bank(String url_of_bank) {
-		this.url_of_bank = url_of_bank;
-	}
-	public Integer getUpload_person_id() {
-		return upload_person_id;
-	}
-	public void setUpload_person_id(Integer upload_person_id) {
-		this.upload_person_id = upload_person_id;
-	}
-	public String getCreate_time() {
-		return create_time;
-	}
-	public void setCreate_time(String create_time) {
-		this.create_time = create_time;
-	}
-	
-	
-}

+ 0 - 414
ccb_fund_trusteeship/src/main/java/com/fuzamei/http/Gwjf.java

@@ -1,414 +0,0 @@
-/*package com.fzm.http;
-
-import java.util.Map;
-
-import com.alibaba.fastjson.JSON;
-import com.fuzamei.jarlibrary.utils.KeyUtils;
-import com.fuzamei.jarlibrary.utils.ProtobufBean;
-import com.fuzamei.jarlibrary.utils.ProtobufUtils;
-
-public class Gwjf {
-	
-	
-	// serverUrl
-	//杭州  121.41.33.113:9903
-	//北京  211.160.73.224:9901
-	//https://122.244.77.186:8088
-	private  String serverUrl = "http://10.1.33.74:9901";
-	private  Request request=RequestFactory.createRequest(serverUrl);
-
-	
-	public boolean configServerUrl(String ip , Integer port) {
-		if (ip != null && !ip.isEmpty()) {
-            // 定义正则表达式
-            String regex = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\."+
-                      "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."+
-                      "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."+
-                      "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$";
-            if (ip.matches(regex)) {
-            	
-            	if(port!=null && 65535>=port && port>0){
-               
-            	this.serverUrl = "http://"+ ip + ":" + port;
-            	
-            	return true;
-            	}else{
-            		return false;
-            	}
-            
-            } else {
-                // 返回判断信息
-                return false;
-            }
-		}
-		return false;
-		
-	}
-	
-
-	// 用户注册
-	public String requestUserCreate(String uid, String info)
-			throws Exception {
-		if(("").equals(uid)){
-			return "uid  is empty";
-		}
-		
-		String url =  this.serverUrl + "/v1/user/register";
-		String parameter = "";
-		String random = KeyUtils.getRandom();
-		String privateKey = KeyUtils.getPrivateKey(uid, random);
-		String publicKey = KeyUtils.getPublicKey(privateKey);
-
-		
-
-		String instructionId = "";
-		String signature = "";
-		if(("").equals(privateKey)||("").equals(publicKey)){
-			return "privateKey or publicKey is emtpy";
-		}
-		ProtobufBean protobufBean = ProtobufUtils.requestUserCreate(privateKey,
-				publicKey, uid, publicKey, info);
-		
-		
-		instructionId = "" + protobufBean.getInstructionId();
-		signature = protobufBean.getSignature();
-		if(("").equals(instructionId)||("").equals(signature)){
-			return "instructionId or signature is empty";
-		}
-		
-		parameter = "uid=" + uid + "&publickey=" + publicKey + "&info=" + info
-				+ "&instructionId=" + instructionId + "&signature=" + signature
-				+ "&random=" + random;
-		String message = request.sendPost(url, parameter);
-		return message;
-
-	}
-
-	// 获取用户随机数及公钥
-	private String GetUserInfo(String uid) throws Exception {
-		if(("").equals(uid)){
-			return "uid is empty";
-		}
-		String url =  this.serverUrl + "/v1/query/user-info";
-		String parameter = "uid=" + uid;
-		String message = request.sendPost(url, parameter);
-		
-		return message;
-	}
-
-	// 获取积分余额
-	private String GetUnspent(String uid) throws Exception {
-		if(("").equals(uid)){
-			return "uid is empty";
-		}
-		String url =  this.serverUrl + "/v1/query/amount";
-		String parameter = "uid=" + uid;
-		String message = request.sendPost(url, parameter);
-		
-		return message;
-	}
-
-	private String GetPlatForm() throws Exception {
-		String url =  this.serverUrl + "/v1/query/platform-info";
-		String parameter = "platform_verify_key=SGCC_33_XLSWDL_FZM@";
-		String message = request.sendPost(url, parameter);
-	
-		return message;
-	}
-
-	// 设置积分兑换比例
-	public String requestSetCompanyExchangeRate(String companyId, int amount_op,
-			int amount,  String info) throws Exception {
-		if(("").equals(companyId)||("").equals(amount_op)||("").equals(amount)){
-			return "companyId  or amount_op or amount is empty";
-		}
-		String message = "";
-		String url =  this.serverUrl + "/v1/user/rate-set";
-		String parameter = "";
-		message = GetPlatForm();
-		
-		@SuppressWarnings("unchecked")
-		Map<String,Object> map =(Map<String,Object>)JSON.parse(message);
-		
-		if (200 == (Integer) map.get("code")) {
-			@SuppressWarnings("unchecked")
-			Map<String,Object> maps = (Map<String,Object>)JSON.parse("" + map.get("data"));
-			String random = (String) maps.get("random");
-			
-
-			String publicKey = (String) maps.get("publickey");
-			String privateKey = KeyUtils.getPrivateKey("gjdwjfxt", random);
-		
-
-			
-			if(("").equals(privateKey)||("").equals(publicKey)){
-				return "instructionId or signature is empty";
-			}
-			
-			
-			ProtobufBean pbSetCompanyExchangeRate = ProtobufUtils
-					.requestSetCompanyExchangeRate(privateKey, publicKey,
-							companyId, amount_op, amount, info);
-			
-			
-			String instructionId = ""+pbSetCompanyExchangeRate.getInstructionId();
-			String signature =  pbSetCompanyExchangeRate.getSignature();
-			if(("").equals(instructionId)||("").equals(signature)){
-				return "instructionId or signature is empty";
-			}
-			
-			try {
-				parameter = "companyId=" + companyId + "&amount_op="
-						+ amount_op + "&amount=" + amount + "&publickey="
-						+ publicKey + "&info=" + info + "&instructionId="
-						+ pbSetCompanyExchangeRate.getInstructionId()
-						+ "&signature="
-						+ pbSetCompanyExchangeRate.getSignature();
-			
-				message = request.sendPost(url, parameter);
-			} catch (Exception e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				throw e;
-			}
-			
-			return message;
-		}
-		return message;
-	}
-
-	// 积分兑入
-	public String requestBuyGwpoints(String companyId, int amount, String uid,
-			 String recordId) throws Exception {
-		if(("").equals(companyId)||("").equals(amount)||("").equals(uid)||("").equals(recordId)){
-			return "companyId or amount or recordId is empty";
-		}
-		String message = "";
-		String parameter = "";
-		String url =  this.serverUrl + "/v1/point/exchange-in";
-		message = this.GetUserInfo(uid);
-		if(("").equals(message)){
-			return "message is empty";
-		}
-		@SuppressWarnings("unchecked")
-		Map<String,Object> map = (Map<String,Object>) JSON.parse(message);
-
-		if (200 == (Integer) map.get("code")) {
-			@SuppressWarnings("unchecked")
-			Map<String,Object> maps = (Map<String,Object>) JSON.parse("" + map.get("data"));
-			String random = (String) maps.get("random");
-
-			String publicKey = (String) maps.get("publickey");
-			String privateKey = KeyUtils.getPrivateKey(uid, random);
-
-			ProtobufBean pbBuyGwpoints = ProtobufUtils.requestBuyGwpoints(
-					privateKey, publicKey, uid, companyId, amount);
-		
-			String instructionId = ""+pbBuyGwpoints.getInstructionId();
-			String signature =  pbBuyGwpoints.getSignature();
-			if(("").equals(instructionId)||("").equals(signature)){
-				return "instructionId or signature is empty";
-			}
-			try {
-				
-				parameter = "companyId=" + companyId + "&amount=" + amount
-						+ "&uid=" + uid + "&publickey=" + publicKey
-						+ "&instructionId=" + pbBuyGwpoints.getInstructionId()
-						+ "&signature=" + pbBuyGwpoints.getSignature()
-						+ "&record_id=" + recordId;
-				
-				message = request.sendPost(url, parameter);
-				
-
-			} catch (Exception e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				throw e;
-			}
-		
-			return message;
-		} else {
-			return message;
-		}
-
-	}
-
-	// 兑出
-	public String requestSellGwPoints(String companyId, int amount, String uid,
-			 String recordId) throws Exception {
-		if(("").equals(companyId)||("").equals(amount)||("").equals(uid)||("").equals(recordId)){
-			return "companyId or amount  or recordId is empty";
-		}
-		String message = "";
-		String url =  this.serverUrl + "/v1/point/exchange-out";
-		String parameter = "";
-		message = this.GetUserInfo(uid);
-		@SuppressWarnings("unchecked")
-		Map<String,Object> map = (Map<String,Object>) JSON.parse(message);
-
-		String mapString = "" + map.get("data");
-		if (200 == (Integer) map.get("code")) {
-			@SuppressWarnings("unchecked")
-			Map<String,Object> maps = (Map<String,Object>) JSON.parse(mapString);
-			String random = (String) maps.get("random");
-
-			String publicKey = (String) maps.get("publickey");
-			if(("").equals(random)||("").equals(publicKey)){
-				return "random or publickey is empty";
-			}
-			String privateKey = KeyUtils.getPrivateKey(uid, random);
-
-			ProtobufBean pbSellGwpoints = ProtobufUtils.requestSellGwPoints(
-					privateKey, publicKey, uid, companyId, amount);
-			
-
-			try {
-				String instructionId = ""+pbSellGwpoints.getInstructionId();
-				String signature =  pbSellGwpoints.getSignature();
-				if(("").equals(instructionId)||("").equals(signature)){
-					return "instructionId or signature is empty";
-				}
-				parameter = "companyId=" + companyId + "&amount=" + amount
-						+ "&uid=" + uid + "&publickey=" + publicKey
-						+ "&instructionId=" + pbSellGwpoints.getInstructionId()
-						+ "&signature=" + pbSellGwpoints.getSignature()
-						+ "&record_id=" + recordId;
-				
-				message = request.sendPost(url, parameter);
-			} catch (Exception e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-				throw e;
-			}
-
-			
-			return message;
-		} else {
-			return message;
-		}
-	}
-
-	// 同步
-	public String requestSyncPoints(int GwAmount, String uid)
-			throws Exception {
-		if(("").equals(uid)||("").equals(GwAmount)){
-			return "uid or GwAmount is empty";
-		}
-		String message = "";
-
-		String url =  this.serverUrl + "/v1/point/sync";
-		String parameter = "";
-
-		String usermessage = this.GetUserInfo(uid);
-		@SuppressWarnings("unchecked")
-		Map<String,Object> map = (Map<String,Object>) JSON.parse(usermessage);
-
-		if (200 == (Integer) map.get("code")) {
-			@SuppressWarnings("unchecked")
-			Map<String,Object> maps = (Map<String,Object>) JSON.parse("" + map.get("data"));
-			String random = (String) maps.get("random");
-
-			String publicKey = (String) maps.get("publickey");
-			String privateKey = KeyUtils.getPrivateKey(uid, random);
-
-			message = this.GetUnspent(uid);
-
-			if (("").equals(message)) {
-				return "getUnspent Exception ";
-			}
-			@SuppressWarnings("unchecked")
-			Map<String,Object> map1 = (Map<String,Object>) JSON.parse(message);
-
-			if (200 == (Integer) map1.get("code")) {
-				@SuppressWarnings("unchecked")
-				Map<String,Object> maps1 = (Map<String,Object>) JSON.parse("" + map1.get("data"));
-				
-				int blockChainAmount = Integer.parseInt(""
-						+ maps1.get("amount"));
-				int amount = 0;
-				int type = 0;
-				if (GwAmount > blockChainAmount) {
-					amount = GwAmount - blockChainAmount;
-					type = 1;
-				} else if (GwAmount < blockChainAmount) {
-					amount = blockChainAmount - GwAmount;
-					type = 2;
-				} else {
-					return message;
-				}
-				
-				
-
-				ProtobufBean pbSyncPoints = ProtobufUtils.requestSyncPoints(
-						privateKey, publicKey, uid, publicKey, amount, type);
-				
-
-				try {
-					String instructionId = ""+pbSyncPoints.getInstructionId();
-					String signature =  pbSyncPoints.getSignature();
-					if(("").equals(instructionId)||("").equals(signature)){
-						return "instructionId or signature is empty";
-					}
-					parameter = "type=" + type + "&amount=" + amount + "&uid="
-							+ uid + "&publickey=" + publicKey
-							+ "&instructionId="
-							+ pbSyncPoints.getInstructionId() + "&signature="
-							+ pbSyncPoints.getSignature();
-					message = request.sendPost(url, parameter);
-					
-				} catch (Exception e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-					throw e;
-				}
-				
-				return message;
-			} else {
-				return message;
-			}
-		} else {
-			return usermessage;
-
-		}
-
-	}
-
-	// 初始化平台
-	public String initPlant() throws Exception {
-
-		String message = "";
-		String url =  this.serverUrl + "/v1/user/platform-init";
-		String parameter = "";
-		String info = "SGCC";
-		String random = KeyUtils.getRandom();
-		try {
-			parameter = "password=" + "gjdwjfxt" + "&random=" + random + "&info="
-					+ info;
-			
-			message = request.sendPost(url, parameter);
-
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-			throw e;
-		}
-		
-		return message;
-	}
-
-	// 获取交易信息
-	public String getTransactionInfo(String recordId) throws Exception {
-		if(("").equals(recordId)){
-			return "recordId is empty";
-		}
-		String message = "";
-		
-		String url =  this.serverUrl + "/v1/query/transaction-info";
-		String param = "record_id=" + recordId;
-		message = request.sendGet(url, param);
-		
-		return message;
-
-	}
-}
-*/

+ 0 - 128
ccb_fund_trusteeship/src/main/java/com/fuzamei/http/HttpRequest.java

@@ -1,128 +0,0 @@
-package com.fuzamei.http;
-
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.List;
-import java.util.Map;
-
-
-public class HttpRequest implements Request{
-
-	@Override
-	public String sendPost(String url, String param) throws Exception {
-		
-		   PrintWriter out = null;
-	        BufferedReader in = null;
-	        String result = "";
-	        try {
-	            URL realUrl = new URL(url);
-	            // �򿪺�URL֮�������
-	            URLConnection conn = realUrl.openConnection();
-	            // ����ͨ�õ���������
-	            conn.setRequestProperty("accept", "*/*");
-	            conn.setRequestProperty("connection", "Keep-Alive");
-	            conn.setRequestProperty("user-agent",
-	                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-	            //2017年8月20日maamin添加
-	            conn.setRequestProperty("Content-Type", "application/json; charset=utf-8");
-	          //2017年8月20日maamin添加
-	            
-	            
-	            // ����POST�������������������
-	            conn.setDoOutput(true);
-	            conn.setDoInput(true);
-	            
-	            // ��ȡURLConnection�����Ӧ�������
-	            out = new PrintWriter(conn.getOutputStream());
-	            // �����������
-	            out.print(param);
-	            // flush������Ļ���
-	            out.flush();
-	            // ����BufferedReader����������ȡURL����Ӧ
-	            in = new BufferedReader(
-	                    new InputStreamReader(conn.getInputStream()));
-	            String line;
-	            while ((line = in.readLine()) != null) {
-	                result += line;
-	            }
-	        } catch (Exception e) {
-	            System.out.println("���� POST ��������쳣��"+e);
-	        //    e.printStackTrace();
-	            throw e;
-	        }
-	        //ʹ��finally�����ر��������������
-	        finally{
-	            try{
-	                if(out!=null){
-	                    out.close();
-	                }
-	                if(in!=null){
-	                    in.close();
-	                }
-	                
-	            }
-	            catch(IOException ex){
-	                ex.printStackTrace();
-	                throw ex;
-	            }
-	          
-	        }
-	        return result;
-	    }    
-
-	@Override
-	public String sendGet(String url, String param) throws Exception {
-		 String result = "";
-	        BufferedReader in = null;
-	        try {
-	            String urlNameString = url + "?" + param;
-	            URL realUrl = new URL(urlNameString);
-	            // �򿪺�URL֮�������
-	            URLConnection connection = realUrl.openConnection();
-	            // ����ͨ�õ���������
-	            connection.setRequestProperty("accept", "*/*");
-	            connection.setRequestProperty("connection", "Keep-Alive");
-	            connection.setRequestProperty("user-agent",
-	                    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
-	            // ����ʵ�ʵ�����
-	            connection.connect();
-	            // ��ȡ������Ӧͷ�ֶ�
-	            Map<String, List<String>> map = connection.getHeaderFields();
-	            // �������е���Ӧͷ�ֶ�
-	            for (String key : map.keySet()) {
-	                System.out.println(key + "--->" + map.get(key));
-	            }
-	            // ���� BufferedReader����������ȡURL����Ӧ
-	            in = new BufferedReader(new InputStreamReader(
-	                    connection.getInputStream()));
-	            String line;
-	            while ((line = in.readLine()) != null) {
-	                result += line;
-	            }
-	        } catch (Exception e) {
-	            System.out.println("����GET��������쳣��" + e);
-	            throw e;
-	           // e.printStackTrace();
-	           
-	        }
-	        // ʹ��finally�����ر�������
-	        finally {
-	            try {
-	                if (in != null) {
-	                    in.close();
-	                }
-	            } catch (Exception e2) {
-	            	throw e2;
-	              //  e2.printStackTrace();
-	            }
-	        }
-	        
-	        return result;
-	}
-	
-}

+ 0 - 103
ccb_fund_trusteeship/src/main/java/com/fuzamei/http/HttpsRequest.java

@@ -1,103 +0,0 @@
-package com.fuzamei.http;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.URL;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-
-
-
-
-public class HttpsRequest implements Request{
-public  class MyX509TrustManager implements X509TrustManager {
-		
-	    public void checkClientTrusted(X509Certificate[] chain, String authType)  
-	            throws CertificateException {  
-		  }
-	
-	    public void checkServerTrusted(X509Certificate[] chain, String authType)  
-	            throws CertificateException {  
-	        // TODO Auto-generated method stub  
-	  
-	    }  
-	
-	    public X509Certificate[] getAcceptedIssuers() {  
-	        // TODO Auto-generated method stub  
-	        return null;  
-	    }  
-	  
-	}  
-
-	//处理http请求  requestUrl为请求地址  requestMethod请求方式,值为"GET"或"POST"  
-
-	    public  String httpsRequest(String requestUrl,String requestMethod,String outputStr) throws Exception{  
-	        StringBuffer buffer=null;  
-	        try{  
-	        //创建SSLContext  
-	        SSLContext sslContext=SSLContext.getInstance("SSL"); 
-	
-	        TrustManager[] tm={(TrustManager) new MyX509TrustManager()};  
-	        //初始化  
-	        sslContext.init(null, tm, new java.security.SecureRandom());;  
-	        //获取SSLSocketFactory对象  
-	        SSLSocketFactory ssf=sslContext.getSocketFactory();  
-	        URL url=new URL(requestUrl);  
-	        HttpsURLConnection conn=(HttpsURLConnection)url.openConnection();  
-	        conn.setDoOutput(true);  
-	        conn.setDoInput(true);  
-	        conn.setUseCaches(false);  
-	        conn.setRequestMethod(requestMethod);  
-	        //设置当前实例使用的SSLSoctetFactory  
-	        conn.setSSLSocketFactory(ssf);  
-	        conn.connect();  
-	        //往服务器端写内容  
-	        if(null!=outputStr){  
-	            OutputStream os=(OutputStream) conn.getOutputStream();  
-	            os.write(outputStr.getBytes("utf-8"));  
-	            os.close();  
-	        }  
-	          
-	        //读取服务器端返回的内容  
-	        InputStream is=(InputStream) conn.getInputStream();  
-	        InputStreamReader isr=new InputStreamReader(is,"utf-8");  
-	        BufferedReader br=new BufferedReader(isr);  
-	        buffer=new StringBuffer();  
-	        String line=null;  
-	        while((line=br.readLine())!=null){  
-	            buffer.append(line);  
-	        }  
-	        }catch(Exception e){  
-	            e.printStackTrace();  
-	            throw e ;
-	        }  
-	        return buffer.toString();  
-	    }  
-	
-	    
-	    /* 
-	     * 处理https GET/POST请求 
-	     * 请求地址、请求方法、参数 
-	     * */  
-	    public String sendPost(String requestUrl,String outputStr) throws Exception{  
-	    	return  httpsRequest(requestUrl, "POST", outputStr);
-	    	
-	    }  
-	    /* 
-	     * 处理https GET/POST请求 
-	     * 请求地址、请求方法、参数 
-	     * */  
-	    public String sendGet(String requestUrl,String outputStr) throws Exception{  
-	    	return  httpsRequest(requestUrl+"?"+outputStr, "GET", null);
-	    }  
-	    
-}

+ 0 - 6
ccb_fund_trusteeship/src/main/java/com/fuzamei/http/Request.java

@@ -1,6 +0,0 @@
-package com.fuzamei.http;
-
-public interface Request {
-		public String sendPost(String url, String param) throws Exception;
-		public String sendGet(String url, String param) throws Exception;
-}

+ 0 - 14
ccb_fund_trusteeship/src/main/java/com/fuzamei/http/RequestFactory.java

@@ -1,14 +0,0 @@
-package com.fuzamei.http;
-
-public class RequestFactory {
-		public static Request createRequest(String url){
-			
-			if(("https").equals(url.substring(0,5))){
-				return  new HttpsRequest();
-			}else{
-				return new HttpRequest();
-			}
-			
-			
-		}
-}

+ 0 - 84
ccb_fund_trusteeship/src/main/java/com/fuzamei/interceptor/TokenInterceptor.java

@@ -1,84 +0,0 @@
-/**  
- * @Title: TokenFilter.java
- * @Package: com.fuzamei.filter
- * @Description: TODO 
- * @author: Ma Amin
- * @date: 2017-10-31 下午12:02:38
- */
-package com.fuzamei.interceptor;
-
-
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-import com.alibaba.fastjson.JSONObject;
-
-/** 
- * @file_name: TokenFilter.java
- * @Description: TODO token拦截,ture--放行。false---过滤
- * @author: Ma Amin
- * @date: 2017-10-31 下午12:02:38 
- * @version 1.0
- */
-public class TokenInterceptor extends HandlerInterceptorAdapter{/*
-	@Autowired
-	private AccountService accountService;
-	 (non-Javadoc)
-	 * @see org.springframework.web.servlet.handler.HandlerInterceptorAdapter#preHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object)
-	 
-	@Override
-	public boolean preHandle(HttpServletRequest request,
-			HttpServletResponse response, Object handler) throws Exception {
-		// TODO Auto-generated method stub
-		PrintWriter out = null;
-		JSONObject json = new JSONObject();
-		if(request.getHeader("Authorization") == null){
-			json.put("code", 12431);
-			json.put("success", false);
-			json.put("message", "Authorization为空");
-			json.put("data", null);
-			out = response.getWriter();
-			out.append(json.toString());
-			return false;
-		}
-		String tokenAndUserId = request.getHeader("Authorization").toString();
-		String token = tokenAndUserId.split("&")[0].toString().replace("Bearer ", "");//token
-		int accountId = Integer.parseInt(tokenAndUserId.split("&")[1]);	//账户id
-		if(token == null){
-			json.put("code", 12431);
-			json.put("success", false);
-			json.put("message", "token为空");
-			json.put("data", null);
-			out = response.getWriter();
-			out.append(json.toString());
-			return false;
-		}
-		boolean flag = accountService.verificationToken(accountId, token);
-		if(flag){
-			json.put("code", 200);
-			json.put("success", true);
-			json.put("message", "token验证通过");
-			json.put("data", null);
-			out = response.getWriter();
-			out.append(json.toString());
-			return true;
-		}
-		json.put("code", 12431);
-		json.put("success", false);
-		json.put("message", "token验证失败");
-		json.put("data", null);
-		out = response.getWriter();
-		out.append(json.toString());
-		return false;
-	}
-*/}

+ 0 - 20
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountInfoInterface.java

@@ -1,20 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.ibatis.annotations.Param;
-
-import com.fuzamei.entity.AccountInfo;
-
-public interface AccountInfoInterface {
-
-	List<AccountInfo> getAllAccount();
-
-	int insertAccountInfo(List<Map<String, Object>> accountList);
-
-	List<AccountInfo> getAccountInfoByUser(String userId);
-
-	int updateBatchAccountById(@Param("parameter")Map<String, Map<String, Object>> parameter, @Param("cloumn")List<String> cloumn);
-	
-}

+ 0 - 15
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountMaintenanceMapper.java

@@ -1,15 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.AccountOpeningRecord;
-
-public interface AccountMaintenanceMapper {
-	public  void  insertIntoAccountMaintenanceInfo(Map<String, Object> map);//添加上传(文件)账户维护信息表 
-	public  void  insertAccountMaintenanceInfoFuJianBiao(Map<String, Object> map);//账户维护开立 上传一份数据到附件表
-	public  void  insertAccountMaintenanceInfoOperationHistory(Map<String, Object> map);//当经办支行进行账户开立维护上传文件的时候往(操作记录表)也插入一条数据
-	public List<AccountOpeningRecord> selectAccountMaintenanceInfo(Map<String, Object> map);//查询账户开立信息维护列表
-	public  int selectCountAccountMaintenancePage(Map<String, Object> map);//查询账户维护开立信息总页数  返回一个int类型
-	public List<AccountOpeningRecord> selectAccountMaintenanceNoPage(Map<String, Object> map);//账户开立 通过点击查看  供应下载页面  
-}

+ 0 - 26
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AccountOpenMapper.java

@@ -1,26 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.AccountOpeningRecord;
-import com.fuzamei.entity.PromptLetter;
-import com.fuzamei.entity.User;
-
-public interface AccountOpenMapper {
-	public List<AccountOpeningRecord> queryAllAccountOpening(Map<String, Object> map);//查询账户开立列表
-	public  int serchCountPage();//总页数
-	public  int serchCountPage2();//提示函总页数
-	public List<AccountOpeningRecord> selectAccountopenNoPage(Map<String, Object> map);//账户开立 通过点击查看  供应下载页面  
-	public List<PromptLetter> selectPromptLetter(Map<String, Object> map);//查询风险提示函     接收人列表
-	public void insertOperationHistory(Map<String, Object> map);//账户开立上传的时候也往操作记录表插入一条数据     多方法公用
-	public void insertTiShiHanOrUserOrOtherTable(Map<String, Object> map);//插入管理人账号 还要往附件表,提示函表,操作记录表里也要加数据
-	public List<PromptLetter> selectTishihan(Map<String, Object> map);//查询风险提示函3 ,省分行拓托管中心风管岗    发送列表
-	public void insertTrueFalseSelect(Map<String, Object> map);//真伪查询   记录插入到附件表
-	public void insertAccountUploadFile(Map<String, Object> map);//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称 -->
-	public void insertAccountUploadFileFuJianBiao(Map<String, Object> map);//<!-- 上传客户资料,承诺书,开户申请书    经办支行添加创建账号和客户名称 -->上传到附件表
-	public void insertIntoPromptLetterTable(Map<String, Object> map);//数据往提示函插入
-	public void insertIntoAttachmentTable(Map<String, Object> map);//提示函数据在往附件表也插入
-	////////////////////////////////////////////////////////////////////////////////////////
-	
-}

+ 0 - 13
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/AttachmentMapper.java

@@ -1,13 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.Set;
-
-import org.apache.ibatis.annotations.Param;
-
-public interface AttachmentMapper {
-
-	int queryIfHasTheSameAttachmentId(Integer attachmentId);
-
-	int queryIfHasTheSameAttachmentIdS(@Param("set")Set<Integer> set);
-	
-}

+ 0 - 41
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/BusinessDeclareMapper.java

@@ -1,41 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.BusinessCheck;
-import com.fuzamei.entity.BusinessDeclare;
-
-public interface BusinessDeclareMapper {
-
-	void insertBusinessDeclareInformationToDaoByBranchBank(Map<String, Object> map);
-
-	void insertAttachmentInformationToDaoByBranchBank(Map<String, Object> map);
-
-	int findAllInfromations(Map<String, Object> map);
-
-	List<BusinessDeclare> queryBusinessDeclareInformation(Map<String, Object> map);
-
-	List<BusinessCheck> queryBusinessCheckInformation(Map<String, Object> map);
-
-	void businessDeclareCheckedBy(Map<String, Object> map);
-
-	void updateBusinessDeclareStatus(Map<String, Object> map);
-
-	void insertContractInformationToContractRecord(Map<String, Object> map);
-
-	void insertContractInformationToContractStatusTracking(Map<String, Object> map);
-
-	void insertContractInformationToAttachment(Map<String, Object> map);
-
-	void insertOperationHistoryInformationToDaoByBranchBank(Map<String, Object> map);
-
-	int queryIfHasTheSameBusinessId(Integer businessId);
-
-	List<BusinessDeclare> queryBusinessDeclareInformationByPBB(Map<String, Object> map);
-
-	int findAllInfromationsByPBB(Map<String, Object> map);
-
-	Integer getStatusIdByBusinessId(Integer businessId);
-
-}

+ 0 - 38
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/CapitalTransferMapper.java

@@ -1,38 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.AccountInfo;
-import com.fuzamei.entity.CapitalTransfer;
-import com.fuzamei.entity.CapitalTransferCheck;
-import com.fuzamei.entity.UserAccount;
-
-public interface CapitalTransferMapper {
-
-	public List<CapitalTransfer> selectCapitalTransferTable(Map<String, Object> map);//查询资金划转列表          指令业务岗和管理人能查看列表
-	public List<CapitalTransfer> selectCapitalTransferTable2(Map<String, Object> map);//查询资金划转列表      指令业务岗审核通过后  核算业务岗才能看到列表里之前的审核信息
-	public List<CapitalTransfer> selectCapitalTransferTable3(Map<String, Object> map);//查询资金划转列表      指令业务岗和核算业务岗审核同过后 核算主管岗才能看到之前2级的审核信息
-	
-    public int  selectCapitalTransferPage(Map<String, Object> map);//查询资金划转表     总页数
-    public int  selectCapitalTransferPage2(Map<String, Object> map);//查询资金划转表     总页数
-    public int  selectCapitalTransferPage3(Map<String, Object> map);//查询资金划转表     总页数
-    
-	public  List<CapitalTransfer> selectChaKanZiJinHuaZhuan(Map<String, Object> map);//资金划转    查看详情
-	public  List<CapitalTransferCheck> selectCapitalTransferRecord(Map<String, Object> map);//资金划转 里审核记录   查看详情
-    public void insertCapitalTransfer(Map<String, Object> map);//管理人发起划款资金
-    
-	public void insertCheckTransfer(Map<String, Object> map);//将划转资金审核的意见插入到(划转资金审核表里)
-	public void updateCapitaltransferStatus(Map<String, Object> map);//将划转审核结果意见在插入划转资金表的同时,也将审核结果更新到划转资金表中去,根据基金id 》fund_id修改指定的业务
-	
-	public List<CapitalTransferCheck> queryCapitalTransferCheckInformation(Map<String, Object> map); //<!-- 根据资金划转id查询划转审核状态id值 -->
-	public Integer getStatusIdByCapitalId(Integer fund_id);
-    public void insertOperationHistory(Map<String, Object> map);//往操作记录表插入
-    public void insertAttachmentInfo(Map<String, Object> map);//往附件表插入
-    public void updateTUserAccountBalance(Map<String, Object> map);//划转资金后  修改账户里的余额
-    public void updateAccountMoney(Map<String, Object> map);//划转资金后把 账户表里的账户钱要修改(加起来)
-   
-    public List<AccountInfo> queryAccountWhereUserId(int user_id);//根据用户id查询账户信息表有多少 账户名称(account_name)返给前端
-  
-    
-}

+ 0 - 41
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/ContractManagementMapper.java

@@ -1,41 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.ibatis.annotations.Param;
-
-import com.fuzamei.entity.ContractRecord;
-import com.fuzamei.entity.ContractStatusTracking;
-
-public interface ContractManagementMapper {
-
-	List<ContractStatusTracking> queryContractStatusTracking(Map<String, Object> map);
-
-	int findAllContractStatusTrackingInformation(Map<String, Object> map);
-
-	List<ContractRecord> queryContractRecord(Map<String, Object> map);
-
-	int findAllContractRecordInformation(Map<String, Object> map);
-
-	ContractStatusTracking getContractStatusTrackingByBusinessId(Integer businessId);
-
-	void insertInformationToAttachment(Map<String, Object> map);
-
-	void insertInformationToOperationHistory(Map<String, Object> map);
-
-	ContractRecord getLatestContractRecordByBusinessId(Integer businessId);
-
-	void insertInformationToContractRecord(Map<String, Object> map);
-
-	void updateContractStatusTracking(Map<String, Object> map);
-
-	ContractRecord getCurrentContractRecordByBusinessId(@Param("businessId") Integer businessId,@Param("version") Integer version);
-
-	void updateContractRecord(Map<String, Object> map);
-
-	void updateOtherContractRecord(Map<String, Object> map);
-
-	void updateContractStatusTrackingStatusAndContractId(Map<String, Object> map);
-	
-}

+ 0 - 15
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/OperationHistoryMapper.java

@@ -1,15 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.OperationHistory;
-
-public interface OperationHistoryMapper {
-
-	int findAllInformation(Map<String, Object> map);
-	
-	List<OperationHistory> queryOperationHistoryInformation(Map<String, Object> map);
-
-	List<OperationHistory> queryOperationHistoryInformationByUser(Map<String, Object> map);
-}

+ 0 - 22
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/ProjectFileMapper.java

@@ -1,22 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.ProjectFile;
-
-public interface ProjectFileMapper {
-
-	int findAllInformation(Map<String, Object> map);
-
-	List<ProjectFile> queryProjectFileInformation(Map<String, Object> mapToDao);
-
-	List<ProjectFile> checkoutProjectFiles(Map<String, Object> mapToDao);
-
-	void insertInformationIntoTable(Map<String, Object> mapToDao);
-
-	void insertOperationHistoryInformationToDao(Map<String, Object> map);
-
-	void insertInformationToAttachment(Map<String, Object> map);
-
-}

+ 0 - 17
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/PromptLetterMapper.java

@@ -1,17 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-import com.fuzamei.entity.PromptLetter;
-
-public interface PromptLetterMapper {
-	
-	public List<PromptLetter> queryPromptLetterByAdmin(Map<String, Object> map);//查询风险提示函     接收人列表
-	public void insertIntoPromptLetterTable(Map<String, Object> map);//提示函插入数据信息
-	public void insertIntoAttachmentTable(Map<String, Object> map);//提示函数据在往附件表也插入
-	public void insertOperationHistory(Map<String, Object> map);//提示函也往操作记录表李插入
-	public int findAllInformation(Map<String, Object> map);//根据条件查询所有符合的信息条数
-	public List<PromptLetter> queryPromptLetterByVenture(Map<String, Object> map);
-	
-}

+ 0 - 12
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/RoleInterface.java

@@ -1,12 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-
-import com.fuzamei.entity.Role;
-
-
-public interface RoleInterface {
-
-	List<Role> getAllRoles();
-
-}

+ 0 - 14
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/TokenInterface.java

@@ -1,14 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import com.fuzamei.entity.Token;
-import com.fuzamei.entity.User;
-
-public interface TokenInterface {
-
-	Token getTokenById(Token token);
-
-	int insertToken(Token token);
-
-	int updateToken(Token token);
-	
-}

+ 0 - 7
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/TrueFalseSelectMapper.java

@@ -1,7 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.Map;
-
-public interface TrueFalseSelectMapper {
-	public void insertOperationHistory(Map<String, Object> map);//真伪查询  往操作记录表查询
-}

+ 0 - 10
ccb_fund_trusteeship/src/main/java/com/fuzamei/mapperInterface/UserAccountInterface.java

@@ -1,10 +0,0 @@
-package com.fuzamei.mapperInterface;
-
-import java.util.List;
-import java.util.Map;
-
-public interface UserAccountInterface {
-
-	int insertUserAccount(List<Map<String, Object>> accountList);
-
-}

Някои файлове не бяха показани, защото твърде много файлове са промени