plusaes icon indicating copy to clipboard operation
plusaes copied to clipboard

Relax GCM restriction related to IV size

Open Alkenso opened this issue 3 years ago • 4 comments

In some cases there is a need to use GCM with IV of size 0.

I'd like to propose to remove

if (iv_size < 1) {
    return kErrorInvalidIvSize;
}

from check_gcm_cond function

Alkenso avatar Sep 22 '22 11:09 Alkenso

I considered 0-size IV, but it is hard to accept.

My understanding is that the IV size of GCM should be one or more. The library can arithmetically calculate with 0-size IV. But, the algorithm behavior seems to be very different.

kkAyataka avatar Oct 02 '22 02:10 kkAyataka

Agree, that could be strange situation. But in some cases there is need to omit IV (seen in some encryption mechanisms of Apple)

Alkenso avatar Oct 02 '22 06:10 Alkenso

Hmm. I cannot imagine. I don't want to ignore the specifications. Can you give a specific use case?

For example, If I create a special version of the following, would It help you?

Error encrypt_gcm_no_iv();

kkAyataka avatar Oct 05 '22 13:10 kkAyataka

any case that allows use GCM with no IV would be appreciated! want to use your shiny lib without custom modifications =)

Alkenso avatar Oct 05 '22 16:10 Alkenso