VirtualBox

Ignore:
Timestamp:
Mar 3, 2022 7:17:34 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150325
Message:

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

Location:
trunk/src/libs/openssl-3.0.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/openssl-3.0.1

    • Property svn:mergeinfo
      •  

        old new  
        1212/vendor/openssl/1.1.1c:131722-131725
        1313/vendor/openssl/1.1.1k:145841-145843
         14/vendor/openssl/3.0.1:150323-150324
         15/vendor/openssl/current:147554-150322
  • trunk/src/libs/openssl-3.0.1/include/internal/constant_time.h

    r91772 r94082  
    11/*
    2  * Copyright 2014-2019 The OpenSSL Project Authors. All Rights Reserved.
    3  *
    4  * Licensed under the OpenSSL license (the "License").  You may not use
     2 * Copyright 2014-2021 The OpenSSL Project Authors. All Rights Reserved.
     3 *
     4 * Licensed under the Apache License 2.0 (the "License").  You may not use
    55 * this file except in compliance with the License.  You can obtain a copy
    66 * in the file LICENSE in the source distribution or at
     
    1010#ifndef OSSL_INTERNAL_CONSTANT_TIME_H
    1111# define OSSL_INTERNAL_CONSTANT_TIME_H
     12# pragma once
    1213
    1314# include <stdlib.h>
     
    182183}
    183184
     185static ossl_inline uint64_t constant_time_is_zero_64(uint64_t a)
     186{
     187    return constant_time_msb_64(~a & (a - 1));
     188}
     189
    184190static ossl_inline unsigned int constant_time_eq(unsigned int a,
    185191                                                 unsigned int b)
     
    354360
    355361/*
     362 * mask must be 0xFF or 0x00.
     363 * "constant time" is per len.
     364 *
     365 * if (mask) {
     366 *     unsigned char tmp[len];
     367 *
     368 *     memcpy(tmp, a, len);
     369 *     memcpy(a, b);
     370 *     memcpy(b, tmp);
     371 * }
     372 */
     373static ossl_inline void constant_time_cond_swap_buff(unsigned char mask,
     374                                                     unsigned char *a,
     375                                                     unsigned char *b,
     376                                                     size_t len)
     377{
     378    size_t i;
     379    unsigned char tmp;
     380
     381    for (i = 0; i < len; i++) {
     382        tmp = a[i] ^ b[i];
     383        tmp &= mask;
     384        a[i] ^= tmp;
     385        b[i] ^= tmp;
     386    }
     387}
     388
     389/*
    356390 * table is a two dimensional array of bytes. Each row has rowsize elements.
    357391 * Copies row number idx into out. rowsize and numrows are not considered
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette