Skip to content

Conversation

@revital76
Copy link

No description provided.

// counter field.
// The first 31 bits of the initial counter field are set to 0, the last bit
// is set
// to 1.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to break the line twice?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that. will fix it. Thanks


// Update last two bytes with new page ordinal (instead of creating new page AAD
// from
// scratch)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 line breaks

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that. will fix it. Thanks

constexpr int8_t kOffsetIndex = 7;

/// Do AES_GCM_CTR_V1 or AES_GCM_V1 encryption
class AesEncryptor {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change comment to "Performs AES encryption operations with GCM or CTR ciphers"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

~AesEncryptor();

/// Size different between plaintext and ciphertext, for this cipher.
int CiphertextSizeDelta();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size differenCe

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, Wes suggested calling this function "ciphertext_size_delta()", " (since this is just accessing an attribute)"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this function in AesEncryptor::AesEncryptorImpl (it's accessing an attribute in this class)

/// Size different between plaintext and ciphertext, for this cipher.
int CiphertextSizeDelta();

/// Key length is passed only for validation. If different from value in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please start comment with "Encrypts plaintext with the key and aad. "

int Encrypt(const uint8_t* plaintext, int plaintext_len, uint8_t* key, int key_len,
uint8_t* aad, int aad_len, uint8_t* ciphertext);

int SignedFooterEncrypt(const uint8_t* footer, int footer_len, uint8_t* key,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comment "/// Encrypts plaintext footer, in order to compute the signature (tag)".

std::unique_ptr<AesEncryptorImpl> impl_;
};

/// Do AES_GCM_CTR_V1 or AES_GCM_V1 decryption
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change comment to "Performs AES decryption operations with GCM or CTR ciphers"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


/// Size different between plaintext and ciphertext, for this cipher.
int CiphertextSizeDelta();

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

differenCe. also, Wes suggested calling this function "ciphertext_size_delta()", " (since this is just accessing an attribute)"

int CiphertextSizeDelta();

/// Key length is passed only for validation. If different from value in
/// constructor, exception will be thrown.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please start comment with "Decrypts ciphertext using the key and aad. "

@ggershinsky ggershinsky merged commit 21ce9d0 into ggershinsky:p1517-crypto-pack-updates May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants