diff --git a/base/runtime/core.odin b/base/runtime/core.odin index 983f104e3..e2ed78452 100644 --- a/base/runtime/core.odin +++ b/base/runtime/core.odin @@ -141,7 +141,7 @@ Type_Info_Struct :: struct { flags: Type_Info_Struct_Flags, - // These are only set iff this structure is an SOA structure + // These are only set if and only if (⟺) this structure is an SOA structure soa_kind: Type_Info_Struct_Soa_Kind, soa_len: i32, soa_base_type: ^Type_Info, diff --git a/base/runtime/core_builtin.odin b/base/runtime/core_builtin.odin index 974b2f048..4d8b493f7 100644 --- a/base/runtime/core_builtin.odin +++ b/base/runtime/core_builtin.odin @@ -1094,7 +1094,7 @@ card :: proc "contextless" (s: $S/bit_set[$E; $U]) -> int { -// Evaluates the condition and panics the program iff the condition is false. +// Evaluates the condition and panics the program if and only if (⟺) the condition is false. // This uses the `context.assertion_failure_procedure` to assert. // // This routine will be ignored when `ODIN_DISABLE_ASSERT` is true. @@ -1118,7 +1118,7 @@ assert :: proc(condition: bool, message := #caller_expression(condition), loc := } } -// Evaluates the condition and panics the program iff the condition is false. +// Evaluates the condition and panics the program if and only if (⟺) the condition is false. // This uses the `context.assertion_failure_procedure` to assert. // This routine ignores `ODIN_DISABLE_ASSERT`, and will always execute. @builtin @@ -1158,7 +1158,7 @@ unimplemented :: proc(message := "", loc := #caller_location) -> ! { p("not yet implemented", message, loc) } -// Evaluates the condition and panics the program iff the condition is false. +// Evaluates the condition and panics the program if and only if (⟺) the condition is false. // This uses the `default_assertion_contextless_failure_proc` to assert. // // This routine will be ignored when `ODIN_DISABLE_ASSERT` is true. @@ -1178,7 +1178,7 @@ assert_contextless :: proc "contextless" (condition: bool, message := #caller_ex } } -// Evaluates the condition and panics the program iff the condition is false. +// Evaluates the condition and panics the program if and only if (⟺) the condition is false. // This uses the `default_assertion_contextless_failure_proc` to assert. @builtin ensure_contextless :: proc "contextless" (condition: bool, message := #caller_expression(condition), loc := #caller_location) { diff --git a/base/runtime/random_generator_chacha8_simd256.odin b/base/runtime/random_generator_chacha8_simd256.odin index c0985f456..f2ccb6934 100644 --- a/base/runtime/random_generator_chacha8_simd256.odin +++ b/base/runtime/random_generator_chacha8_simd256.odin @@ -136,7 +136,7 @@ chacha8rand_refill_simd256 :: proc(r: ^Default_Random_State) { // // LLVM appears not to consider "this instruction is totally // awful on the given microarchitcture", which leads to - // `VPCOMPRESSED` being generated iff AVX512 support is + // `VPCOMPRESSED` being generated if and only if (⟺) AVX512 support is // enabled for `intrinsics.simd_masked_compress_store`. // On Zen 4, this leads to a 50% performance regression vs // the 128-bit SIMD code. diff --git a/core/bufio/reader.odin b/core/bufio/reader.odin index 8e30542f1..e361612d2 100644 --- a/core/bufio/reader.odin +++ b/core/bufio/reader.odin @@ -45,7 +45,7 @@ reader_init_with_buf :: proc(b: ^Reader, rd: io.Reader, buf: []byte) { b.buf = buf } -// reader_destroy destroys the underlying buffer with its associated allocator IFF that allocator has been set +// reader_destroy destroys the underlying buffer with its associated allocator if and only if (⟺) that allocator has been set reader_destroy :: proc(b: ^Reader) { delete(b.buf, b.buf_allocator) b^ = {} diff --git a/core/bufio/writer.odin b/core/bufio/writer.odin index 666c05b67..9d5ef3481 100644 --- a/core/bufio/writer.odin +++ b/core/bufio/writer.odin @@ -35,7 +35,7 @@ writer_init_with_buf :: proc(b: ^Writer, wr: io.Writer, buf: []byte) { b.buf = buf } -// writer_destroy destroys the underlying buffer with its associated allocator IFF that allocator has been set +// writer_destroy destroys the underlying buffer with its associated allocator if and only if (⟺) that allocator has been set writer_destroy :: proc(b: ^Writer) { delete(b.buf, b.buf_allocator) b^ = {} diff --git a/core/bytes/bytes.odin b/core/bytes/bytes.odin index 33978b3df..55eca5386 100644 --- a/core/bytes/bytes.odin +++ b/core/bytes/bytes.odin @@ -1460,7 +1460,7 @@ fields_proc :: proc(s: []byte, f: proc(rune) -> bool, allocator := context.alloc return subslices[:] } -// alias returns true iff a and b have a non-zero length, and any part of +// alias returns true if and only if (⟺) a and b have a non-zero length, and any part of // a overlaps with b. alias :: proc "contextless" (a, b: []byte) -> bool { a_len, b_len := len(a), len(b) @@ -1474,7 +1474,7 @@ alias :: proc "contextless" (a, b: []byte) -> bool { return a_start <= b_end && b_start <= a_end } -// alias_inexactly returns true iff a and b have a non-zero length, +// alias_inexactly returns true if and only if (⟺) a and b have a non-zero length, // the base pointer of a and b are NOT equal, and any part of a overlaps // with b (ie: `alias(a, b)` with an exception that returns false for // `a == b`, `b = a[:len(a)-69]` and similar conditions). diff --git a/core/container/avl/avl.odin b/core/container/avl/avl.odin index 6c7216c29..1208cd213 100644 --- a/core/container/avl/avl.odin +++ b/core/container/avl/avl.odin @@ -100,20 +100,20 @@ len :: proc "contextless" (t: ^$T/Tree($Value)) -> int { return t._size } -// first returns the first node in the tree (in-order) or nil iff +// first returns the first node in the tree (in-order) or nil if and only if (⟺) // the tree is empty. first :: proc "contextless" (t: ^$T/Tree($Value)) -> ^Node(Value) { return tree_first_or_last_in_order(t, Direction.Backward) } -// last returns the last element in the tree (in-order) or nil iff +// last returns the last element in the tree (in-order) or nil if and only if (⟺) // the tree is empty. last :: proc "contextless" (t: ^$T/Tree($Value)) -> ^Node(Value) { return tree_first_or_last_in_order(t, Direction.Forward) } // find finds the value in the tree, and returns the corresponding -// node or nil iff the value is not present. +// node or nil if and only if (⟺) the value is not present. find :: proc(t: ^$T/Tree($Value), value: Value) -> ^Node(Value) { cur := t._root descend_loop: for cur != nil { @@ -168,7 +168,7 @@ find_or_insert :: proc( return } -// remove removes a node or value from the tree, and returns true iff the +// remove removes a node or value from the tree, and returns true if and only if (⟺) the // removal was successful. While the node's value will be left intact, // the node itself will be freed via the tree's node allocator. remove :: proc { @@ -176,7 +176,7 @@ remove :: proc { remove_node, } -// remove_value removes a value from the tree, and returns true iff the +// remove_value removes a value from the tree, and returns true if and only if (⟺) the // removal was successful. While the node's value will be left intact, // the node itself will be freed via the tree's node allocator. remove_value :: proc(t: ^$T/Tree($Value), value: Value, call_on_remove: bool = true) -> bool { @@ -187,7 +187,7 @@ remove_value :: proc(t: ^$T/Tree($Value), value: Value, call_on_remove: bool = t return remove_node(t, n, call_on_remove) } -// remove_node removes a node from the tree, and returns true iff the +// remove_node removes a node from the tree, and returns true if and only if (⟺) the // removal was successful. While the node's value will be left intact, // the node itself will be freed via the tree's node allocator. remove_node :: proc(t: ^$T/Tree($Value), node: ^Node(Value), call_on_remove: bool = true) -> bool { @@ -281,14 +281,14 @@ iterator_from_pos :: proc "contextless" ( } // iterator_get returns the node currently pointed to by the iterator, -// or nil iff the node has been removed, the tree is empty, or the end +// or nil if and only if (⟺) the node has been removed, the tree is empty, or the end // of the tree has been reached. iterator_get :: proc "contextless" (it: ^$I/Iterator($Value)) -> ^Node(Value) { return it._cur } // iterator_remove removes the node currently pointed to by the iterator, -// and returns true iff the removal was successful. Semantics are the +// and returns true if and only if (⟺) the removal was successful. Semantics are the // same as the Tree remove. iterator_remove :: proc(it: ^$I/Iterator($Value), call_on_remove: bool = true) -> bool { if it._cur == nil { @@ -304,7 +304,7 @@ iterator_remove :: proc(it: ^$I/Iterator($Value), call_on_remove: bool = true) - } // iterator_next advances the iterator and returns the (node, true) or -// or (nil, false) iff the end of the tree has been reached. +// or (nil, false) if and only if (⟺) the end of the tree has been reached. // // Note: The first call to iterator_next will return the first node instead // of advancing the iterator. diff --git a/core/container/rbtree/rbtree.odin b/core/container/rbtree/rbtree.odin index e892188d7..c138838df 100644 --- a/core/container/rbtree/rbtree.odin +++ b/core/container/rbtree/rbtree.odin @@ -95,19 +95,19 @@ len :: proc "contextless" (t: $T/Tree($Key, $Value)) -> (node_count: int) { return t._size } -// first returns the first node in the tree (in-order) or nil iff +// first returns the first node in the tree (in-order) or nil if and only if (⟺) // the tree is empty. first :: proc "contextless" (t: ^$T/Tree($Key, $Value)) -> ^Node(Key, Value) { return tree_first_or_last_in_order(t, Direction.Backward) } -// last returns the last element in the tree (in-order) or nil iff +// last returns the last element in the tree (in-order) or nil if and only if (⟺) // the tree is empty. last :: proc "contextless" (t: ^$T/Tree($Key, $Value)) -> ^Node(Key, Value) { return tree_first_or_last_in_order(t, Direction.Forward) } -// find finds the key in the tree, and returns the corresponding node, or nil iff the value is not present. +// find finds the key in the tree, and returns the corresponding node, or nil if and only if (⟺) the value is not present. find :: proc(t: $T/Tree($Key, $Value), key: Key) -> (node: ^Node(Key, Value)) { node = t._root for node != nil { @@ -120,7 +120,7 @@ find :: proc(t: $T/Tree($Key, $Value), key: Key) -> (node: ^Node(Key, Value)) { return node } -// find_value finds the key in the tree, and returns the corresponding value, or nil iff the value is not present. +// find_value finds the key in the tree, and returns the corresponding value, or nil if and only if (⟺) the value is not present. find_value :: proc(t: $T/Tree($Key, $Value), key: Key) -> (value: Value, ok: bool) #optional_ok { if n := find(t, key); n != nil { return n.value, true @@ -154,7 +154,7 @@ find_or_insert :: proc(t: ^$T/Tree($Key, $Value), key: Key, value: Value) -> (n: return n, true, nil } -// remove removes a node or value from the tree, and returns true iff the +// remove removes a node or value from the tree, and returns true if and only if (⟺) the // removal was successful. While the node's value will be left intact, // the node itself will be freed via the tree's node allocator. remove :: proc { @@ -162,7 +162,7 @@ remove :: proc { remove_node, } -// remove_value removes a value from the tree, and returns true iff the +// remove_value removes a value from the tree, and returns true if and only if (⟺) the // removal was successful. While the node's key + value will be left intact, // the node itself will be freed via the tree's node allocator. remove_key :: proc(t: ^$T/Tree($Key, $Value), key: Key, call_on_remove := true) -> bool { @@ -173,7 +173,7 @@ remove_key :: proc(t: ^$T/Tree($Key, $Value), key: Key, call_on_remove := true) return remove_node(t, n, call_on_remove) } -// remove_node removes a node from the tree, and returns true iff the +// remove_node removes a node from the tree, and returns true if and only if (⟺) the // removal was successful. While the node's key + value will be left intact, // the node itself will be freed via the tree's node allocator. remove_node :: proc(t: ^$T/Tree($Key, $Value), node: ^$N/Node(Key, Value), call_on_remove := true) -> (found: bool) { @@ -235,14 +235,14 @@ iterator_from_pos :: proc "contextless" (t: ^$T/Tree($Key, $Value), pos: ^Node(K } // iterator_get returns the node currently pointed to by the iterator, -// or nil iff the node has been removed, the tree is empty, or the end +// or nil if and only if (⟺) the node has been removed, the tree is empty, or the end // of the tree has been reached. iterator_get :: proc "contextless" (it: ^$I/Iterator($Key, $Value)) -> ^Node(Key, Value) { return it._cur } // iterator_remove removes the node currently pointed to by the iterator, -// and returns true iff the removal was successful. Semantics are the +// and returns true if and only if (⟺) the removal was successful. Semantics are the // same as the Tree remove. iterator_remove :: proc(it: ^$I/Iterator($Key, $Value), call_on_remove: bool = true) -> bool { if it._cur == nil { @@ -258,7 +258,7 @@ iterator_remove :: proc(it: ^$I/Iterator($Key, $Value), call_on_remove: bool = t } // iterator_next advances the iterator and returns the (node, true) or -// or (nil, false) iff the end of the tree has been reached. +// or (nil, false) if and only if (⟺) the end of the tree has been reached. // // Note: The first call to iterator_next will return the first node instead // of advancing the iterator. diff --git a/core/crypto/_aes/hw_intel/api.odin b/core/crypto/_aes/hw_intel/api.odin index ce769fc10..9547d8f84 100644 --- a/core/crypto/_aes/hw_intel/api.odin +++ b/core/crypto/_aes/hw_intel/api.odin @@ -3,7 +3,7 @@ package aes_hw_intel import "core:sys/info" -// is_supported returns true iff hardware accelerated AES +// is_supported returns true if and only if (⟺) hardware accelerated AES // is supported. is_supported :: proc "contextless" () -> bool { // Note: Everything with AES-NI and PCLMULQDQ has support for diff --git a/core/crypto/_chacha20/simd128/chacha20_simd128.odin b/core/crypto/_chacha20/simd128/chacha20_simd128.odin index 9da0a54ea..fd48074df 100644 --- a/core/crypto/_chacha20/simd128/chacha20_simd128.odin +++ b/core/crypto/_chacha20/simd128/chacha20_simd128.odin @@ -215,7 +215,7 @@ _store_simd128 :: #force_inline proc "contextless" ( intrinsics.unaligned_store((^simd.u32x4)(dst[3:]), v3) } -// is_performant returns true iff the target and current host both support +// is_performant returns true if and only if (⟺) the target and current host both support // "enough" 128-bit SIMD to make this implementation performant. is_performant :: proc "contextless" () -> bool { when ODIN_ARCH == .arm64 || ODIN_ARCH == .arm32 || ODIN_ARCH == .amd64 || ODIN_ARCH == .i386 || ODIN_ARCH == .riscv64 { diff --git a/core/crypto/_chacha20/simd256/chacha20_simd256.odin b/core/crypto/_chacha20/simd256/chacha20_simd256.odin index 407fbac56..c2f709aec 100644 --- a/core/crypto/_chacha20/simd256/chacha20_simd256.odin +++ b/core/crypto/_chacha20/simd256/chacha20_simd256.odin @@ -36,7 +36,7 @@ _VEC_ZERO_ONE: simd.u64x4 : {0, 0, 1, 0} @(private = "file") _VEC_TWO: simd.u64x4 : {2, 0, 2, 0} -// is_performant returns true iff the target and current host both support +// is_performant returns true if and only if (⟺) the target and current host both support // "enough" SIMD to make this implementation performant. is_performant :: proc "contextless" () -> bool { req_features :: info.CPU_Features{.avx, .avx2} diff --git a/core/crypto/_fiat/field_p256r1/field.odin b/core/crypto/_fiat/field_p256r1/field.odin index f39bee4a9..f7dd978aa 100644 --- a/core/crypto/_fiat/field_p256r1/field.odin +++ b/core/crypto/_fiat/field_p256r1/field.odin @@ -69,7 +69,7 @@ fe_equal :: proc "contextless" (arg1, arg2: ^Montgomery_Domain_Field_Element) -> tmp: Montgomery_Domain_Field_Element = --- fe_sub(&tmp, arg1, arg2) - // This will only underflow iff arg1 == arg2, and we return the borrow, + // This will only underflow if and only if (⟺) arg1 == arg2, and we return the borrow, // which will be 1. is_eq := subtle.u64_is_zero(fe_non_zero(&tmp)) diff --git a/core/crypto/_fiat/field_p384r1/field.odin b/core/crypto/_fiat/field_p384r1/field.odin index 5cb5cd05e..2bddff18c 100644 --- a/core/crypto/_fiat/field_p384r1/field.odin +++ b/core/crypto/_fiat/field_p384r1/field.odin @@ -75,7 +75,7 @@ fe_equal :: proc "contextless" (arg1, arg2: ^Montgomery_Domain_Field_Element) -> tmp: Montgomery_Domain_Field_Element = --- fe_sub(&tmp, arg1, arg2) - // This will only underflow iff arg1 == arg2, and we return the borrow, + // This will only underflow if and only if (⟺) arg1 == arg2, and we return the borrow, // which will be 1. is_eq := subtle.u64_is_zero(fe_non_zero(&tmp)) diff --git a/core/crypto/_subtle/subtle.odin b/core/crypto/_subtle/subtle.odin index 89328072c..454066e4a 100644 --- a/core/crypto/_subtle/subtle.odin +++ b/core/crypto/_subtle/subtle.odin @@ -5,17 +5,17 @@ package _subtle import "core:math/bits" -// byte_eq returns 1 iff a == b, 0 otherwise. +// byte_eq returns 1 if and only if (⟺) a == b, 0 otherwise. @(optimization_mode="none") byte_eq :: proc "contextless" (a, b: byte) -> int { v := a ~ b - // v == 0 iff a == b. The subtraction will underflow, setting the + // v == 0 if and only if (⟺) a == b. The subtraction will underflow, setting the // sign bit, which will get returned. return int((u32(v)-1) >> 31) } -// u64_eq returns 1 iff a == b, 0 otherwise. +// u64_eq returns 1 if and only if (⟺) a == b, 0 otherwise. @(optimization_mode="none") u64_eq :: proc "contextless" (a, b: u64) -> u64 { _, borrow := bits.sub_u64(0, a ~ b, 0) @@ -27,14 +27,14 @@ eq :: proc { u64_eq, } -// u64_is_zero returns 1 iff a == 0, 0 otherwise. +// u64_is_zero returns 1 if and only if (⟺) a == 0, 0 otherwise. @(optimization_mode="none") u64_is_zero :: proc "contextless" (a: u64) -> u64 { _, borrow := bits.sub_u64(a, 1, 0) return borrow } -// u64_is_non_zero returns 1 iff a != 0, 0 otherwise. +// u64_is_non_zero returns 1 if and only if (⟺) a != 0, 0 otherwise. @(optimization_mode="none") u64_is_non_zero :: proc "contextless" (a: u64) -> u64 { is_zero := u64_is_zero(a) diff --git a/core/crypto/aead/aead.odin b/core/crypto/aead/aead.odin index c8f324929..ed14a41f3 100644 --- a/core/crypto/aead/aead.odin +++ b/core/crypto/aead/aead.odin @@ -13,7 +13,7 @@ seal_oneshot :: proc(algo: Algorithm, dst, tag, key, iv, aad, plaintext: []byte, // open authenticates the aad and ciphertext, and decrypts the ciphertext, // with the provided algorithm, key, iv, and tag, and stores the output in dst, -// returning true iff the authentication was successful. If authentication +// returning true if and only if (⟺) the authentication was successful. If authentication // fails, the destination buffer will be zeroed. // // dst and ciphertext MUST alias exactly or not at all. diff --git a/core/crypto/aead/low_level.odin b/core/crypto/aead/low_level.odin index c80574a0d..c89d85823 100644 --- a/core/crypto/aead/low_level.odin +++ b/core/crypto/aead/low_level.odin @@ -183,7 +183,7 @@ seal_ctx :: proc(ctx: ^Context, dst, tag, iv, aad, plaintext: []byte) { // open_ctx authenticates the aad and ciphertext, and decrypts the ciphertext, // with the provided Context, iv, and tag, and stores the output in dst, -// returning true iff the authentication was successful. If authentication +// returning true if and only if (⟺) the authentication was successful. If authentication // fails, the destination buffer will be zeroed. // // dst and plaintext MUST alias exactly or not at all. diff --git a/core/crypto/aegis/aegis.odin b/core/crypto/aegis/aegis.odin index fbb19f1ae..5aee61767 100644 --- a/core/crypto/aegis/aegis.odin +++ b/core/crypto/aegis/aegis.odin @@ -144,7 +144,7 @@ seal :: proc(ctx: ^Context, dst, tag, iv, aad, plaintext: []byte) { // open authenticates the aad and ciphertext, and decrypts the ciphertext, // with the provided Context, iv, and tag, and stores the output in dst, -// returning true iff the authentication was successful. If authentication +// returning true if and only if (⟺) the authentication was successful. If authentication // fails, the destination buffer will be zeroed. // // dst and plaintext MUST alias exactly or not at all. diff --git a/core/crypto/aegis/aegis_impl_hw_gen.odin b/core/crypto/aegis/aegis_impl_hw_gen.odin index 5ec2f3d6e..db38e71bc 100644 --- a/core/crypto/aegis/aegis_impl_hw_gen.odin +++ b/core/crypto/aegis/aegis_impl_hw_gen.odin @@ -7,7 +7,7 @@ ERR_HW_NOT_SUPPORTED :: "crypto/aegis: hardware implementation unsupported" @(private) State_HW :: struct {} -// is_hardware_accelerated returns true iff hardware accelerated AEGIS +// is_hardware_accelerated returns true if and only if (⟺) hardware accelerated AEGIS // is supported. is_hardware_accelerated :: proc "contextless" () -> bool { return false diff --git a/core/crypto/aegis/aegis_impl_hw_intel.odin b/core/crypto/aegis/aegis_impl_hw_intel.odin index 7673b6b28..8b767908c 100644 --- a/core/crypto/aegis/aegis_impl_hw_intel.odin +++ b/core/crypto/aegis/aegis_impl_hw_intel.odin @@ -20,7 +20,7 @@ State_HW :: struct { rate: int, } -// is_hardware_accelerated returns true iff hardware accelerated AEGIS +// is_hardware_accelerated returns true if and only if (⟺) hardware accelerated AEGIS // is supported. is_hardware_accelerated :: proc "contextless" () -> bool { return aes.is_hardware_accelerated() diff --git a/core/crypto/aes/aes_gcm.odin b/core/crypto/aes/aes_gcm.odin index bb87788ac..0acd95d2f 100644 --- a/core/crypto/aes/aes_gcm.odin +++ b/core/crypto/aes/aes_gcm.odin @@ -65,7 +65,7 @@ seal_gcm :: proc(ctx: ^Context_GCM, dst, tag, iv, aad, plaintext: []byte) { // open_gcm authenticates the aad and ciphertext, and decrypts the ciphertext, // with the provided Context_GCM, iv, and tag, and stores the output in dst, -// returning true iff the authentication was successful. If authentication +// returning true if and only if (⟺) the authentication was successful. If authentication // fails, the destination buffer will be zeroed. // // dst and plaintext MUST alias exactly or not at all. diff --git a/core/crypto/aes/aes_impl_hw_gen.odin b/core/crypto/aes/aes_impl_hw_gen.odin index 0c9ec6edc..506298751 100644 --- a/core/crypto/aes/aes_impl_hw_gen.odin +++ b/core/crypto/aes/aes_impl_hw_gen.odin @@ -4,7 +4,7 @@ package aes @(private = "file") ERR_HW_NOT_SUPPORTED :: "crypto/aes: hardware implementation unsupported" -// is_hardware_accelerated returns true iff hardware accelerated AES +// is_hardware_accelerated returns true if and only if (⟺) hardware accelerated AES // is supported. is_hardware_accelerated :: proc "contextless" () -> bool { return false diff --git a/core/crypto/aes/aes_impl_hw_intel.odin b/core/crypto/aes/aes_impl_hw_intel.odin index 0f1fa6143..96a1811f3 100644 --- a/core/crypto/aes/aes_impl_hw_intel.odin +++ b/core/crypto/aes/aes_impl_hw_intel.odin @@ -3,7 +3,7 @@ package aes import "core:crypto/_aes/hw_intel" -// is_hardware_accelerated returns true iff hardware accelerated AES +// is_hardware_accelerated returns true if and only if (⟺) hardware accelerated AES // is supported. is_hardware_accelerated :: proc "contextless" () -> bool { return hw_intel.is_supported() diff --git a/core/crypto/blake2b/blake2b.odin b/core/crypto/blake2b/blake2b.odin index 6c2c5c1e9..8cce6dac8 100644 --- a/core/crypto/blake2b/blake2b.odin +++ b/core/crypto/blake2b/blake2b.odin @@ -54,7 +54,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { _blake2.final(ctx, hash, finalize_clone) diff --git a/core/crypto/blake2s/blake2s.odin b/core/crypto/blake2s/blake2s.odin index 902f992b3..35e278f72 100644 --- a/core/crypto/blake2s/blake2s.odin +++ b/core/crypto/blake2s/blake2s.odin @@ -54,7 +54,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { _blake2.final(ctx, hash, finalize_clone) diff --git a/core/crypto/chacha20poly1305/chacha20poly1305.odin b/core/crypto/chacha20poly1305/chacha20poly1305.odin index 0504acab0..c405a2736 100644 --- a/core/crypto/chacha20poly1305/chacha20poly1305.odin +++ b/core/crypto/chacha20poly1305/chacha20poly1305.odin @@ -136,7 +136,7 @@ seal :: proc(ctx: ^Context, dst, tag, iv, aad, plaintext: []byte) { // open authenticates the aad and ciphertext, and decrypts the ciphertext, // with the provided Context, iv, and tag, and stores the output in dst, -// returning true iff the authentication was successful. If authentication +// returning true if and only if (⟺) the authentication was successful. If authentication // fails, the destination buffer will be zeroed. // // dst and plaintext MUST alias exactly or not at all. diff --git a/core/crypto/crypto.odin b/core/crypto/crypto.odin index b36bc2004..f4ddbfbe7 100644 --- a/core/crypto/crypto.odin +++ b/core/crypto/crypto.odin @@ -8,15 +8,15 @@ import subtle "core:crypto/_subtle" // Omit large precomputed tables, trading off performance for size. COMPACT_IMPLS: bool : #config(ODIN_CRYPTO_COMPACT, false) -// HAS_RAND_BYTES is true iff the runtime provides a cryptographic +// HAS_RAND_BYTES is true if and only if (⟺) the runtime provides a cryptographic // entropy source. HAS_RAND_BYTES :: runtime.HAS_RAND_BYTES -// compare_constant_time returns 1 iff a and b are equal, 0 otherwise. +// compare_constant_time returns 1 if and only if (⟺) a and b are equal, 0 otherwise. // // The execution time of this routine is constant regardless of the contents // of the slices being compared, as long as the length of the slices is equal. -// If the length of the two slices is different, it will early-return 0. +// If the length of the two slices is dif and only if (⟺)erent, it will early-return 0. compare_constant_time :: proc "contextless" (a, b: []byte) -> int { // If the length of the slices is different, early return. // @@ -31,7 +31,7 @@ compare_constant_time :: proc "contextless" (a, b: []byte) -> int { return compare_byte_ptrs_constant_time(raw_data(a), raw_data(b), n) } -// compare_byte_ptrs_constant_time returns 1 iff the bytes pointed to by +// compare_byte_ptrs_constant_time returns 1 if and only if (⟺) the bytes pointed to by // a and b are equal, 0 otherwise. // // The execution time of this routine is constant regardless of the @@ -46,12 +46,12 @@ compare_byte_ptrs_constant_time :: proc "contextless" (a, b: ^byte, n: int) -> i v |= x[i] ~ y[i] } - // After the loop, v == 0 iff a == b. The subtraction will underflow - // iff v == 0, setting the sign-bit, which gets returned. + // After the loop, v == 0 if and only if (⟺) a == b. The subtraction will underflow + // if and only if (⟺) v == 0, setting the sign-bit, which gets returned. return subtle.eq(0, v) } -// is_zero_constant_time returns 1 iff b is all 0s, 0 otherwise. +// is_zero_constant_time returns 1 if and only if (⟺) b is all 0s, 0 otherwise. is_zero_constant_time :: proc "contextless" (b: []byte) -> int { v: byte for b_ in b { diff --git a/core/crypto/deoxysii/deoxysii.odin b/core/crypto/deoxysii/deoxysii.odin index 829d3d3ad..ffe9b4b32 100644 --- a/core/crypto/deoxysii/deoxysii.odin +++ b/core/crypto/deoxysii/deoxysii.odin @@ -122,7 +122,7 @@ seal :: proc(ctx: ^Context, dst, tag, iv, aad, plaintext: []byte) { // open authenticates the aad and ciphertext, and decrypts the ciphertext, // with the provided Context, iv, and tag, and stores the output in dst, -// returning true iff the authentication was successful. If authentication +// returning true if and only if (⟺) the authentication was successful. If authentication // fails, the destination buffer will be zeroed. // // dst and plaintext MUST alias exactly or not at all. diff --git a/core/crypto/deoxysii/deoxysii_impl_hw_gen.odin b/core/crypto/deoxysii/deoxysii_impl_hw_gen.odin index b0705ca62..89dae7229 100644 --- a/core/crypto/deoxysii/deoxysii_impl_hw_gen.odin +++ b/core/crypto/deoxysii/deoxysii_impl_hw_gen.odin @@ -4,7 +4,7 @@ package deoxysii @(private = "file") ERR_HW_NOT_SUPPORTED :: "crypto/deoxysii: hardware implementation unsupported" -// is_hardware_accelerated returns true iff hardware accelerated Deoxys-II +// is_hardware_accelerated returns true if and only if (⟺) hardware accelerated Deoxys-II // is supported. is_hardware_accelerated :: proc "contextless" () -> bool { return false diff --git a/core/crypto/deoxysii/deoxysii_impl_hw_intel.odin b/core/crypto/deoxysii/deoxysii_impl_hw_intel.odin index cdad16f42..88c569d53 100644 --- a/core/crypto/deoxysii/deoxysii_impl_hw_intel.odin +++ b/core/crypto/deoxysii/deoxysii_impl_hw_intel.odin @@ -21,7 +21,7 @@ _PREFIX_MSG_BLOCK :: x86.__m128i{PREFIX_MSG_BLOCK << PREFIX_SHIFT, 0} @(private = "file") _PREFIX_MSG_FINAL :: x86.__m128i{PREFIX_MSG_FINAL << PREFIX_SHIFT, 0} -// is_hardware_accelerated returns true iff hardware accelerated Deoxys-II +// is_hardware_accelerated returns true if and only if (⟺) hardware accelerated Deoxys-II // is supported. is_hardware_accelerated :: proc "contextless" () -> bool { return aes.is_hardware_accelerated() diff --git a/core/crypto/ecdh/ecdh.odin b/core/crypto/ecdh/ecdh.odin index af60f5649..6a8f6e466 100644 --- a/core/crypto/ecdh/ecdh.odin +++ b/core/crypto/ecdh/ecdh.odin @@ -104,7 +104,7 @@ Public_Key :: struct { } // private_key_generate uses the system entropy source to generate a new -// Private_Key. This will only fail iff the system entropy source is +// Private_Key. This will only fail if and only if (⟺) the system entropy source is // missing or broken. private_key_generate :: proc(priv_key: ^Private_Key, curve: Curve) -> bool { private_key_clear(priv_key) @@ -142,7 +142,7 @@ private_key_generate :: proc(priv_key: ^Private_Key, curve: Curve) -> bool { } // private_key_set_bytes decodes a byte-encoded private key, and returns -// true iff the operation was successful. +// true if and only if (⟺) the operation was successful. private_key_set_bytes :: proc(priv_key: ^Private_Key, curve: Curve, b: []byte) -> bool { private_key_clear(priv_key) @@ -245,7 +245,7 @@ private_key_bytes :: proc(priv_key: ^Private_Key, dst: []byte) { } } -// private_key_equal returns true iff the private keys are equal, +// private_key_equal returns true if and only if (⟺) the private keys are equal, // in constant time. private_key_equal :: proc(p, q: ^Private_Key) -> bool { if p._curve != q._curve { @@ -276,7 +276,7 @@ private_key_clear :: proc "contextless" (priv_key: ^Private_Key) { } // public_key_set_bytes decodes a byte-encoded public key, and returns -// true iff the operation was successful. +// true if and only if (⟺) the operation was successful. public_key_set_bytes :: proc(pub_key: ^Public_Key, curve: Curve, b: []byte) -> bool { public_key_clear(pub_key) @@ -365,7 +365,7 @@ public_key_bytes :: proc(pub_key: ^Public_Key, dst: []byte) { } } -// public_key_equal returns true iff the public keys are equal, +// public_key_equal returns true if and only if (⟺) the public keys are equal, // in constant time. public_key_equal :: proc(p, q: ^Public_Key) -> bool { if p._curve != q._curve { diff --git a/core/crypto/ecdsa/ecdsa.odin b/core/crypto/ecdsa/ecdsa.odin index 241d50987..6c71feef7 100644 --- a/core/crypto/ecdsa/ecdsa.odin +++ b/core/crypto/ecdsa/ecdsa.odin @@ -79,7 +79,7 @@ Public_Key :: struct { } // private_key_generate uses the system entropy source to generate a new -// Private_Key. This will only fail iff the system entropy source is +// Private_Key. This will only fail if and only if (⟺) the system entropy source is // missing or broken. private_key_generate :: proc(priv_key: ^Private_Key, curve: Curve) -> bool { private_key_clear(priv_key) @@ -111,7 +111,7 @@ private_key_generate :: proc(priv_key: ^Private_Key, curve: Curve) -> bool { } // private_key_set_bytes decodes a byte-encoded private key, and returns -// true iff the operation was successful. +// true if and only if (⟺) the operation was successful. private_key_set_bytes :: proc(priv_key: ^Private_Key, curve: Curve, b: []byte) -> bool { private_key_clear(priv_key) @@ -194,7 +194,7 @@ private_key_bytes :: proc(priv_key: ^Private_Key, dst: []byte) { } } -// private_key_equal returns true iff the private keys are equal, +// private_key_equal returns true if and only if (⟺) the private keys are equal, // in constant time. private_key_equal :: proc(p, q: ^Private_Key) -> bool { if p._curve != q._curve { @@ -219,7 +219,7 @@ private_key_clear :: proc "contextless" (priv_key: ^Private_Key) { } // public_key_set_bytes decodes a byte-encoded public key, and returns -// true iff the operation was successful. +// true if and only if (⟺) the operation was successful. public_key_set_bytes :: proc(pub_key: ^Public_Key, curve: Curve, b: []byte) -> bool { public_key_clear(pub_key) @@ -296,7 +296,7 @@ public_key_bytes :: proc(pub_key: ^Public_Key, dst: []byte) { } } -// public_key_equal returns true iff the public keys are equal, +// public_key_equal returns true if and only if (⟺) the public keys are equal, // in constant time. public_key_equal :: proc(p, q: ^Public_Key) -> bool { if p._curve != q._curve { diff --git a/core/crypto/ecdsa/ecdsa_asn1.odin b/core/crypto/ecdsa/ecdsa_asn1.odin index 0b423286d..74c9d65e6 100644 --- a/core/crypto/ecdsa/ecdsa_asn1.odin +++ b/core/crypto/ecdsa/ecdsa_asn1.odin @@ -141,7 +141,7 @@ parse_asn1_sig :: proc(sig: []byte) -> (r, s: []byte, ok: bool) { return nil, nil, false } - // DER requires a leading 0 iff the sign bit of the leading byte + // DER requires a leading 0 if and only if (⟺) the sign bit of the leading byte // is set to distinguish between positive and negative integers, // and the minimal length representation. `r` and `s` are always // going to be unsigned, so we validate malformed DER and strip diff --git a/core/crypto/ecdsa/ecdsa_verify.odin b/core/crypto/ecdsa/ecdsa_verify.odin index 6b4e3dd4a..bd973a8df 100644 --- a/core/crypto/ecdsa/ecdsa_verify.odin +++ b/core/crypto/ecdsa/ecdsa_verify.odin @@ -3,7 +3,7 @@ package ecdsa import "core:crypto/hash" import secec "core:crypto/_weierstrass" -// verify_raw returns true iff sig is a valid signature by pub_key over +// verify_raw returns true if and only if (⟺) sig is a valid signature by pub_key over // msg, hased using hash_algo, per the verification procedure specifed // in SEC 1, Version 2.0, Section 4.1.4. // @@ -33,7 +33,7 @@ verify_raw :: proc(pub_key: ^Public_Key, hash_algo: hash.Algorithm, msg, sig: [] panic("crypto/ecdsa: invalid curve") } -// verify_asn1 returns true iff sig is a valid signature by pub_key over +// verify_asn1 returns true if and only if (⟺) sig is a valid signature by pub_key over // msg, hased using hash_algo, per the verification procedure specifed // in SEC 1, Version 2.0, Section 4.1.4. // diff --git a/core/crypto/ed25519/ed25519.odin b/core/crypto/ed25519/ed25519.odin index 817c8d34b..2020c0633 100644 --- a/core/crypto/ed25519/ed25519.odin +++ b/core/crypto/ed25519/ed25519.odin @@ -48,7 +48,7 @@ Public_Key :: struct { } // private_key_generate uses the system entropy source to generate a new -// Private_Key. This will only fail iff the system entropy source is +// Private_Key. This will only fail if and only if (⟺) the system entropy source is // missing or broken. private_key_generate :: proc(priv_key: ^Private_Key) -> bool { private_key_clear(priv_key) @@ -67,7 +67,7 @@ private_key_generate :: proc(priv_key: ^Private_Key) -> bool { } // private_key_set_bytes decodes a byte-encoded private key, and returns -// true iff the operation was successful. +// true if and only if (⟺) the operation was successful. private_key_set_bytes :: proc(priv_key: ^Private_Key, b: []byte) -> bool { if len(b) != PRIVATE_KEY_SIZE { return false @@ -167,7 +167,7 @@ sign :: proc(priv_key: ^Private_Key, msg, sig: []byte) { } // public_key_set_bytes decodes a byte-encoded public key, and returns -// true iff the operation was successful. +// true if and only if (⟺) the operation was successful. public_key_set_bytes :: proc "contextless" (pub_key: ^Public_Key, b: []byte) -> bool { if len(b) != PUBLIC_KEY_SIZE { return false @@ -205,14 +205,14 @@ public_key_bytes :: proc(pub_key: ^Public_Key, dst: []byte) { copy(dst, pub_key._b[:]) } -// public_key_equal returns true iff pub_key is equal to other. +// public_key_equal returns true if and only if (⟺) pub_key is equal to other. public_key_equal :: proc(pub_key, other: ^Public_Key) -> bool { ensure(pub_key._is_initialized && other._is_initialized, "crypto/ed25519: uninitialized public key") return crypto.compare_constant_time(pub_key._b[:], other._b[:]) == 1 } -// verify returns true iff sig is a valid signature by pub_key over msg. +// verify returns true if and only if (⟺) sig is a valid signature by pub_key over msg. // // The optional `allow_small_order_A` parameter will make this // implementation strictly compatible with FIPS 186-5, at the expense of diff --git a/core/crypto/hash/low_level.odin b/core/crypto/hash/low_level.odin index 242eadd5f..44b2a8100 100644 --- a/core/crypto/hash/low_level.odin +++ b/core/crypto/hash/low_level.odin @@ -235,7 +235,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { switch &impl in ctx._impl { diff --git a/core/crypto/hmac/hmac.odin b/core/crypto/hmac/hmac.odin index d28c03b5b..56decc0ef 100644 --- a/core/crypto/hmac/hmac.odin +++ b/core/crypto/hmac/hmac.odin @@ -21,7 +21,7 @@ sum :: proc(algorithm: hash.Algorithm, dst, msg, key: []byte) { } // verify will verify the HMAC tag computed with the specified algorithm -// and key over msg and return true iff the tag is valid. It requires +// and key over msg and return true if and only if (⟺) the tag is valid. It requires // that the tag is correctly sized. verify :: proc(algorithm: hash.Algorithm, tag, msg, key: []byte) -> bool { tag_buf: [hash.MAX_DIGEST_SIZE]byte diff --git a/core/crypto/kmac/kmac.odin b/core/crypto/kmac/kmac.odin index 4ecff4f12..f0c27739a 100644 --- a/core/crypto/kmac/kmac.odin +++ b/core/crypto/kmac/kmac.odin @@ -32,7 +32,7 @@ sum :: proc(sec_strength: int, dst, msg, key, domain_sep: []byte) { } // verify will verify the KMAC tag computed with the specified security -// strength, key and domain separator over msg and return true iff the +// strength, key and domain separator over msg and return true if and only if (⟺) the // tag is valid. verify :: proc(sec_strength: int, tag, msg, key, domain_sep: []byte, allocator := context.temp_allocator) -> bool { derived_tag := make([]byte, len(tag), allocator) diff --git a/core/crypto/legacy/keccak/keccak.odin b/core/crypto/legacy/keccak/keccak.odin index ec6af2565..ffca1c95c 100644 --- a/core/crypto/legacy/keccak/keccak.odin +++ b/core/crypto/legacy/keccak/keccak.odin @@ -77,7 +77,7 @@ update :: proc "contextless" (ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc "contextless" (ctx: ^Context, hash: []byte, finalize_clone: bool = false) { _sha3.final((^_sha3.Context)(ctx), hash, finalize_clone) diff --git a/core/crypto/legacy/md5/md5.odin b/core/crypto/legacy/md5/md5.odin index 399a789ed..4bbc5d32a 100644 --- a/core/crypto/legacy/md5/md5.odin +++ b/core/crypto/legacy/md5/md5.odin @@ -69,7 +69,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { ensure(ctx.is_initialized) diff --git a/core/crypto/legacy/sha1/sha1.odin b/core/crypto/legacy/sha1/sha1.odin index f9adcc3d1..892f893a6 100644 --- a/core/crypto/legacy/sha1/sha1.odin +++ b/core/crypto/legacy/sha1/sha1.odin @@ -76,7 +76,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { ensure(ctx.is_initialized) diff --git a/core/crypto/pbkdf2/pbkdf2.odin b/core/crypto/pbkdf2/pbkdf2.odin index 9d8394031..c27ec4aa2 100644 --- a/core/crypto/pbkdf2/pbkdf2.odin +++ b/core/crypto/pbkdf2/pbkdf2.odin @@ -66,7 +66,7 @@ derive :: proc( dst_blk = dst_blk[h_len:] } - // Instead of rounding l up, just proceass the one extra block iff + // Instead of rounding l up, just proceass the one extra block if and only if (⟺) // r != 0. if r > 0 { tmp: [hash.MAX_DIGEST_SIZE]byte diff --git a/core/crypto/poly1305/poly1305.odin b/core/crypto/poly1305/poly1305.odin index 69e2e3ad3..ed2bec82d 100644 --- a/core/crypto/poly1305/poly1305.odin +++ b/core/crypto/poly1305/poly1305.odin @@ -33,7 +33,7 @@ sum :: proc(dst, msg, key: []byte) { } // verify will verify the Poly1305 tag computed with the key over msg and -// return true iff the tag is valid. It requires that the tag is correctly +// return true if and only if (⟺) the tag is valid. It requires that the tag is correctly // sized. verify :: proc(tag, msg, key: []byte) -> bool { ctx: Context = --- diff --git a/core/crypto/ristretto255/ristretto255.odin b/core/crypto/ristretto255/ristretto255.odin index 3724aee7a..ef899d1da 100644 --- a/core/crypto/ristretto255/ristretto255.odin +++ b/core/crypto/ristretto255/ristretto255.odin @@ -360,7 +360,7 @@ ge_double_scalarmult_generator_vartime :: proc( ge._is_initialized = true } -// ge_cond_negate sets `ge = a` iff `ctrl == 0` and `ge = -a` iff `ctrl == 1`. +// ge_cond_negate sets `ge = a` if and only if (⟺) `ctrl == 0` and `ge = -a` if and only if (⟺) `ctrl == 1`. // Behavior for all other values of ctrl are undefined, ge_cond_negate :: proc(ge, a: ^Group_Element, ctrl: int) { _ge_ensure_initialized([]^Group_Element{a}) @@ -369,7 +369,7 @@ ge_cond_negate :: proc(ge, a: ^Group_Element, ctrl: int) { ge._is_initialized = true } -// ge_cond_assign sets `ge = ge` iff `ctrl == 0` and `ge = a` iff `ctrl == 1`. +// ge_cond_assign sets `ge = ge` if and only if (⟺) `ctrl == 0` and `ge = a` if and only if (⟺) `ctrl == 1`. // Behavior for all other values of ctrl are undefined, ge_cond_assign :: proc(ge, a: ^Group_Element, ctrl: int) { _ge_ensure_initialized([]^Group_Element{ge, a}) @@ -377,7 +377,7 @@ ge_cond_assign :: proc(ge, a: ^Group_Element, ctrl: int) { grp.ge_cond_assign(&ge._p, &a._p, ctrl) } -// ge_cond_select sets `ge = a` iff `ctrl == 0` and `ge = b` iff `ctrl == 1`. +// ge_cond_select sets `ge = a` if and only if (⟺) `ctrl == 0` and `ge = b` if and only if (⟺) `ctrl == 1`. // Behavior for all other values of ctrl are undefined, ge_cond_select :: proc(ge, a, b: ^Group_Element, ctrl: int) { _ge_ensure_initialized([]^Group_Element{a, b}) @@ -386,7 +386,7 @@ ge_cond_select :: proc(ge, a, b: ^Group_Element, ctrl: int) { ge._is_initialized = true } -// ge_equal returns 1 iff `a == b`, and 0 otherwise. +// ge_equal returns 1 if and only if (⟺) `a == b`, and 0 otherwise. @(require_results) ge_equal :: proc(a, b: ^Group_Element) -> int { _ge_ensure_initialized([]^Group_Element{a, b}) @@ -405,7 +405,7 @@ ge_equal :: proc(a, b: ^Group_Element) -> int { return ret } -// ge_is_identity returns 1 iff `ge` is the identity element, and 0 otherwise. +// ge_is_identity returns 1 if and only if (⟺) `ge` is the identity element, and 0 otherwise. @(require_results) ge_is_identity :: proc(ge: ^Group_Element) -> int { return ge_equal(ge, &GE_IDENTITY) diff --git a/core/crypto/ristretto255/ristretto255_scalar.odin b/core/crypto/ristretto255/ristretto255_scalar.odin index 75844b3f4..743e02ef3 100644 --- a/core/crypto/ristretto255/ristretto255_scalar.odin +++ b/core/crypto/ristretto255/ristretto255_scalar.odin @@ -80,13 +80,13 @@ sc_square :: proc "contextless" (sc, a: ^Scalar) { grp.sc_square(sc, a) } -// sc_cond_assign sets `sc = sc` iff `ctrl == 0` and `sc = a` iff `ctrl == 1`. +// sc_cond_assign sets `sc = sc` if and only if (⟺) `ctrl == 0` and `sc = a` if and only if (⟺) `ctrl == 1`. // Behavior for all other values of ctrl are undefined, sc_cond_assign :: proc(sc, a: ^Scalar, ctrl: int) { grp.sc_cond_assign(sc, a, ctrl) } -// sc_equal returns 1 iff `a == b`, and 0 otherwise. +// sc_equal returns 1 if and only if (⟺) `a == b`, and 0 otherwise. @(require_results) sc_equal :: proc(a, b: ^Scalar) -> int { return grp.sc_equal(a, b) diff --git a/core/crypto/sha2/sha2.odin b/core/crypto/sha2/sha2.odin index 36fa4aa02..dc41462e4 100644 --- a/core/crypto/sha2/sha2.odin +++ b/core/crypto/sha2/sha2.odin @@ -191,7 +191,7 @@ update :: proc(ctx: ^$T, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^$T, hash: []byte, finalize_clone: bool = false) { ensure(ctx.is_initialized) diff --git a/core/crypto/sha2/sha2_impl_hw_gen.odin b/core/crypto/sha2/sha2_impl_hw_gen.odin index 85c7f8b28..837d0656d 100644 --- a/core/crypto/sha2/sha2_impl_hw_gen.odin +++ b/core/crypto/sha2/sha2_impl_hw_gen.odin @@ -4,7 +4,7 @@ package sha2 @(private = "file") ERR_HW_NOT_SUPPORTED :: "crypto/sha2: hardware implementation unsupported" -// is_hardware_accelerated_256 returns true iff hardware accelerated +// is_hardware_accelerated_256 returns true if and only if (⟺) hardware accelerated // SHA-224/SHA-256 is supported. is_hardware_accelerated_256 :: proc "contextless" () -> bool { return false diff --git a/core/crypto/sha2/sha2_impl_hw_intel.odin b/core/crypto/sha2/sha2_impl_hw_intel.odin index 83ef58a12..3f6ebb746 100644 --- a/core/crypto/sha2/sha2_impl_hw_intel.odin +++ b/core/crypto/sha2/sha2_impl_hw_intel.odin @@ -49,7 +49,7 @@ K_14 :: simd.u64x2{0x78a5636f748f82ee, 0x8cc7020884c87814} K_15 :: simd.u64x2{0xa4506ceb90befffa, 0xc67178f2bef9a3f7} -// is_hardware_accelerated_256 returns true iff hardware accelerated +// is_hardware_accelerated_256 returns true if and only if (⟺) hardware accelerated // SHA-224/SHA-256 is supported. is_hardware_accelerated_256 :: proc "contextless" () -> bool { req_features :: info.CPU_Features{ diff --git a/core/crypto/sha3/sha3.odin b/core/crypto/sha3/sha3.odin index 2ca70963a..2f8d95092 100644 --- a/core/crypto/sha3/sha3.odin +++ b/core/crypto/sha3/sha3.odin @@ -79,7 +79,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { _sha3.final((^_sha3.Context)(ctx), hash, finalize_clone) diff --git a/core/crypto/sm3/sm3.odin b/core/crypto/sm3/sm3.odin index ac38ca417..6f1d788e0 100644 --- a/core/crypto/sm3/sm3.odin +++ b/core/crypto/sm3/sm3.odin @@ -80,7 +80,7 @@ update :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { ensure(ctx.is_initialized) diff --git a/core/crypto/tuplehash/tuplehash.odin b/core/crypto/tuplehash/tuplehash.odin index 5c8d8e39b..a45c1b120 100644 --- a/core/crypto/tuplehash/tuplehash.odin +++ b/core/crypto/tuplehash/tuplehash.odin @@ -31,7 +31,7 @@ write_element :: proc(ctx: ^Context, data: []byte) { // final finalizes the Context, writes the digest to hash, and calls // reset on the Context. // -// Iff finalize_clone is set, final will work on a copy of the Context, +// If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, // which is useful for for calculating rolling digests. final :: proc(ctx: ^Context, hash: []byte, finalize_clone: bool = false) { _sha3.final_cshake((^_sha3.Context)(ctx), hash, finalize_clone) diff --git a/core/io/io.odin b/core/io/io.odin index 9fae30946..631a232aa 100644 --- a/core/io/io.odin +++ b/core/io/io.odin @@ -436,7 +436,7 @@ copy_buffer :: proc(dst: Writer, src: Reader, buf: []byte) -> (written: i64, err // copy_n copies n bytes (or till an error) from src to dst. // It returns the number of bytes copied and the first error that occurred whilst copying, if any. -// On return, written == n IFF err == nil +// On return, written == n if and only if (⟺) err == nil copy_n :: proc(dst: Writer, src: Reader, n: i64) -> (written: i64, err: Error) { nsrc := limited_reader_init(&Limited_Reader{}, src, n) written, err = copy(dst, nsrc) diff --git a/core/sys/darwin/Foundation/NSBlock.odin b/core/sys/darwin/Foundation/NSBlock.odin index 34e562d75..a5b99abc5 100644 --- a/core/sys/darwin/Foundation/NSBlock.odin +++ b/core/sys/darwin/Foundation/NSBlock.odin @@ -82,7 +82,7 @@ internal_block_literal_make :: proc (is_global: bool, user_data: rawptr, user_pr BLOCK_HAS_COPY_DISPOSE :: 1 << 25 BLOCK_HAS_CTOR :: 1 << 26 // helpers have C++ code BLOCK_IS_GLOBAL :: 1 << 28 - BLOCK_HAS_STRET :: 1 << 29 // IFF BLOCK_HAS_SIGNATURE + BLOCK_HAS_STRET :: 1 << 29 // if and only if (⟺) BLOCK_HAS_SIGNATURE BLOCK_HAS_SIGNATURE :: 1 << 30 bl.isa = is_global ? &_NSConcreteGlobalBlock : &_NSConcreteStackBlock diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 80df35edc..3dd4808c3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -4460,9 +4460,9 @@ gb_internal void check_binary_expr(CheckerContext *c, Operand *x, Ast *node, Typ truncated: r = a - b*trunc(a/b) floored: r = a - b*floor(a/b) - IFF a/0 == 0, then (a%0 == a) or (a%%0 == a) - IFF a/0 == a, then (a%0 == 0) or (a%%0 == 0) - IFF a/0 == 0b111..., then (a%0 == a) or (a%%0 == a) + If and only if (⟺) a/0 == 0, then (a%0 == a) or (a%%0 == a) + If and only if (⟺) a/0 == a, then (a%0 == 0) or (a%%0 == 0) + If and only if (⟺) a/0 == 0b111..., then (a%0 == a) or (a%%0 == a) */ switch (zero_behaviour) { diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp index 1685f9627..fc68561b3 100644 --- a/src/llvm_backend_expr.cpp +++ b/src/llvm_backend_expr.cpp @@ -1424,8 +1424,8 @@ gb_internal LLVMValueRef lb_integer_modulo(lbProcedure *p, LLVMValueRef lhs, LLV truncated: r = a - b*trunc(a/b) floored: r = a - b*floor(a/b) - IFF a/0 == 0, then (a%0 == a) or (a%%0 == a) - IFF a/0 == a, then (a%0 == 0) or (a%%0 == 0) + If and only if (⟺) a/0 == 0, then (a%0 == a) or (a%%0 == a) + If and only if (⟺) a/0 == a, then (a%0 == 0) or (a%%0 == 0) */ switch (behaviour) { diff --git a/vendor/lua/5.4/include/luaconf.h b/vendor/lua/5.4/include/luaconf.h index 3ad294e4f..fbfa5781b 100644 --- a/vendor/lua/5.4/include/luaconf.h +++ b/vendor/lua/5.4/include/luaconf.h @@ -71,7 +71,7 @@ /* -@@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. +@@ LUAI_IS32INT is true if and only if (⟺) 'int' has (at least) 32 bits. */ #define LUAI_IS32INT ((UINT_MAX >> 30) >= 3) diff --git a/vendor/portmidi/portmidi.odin b/vendor/portmidi/portmidi.odin index 58d7c2ec2..1f2aca286 100644 --- a/vendor/portmidi/portmidi.odin +++ b/vendor/portmidi/portmidi.odin @@ -119,8 +119,8 @@ DeviceInfo :: struct { structVersion: c.int, /**< this internal structure version */ interf: cstring, /**< underlying MIDI API, e.g. MMSystem or DirectX */ name: cstring, /**< device name, e.g. USB MidiSport 1x1 */ - input: b32, /**< true iff input is available */ - output: b32, /**< true iff output is available */ + input: b32, /**< true if and only if (⟺) input is available */ + output: b32, /**< true if and only if (⟺) output is available */ opened: b32, /**< used by generic PortMidi code to do error checking on arguments */ }