MCPcopy Index your code
hub / github.com/bcgit/bc-java / Nat160

Class Nat160

core/src/main/java/org/bouncycastle/math/raw/Nat160.java:7–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import org.bouncycastle.util.Pack;
6
7public abstract class Nat160
8{
9 private static final long M = 0xFFFFFFFFL;
10
11 public static int add(int[] x, int[] y, int[] z)
12 {
13 long c = 0;
14 c += (x[0] & M) + (y[0] & M);
15 z[0] = (int)c;
16 c >>>= 32;
17 c += (x[1] & M) + (y[1] & M);
18 z[1] = (int)c;
19 c >>>= 32;
20 c += (x[2] & M) + (y[2] & M);
21 z[2] = (int)c;
22 c >>>= 32;
23 c += (x[3] & M) + (y[3] & M);
24 z[3] = (int)c;
25 c >>>= 32;
26 c += (x[4] & M) + (y[4] & M);
27 z[4] = (int)c;
28 c >>>= 32;
29 return (int)c;
30 }
31
32 public static int addBothTo(int[] x, int[] y, int[] z)
33 {
34 long c = 0;
35 c += (x[0] & M) + (y[0] & M) + (z[0] & M);
36 z[0] = (int)c;
37 c >>>= 32;
38 c += (x[1] & M) + (y[1] & M) + (z[1] & M);
39 z[1] = (int)c;
40 c >>>= 32;
41 c += (x[2] & M) + (y[2] & M) + (z[2] & M);
42 z[2] = (int)c;
43 c >>>= 32;
44 c += (x[3] & M) + (y[3] & M) + (z[3] & M);
45 z[3] = (int)c;
46 c >>>= 32;
47 c += (x[4] & M) + (y[4] & M) + (z[4] & M);
48 z[4] = (int)c;
49 c >>>= 32;
50 return (int)c;
51 }
52
53 public static int addTo(int[] x, int[] z)
54 {
55 long c = 0;
56 c += (x[0] & M) + (z[0] & M);
57 z[0] = (int)c;
58 c >>>= 32;
59 c += (x[1] & M) + (z[1] & M);
60 z[1] = (int)c;
61 c >>>= 32;
62 c += (x[2] & M) + (z[2] & M);
63 z[2] = (int)c;
64 c >>>= 32;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected