aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/donna128.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-23 17:09:54 +0000
committerlloyd <[email protected]>2015-01-23 17:09:54 +0000
commitb6cc9a4084caf6d9d4b955fadc321f6521f2b36e (patch)
tree89eb2fcb93014c016ed61b0967f3af649e5b8c86 /src/lib/utils/donna128.h
parent9a0da0565c042c0f0a09caed036621c47e3f494e (diff)
Amalgamation fixes
Diffstat (limited to 'src/lib/utils/donna128.h')
-rw-r--r--src/lib/utils/donna128.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/utils/donna128.h b/src/lib/utils/donna128.h
index 2cfeb455f..037d9bdfe 100644
--- a/src/lib/utils/donna128.h
+++ b/src/lib/utils/donna128.h
@@ -111,6 +111,17 @@ inline u64bit combine_lower(const donna128 a, size_t s1,
return z.lo();
}
+inline u64bit carry_shift(const uint128_t a, size_t shift)
+ {
+ return static_cast<u64bit>(a >> shift);
+ }
+
+inline u64bit combine_lower(const uint128_t a, size_t s1,
+ const uint128_t b, size_t s2)
+ {
+ return static_cast<u64bit>((a >> s1) | (b << s2));
+ }
+
}
#endif