CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
blowfish.cc File Reference
#include "blowfish.h"

Go to the source code of this file.

Macros

#define N   16
 

Functions

void Blowfish_Decrypt (BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr)
 
void Blowfish_Encrypt (BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr)
 
void Blowfish_Init (BLOWFISH_CTX *ctx, unsigned char *key, int keyLen)
 
static uInt32 F (BLOWFISH_CTX *ctx, uInt32 x)
 

Variables

static const uInt32 ORIG_P [16+2]
 
static const uInt32 ORIG_S [4][256]
 

Macro Definition Documentation

#define N   16

Definition at line 9 of file blowfish.cc.

Referenced by Phase1PixelSummaryMap::addNamedBins(), StripCPEgeometric::WrappedCluster::addSuppressedEdgeStrip(), L1TConfigDumper::analyze(), apply(), asHepVector(), ticl::assignPCAtoTracksters(), PFRecHitCaloNavigator< CaloTowerDetId, CaloTowerTopology >::associateNeighbours(), PFRecHitCaloNavigatorWithTime< EEDetId, EcalEndcapTopology >::associateNeighbours(), JetCorrectorParameters::binIndex(), Blowfish_Decrypt(), Blowfish_Encrypt(), Blowfish_Init(), JetMETHLTOfflineSource::bookHistograms(), FWBeamSpotProxyBuilder::build(), FWTracksterHitsProxyBuilder::build(), FWTracksterLayersProxyBuilder::build(), FastCircleFit::calculate(), edm::VecArray< std::pair< int, int >, 9 >::capacity(), HGCalDDDConstants::cellHex(), HGCalDDDConstants::cellType(), HeterogeneousHGCSiliconDetId::cellX(), HFNoseDetId::cellX(), HGCSiliconDetId::cellX(), HeterogeneousHGCSiliconDetId::cellY(), HFNoseDetId::cellY(), HGCSiliconDetId::cellY(), StripCPEgeometric::WrappedCluster::centroid(), JetCorrectorParametersHelper::checkMiddleBinUniformity(), RPCSeedOverlapper::CheckOverlap(), clangcms::FiniteMathChecker::checkPreStmt(), popcon::EcalPulseSymmCovariancesHandler::checkPulseSymmCovariance(), riemannFit::circleFit(), dtCalibration::DTVDriftMeanTimer::compute(), calo::multifit::compute_decomposition(), calo::multifit::compute_decomposition_forwardsubst_with_offsets(), edm::ParameterTypeTraits< std::array< T, N > >::convert(), ConvertToHist(), SimpleJetCorrector::correctionBin(), riemannFit::cov_carttorad(), riemannFit::cov_carttorad_prefit(), riemannFit::cov_radtocart(), tauImpactParameter::ParticleBuilder::createLorentzVectorParticle(), reco::NamedCompositeCandidate::daughter(), reco::CompositeCandidate::daughter(), StripCPEgeometric::WrappedCluster::deformed(), SingleGaussianState< N >::dimension(), MultiGaussianState< N >::dimension(), dot(), EcalZmassClient::dqmEndJob(), TEveEllipsoidProjectedGL::DrawRhoZ(), StripCPEgeometric::WrappedCluster::dropSmallerEdgeStrip(), EcalPulseSymmCovariance::EcalPulseSymmCovariance(), edm::VecArray< std::pair< int, int >, 9 >::emplace_back(), DTVDriftCalibration::endJob(), cond::serialization::access< T[N]>::equal_(), cond::serialization::access< std::array< T, N > >::equal_(), FastCircleFit::FastCircleFit(), riemannFit::fastFit(), LA_Filler_Fitter::fill(), MuonResidualsAngleFitter::fit(), MuonResidualsBfieldAngleFitter::fit(), MuonResidualsPositionFitter::fit(), MuonResiduals1DOFFitter::fit(), CSCFindPeakTime::fivePoleFitCharge(), fnc_dscb(), fnc_gaussalpha(), fnc_gaussalpha1alpha2(), ProjectMatrix< T, N, D >::fromH(), mathSSE::Vec4< double >::get1(), mathSSE::Vec2< float >::get1(), mathSSE::Vec4< align::Scalar >::get1(), HGCalParametersFromDD::getCellPosition(), PFEnergyResolution::getEnergyResolutionEm(), fit::RootMinuit< Function >::getErrorMatrix(), ReferenceTrajectory::getHitProjectionMatrixT(), GetMEAN(), RPCSeedPattern::getSpecialAlgorithmErrorMatrix(), graph_combine(), h2DSegm::h2DSegm(), h4DSegm::h4DSegm(), magfieldparam::HarmBasis3DCyl::HarmBasis3DCyl(), hDeltaR::hDeltaR(), hDigis::hDigis(), riemannFit::helixFit(), hHits::hHits(), HistoExists(), hMuonStat::hMuonStat(), hParam::hParam(), hTDelay::hTDelay(), hTOF::hTOF(), magfieldparam::poly2d_base::IncNPwr(), SiTrivialInduceChargeOnStrips::induceVector(), PFHCALDenseIdNavigator< HcalDetId, HcalTopology, false >::init(), MultiGaussianStateTransform::innerMultiState1D(), math::cholesky::invertNN(), DDBase< DDName, std::unique_ptr< DDI::Material > >::isDefined(), mayown_ptr< T, N >::isOwn(), HGCalDDDConstants::isValidCell8(), HGCalDDDConstants::isValidHex8(), ConvertingESProducerWithDependenciesT< CombinedRecord< DepsRecords...>, Target, Dependencies...>::WalkConsumes< N >::iterate(), ConvertingESProducerWithDependenciesT< CombinedRecord< DepsRecords...>, Target, Dependencies...>::WalkAndCall< N, Types >::iterate(), PerigeeConversions::jacobianCurvilinear2Perigee(), PerigeeConversions::jacobianPerigee2Curvilinear(), riemannFit::lineFit(), HGCalGeomParameters::loadWaferHexagon8(), StripCPEfromTrackAngle::localParameters(), lumiperIOV(), PVValHelper::makeLogBins(), mayown_ptr< T, N >::markOwn(), HGCalDDDConstants::maskCell(), edm::EventSelector::maskTriggerResults(), L1TMuonBarrelKalmanAlgo::match(), HGCalDDDConstants::maxCells(), StripCPEgeometric::WrappedCluster::maxProjection(), StripCPEgeometric::WrappedCluster::middle(), MultiGaussianStateTransform::multiState1D(), DTTFBitArray< N >::nBits(), BitArray< 9 >::nBits(), HGCalTopology::neighbors(), JetCorrectorParameters::neighbourBin(), HGCalDDDConstants::numberCellsHexagon(), BitArray< 9 >::nWords(), DTTFBitArray< N >::nWords(), KalmanTrackToTrackCovCalculator< N >::operator()(), TtHadLRSignalSelObservables::operator()(), TtSemiLRSignalSelObservables::operator()(), CSCThrTurnOnFcn::operator()(), MultiGaussianStateTransform::outerMultiState1D(), JetResolution::parameter(), JetResolution::parameterEtaEval(), mayown_ptr< T, N >::pointer(), polevlf(), DDHGCalEEAlgo::positionSensitive(), DDHGCalEEFileAlgo::positionSensitive(), DDHGCalHEFileAlgo::positionSensitive(), DDHGCalHEAlgo::positionSensitive(), HGCalEEFileAlgo::positionSensitive(), HGCalEEAlgo::PositionSensitive(), HGCalHEFileAlgo::positionSensitive(), HGCalHEAlgo::positionSensitive(), PhiMemoryImage::print(), StraightTrackAlignment::printN(), RecoTauCleanerImpl< Prod >::produce(), CTPPSProtonReconstructionPlotter::profileToRMSGraph(), CTPPSProtonReconstructionSimulationValidator::PlotGroup::profileToRMSGraph(), ProjectMatrix< T, N, D >::project(), ProjectMatrix< T, N, D >::projectAndSubtractFrom(), TempTrajectory::push(), edm::VecArray< std::pair< int, int >, 9 >::push_back(), cscdqm::Summary::ReadErrorChambers(), cscdqm::Summary::ReadReportingChambersRef(), DTSegmentUpdator::rejectBadHits(), PFMuonAlgo::removeDeadCandidates(), edm::VecArray< std::pair< int, int >, 9 >::resize(), JetResolution::resolution(), EnergyResolutionVsLumi::Resolution(), runlistfromlumifile(), magfieldparam::rz_harm_poly::rz_harm_poly(), magfieldparam::rz_poly::rz_poly(), RZLine::RZLine(), scalebylumi(), riemannFit::scatter_cov_rad(), riemannFit::scatterCovLine(), JetMETHLTOfflineSource::PathInfo::setHistos(), SiPixelDetectorStatus::setNevents(), CosmicMuonGenerator::setNumberOfEvents(), CosmicMuonGenerator::setRanSeed(), magfieldparam::poly2d_base::SetTabSize(), StraightTrackAlignment::setToString(), magfieldparam::rz_harm_poly::SetTrigArrSize(), dqm::impl::MonitorElement::ShiftFillLast(), DoubleCrystalBallGenerator::shoot(), cscdqm::Utility::SignificanceLevelHigh(), stat_RMS(), StripCPEgeometric::WrappedCluster::sumQ(), reco::tau::takeNElements(), edm::EventSelector::testSelectionOverlap(), CSCSegment::time(), GsfMatrixTools::trace(), KalmanVertexTrackUpdator< N >::trackRefit(), npstat::transposeBuffer(), HGCSiliconDetId::triggerCellU(), HFNoseDetId::triggerCellU(), HGCSiliconDetId::triggerCellV(), HFNoseDetId::triggerCellV(), HFNoseTriggerDetId::triggerCellX(), HGCalTriggerDetId::triggerCellX(), HFNoseTriggerDetId::triggerCellY(), HGCalTriggerDetId::triggerCellY(), SimpleJetCorrectionUncertainty::uncertaintyBin(), SurveyOutput::write(), and HFunctionResolution::Write().

Function Documentation

void Blowfish_Decrypt ( BLOWFISH_CTX ctx,
uInt32 xl,
uInt32 xr 
)

Definition at line 207 of file blowfish.cc.

References F(), mps_fire::i, N, BLOWFISH_CTX::P, and groupFilesInBlocks::temp.

Referenced by cond::auth::Cipher::bf_process_alloc().

207  {
208  uInt32 Xl;
209  uInt32 Xr;
210  uInt32 temp;
211  short i;
212 
213  Xl = *xl;
214  Xr = *xr;
215 
216  for (i = N + 1; i > 1; --i) {
217  Xl = Xl ^ ctx->P[i];
218  Xr = F(ctx, Xl) ^ Xr;
219  /* Exchange Xl and Xr */
220  temp = Xl;
221  Xl = Xr;
222  Xr = temp;
223  }
224 
225  /* Exchange Xl and Xr */
226  temp = Xl;
227  Xl = Xr;
228  Xr = temp;
229  Xr = Xr ^ ctx->P[1];
230  Xl = Xl ^ ctx->P[0];
231  *xl = Xl;
232  *xr = Xr;
233 }
unsigned int uInt32
Definition: blowfish.h:25
uInt32 P[16+2]
Definition: blowfish.h:40
#define N
Definition: blowfish.cc:9
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
void Blowfish_Encrypt ( BLOWFISH_CTX ctx,
uInt32 xl,
uInt32 xr 
)

Definition at line 181 of file blowfish.cc.

References F(), mps_fire::i, N, BLOWFISH_CTX::P, and groupFilesInBlocks::temp.

Referenced by cond::auth::Cipher::bf_process_alloc(), and Blowfish_Init().

181  {
182  uInt32 Xl;
183  uInt32 Xr;
184  uInt32 temp;
185  short i;
186 
187  Xl = *xl;
188  Xr = *xr;
189 
190  for (i = 0; i < N; ++i) {
191  Xl = Xl ^ ctx->P[i];
192  Xr = F(ctx, Xl) ^ Xr;
193  temp = Xl;
194  Xl = Xr;
195  Xr = temp;
196  }
197 
198  temp = Xl;
199  Xl = Xr;
200  Xr = temp;
201  Xr = Xr ^ ctx->P[N];
202  Xl = Xl ^ ctx->P[N + 1];
203  *xl = Xl;
204  *xr = Xr;
205 }
unsigned int uInt32
Definition: blowfish.h:25
uInt32 P[16+2]
Definition: blowfish.h:40
#define N
Definition: blowfish.cc:9
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
void Blowfish_Init ( BLOWFISH_CTX ctx,
unsigned char *  key,
int  keyLen 
)

Definition at line 235 of file blowfish.cc.

References Blowfish_Encrypt(), data, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, N, ORIG_P, ORIG_S, BLOWFISH_CTX::P, and BLOWFISH_CTX::S.

Referenced by cond::auth::Cipher::Cipher().

235  {
236  int i, j, k;
237  uInt32 data, datal, datar;
238 
239  for (i = 0; i < 4; i++) {
240  for (j = 0; j < 256; j++)
241  ctx->S[i][j] = ORIG_S[i][j];
242  }
243 
244  j = 0;
245 
246  for (i = 0; i < N + 2; ++i) {
247  data = 0x00000000;
248 
249  for (k = 0; k < 4; ++k) {
250  data = (data << 8) | key[j];
251  j = j + 1;
252  if (j >= keyLen)
253  j = 0;
254  }
255 
256  ctx->P[i] = ORIG_P[i] ^ data;
257  }
258 
259  datal = 0x00000000;
260  datar = 0x00000000;
261 
262  for (i = 0; i < N + 2; i += 2) {
263  Blowfish_Encrypt(ctx, &datal, &datar);
264  ctx->P[i] = datal;
265  ctx->P[i + 1] = datar;
266  }
267 
268  for (i = 0; i < 4; ++i) {
269  for (j = 0; j < 256; j += 2) {
270  Blowfish_Encrypt(ctx, &datal, &datar);
271  ctx->S[i][j] = datal;
272  ctx->S[i][j + 1] = datar;
273  }
274  }
275 }
void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 *xr)
Definition: blowfish.cc:181
uInt32 S[4][256]
Definition: blowfish.h:41
static const uInt32 ORIG_S[4][256]
Definition: blowfish.cc:31
unsigned int uInt32
Definition: blowfish.h:25
uInt32 P[16+2]
Definition: blowfish.h:40
tuple key
prepare the HTCondor submission files and eventually submit them
static const uInt32 ORIG_P[16+2]
Definition: blowfish.cc:12
#define N
Definition: blowfish.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uInt32 F ( BLOWFISH_CTX ctx,
uInt32  x 
)
static

Definition at line 163 of file blowfish.cc.

References a, b, c, ztail::d, BLOWFISH_CTX::S, and detailsBasic3DVector::y.

Referenced by L1TConfigDumper::analyze(), DMRChecker::analyze(), Rivet::HiggsTemplateCrossSections::analyze(), Blowfish_Decrypt(), Blowfish_Encrypt(), HcalHaloAlgo::Calculate(), hitfit::Fourvec_Constraint_Calculator::calculate_constraints(), hitfit::Base_Constrainer::call_constraint_fcn(), TangentCircle::charge(), clangcms::EDMPluginDumper::checkASTDecl(), funct::RatioP1< A, B, Numerical< n > >::combine(), funct::RatioP2< A, B, ProductStruct< C, D > >::combine(), ForwardDiskSectorBuilderFromDet::computeBounds(), ForwardRingDiskBuilderFromDet::computeBounds(), BarrelDetLayer::computeSurface(), ForwardDetLayer::computeSurface(), DAClusterizerInZ::dump(), DAClusterizerInZ_vect::dump(), DAClusterizerInZT_vect::dump(), TrackerTreeGenerator::endJob(), TrackerValidationVariables::fillHitQuantities(), ApeEstimator::fillHitVariables(), ApeEstimator::fillTrackVariables(), reco::findMethod(), edm::refitem::findRefItem(), hitfit::Chisq_Constrainer::fit(), reco::componenthelper::SingleComponent< C, T, F >::get(), reco::componenthelper::MultipleComponents< C, T, F, S >::get(), TKinFitter::getF(), edm::refitem::GetRefPtrImpl< C, T, F, KEY >::getRefPtr_(), edm::refitem::GetRefPtrImpl< C, T, F, unsigned int >::getRefPtr_(), LayerMeasurements::groupedMeasurements(), HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), HTXS::HTXSstage1_2_Fine_to_HTXSstage1_2_Fine_FineIndex(), HTXS::HTXSstage1_2_Fine_to_index(), HTXS::HTXSstage1_2_to_HTXSstage1_2_FineIndex(), HTXS::HTXSstage1_2_to_index(), HTXS::HTXSstage1_to_HTXSstage1FineIndex(), HTXS::HTXSstage1_to_index(), MagneticField::inInverseGeV(), TkStackMeasurementDet::measurements(), LayerMeasurements::measurements(), TkGluedMeasurementDet::measurements(), TkPhase2OTMeasurementDet::measurements(), TkPixelMeasurementDet::measurements(), TkStripMeasurementDet::measurements(), fastsim::HelixTrajectory::nextCrossingTimeC(), HBHEPulseShapeFlagSetter::PerformNominalFit(), edm::waiting_task::detail::ThenAdaptor< F >::pipe(), ApeEstimator::radialPositionAndError2(), ApeTreeCreateDefault::sectorBuilder(), ApeEstimator::sectorBuilder(), CPPFCluster::timeRMS(), RPCCluster::timeRMS(), VectorHit::transverseMomentum(), CPPFCluster::yRMS(), and RPCCluster::yRMS().

163  {
164  unsigned short a, b, c, d;
165  uInt32 y;
166 
167  d = x & 0x00FF;
168  x >>= 8;
169  c = x & 0x00FF;
170  x >>= 8;
171  b = x & 0x00FF;
172  x >>= 8;
173  a = x & 0x00FF;
174 
175  y = ctx->S[0][a] + ctx->S[1][b];
176  y = y ^ ctx->S[2][c];
177  y = y + ctx->S[3][d];
178  return y;
179 }
const edm::EventSetup & c
uInt32 S[4][256]
Definition: blowfish.h:41
unsigned int uInt32
Definition: blowfish.h:25
tuple d
Definition: ztail.py:151
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119

Variable Documentation

const uInt32 ORIG_P[16+2]
static
Initial value:
= {0x243F6A88L,
0x85A308D3L,
0x13198A2EL,
0x03707344L,
0xA4093822L,
0x299F31D0L,
0x082EFA98L,
0xEC4E6C89L,
0x452821E6L,
0x38D01377L,
0xBE5466CFL,
0x34E90C6CL,
0xC0AC29B7L,
0xC97C50DDL,
0x3F84D5B5L,
0xB5470917L,
0x9216D5D9L,
0x8979FB1BL}

Definition at line 12 of file blowfish.cc.

Referenced by Blowfish_Init().

const uInt32 ORIG_S[4][256]
static

Definition at line 31 of file blowfish.cc.

Referenced by Blowfish_Init().