Skip to content

Commit 3c7bdbe

Browse files
authored
chore(CRP-2787): make unit in IBE ciphertext/plaintext size helpers explicit (#180)
Makes the unit, namely bytes, explicit in the documentation of the helper functions to determine IBE ciphertext/plaintext size explicit.
1 parent 554f545 commit 3c7bdbe

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

  • backend/rs/ic_vetkeys/src/utils
  • frontend/ic_vetkeys/src/utils

backend/rs/ic_vetkeys/src/utils/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,12 +764,12 @@ impl IbeCiphertext {
764764
}
765765
}
766766

767-
/// Helper function for determining size of the IBE ciphertext
767+
/// Helper function for determining the size of an IBE ciphertext in bytes.
768768
pub fn ciphertext_size(plaintext_size: usize) -> usize {
769769
plaintext_size + IBE_OVERHEAD
770770
}
771771

772-
/// Helper function for determining size of the IBE plaintext
772+
/// Helper function for determining the size of an IBE plaintext in bytes.
773773
///
774774
/// Returns None if the indicated length would be a ciphertext
775775
/// that is not possibly valid (due to missing required elements)

frontend/ic_vetkeys/src/utils/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ export class IbeCiphertext {
943943
readonly #c3: Uint8Array;
944944

945945
/**
946-
* Helper function for determining size of the IBE ciphertext
946+
* Helper function for determining the size of an IBE ciphertext in bytes.
947947
*/
948948
static ciphertextSize(plaintextSize: number): number {
949949
if (plaintextSize < 0) {
@@ -956,7 +956,7 @@ export class IbeCiphertext {
956956
}
957957

958958
/**
959-
* Helper function for determining size of the IBE plaintext
959+
* Helper function for determining the size of an IBE plaintext in bytes.
960960
*/
961961
static plaintextSize(ciphertextSize: number): number {
962962
if (ciphertextSize < IBE_OVERHEAD) {

0 commit comments

Comments
 (0)