Okey doke.


On Wed, Jan 22, 2014 at 5:31 PM, Paul Kehrer <notifications@github.com>wrote:

> In cryptography/hazmat/backends/commoncrypto/backend.py:
>
> > +        )
> > +        self._backend._check_response(res)
> > +
> > +    def update(self, data):
> > +        buf = self._backend._ffi.new("unsigned char[]", len(data))
> > +        args = (self._ctx[0], data, len(data), buf)
> > +        if self._operation == self._ENCRYPT:
> > +            res = self._backend._lib.CCCryptorGCMEncrypt(*args)
> > +        else:
> > +            res = self._backend._lib.CCCryptorGCMDecrypt(*args)
> > +
> > +        self._backend._check_response(res)
> > +        return self._backend._ffi.buffer(buf)[:len(data)]
> > +
> > +    def finalize(self):
> > +        tag_size = self._cipher.block_size // 8
>
> GCM is only defined for 128-bit block ciphers and the tag length is
> guaranteed to be the same as the block size. We actually do this same
> calculation in the OpenSSL backend here<https://github.com/pyca/cryptography/blob/master/cryptography/hazmat/backends/openssl/backend.py#L277>
> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pyca/cryptography/pull/495/files#r9097513>
> .
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084