@@ -184,7 +184,7 @@ to access individual bytes by index as a primitive operation. Thus, we can view
184
184
a ` BuiltinByteString ` as an indexed collection of bytes; for any
185
185
` BuiltinByteString ` $b$ of length $n$, and any $i \in 0, 1, \ldots, n - 1$, we
186
186
define $b\\ {i\\ }$ as the byte at index $i$ in $b$, as defined by the
187
- ` builtinIndexByteString ` primitive. In essence, for any ` BuiltinByteString ` of
187
+ ` indexByteString ` primitive. In essence, for any ` BuiltinByteString ` of
188
188
length ` n ` , we have _ byte_ indexes as follows:
189
189
190
190
```
@@ -354,7 +354,7 @@ their lengths in bytes; see the
354
354
for the exact specification of this. Let the result of ` bitwiseLogicalAnd ` , given
355
355
$b_1, b_2$ and some padding semantics argument, be $b_r$, also of length $n$
356
356
in bytes. We use $b_1\\ {i\\ }$ to refer to the byte at index $i$ in $b_1$ (and
357
- analogously for $b_2$, $b_r# ); see the [ section on the bit indexing
357
+ analogously for $b_2$, $b_r$ ); see the [ section on the bit indexing
358
358
scheme] ( #bit-indexing-scheme ) for the exact specification of this.
359
359
360
360
For all $i \in 0, 1, \ldots, n - 1$, we have
@@ -381,11 +381,11 @@ bitwiseLogicalAnd True [] [0xFF] => [0xFF]
381
381
382
382
bitwiseLogicalAnd True [0xFF] [] => [0xFF]
383
383
384
- bitwiseLogicalAnd False [0xFF] [0x00] => [0x00]
384
+ bitwiseLogicalAnd True [0xFF] [0x00] => [0x00]
385
385
386
- bitwiseLogicalAnd False [0x00] [0xFF] => [0x00]
386
+ bitwiseLogicalAnd True [0x00] [0xFF] => [0x00]
387
387
388
- bitwiseLogicalAnd False [0x4F, 0x00] [0xF4] => [0x44, 0x00]
388
+ bitwiseLogicalAnd True [0x4F, 0x00] [0xF4] => [0x44, 0x00]
389
389
```
390
390
391
391
#### ` bitwiseLogicalOr `
@@ -405,7 +405,7 @@ their lengths in bytes; see the
405
405
for the exact specification of this. Let the result of ` bitwiseLogicalOr ` , given
406
406
$b_1, b_2$ and some padding semantics argument, be $b_r$, also of length $n$
407
407
in bytes. We use $b_1\\ {i\\ }$ to refer to the byte at index $i$ in $b_1$ (and
408
- analogously for $b_2$, $b_r# ); see the [ section on the bit indexing
408
+ analogously for $b_2$, $b_r$ ); see the [ section on the bit indexing
409
409
scheme] ( #bit-indexing-scheme ) for the exact specification of this.
410
410
411
411
For all $i \in 0, 1, \ldots, n - 1$, we have
@@ -429,11 +429,11 @@ bitwiseLogicalOr True [] [0xFF] => [0xFF]
429
429
430
430
bitwiseLogicalOr True [0xFF] [] => [0xFF]
431
431
432
- bitwiseLogicalOr False [0xFF] [0x00] => [0xFF]
432
+ bitwiseLogicalOr True [0xFF] [0x00] => [0xFF]
433
433
434
- bitwiseLogicalOr False [0x00] [0xFF] => [0xFF]
434
+ bitwiseLogicalOr True [0x00] [0xFF] => [0xFF]
435
435
436
- bitwiseLogicalOr False [0x4F, 0x00] [0xF4] => [0xFF, 0x00]
436
+ bitwiseLogicalOr True [0x4F, 0x00] [0xF4] => [0xFF, 0x00]
437
437
```
438
438
439
439
#### ` bitwiseLogicalXor `
@@ -453,7 +453,7 @@ their lengths in bytes; see the
453
453
for the exact specification of this. Let the result of ` bitwiseLogicalXor ` , given
454
454
$b_1, b_2$ and some padding semantics argument, be $b_r$, also of length $n$
455
455
in bytes. We use $b_1\\ {i\\ }$ to refer to the byte at index $i$ in $b_1$ (and
456
- analogously for $b_2$, $b_r# ); see the [ section on the bit indexing
456
+ analogously for $b_2$, $b_r$ ); see the [ section on the bit indexing
457
457
scheme] ( #bit-indexing-scheme ) for the exact specification of this.
458
458
459
459
For all $i \in 0, 1, \ldots, n - 1$, we have
@@ -480,11 +480,11 @@ bitwiseLogicalOr True [] [0xFF] => [0xFF]
480
480
481
481
bitwiseLogicalOr True [0xFF] [] => [0xFF]
482
482
483
- bitwiseLogicalOr False [0xFF] [0x00] => [0xFF]
483
+ bitwiseLogicalOr True [0xFF] [0x00] => [0xFF]
484
484
485
- bitwiseLogicalOr False [0x00] [0xFF] => [0xFF]
485
+ bitwiseLogicalOr True [0x00] [0xFF] => [0xFF]
486
486
487
- bitwiseLogicalOr False [0x4F, 0x00] [0xF4] => [0xBB, 0x00]
487
+ bitwiseLogicalOr True [0x4F, 0x00] [0xF4] => [0xBB, 0x00]
488
488
```
489
489
490
490
#### ` bitwiseLogicalComplement `
@@ -526,7 +526,7 @@ bitwiseLogicalComplement [0x4F, 0xF4] => [0xB0, 0x0B]
526
526
_ index argument_ .
527
527
528
528
Let $b$ refer to the data argument, of length $n$ in bytes, and let $i$ refer to
529
- the index argument. We use $b[ i] $ to refer to the value at index $i$t of $b$; see
529
+ the index argument. We use $b[ i] $ to refer to the value at index $i$ of $b$; see
530
530
the [ section on the bit indexing scheme] ( #bit-indexing-scheme ) for the exact
531
531
specification of this.
532
532
@@ -938,16 +938,16 @@ replicateByteString (n + m) w = replicateByteString n w <> replicateByteString m
938
938
```
939
939
940
940
Additionally, for any 'in-bounds' index (that is, any index for which
941
- ` builtinIndexByteString ` won't error) ` i ` , we have
941
+ ` indexByteString ` won't error) ` i ` , we have
942
942
943
943
``` haskell
944
- builtinIndexByteString (replicateByteString n w) i = w
944
+ indexByteString (replicateByteString n w) i = w
945
945
```
946
946
947
947
Lastly, we have
948
948
949
949
``` haskell
950
- builtinSizeOfByteString (replicateByteString n w) = n
950
+ lengthByteString (replicateByteString n w) = n
951
951
```
952
952
953
953
## Rationale: how does this CIP achieve its goals?
@@ -1522,7 +1522,7 @@ This CIP is licensed under [Apache-2.0](http://www.apache.org/licenses/LICENSE-2
1522
1522
[cip- 58 ]: https:// github. com/ cardano- foundation/ CIPs / tree/ master/ CIP - 0058
1523
1523
[croaring]: https:// github. com/ RoaringBitmap / CRoaring
1524
1524
[too- many- ways- 1 ]: https:// fgiesen. wordpress. com/ 2018 / 02 / 19 / reading- bits- in - far- too- many- ways- part- 1
1525
- [conversion- cip]: https:// github. com/ mlabs - haskell / CIPs / blob/ koz / to - from - bytestring / CIP - 0121 / README. md
1525
+ [conversion- cip]: https:// github. com/ cardano - foundation / CIPs / blob/ master / CIP - 0121 / README. md
1526
1526
[benchmarks- bits]: https:// github. com/ mlabs- haskell/ plutus- integer- bytestring/ blob/ main/ bench/ naive/ Main. hs# L74 - L83
1527
1527
[vector]: https:// hackage. haskell. org/ package/ vector- 0.13 . 1.0 / docs/ Data - Vector. html# v:- 47 -- 47-
1528
1528
[boolean- algebra- 2 ]: https:// en. wikipedia. org/ wiki/ Two - element_Boolean_algebra
@@ -1531,7 +1531,8 @@ This CIP is licensed under [Apache-2.0](http://www.apache.org/licenses/LICENSE-2
1531
1531
[blake2b]: https:// en. wikipedia. org/ wiki/ BLAKE_ (hash_function)
1532
1532
[argon2]: https:// en. wikipedia. org/ wiki/ Argon2
1533
1533
[xor- crypto]: https:// en. wikipedia. org/ wiki/ Exclusive_or # Bitwise_operation
1534
- [cip- 121 - big- endian]: https:// github. com/ mlabs- haskell/ CIPs / blob/ koz/ to- from- bytestring/ CIP - 0121 / README. md# representation
1534
+ [cip- 121 ]: https:// github. com/ cardano- foundation/ CIPs / blob/ master/ CIP - 0121 / README. md
1535
+ [cip- 121 - big- endian]: https:// github. com/ cardano- foundation/ CIPs / blob/ master/ CIP - 0121 / README. md/# representation
1535
1536
[bitwise- and ]: https:// en. wikipedia. org/ wiki/ Bitwise_operation # AND
1536
1537
[bitwise- or ]: https:// en. wikipedia. org/ wiki/ Bitwise_operation # OR
1537
1538
[bitwise- xor]: https:// en. wikipedia. org/ wiki/ Bitwise_operation # XOR
0 commit comments