"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "crypto/rand/drbg_ctr.c" between
openssl-1.1.1f.tar.gz and openssl-1.1.1g.tar.gz

About: OpenSSL is a toolkit implementing the Transport Layer Security (TLS) protocols (including SSLv3) as well as a full-strength general purpose cryptographic library. Long Term Support (LTS) version (includes support for TLSv1.3).

drbg_ctr.c  (openssl-1.1.1f):drbg_ctr.c  (openssl-1.1.1g)
/* /*
* Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved.
* *
* Licensed under the OpenSSL license (the "License"). You may not use * Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy * this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html * https://www.openssl.org/source/license.html
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <openssl/crypto.h> #include <openssl/crypto.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#include "internal/thread_once.h" #include "modes_local.h"
#include "internal/thread_once.h" #include "internal/thread_once.h"
#include "rand_local.h" #include "rand_local.h"
/* /*
* Implementation of NIST SP 800-90A CTR DRBG. * Implementation of NIST SP 800-90A CTR DRBG.
*/ */
static void inc_128(RAND_DRBG_CTR *ctr) static void inc_128(RAND_DRBG_CTR *ctr)
{ {
int i; unsigned char *p = &ctr->V[0];
unsigned char c; u32 n = 16, c = 1;
unsigned char *p = &ctr->V[15];
do {
for (i = 0; i < 16; i++, p--) { --n;
c = *p; c += p[n];
c++; p[n] = (u8)c;
*p = c; c >>= 8;
if (c != 0) { } while (n);
/* If we didn't wrap around, we're done. */
break;
}
}
} }
static void ctr_XOR(RAND_DRBG_CTR *ctr, const unsigned char *in, size_t inlen) static void ctr_XOR(RAND_DRBG_CTR *ctr, const unsigned char *in, size_t inlen)
{ {
size_t i, n; size_t i, n;
if (in == NULL || inlen == 0) if (in == NULL || inlen == 0)
return; return;
/* /*
 End of changes. 4 change blocks. 
15 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)