[Ceres]: Add bitwise ops, Address.to_bytes and Crypto.poseidon

This commit is contained in:
Hans Svensson
2021-10-29 13:34:40 +02:00
committed by Hans Svensson
parent 5c3b42aff1
commit f60f9122ba
16 changed files with 128 additions and 236 deletions
+8
View File
@@ -632,6 +632,14 @@ All operations are *safe* with respect to overflow and underflow.
The division and modulo operations throw an arithmetic error if the
right-hand operand is zero.
Sophia arbitrary-sized integers (FATE) also supports the following bitwise operations:
- bitwise and (`x band y`)
- bitwise or (`x bor y`)
- bitwise xor (`x bxor y`)
- bitwise not (`bnot x`)
- arithmetic bitshift left (`x << n`)
- arithmetic bitshift right (`x >> n`)
## Bit fields
Sophia integers do not support bit arithmetic. Instead there is a separate