What's the maximum length for AAD in GCM? int mbedtls_gcm_starts( mbedtls_gcm_context *ctx,
                int mode,
                const unsigned char *iv,
                size_t iv_len,
                const unsigned char *add,
                size_t add_len )
{
    int ret;
    unsigned char work_buf[16];
    size_t i;
    const unsigned char *p;
    size_t use_len, olen = 0;

    /* IV and AD are limited to 2^64 bits, so 2^61 bytes */
    if( ( (uint64_t) iv_len  ) &gt;&gt; 61 != 0 ||
        ( (uint64_t) add_len ) &gt;&gt; 61 != 0 )
    {
        return( MBEDTLS_ERR_GCM_BAD_INPUT );
    }
}


Above is a part of the implementation of GCM (Galois/Counter Mode) by mbedtls. 

The implementation puts a restriction on the length of AAD (additional authenticated data), that is, the length of AAD cannot be greater than $2^{61}$ bytes.

My questions:


Is there an actual limit on the length of AAD, or that's just an implementaion-specific restriction?
Theoretically, can I input an AAD of any length?
From the GCM specification:


  Additional authenticated data (AAD), which is denoted as A. This data is authenticated, but not encrypted, and can have any number of bits between $0$ and $2^{64}$ .