Java Doc for Tnaf.java in  » Security » Bouncy-Castle » org » bouncycastle » math » ec » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Security » Bouncy Castle » org.bouncycastle.math.ec 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.bouncycastle.math.ec.Tnaf

Tnaf
class Tnaf (Code)
Class holding methods for point multiplication based on the window τ-adic nonadjacent form (WTNAF). The algorithms are based on the paper "Improved Algorithms for Arithmetic on Anomalous Binary Curves" by Jerome A. Solinas. The paper first appeared in the Proceedings of Crypto 1997.


Field Summary
final public static  bytePOW_2_WIDTH
    
final public static  byteWIDTH
     The window width of WTNAF.
final public static  ZTauElement[]alpha0
     The αu's for a=0 as an array of ZTauElements.
final public static  byte[][]alpha0Tnaf
     The αu's for a=0 as an array of TNAFs.
final public static  ZTauElement[]alpha1
     The αu's for a=1 as an array of ZTauElements.
final public static  byte[][]alpha1Tnaf
     The αu's for a=1 as an array of TNAFs.


Method Summary
public static  SimpleBigDecimalapproximateDivisionByN(BigInteger k, BigInteger s, BigInteger vm, byte a, int m, int c)
     Approximate division by n.
public static  BigInteger[]getLucas(byte mu, int k, boolean doV)
     Calculates the Lucas Sequence elements Uk-1 and Uk or Vk-1 and Vk.
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  k - The index of the second element of the Lucas Sequence to bereturned.
Parameters:
  doV - If set to true, computes Vk-1 andVk, otherwise Uk-1 andUk.
public static  bytegetMu(ECCurve.F2m curve)
     Returns the parameter μ of the elliptic curve.
Parameters:
  curve - The elliptic curve from which to obtain μ.The curve must be a Koblitz curve, i.e.
public static  ECPoint.F2m[]getPreComp(ECPoint.F2m p, byte a)
     Does the precomputation for WTNAF multiplication.
Parameters:
  p - The ECPoint for which to do the precomputation.
Parameters:
  a - The parameter a of the elliptic curve.
public static  BigInteger[]getSi(ECCurve.F2m curve)
     Computes the auxiliary values s0 and s1 used for partial modular reduction.
public static  BigIntegergetTw(byte mu, int w)
     Computes the auxiliary value tw.
public static  ECPoint.F2mmultiplyFromTnaf(ECPoint.F2m p, byte[] u)
     Multiplies a org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m by an element λ of Z[τ] using the τ-adic NAF (TNAF) method, given the TNAF of λ.
Parameters:
  p - The ECPoint.F2m to multiply.
Parameters:
  u - The the TNAF of λ..
public static  ECPoint.F2mmultiplyRTnaf(ECPoint.F2m p, BigInteger k)
     Multiplies a org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m by a BigInteger using the reduced τ-adic NAF (RTNAF) method.
Parameters:
  p - The ECPoint.F2m to multiply.
Parameters:
  k - The BigInteger by which to multiply p.
public static  ECPoint.F2mmultiplyTnaf(ECPoint.F2m p, ZTauElement lambda)
     Multiplies a org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m by an element λ of Z[τ] using the τ-adic NAF (TNAF) method.
Parameters:
  p - The ECPoint.F2m to multiply.
Parameters:
  lambda - The element λ ofZ[τ].
public static  BigIntegernorm(byte mu, ZTauElement lambda)
     Computes the norm of an element λ of Z[τ].
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  lambda - The element λ ofZ[τ].
public static  SimpleBigDecimalnorm(byte mu, SimpleBigDecimal u, SimpleBigDecimal v)
     Computes the norm of an element λ of R[τ], where λ = u + vτ and u and u are real numbers (elements of R).
public static  ZTauElementpartModReduction(BigInteger k, int m, byte a, BigInteger[] s, byte mu, byte c)
     Partial modular reduction modulo m - 1)/(τ - 1).
Parameters:
  k - The integer to be reduced.
Parameters:
  m - The bitlength of the underlying finite field.
Parameters:
  a - The parameter a of the elliptic curve.
Parameters:
  s - The auxiliary values s0 ands1.
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  c - The precision (number of bits of accuracy) of the partialmodular reduction.
public static  ZTauElementround(SimpleBigDecimal lambda0, SimpleBigDecimal lambda1, byte mu)
     Rounds an element λ of R[τ] to an element of Z[τ], such that their difference has minimal norm.
public static  ECPoint.F2mtau(ECPoint.F2m p)
     Applies the operation τ() to an ECPoint.F2m.
public static  byte[]tauAdicNaf(byte mu, ZTauElement lambda)
     Computes the τ-adic NAF (non-adjacent form) of an element λ of Z[τ].
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  lambda - The element λ ofZ[τ].
public static  byte[]tauAdicWNaf(byte mu, ZTauElement lambda, byte width, BigInteger pow2w, BigInteger tw, ZTauElement[] alpha)
     Computes the [τ]-adic window NAF of an element λ of Z[τ].
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  lambda - The element λ ofZ[τ] of which to compute the[τ]-adic NAF.
Parameters:
  width - The window width of the resulting WNAF.
Parameters:
  pow2w - 2width.
Parameters:
  tw - The auxiliary value tw.
Parameters:
  alpha - The αu's for the window width.

Field Detail
POW_2_WIDTH
final public static byte POW_2_WIDTH(Code)
24



WIDTH
final public static byte WIDTH(Code)
The window width of WTNAF. The standard value of 4 is slightly less than optimal for running time, but keeps space requirements for precomputation low. For typical curves, a value of 5 or 6 results in a better running time. When changing this value, the αu's must be computed differently, see e.g. "Guide to Elliptic Curve Cryptography", Darrel Hankerson, Alfred Menezes, Scott Vanstone, Springer-Verlag New York Inc., 2004, p. 121-122



alpha0
final public static ZTauElement[] alpha0(Code)
The αu's for a=0 as an array of ZTauElements.



alpha0Tnaf
final public static byte[][] alpha0Tnaf(Code)
The αu's for a=0 as an array of TNAFs.



alpha1
final public static ZTauElement[] alpha1(Code)
The αu's for a=1 as an array of ZTauElements.



alpha1Tnaf
final public static byte[][] alpha1Tnaf(Code)
The αu's for a=1 as an array of TNAFs.





Method Detail
approximateDivisionByN
public static SimpleBigDecimal approximateDivisionByN(BigInteger k, BigInteger s, BigInteger vm, byte a, int m, int c)(Code)
Approximate division by n. For an integer k, the value λ = s k / n is computed to c bits of accuracy.
Parameters:
  k - The parameter k.
Parameters:
  s - The curve parameter s0 ors1.
Parameters:
  vm - The Lucas Sequence element Vm.
Parameters:
  a - The parameter a of the elliptic curve.
Parameters:
  m - The bit length of the finite fieldFm.
Parameters:
  c - The number of bits of accuracy, i.e. the scale of the returnedSimpleBigDecimal. The value λ = s k / n computed toc bits of accuracy.



getLucas
public static BigInteger[] getLucas(byte mu, int k, boolean doV)(Code)
Calculates the Lucas Sequence elements Uk-1 and Uk or Vk-1 and Vk.
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  k - The index of the second element of the Lucas Sequence to bereturned.
Parameters:
  doV - If set to true, computes Vk-1 andVk, otherwise Uk-1 andUk. An array with 2 elements, containing Uk-1and Uk or Vk-1and Vk.



getMu
public static byte getMu(ECCurve.F2m curve)(Code)
Returns the parameter μ of the elliptic curve.
Parameters:
  curve - The elliptic curve from which to obtain μ.The curve must be a Koblitz curve, i.e. a equals0 or 1 and b equals1. μ of the elliptic curve.
throws:
  IllegalArgumentException - if the given ECCurve is not a Koblitzcurve.



getPreComp
public static ECPoint.F2m[] getPreComp(ECPoint.F2m p, byte a)(Code)
Does the precomputation for WTNAF multiplication.
Parameters:
  p - The ECPoint for which to do the precomputation.
Parameters:
  a - The parameter a of the elliptic curve. The precomputation array for p.



getSi
public static BigInteger[] getSi(ECCurve.F2m curve)(Code)
Computes the auxiliary values s0 and s1 used for partial modular reduction.
Parameters:
  curve - The elliptic curve for which to computes0 and s1.
throws:
  IllegalArgumentException - if curve is not aKoblitz curve (Anomalous Binary Curve, ABC).



getTw
public static BigInteger getTw(byte mu, int w)(Code)
Computes the auxiliary value tw. If the width is 4, then for mu = 1, tw = 6 and for mu = -1, tw = 10
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  w - The window width of the WTNAF. the auxiliary value tw



multiplyFromTnaf
public static ECPoint.F2m multiplyFromTnaf(ECPoint.F2m p, byte[] u)(Code)
Multiplies a org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m by an element λ of Z[τ] using the τ-adic NAF (TNAF) method, given the TNAF of λ.
Parameters:
  p - The ECPoint.F2m to multiply.
Parameters:
  u - The the TNAF of λ.. λ * p



multiplyRTnaf
public static ECPoint.F2m multiplyRTnaf(ECPoint.F2m p, BigInteger k)(Code)
Multiplies a org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m by a BigInteger using the reduced τ-adic NAF (RTNAF) method.
Parameters:
  p - The ECPoint.F2m to multiply.
Parameters:
  k - The BigInteger by which to multiply p. k * p



multiplyTnaf
public static ECPoint.F2m multiplyTnaf(ECPoint.F2m p, ZTauElement lambda)(Code)
Multiplies a org.bouncycastle.math.ec.ECPoint.F2m ECPoint.F2m by an element λ of Z[τ] using the τ-adic NAF (TNAF) method.
Parameters:
  p - The ECPoint.F2m to multiply.
Parameters:
  lambda - The element λ ofZ[τ]. λ * p



norm
public static BigInteger norm(byte mu, ZTauElement lambda)(Code)
Computes the norm of an element λ of Z[τ].
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  lambda - The element λ ofZ[τ]. The norm of λ.



norm
public static SimpleBigDecimal norm(byte mu, SimpleBigDecimal u, SimpleBigDecimal v)(Code)
Computes the norm of an element λ of R[τ], where λ = u + vτ and u and u are real numbers (elements of R).
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  u - The real part of the element λ ofR[τ].
Parameters:
  v - The τ-adic part of the elementλ of R[τ]. The norm of λ.



partModReduction
public static ZTauElement partModReduction(BigInteger k, int m, byte a, BigInteger[] s, byte mu, byte c)(Code)
Partial modular reduction modulo m - 1)/(τ - 1).
Parameters:
  k - The integer to be reduced.
Parameters:
  m - The bitlength of the underlying finite field.
Parameters:
  a - The parameter a of the elliptic curve.
Parameters:
  s - The auxiliary values s0 ands1.
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  c - The precision (number of bits of accuracy) of the partialmodular reduction. ρ := k partmod (τm - 1)/(τ - 1)



round
public static ZTauElement round(SimpleBigDecimal lambda0, SimpleBigDecimal lambda1, byte mu)(Code)
Rounds an element λ of R[τ] to an element of Z[τ], such that their difference has minimal norm. λ is given as λ = λ0 + λ1τ.
Parameters:
  lambda0 - The component λ0.
Parameters:
  lambda1 - The component λ1.
Parameters:
  mu - The parameter μ of the elliptic curve. Mustequal 1 or -1. The rounded element of Z[τ].
throws:
  IllegalArgumentException - if lambda0 andlambda1 do not have same scale.



tau
public static ECPoint.F2m tau(ECPoint.F2m p)(Code)
Applies the operation τ() to an ECPoint.F2m.
Parameters:
  p - The ECPoint.F2m to which τ() is applied. τ(p)



tauAdicNaf
public static byte[] tauAdicNaf(byte mu, ZTauElement lambda)(Code)
Computes the τ-adic NAF (non-adjacent form) of an element λ of Z[τ].
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  lambda - The element λ ofZ[τ]. The τ-adic NAF of λ.



tauAdicWNaf
public static byte[] tauAdicWNaf(byte mu, ZTauElement lambda, byte width, BigInteger pow2w, BigInteger tw, ZTauElement[] alpha)(Code)
Computes the [τ]-adic window NAF of an element λ of Z[τ].
Parameters:
  mu - The parameter μ of the elliptic curve.
Parameters:
  lambda - The element λ ofZ[τ] of which to compute the[τ]-adic NAF.
Parameters:
  width - The window width of the resulting WNAF.
Parameters:
  pow2w - 2width.
Parameters:
  tw - The auxiliary value tw.
Parameters:
  alpha - The αu's for the window width. The [τ]-adic window NAF ofλ.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.