I'm trying to implement the tiny encryption algorithm (TEA) in Oberon
(latest revision). However, I can't find a way to perform bitwise XOR (exclusive or) on integers. I know that for sets the symmetric
difference can be calculated using / but there is no way to convert an integer to a set. Any clues?
https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm
https://www.miasap.se/obnc/oberon-report.html
You can use SYSTEM.VAL to typecast an INTEGER to a SET.
On 2019-09-29 01:21, cfbsoftware wrote:
You can use SYSTEM.VAL to typecast an INTEGER to a SET.
Ah, of course. Thanks! Below is my implementation in Oberon. Is there a
more efficient way to implement logical right shift?
On Sunday, September 29, 2019 at 7:06:53 PM UTC+9:30, August Karlstrom wrote:
On 2019-09-29 01:21, cfbsoftware wrote:
You can use SYSTEM.VAL to typecast an INTEGER to a SET.
Ah, of course. Thanks! Below is my implementation in Oberon. Is there a
more efficient way to implement logical right shift?
Try ROR(LSL(ROR(x, n), n), n)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 52:25:04 |
Calls: | 6,650 |
Calls today: | 2 |
Files: | 12,200 |
Messages: | 5,330,388 |